/*
 * Galería compacta de la planta.
 * Esta hoja se carga después de plant-home.css y solo modifica esta sección.
 */

.plant-gallery {
    padding-block: clamp(52px, 6vw, 82px);
}

.plant-gallery__heading {
    display: block;
    margin-bottom: clamp(22px, 3vw, 34px);
}

.plant-gallery__heading .section-title {
    max-width: none;
    margin: 0;
    font-size: clamp(2rem, 3.4vw, 3.35rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.plant-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(10px, 1.35vw, 18px);
}

.plant-gallery__item {
    position: relative;
    min-height: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    padding: 0;
    margin: 0;
    appearance: none;
    cursor: zoom-in;
    background: #eaf5f9;
    border: 0;
    border-radius: 13px;
    box-shadow: 0 8px 22px rgba(3, 40, 63, 0.08);
    isolation: isolate;
}

.plant-gallery__item::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    pointer-events: none;
    background: linear-gradient(180deg, transparent 60%, rgba(3, 40, 63, 0.2));
    opacity: 0.7;
    transition: opacity 220ms ease;
}

.plant-gallery__item img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    transition: transform 420ms ease;
}

.plant-gallery__item:hover img {
    transform: scale(1.035);
}

.plant-gallery__item:hover::after {
    opacity: 1;
}

.plant-gallery__item:focus-visible {
    outline: 3px solid #f15132;
    outline-offset: 4px;
}

.plant-gallery__item--trays img {
    object-position: center 45%;
}

.plant-gallery__item--frozen img {
    object-position: center 50%;
}

.plant-gallery__item--production img {
    object-position: center 48%;
}

.plant-gallery__item--boxed img {
    object-position: center 42%;
}

.plant-gallery__zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: grid;
    width: 36px;
    height: 36px;
    color: #fff;
    background: rgba(3, 57, 86, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(3, 40, 63, 0.24);
    place-items: center;
    transition: background 180ms ease, transform 180ms ease;
}

.plant-gallery__zoom svg {
    width: 17px;
    height: 17px;
}

.plant-gallery__item:hover .plant-gallery__zoom {
    background: #f15132;
    transform: translateY(-2px);
}

body.plant-lightbox-open {
    overflow: hidden;
}

.plant-lightbox {
    width: min(94vw, 1440px);
    max-width: none;
    height: min(92vh, 980px);
    max-height: none;
    padding: 0;
    overflow: visible;
    color: #fff;
    background: transparent;
    border: 0;
}

.plant-lightbox::backdrop {
    background: rgba(1, 19, 30, 0.92);
    backdrop-filter: blur(8px);
}

.plant-lightbox__frame {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
}

.plant-lightbox__figure {
    display: grid;
    width: 100%;
    height: 100%;
    margin: 0;
    place-items: center;
}

.plant-lightbox__image {
    display: block;
    max-width: calc(100% - 120px);
    max-height: calc(100% - 52px);
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.plant-lightbox__control {
    position: absolute;
    z-index: 3;
    display: grid;
    width: 46px;
    height: 46px;
    padding: 0;
    color: #fff;
    cursor: pointer;
    background: rgba(3, 57, 86, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    place-items: center;
    transition: background 180ms ease, transform 180ms ease;
}

.plant-lightbox__control:hover {
    background: #f15132;
    transform: scale(1.05);
}

.plant-lightbox__control:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.plant-lightbox__control svg {
    width: 22px;
    height: 22px;
}

.plant-lightbox__close {
    top: 2px;
    right: 2px;
}

.plant-lightbox__previous {
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
}

.plant-lightbox__previous:hover {
    transform: translateY(-50%) scale(1.05);
}

.plant-lightbox__next {
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
}

.plant-lightbox__next:hover {
    transform: translateY(-50%) scale(1.05);
}

html[dir="rtl"] .plant-lightbox__previous {
    right: 2px;
    left: auto;
}

html[dir="rtl"] .plant-lightbox__next {
    right: auto;
    left: 2px;
}

@media (max-width: 900px) {
    .plant-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .plant-gallery {
        padding-block: 48px;
    }

    .plant-gallery__heading {
        margin-bottom: 20px;
    }

    .plant-gallery__heading .section-title {
        font-size: clamp(1.9rem, 9vw, 2.55rem);
    }

    .plant-gallery__grid {
        gap: 9px;
    }

    .plant-gallery__item {
        border-radius: 9px;
    }

    .plant-gallery__zoom {
        right: 8px;
        bottom: 8px;
        width: 31px;
        height: 31px;
    }

    .plant-lightbox {
        width: 100vw;
        height: 100dvh;
    }

    .plant-lightbox__image {
        max-width: calc(100% - 24px);
        max-height: calc(100% - 116px);
        border-radius: 8px;
    }

    .plant-lightbox__control {
        width: 42px;
        height: 42px;
    }

    .plant-lightbox__close {
        top: 14px;
        right: 14px;
    }

    .plant-lightbox__previous {
        top: auto;
        bottom: 14px;
        left: calc(50% - 58px);
        transform: none;
    }

    .plant-lightbox__previous:hover {
        transform: scale(1.05);
    }

    .plant-lightbox__next {
        top: auto;
        right: calc(50% - 58px);
        bottom: 14px;
        transform: none;
    }

    .plant-lightbox__next:hover {
        transform: scale(1.05);
    }

    html[dir="rtl"] .plant-lightbox__previous {
        right: calc(50% - 58px);
        left: auto;
    }

    html[dir="rtl"] .plant-lightbox__next {
        right: auto;
        left: calc(50% - 58px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .plant-gallery__item img,
    .plant-gallery__zoom,
    .plant-lightbox__control {
        transition: none;
    }
}

/* modal-scroll-fix:start */
.plant-lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.plant-lightbox__frame {
    display: block;
    width: 100%;
    min-height: 100%;
    height: auto;
    padding: 72px clamp(70px, 7vw, 130px) 60px;
    box-sizing: border-box;
}

.plant-lightbox__figure {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

.plant-lightbox__image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: none !important;
    margin: 0 auto;
    object-fit: contain;
}

.plant-lightbox__control {
    position: fixed;
}

.plant-lightbox__close {
    top: 18px;
    right: 18px;
}

.plant-lightbox__previous {
    top: 50%;
    bottom: auto;
    left: 18px;
    transform: translateY(-50%);
}

.plant-lightbox__next {
    top: 50%;
    right: 18px;
    bottom: auto;
    transform: translateY(-50%);
}

html[dir="rtl"] .plant-lightbox__previous {
    right: 18px;
    left: auto;
}

html[dir="rtl"] .plant-lightbox__next {
    right: auto;
    left: 18px;
}

@media (max-width: 600px) {
    .plant-lightbox__frame {
        padding: 72px 12px 88px;
    }

    .plant-lightbox__close {
        top: 14px;
        right: 14px;
    }

    .plant-lightbox__previous {
        top: auto;
        bottom: 14px;
        left: calc(50% - 58px);
        transform: none;
    }

    .plant-lightbox__next {
        top: auto;
        right: calc(50% - 58px);
        bottom: 14px;
        transform: none;
    }

    html[dir="rtl"] .plant-lightbox__previous {
        right: calc(50% - 58px);
        left: auto;
    }

    html[dir="rtl"] .plant-lightbox__next {
        right: auto;
        left: calc(50% - 58px);
    }
}
/* modal-scroll-fix:end */
