/* AgroIngenio Lab - Explorador hidropónico */

.hx-explorer {
    padding: 4.5rem 0;
}

.hx-heading {
    max-width: 760px;
    margin: 0 auto 2rem;
    text-align: center;
}

.hx-heading h2 {
    margin: .7rem 0;
    font-size: clamp(1.8rem,7vw,2.7rem);
    line-height: 1.12;
}

.hx-heading p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.hx-tree {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 1rem;
    padding: 1.4rem;
}

.hx-tree::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 12%;
    bottom: 12%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(77,190,110,.45), transparent);
}

.hx-tree::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(77,190,110,.45), transparent);
}

.hx-system {
    position: relative;
    min-height: 112px;
    padding: 1rem;
    border: 1px solid rgba(100,180,120,.2);
    border-radius: 18px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: center;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.hx-system:active {
    transform: scale(.97);
}

.hx-system.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(70,170,100,.15), 0 10px 30px rgba(0,0,0,.14);
}

.hx-system-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0 auto .55rem;
    border-radius: 50%;
    background: rgba(70,170,100,.12);
    color: var(--accent-primary);
    font-size: 1.35rem;
    font-weight: 800;
}

.hx-system strong {
    display: block;
    font-size: .9rem;
}

.hx-system small {
    display: block;
    margin-top: .25rem;
    color: var(--text-muted);
    font-size: .7rem;
}

.hx-viewer {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.15rem;
    border: 1px solid rgba(100,180,120,.2);
    border-radius: 20px;
    background: var(--bg-card);
    box-shadow: 0 14px 36px rgba(0,0,0,.12);
}

.hx-viewer-head {
    margin-bottom: 1rem;
}

.hx-counter {
    display: inline-block;
    margin-bottom: .45rem;
    color: var(--accent-primary);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hx-viewer-head h3 {
    margin: 0 0 .35rem;
    font-size: 1.35rem;
}

.hx-viewer-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.55;
}

@media (max-width:600px) {
    .hx-explorer {
        padding: 3.5rem 0;
    }
    .hx-tree {
        gap: .7rem;
        padding: .8rem 0;
    }
    .hx-system {
        min-height: 104px;
        padding: .85rem .55rem;
    }
    .hx-viewer {
        padding: 1rem;
    }
}

.hx-tabs {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: .4rem;
    margin-bottom: 1rem;
    padding: .35rem;
    border-radius: 13px;
    background: rgba(100,160,115,.06);
}

.hx-tab {
    padding: .65rem .35rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.hx-tab.active {
    background: rgba(70,170,100,.14);
    color: var(--accent-primary);
}

.hx-canvas {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid rgba(100,180,120,.14);
    border-radius: 16px;
    background: linear-gradient(180deg,rgba(70,170,100,.05),rgba(20,30,24,.03));
}

.hx-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: .8rem;
}

.hx-sketch {
    position: relative;
    min-height: 270px;
}

.hx-sketch-title {
    margin-bottom: .8rem;
    color: var(--text-muted);
    text-align: center;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hx-pipe {
    position: relative;
    height: 18px;
    margin: 16px 10px;
    border: 1px solid rgba(90,200,120,.35);
    border-radius: 999px;
    background: linear-gradient(90deg,rgba(60,180,100,.28),rgba(60,180,100,.08));
}

.hx-hole-row {
    position: absolute;
    inset: -5px 8px auto;
    display: flex;
    justify-content: space-between;
}

.hx-hole-dot {
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    background: var(--bg-card);
}

.hx-tank {
    width: 105px;
    margin: 1.2rem auto 0;
    padding: .8rem;
    border: 2px solid rgba(70,170,100,.4);
    border-radius: 12px 12px 18px 18px;
    background: rgba(50,150,90,.08);
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
}

.hx-line-flow {
    margin: .65rem auto;
    color: var(--accent-primary);
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
}

.hx-hotspot {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: .25rem;
    padding: .45rem .6rem;
    border: 1px solid rgba(80,190,110,.25);
    border-radius: 999px;
    background: rgba(70,170,100,.09);
    color: var(--text-primary);
    font-size: .7rem;
    cursor: pointer;
}

.hx-hotspot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(70,170,100,.1);
}

.hx-hotspots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: .8rem;
}

.hx-info {
    min-height: 58px;
    margin-top: .8rem;
    padding: .8rem;
    border-radius: 12px;
    background: rgba(100,160,115,.06);
    color: var(--text-muted);
    font-size: .77rem;
    line-height: 1.55;
}

.hx-info strong {
    color: var(--text-primary);
}

.hx-nav {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    margin-top: 1rem;
}

.hx-nav button {
    flex: 1;
    padding: .7rem;
    border: 1px solid rgba(100,180,120,.2);
    border-radius: 11px;
    background: rgba(70,170,100,.07);
    color: var(--text-primary);
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width:520px) {
    .hx-tabs {
        grid-template-columns: repeat(2,1fr);
    }
    .hx-canvas {
        min-height: 285px;
        padding: .8rem;
    }
    .hx-hole-dot {
        width: 20px;
        height: 20px;
    }
}

.hx-a-shape {
    display: grid;
    grid-template-columns: 1fr 70px 1fr;
    align-items: end;
    gap: .4rem;
    max-width: 650px;
    margin: 0 auto;
}

.hx-a-side {
    transform-origin: bottom center;
}

.hx-a-side:first-child {
    transform: rotate(-8deg);
}

.hx-a-side:last-child {
    transform: rotate(8deg);
}

.hx-a-center {
    display: grid;
    place-items: center;
    min-height: 125px;
    color: rgba(70,170,100,.55);
    font-size: 4rem;
    font-weight: 800;
}

.hx-parcel-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: .8rem;
    max-width: 700px;
    margin: 0 auto;
}

.hx-parcel-grid > div {
    padding: .45rem;
    border: 1px dashed rgba(100,180,120,.25);
    border-radius: 12px;
    background: rgba(70,170,100,.035);
}

.hx-sketch-vertical .hx-pipe {
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width:520px) {
    .hx-a-shape {
        grid-template-columns: 1fr 44px 1fr;
        gap: .15rem;
    }
    .hx-a-center {
        min-height: 105px;
        font-size: 2.8rem;
    }
    .hx-a-side:first-child {
        transform: rotate(-5deg);
    }
    .hx-a-side:last-child {
        transform: rotate(5deg);
    }
    .hx-parcel-grid {
        gap: .5rem;
    }
    .hx-parcel-grid .hx-pipe {
        margin: 12px 3px;
    }
}

/* PATCH MAPA PARCELA */
.hx-sketch-parcel {
    position: relative;
}

.hx-parcel-grid {
    position: relative;
    padding: .6rem 0 1.2rem;
}

.hx-parcel-grid::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 22%;
    bottom: 18%;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, transparent, rgba(70,170,100,.45), transparent);
}

.hx-parcel-grid::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(to right, transparent, rgba(70,170,100,.45), transparent);
}

.hx-module-card {
    position: relative;
    padding: 2rem .45rem .55rem;
    border: 1px dashed rgba(100,180,120,.28);
    border-radius: 14px;
    background: rgba(70,170,100,.04);
    cursor: pointer;
}

.hx-module-card.active {
    border-color: var(--accent-primary);
    background: rgba(70,170,100,.08);
    box-shadow: 0 0 0 1px rgba(70,170,100,.18);
}

.hx-module-card::before {
    content: attr(data-label);
    position: absolute;
    top: .55rem;
    left: .7rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(70,170,100,.12);
    color: var(--accent-primary);
    font-size: .68rem;
    font-weight: 800;
}

/* PARCELA VISUAL BLOQUE 2 */
.hx-module-card .hx-pipe {
    margin: 14px 6px;
}

.hx-parcel-mainline,
.hx-parcel-return {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    max-width: 700px;
    margin: .8rem auto;
    padding: .7rem .85rem;
    border-radius: 999px;
    border: 1px solid rgba(100,180,120,.22);
    background: rgba(70,170,100,.08);
    color: var(--text-primary);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.4;
}

.hx-parcel-mainline {
    cursor: pointer;
}

.hx-parcel-mainline:active {
    transform: scale(.985);
}

.hx-parcel-mainline b,
.hx-parcel-return b {
    color: var(--accent-primary);
    font-size: .95rem;
}

.hx-sketch-parcel .hx-tank {
    cursor: pointer;
}

@media (max-width:520px) {
    .hx-parcel-grid::before {
        top: 18%;
        bottom: 16%;
    }
    .hx-parcel-grid::after {
        left: 10%;
        right: 10%;
    }
    .hx-module-card {
        padding: 1.8rem .35rem .45rem;
    }
    .hx-module-card::before {
        left: .5rem;
        font-size: .64rem;
    }
    .hx-parcel-mainline,
    .hx-parcel-return {
        font-size: .72rem;
        padding: .65rem .7rem;
    }
}

/* PATCH GUIA COLAPSABLE */
body.hx-guide-ready:not(.hx-guide-open) #guia-hidroponica,
body.hx-guide-ready:not(.hx-guide-open) #armado-hidroponico,
body.hx-guide-ready:not(.hx-guide-open) #hidro-agua-nutrientes,
body.hx-guide-ready:not(.hx-guide-open) #hidro-nutricion-control,
body.hx-guide-ready:not(.hx-guide-open) #diagrama-horizontal-domestico {
    display: none !important;
}

.hx-guide-toggle-wrap {
    max-width: 1180px;
    margin: 1.2rem auto 2.2rem;
    padding: 0 1rem;
    text-align: center;
}

.hx-guide-toggle {
    width: min(100%, 440px);
    padding: .95rem 1.2rem;
    border: 1px solid rgba(80,190,110,.32);
    border-radius: 16px;
    background: rgba(70,170,100,.09);
    color: var(--text-primary);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0,0,0,.10);
}

.hx-guide-toggle span {
    margin-left: .35rem;
}

.hx-guide-toggle:active {
    transform: scale(.985);
}
/* FIN PATCH GUIA COLAPSABLE */

/* PATCH CROQUIS HVT */
.hx-pipe.hx-interactive-pipe {
    position: relative;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.hx-pipe.hx-interactive-pipe:active {
    transform: scale(.985);
}

.hx-pipe.hx-interactive-pipe.hx-part-active {
    background: rgba(55,200,105,.15);
    box-shadow: 0 0 0 2px rgba(55,200,105,.28), 0 8px 22px rgba(0,0,0,.10);
}

.hx-pipe.hx-interactive-pipe::after {
    content: attr(data-label);
    position: absolute;
    right: 8px;
    top: -10px;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: rgba(20,45,28,.92);
    border: 1px solid rgba(70,190,105,.28);
    color: var(--accent-primary);
    font-size: .58rem;
    font-weight: 800;
    pointer-events: none;
}

.hx-a-side.hx-interactive-side {
    position: relative;
    cursor: pointer;
    border-radius: 14px;
    transition: background .18s ease, box-shadow .18s ease;
}

.hx-a-side.hx-interactive-side.hx-side-active {
    background: rgba(55,200,105,.07);
    box-shadow: 0 0 0 1px rgba(55,200,105,.22);
}

.hx-side-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto .35rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(55,200,105,.09);
    color: var(--accent-primary);
    font-size: .65rem;
    font-weight: 800;
}

@media (max-width:520px) {
    .hx-pipe.hx-interactive-pipe::after {
        right: 5px;
        font-size: .53rem;
        padding: .12rem .38rem;
    }
}

/* PATCH PARCELA LIMPIEZA */
.hx-parcel-grid > .hx-module-card {
    position: relative;
    z-index: 1;
    padding: 2.55rem .5rem .7rem;
}

.hx-module-card::before {
    top: .45rem;
    left: .65rem;
    right: .65rem;
    z-index: 3;
    text-align: left;
}

.hx-module-card .hx-pipe {
    position: relative;
    z-index: 2;
}

.hx-parcel-grid::before,
.hx-parcel-grid::after {
    z-index: 0;
    pointer-events: none;
}

.hx-sketch-parcel > .hx-line-flow {
    display: none;
}

@media (max-width:520px) {
    .hx-parcel-grid > .hx-module-card {
        padding: 2.4rem .35rem .55rem;
    }
}
/* FIN PATCH PARCELA LIMPIEZA */

/* PATCH AJUSTE FINAL CROQUIS */
.hx-parcel-grid > .hx-module-card {
    padding-top: 3.25rem;
}

.hx-module-card::before {
    top: .55rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    white-space: nowrap;
}

.hx-parcel-grid ~ .hx-line-flow {
    display: none !important;
}

.hx-sketch-vertical .hx-pipe.hx-interactive-pipe {
    max-width: 68%;
}

.hx-sketch-vertical .hx-pipe.hx-interactive-pipe::after {
    right: -58px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width:520px) {
    .hx-parcel-grid > .hx-module-card {
        padding-top: 3.15rem;
    }
    .hx-sketch-vertical .hx-pipe.hx-interactive-pipe {
        max-width: 66%;
    }
    .hx-sketch-vertical .hx-pipe.hx-interactive-pipe::after {
        right: -54px;
    }
}
/* FIN PATCH AJUSTE FINAL CROQUIS */
