/* =========================================================
   Listado de embalajes — pages/embalajes.php
   Mismo esquema visual que el listado de diseñadores.
   ========================================================= */

body.page-embalajes {
    background: #000;
}

.page-embalajes-list {
    width: 100%;
    box-sizing: border-box;
}

.page-embalajes-list .embalajes-breadcrumbs {
    width: 100%;
    padding: 0 10px;
    overflow-x: hidden;
    box-sizing: border-box;
    border-bottom: none;
}

.page-embalajes-list .embalajes-ruta {
    margin: 0;
    padding: 10px 10px !important;
    font-size: 2rem;
    color: #fff;
    text-align: center;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    text-transform: capitalize;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.page-embalajes-list .embalajes-ruta::-webkit-scrollbar {
    display: none;
}

.page-embalajes-list .embalajes-ruta > * {
    flex: 0 0 auto;
    white-space: nowrap;
}

.page-embalajes-list .embalajes-ruta a {
    color: #fff;
    text-decoration: none;
    text-transform: capitalize;
}

.page-embalajes-list .embalajes-ruta__current {
    color: aqua;
}

.page-embalajes-list .embalajes-ruta__sep {
    margin: 0 0.35rem;
}

.page-embalajes-list .embalajes-ruta > .embalajes-filter {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    flex: 0 1 36rem;
    min-width: 16rem;
    max-width: 42rem;
    width: 36rem;
    height: calc(2rem + 9px + 2px);
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 4px;
    overflow: hidden;
    white-space: nowrap;
}

.page-embalajes-list .embalajes-filter__box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 100%;
    padding: 0 8px;
    color: #111;
    pointer-events: none;
}

.page-embalajes-list .embalajes-filter__box svg {
    display: block;
    width: 18px;
    height: 18px;
}

.page-embalajes-list .embalajes-filter__input {
    width: 100%;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0 12px 0 0;
    font: 15px/1 'BentonSans-Regular', 'BentonSans-Bold', sans-serif;
    color: #111;
    background: transparent;
    border: none;
    border-radius: 0;
    text-transform: none;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.page-embalajes-list .embalajes-filter__input::placeholder {
    color: #888;
    text-transform: none;
}

.page-embalajes-list .embalajes-filter__input::-webkit-search-decoration,
.page-embalajes-list .embalajes-filter__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.page-embalajes-list .embalajes-filter:focus-within {
    outline: 1px solid aqua;
}

.page-embalajes-list .embalajes-filter .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-embalajes-list .embalajes-card[hidden] {
    display: none !important;
}

@media (min-width: 992px) {
    .page-embalajes-list .embalajes-ruta a.btn-step-back {
        margin-left: 1rem;
        padding: 1rem;
        font: 21px/9px 'BentonSans-Regular', 'BentonSans-Bold', sans-serif !important;
        color: #fff !important;
        background: #545454;
        border: 1px solid #D5D0CA;
        border-radius: 4px;
        text-decoration: none !important;
        cursor: pointer;
        display: inline-block;
        width: auto;
        text-align: center;
        z-index: 100;
        transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    }

    .page-embalajes-list .embalajes-ruta a.btn-step-back:hover {
        background: #493E3A;
        border-color: #988B85;
        color: #D5D0CA !important;
    }
}

.page-embalajes-list .embalajes-empty {
    text-align: center;
    font-size: 3rem;
    color: #fff;
    padding: 3rem 1rem;
}

.page-embalajes-list .embalajes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
    padding: 0 2rem 0;
    max-width: 100%;
    box-sizing: border-box;
    --embalajes-img-h: 30rem;
}

@media (min-width: 992px) {
    .page-embalajes-list .embalajes-grid {
        margin-left: 10%;
        margin-right: 10%;
    }

    .page-embalajes-list .div-consulta.embalajes-volver-wrap {
        margin-left: 10%;
        margin-right: 10%;
        padding: 0 2rem;
    }
}

.page-embalajes-list .embalajes-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    box-sizing: border-box;
}

.page-embalajes-list .embalajes-card__media {
    position: relative;
    flex: 0 0 var(--embalajes-img-h);
    display: flex;
    flex-direction: column;
    height: var(--embalajes-img-h);
    min-height: var(--embalajes-img-h);
    max-height: var(--embalajes-img-h);
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.page-embalajes-list .embalajes-card__zoom {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 0;
    text-decoration: none;
    cursor: pointer;
}

.page-embalajes-list .embalajes-card__arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 6rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111;
    line-height: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.page-embalajes-list .embalajes-card__arrow--prev {
    left: 0.4rem;
}

.page-embalajes-list .embalajes-card__arrow--next {
    right: 0.4rem;
}

.page-embalajes-list .embalajes-card__arrow:hover {
    color: #000;
}

.page-embalajes-list .embalajes-card__arrow:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.page-embalajes-list .embalajes-card__chev {
    display: block;
    width: calc(1.85rem * 3);
    height: calc(1.85rem * 3);
    flex-shrink: 0;
}

.page-embalajes-list .embalajes-card__zoom svg {
    display: block;
    width: 4.8rem;
    height: 4.8rem;
}

.page-embalajes-list .embalajes-card__image-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
}

.page-embalajes-list .embalajes-card__image-link::before {
    content: "";
    position: absolute;
    inset: 8%;
    border-radius: 0.4rem;
    background: linear-gradient(100deg, #ececec 30%, #f8f8f8 50%, #ececec 70%);
    background-size: 200% 100%;
    animation: embalajes-image-loading 1.2s linear infinite;
    transition: opacity 0.15s ease;
}

.page-embalajes-list .embalajes-card__image-link.is-image-loaded::before {
    opacity: 0;
    visibility: hidden;
}

.page-embalajes-list .embalajes-card__img {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

@keyframes embalajes-image-loading {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .page-embalajes-list .embalajes-card__image-link::before {
        animation: none;
    }
}

.page-embalajes-list .embalajes-card__name {
    --embalajes-name-size: 2rem;
    --embalajes-name-lh: 1.3;
    --embalajes-name-pad-y: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0;
    height: calc((var(--embalajes-name-pad-y) * 2) + (var(--embalajes-name-size) * var(--embalajes-name-lh)));
    padding: var(--embalajes-name-pad-y) 1.25rem;
    box-sizing: border-box;
    background-color: #c0c0c0;
    color: inherit;
    overflow: hidden;
}

.page-embalajes-list .embalajes-card__name-text {
    display: block;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: var(--embalajes-name-size);
    line-height: var(--embalajes-name-lh);
    font-weight: 500;
    color: #111;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-transform: capitalize;
}

.page-embalajes-list .div-consulta.embalajes-volver-wrap {
    display: block;
    width: auto;
    max-width: 100%;
    margin: 2rem 0;
    padding: 0 2rem;
    box-sizing: border-box;
    border-top: none !important;
}

.page-embalajes-list .embalajes-volver-wrap .btn-extra.btn-extra-blue.cienwidth {
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
    background: #CEE0E3 !important;
}

.page-embalajes-list .embalajes-volver-wrap .btn-extra a {
    display: block;
    box-sizing: border-box;
    padding: 1px 0;
    font: 23px/42px 'BentonSans-Regular', 'BentonSans-Bold', Arial, Helvetica, sans-serif;
    font-weight: bold;
    color: #000;
    text-decoration: none;
    border: 1.5px solid #000;
    transition: all 0.3s ease-in-out;
}

.page-embalajes-list .embalajes-volver-wrap .btn-extra-blue a:hover {
    color: #2B454F;
    border-color: #CEE0E3;
    background-color: #91B9C1;
    box-shadow: 0 0 10px #91B9C1;
}

/* Suscripción alineada con el ancho interior de la grilla. */
body.page-embalajes footer #registrarse.info-suscrip {
    width: auto;
    margin-right: calc(10% + 2rem);
    margin-left: calc(10% + 2rem);
    justify-content: flex-start;
}

body.page-embalajes footer #registrarse #texto1 {
    flex: 0 0 auto;
    max-width: none;
    white-space: nowrap;
}

body.page-embalajes footer #registrarse #txtemail {
    flex: 1 1 14rem;
    width: auto;
    min-width: 0;
}

/* Celular / tablet: sin márgenes de PC prematuros (769–991) */
@media (max-width: 991px) {
    /* Ruta / Volver superior: css/nav-ruta.css (una fila + scroll; filtro en la misma fila) */
    .page-embalajes-list .embalajes-ruta > .embalajes-filter {
        display: inline-flex;
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        min-width: 0;
        margin-left: 0;
    }

    .page-embalajes-list .embalajes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-left: 0;
        margin-right: 0;
        padding: clamp(12px, 3.2vw, 16px);
        --embalajes-img-h: min(26rem, 72vw);
    }

    .page-embalajes-list .embalajes-card__media {
        flex: 0 0 var(--embalajes-img-h);
        height: var(--embalajes-img-h);
        min-height: var(--embalajes-img-h);
        max-height: var(--embalajes-img-h);
    }

    .page-embalajes-list .embalajes-card__image-link {
        padding: 0 clamp(2.25rem, 8vw, 3rem);
        box-sizing: border-box;
    }

    .page-embalajes-list .embalajes-card__img {
        width: auto;
        max-width: 100%;
        max-height: 100%;
        height: auto;
        margin: 0 auto;
    }

    /* Lupa / flechas más pequeñas; hit area cómoda; no tapan el centro */
    .page-embalajes-list .embalajes-card__zoom {
        top: 0.4rem;
        right: 0.4rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    .page-embalajes-list .embalajes-card__zoom svg {
        width: 2.4rem;
        height: 2.4rem;
    }

    .page-embalajes-list .embalajes-card__arrow {
        width: 2.75rem;
        height: 2.75rem;
    }

    .page-embalajes-list .embalajes-card__arrow--prev {
        left: 0.2rem;
    }

    .page-embalajes-list .embalajes-card__arrow--next {
        right: 0.2rem;
    }

    .page-embalajes-list .embalajes-card__chev {
        width: 1.65rem;
        height: 1.65rem;
    }

    /* Tipografía tipo Productos; nombre completo en varias líneas */
    .page-embalajes-list .embalajes-card__name {
        --embalajes-name-size: clamp(1.25rem, 3.2vw, 1.5rem);
        --embalajes-name-lh: 1.3;
        --embalajes-name-pad-y: 0.75rem;
        height: auto;
        min-height: calc((var(--embalajes-name-pad-y) * 2) + (var(--embalajes-name-size) * var(--embalajes-name-lh)));
        padding: var(--embalajes-name-pad-y) clamp(0.75rem, 2.5vw, 1.1rem);
        overflow: visible;
    }

    .page-embalajes-list .embalajes-card__name-text {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Volver: mismo criterio tipográfico que Productos; centrado; sin altura excesiva */
    .page-embalajes-list .div-consulta.embalajes-volver-wrap {
        width: auto;
        max-width: 100%;
        margin: 1.5rem 0;
        padding: 0 clamp(12px, 3.2vw, 16px);
        box-sizing: border-box;
    }

    .page-embalajes-list .embalajes-volver-wrap .btn-extra.btn-extra-blue.cienwidth {
        padding: 0.5rem;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .page-embalajes-list .embalajes-volver-wrap .btn-extra a {
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 100%;
        margin: 0;
        padding: 0.5rem 0.75rem;
        min-height: 0;
        height: auto;
        font-family: 'BentonSans-Regular', 'BentonSans-Bold', Arial, Helvetica, sans-serif;
        font-size: clamp(1.625rem, calc(1.15rem + 2.11vw), 2.5rem);
        font-weight: normal;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }

    /* Suscripción ≤991: tipografía/altura/márgenes en css/footer.css */
}

/* ≤991: una columna, igual que el celular (el bloque de 600–991 px agrandaba las fotos). */

.embalajes-lightbox[hidden] {
    display: none !important;
}

.embalajes-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    box-sizing: border-box;
}

.embalajes-lightbox__backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.embalajes-lightbox__dialog {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.embalajes-lightbox__img {
    display: block;
    width: auto;
    max-width: calc(100vw - 144px);
    max-height: 80vh;
    height: auto;
    object-fit: contain;
    background: transparent;
    pointer-events: auto;
}

.embalajes-lightbox__close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.embalajes-lightbox__nav {
    position: fixed;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -22px 0 0;
    padding: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    box-sizing: border-box;
}

.embalajes-lightbox__nav--prev {
    left: 8px;
}

.embalajes-lightbox__nav--next {
    right: 8px;
}

.embalajes-lightbox__nav .embalajes-card__chev {
    width: calc(1.85rem * 3);
    height: calc(1.85rem * 3);
    color: #fff;
}

.embalajes-lightbox__nav[hidden] {
    display: none !important;
}

.embalajes-lightbox__nav:hover,
.embalajes-lightbox__close:hover {
    color: #fff;
}

.embalajes-lightbox__nav:focus-visible,
.embalajes-lightbox__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 991px) {
    .embalajes-lightbox__dialog {
        padding: 3.5rem 0.5rem 1rem;
        box-sizing: border-box;
    }

    .embalajes-lightbox__img {
        max-width: min(100vw - 4.5rem, 100%);
        max-height: min(82vh, calc(100dvh - 5.5rem));
        margin: 0 auto;
    }

    .embalajes-lightbox__close {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    .embalajes-lightbox__nav {
        width: 2.75rem;
        height: 2.75rem;
        margin-top: -1.375rem;
        padding: 0.25rem;
        border-radius: 6px;
        background: rgba(0, 0, 0, 0.35);
    }

    .embalajes-lightbox__nav--prev {
        left: 0.25rem;
    }

    .embalajes-lightbox__nav--next {
        right: 0.25rem;
    }

    .embalajes-lightbox__nav .embalajes-card__chev {
        width: 1.65rem;
        height: 1.65rem;
    }
}
