/**
 * Blessed7
 * Archivo: assets/css/coleccion.css
 *
 * Estilos exclusivos para:
 * - Portada individual de una colección.
 * - Búsqueda y ordenamiento.
 * - Cuadrícula de productos.
 * - Estados vacíos y errores.
 * - Colecciones relacionadas.
 * - Adaptación para tablet y móvil.
 */

.pagina-coleccion {
    background: #f7f7f8;
    color: #171717;
}

.pagina-coleccion .contenedor {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

/* ==========================================================================
   Portada
   ========================================================================== */

.coleccion-portada {
    position: relative;
    min-height: clamp(520px, 65vw, 720px);
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background: #171419;
}

.coleccion-portada__fondo {
    position: absolute;
    z-index: -3;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.015);
    animation: coleccion-fondo-entrada 900ms ease-out both;
}

.coleccion-portada__sombra {
    position: absolute;
    z-index: -2;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(10, 8, 12, 0.94) 0%,
            rgba(10, 8, 12, 0.72) 43%,
            rgba(10, 8, 12, 0.2) 76%,
            rgba(10, 8, 12, 0.08) 100%
        ),
        linear-gradient(
            0deg,
            rgba(10, 8, 12, 0.72) 0%,
            transparent 42%
        );
}

.coleccion-portada::after {
    position: absolute;
    z-index: -1;
    right: -150px;
    bottom: -250px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow:
        0 0 0 70px rgba(255, 255, 255, 0.025),
        0 0 0 140px rgba(255, 255, 255, 0.018);
    content: "";
    pointer-events: none;
}

.coleccion-portada__interior {
    display: flex;
    min-height: inherit;
    flex-direction: column;
    padding-top: 34px;
    padding-bottom: 64px;
}

.migas--claras {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 70px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
}

.migas--claras a {
    color: inherit;
    text-decoration: none;
    transition: color 180ms ease;
}

.migas--claras a:hover,
.migas--claras a:focus-visible {
    color: #fff;
}

.coleccion-portada__contenido {
    display: flex;
    width: min(720px, 100%);
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    animation: coleccion-contenido-entrada 700ms 100ms ease-out both;
}

.coleccion-portada__eyebrow {
    margin: 0 0 14px;
    color: #c7a8ff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.coleccion-portada h1 {
    max-width: 760px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.8rem, 7vw, 6rem);
    font-weight: 850;
    letter-spacing: -0.065em;
    line-height: 0.91;
    text-wrap: balance;
}

.coleccion-portada__descripcion {
    max-width: 650px;
    margin: 25px 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(0.95rem, 1.8vw, 1.08rem);
    line-height: 1.75;
}

.coleccion-portada__dato {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-top: 28px;
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(10px);
}

.coleccion-portada__dato strong {
    display: grid;
    min-width: 34px;
    min-height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #19151d;
    font-size: 0.92rem;
}

.coleccion-portada__dato span {
    padding-right: 3px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 650;
}

/* ==========================================================================
   Productos y encabezado
   ========================================================================== */

.coleccion-productos {
    padding: 70px 0 92px;
}

.coleccion-productos__encabezado,
.coleccion-otras__encabezado {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
}

.coleccion-productos__encabezado p,
.coleccion-otras__encabezado p {
    margin: 0 0 7px;
    color: #8354dc;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.coleccion-productos__encabezado h2,
.coleccion-otras__encabezado h2 {
    margin: 0;
    color: #19171b;
    font-size: clamp(1.65rem, 3.4vw, 2.55rem);
    font-weight: 820;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.coleccion-productos__encabezado > a,
.coleccion-otras__encabezado > a {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    padding: 10px 0;
    color: #272329;
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

.coleccion-productos__encabezado > a span,
.coleccion-otras__encabezado > a span {
    transition: transform 180ms ease;
}

.coleccion-productos__encabezado > a:hover span,
.coleccion-otras__encabezado > a:hover span {
    transform: translateX(4px);
}

/* ==========================================================================
   Controles
   ========================================================================== */

.coleccion-controles {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.42fr) auto;
    align-items: end;
    gap: 14px;
    margin: 0 0 32px;
    padding: 20px;
    border: 1px solid #e8e5eb;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 44px rgba(30, 20, 40, 0.07);
}

.coleccion-busqueda,
.coleccion-control {
    min-width: 0;
}

.coleccion-busqueda > label,
.coleccion-control > label {
    display: block;
    margin: 0 0 8px;
    color: #68636e;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

.coleccion-busqueda__campo {
    position: relative;
}

.coleccion-busqueda__campo svg {
    position: absolute;
    top: 50%;
    left: 15px;
    color: #817a88;
    transform: translateY(-50%);
    pointer-events: none;
}

.coleccion-busqueda input,
.coleccion-control select {
    width: 100%;
    min-height: 50px;
    border: 1px solid #dedbe2;
    border-radius: 12px;
    outline: 0;
    background-color: #faf9fb;
    color: #242126;
    font: inherit;
    font-size: 0.88rem;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease;
}

.coleccion-busqueda input {
    padding: 0 15px 0 45px;
}

.coleccion-control select {
    padding: 0 40px 0 14px;
    cursor: pointer;
}

.coleccion-busqueda input:focus,
.coleccion-control select:focus {
    border-color: #8b5de4;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(139, 93, 228, 0.12);
}

.coleccion-controles > button {
    min-height: 50px;
    padding: 0 25px;
    border: 0;
    border-radius: 12px;
    background: #181619;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease;
}

.coleccion-controles > button:hover {
    background: #7445cd;
    box-shadow: 0 10px 22px rgba(116, 69, 205, 0.22);
    transform: translateY(-2px);
}

.coleccion-controles > button:active {
    transform: translateY(0);
}

.coleccion-controles > button:focus-visible,
.coleccion-productos a:focus-visible,
.coleccion-otras a:focus-visible,
.coleccion-estado a:focus-visible {
    outline: 3px solid rgba(139, 93, 228, 0.38);
    outline-offset: 3px;
}

.coleccion-resumen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: -11px 0 29px;
    padding: 13px 17px;
    border: 1px solid #e9e3f2;
    border-radius: 13px;
    background: #f5f0fc;
}

.coleccion-resumen p {
    margin: 0;
    color: #5e5667;
    font-size: 0.84rem;
}

.coleccion-resumen strong {
    color: #342743;
}

.coleccion-resumen a {
    flex: 0 0 auto;
    color: #7043c1;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

/* ==========================================================================
   Cuadrícula y paginación
   ========================================================================== */

.coleccion-grid {
    margin-top: 6px;
}

.coleccion-grid .producto-tarjeta {
    animation: coleccion-tarjeta-entrada 520ms ease both;
}

.coleccion-grid .producto-tarjeta:nth-child(2) {
    animation-delay: 55ms;
}

.coleccion-grid .producto-tarjeta:nth-child(3) {
    animation-delay: 110ms;
}

.coleccion-grid .producto-tarjeta:nth-child(4) {
    animation-delay: 165ms;
}

.pagina-coleccion .paginacion {
    margin-top: 50px;
}

/* ==========================================================================
   Estados vacíos, error y 404
   ========================================================================== */

.coleccion-no-encontrada {
    display: grid;
    min-height: clamp(500px, 70vh, 720px);
    place-items: center;
    padding: 70px 0;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(139, 93, 228, 0.13),
            transparent 34%
        ),
        #f7f7f8;
}

.coleccion-estado {
    display: flex;
    width: min(680px, 100%);
    min-height: 310px;
    margin: 38px auto 0;
    padding: 52px 34px;
    border: 1px solid #e8e5eb;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 22px 58px rgba(29, 19, 38, 0.08);
    text-align: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.coleccion-no-encontrada .coleccion-estado {
    margin: 0 auto;
}

.coleccion-estado > span {
    display: grid;
    min-width: 68px;
    min-height: 68px;
    margin-bottom: 22px;
    padding: 0 13px;
    place-items: center;
    border-radius: 22px;
    background: #f1eafb;
    color: #7745d2;
    font-size: 1.2rem;
    font-weight: 850;
}

.coleccion-estado--error > span {
    background: #fff0f0;
    color: #c43d48;
}

.coleccion-estado h1,
.coleccion-estado h2 {
    margin: 0;
    color: #201d22;
    font-size: clamp(1.55rem, 3.4vw, 2.25rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.coleccion-estado p {
    max-width: 520px;
    margin: 15px auto 0;
    color: #716b76;
    font-size: 0.94rem;
    line-height: 1.7;
}

.coleccion-estado > a,
.coleccion-estado__acciones a {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    padding: 0 22px;
    border-radius: 11px;
    background: #1b191c;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    transition:
        background-color 180ms ease,
        transform 180ms ease;
}

.coleccion-estado > a:hover,
.coleccion-estado__acciones a:hover {
    background: #7445cd;
    transform: translateY(-2px);
}

.coleccion-estado__acciones {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.coleccion-estado__acciones a + a {
    border: 1px solid #ddd8e1;
    background: #fff;
    color: #39343c;
}

.coleccion-estado__acciones a + a:hover {
    border-color: #7445cd;
    color: #7445cd;
}

/* ==========================================================================
   Otras colecciones
   ========================================================================== */

.coleccion-otras {
    padding: 83px 0 96px;
    border-top: 1px solid #e7e4e9;
    background: #fff;
}

.coleccion-otras__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.coleccion-otras__grid article {
    min-width: 0;
}

.coleccion-otras__grid article > a {
    position: relative;
    display: block;
    min-height: 310px;
    overflow: hidden;
    border-radius: 20px;
    background: #1b181d;
    box-shadow: 0 18px 38px rgba(24, 17, 31, 0.09);
    color: #fff;
    text-decoration: none;
    isolation: isolate;
}

.coleccion-otras__grid img {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.coleccion-otras__grid article > a > span {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(
            0deg,
            rgba(10, 8, 12, 0.86) 0%,
            rgba(10, 8, 12, 0.24) 65%,
            rgba(10, 8, 12, 0.08) 100%
        );
}

.coleccion-otras__grid article > a > div {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 25px;
}

.coleccion-otras__grid h3 {
    margin: 0 0 9px;
    color: #fff;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    font-weight: 820;
    letter-spacing: -0.035em;
}

.coleccion-otras__grid strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.78rem;
}

.coleccion-otras__grid strong span {
    transition: transform 180ms ease;
}

.coleccion-otras__grid article > a:hover img {
    transform: scale(1.055);
}

.coleccion-otras__grid article > a:hover strong span {
    transform: translateX(4px);
}

/* ==========================================================================
   Animaciones
   ========================================================================== */

@keyframes coleccion-fondo-entrada {
    from {
        opacity: 0;
        transform: scale(1.06);
    }
    to {
        opacity: 1;
        transform: scale(1.015);
    }
}

@keyframes coleccion-contenido-entrada {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes coleccion-tarjeta-entrada {
    from {
        opacity: 0;
        transform: translateY(13px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 900px) {
    .coleccion-portada {
        min-height: 600px;
    }

    .coleccion-portada__sombra {
        background:
            linear-gradient(
                90deg,
                rgba(10, 8, 12, 0.88) 0%,
                rgba(10, 8, 12, 0.58) 70%,
                rgba(10, 8, 12, 0.28) 100%
            ),
            linear-gradient(
                0deg,
                rgba(10, 8, 12, 0.78) 0%,
                transparent 55%
            );
    }

    .migas--claras {
        margin-bottom: 55px;
    }

    .coleccion-controles {
        grid-template-columns: minmax(0, 1fr) minmax(210px, 0.6fr);
    }

    .coleccion-controles > button {
        grid-column: 1 / -1;
    }

    .coleccion-otras__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coleccion-otras__grid article:last-child {
        grid-column: 1 / -1;
    }

    .coleccion-otras__grid article:last-child > a {
        min-height: 280px;
    }
}

/* ==========================================================================
   Móvil
   ========================================================================== */

@media (max-width: 640px) {
    .pagina-coleccion .contenedor {
        width: min(100% - 28px, 1180px);
    }

    .coleccion-portada {
        min-height: 560px;
    }

    .coleccion-portada__fondo {
        object-position: 60% center;
    }

    .coleccion-portada__sombra {
        background:
            linear-gradient(
                0deg,
                rgba(9, 7, 10, 0.94) 0%,
                rgba(9, 7, 10, 0.58) 58%,
                rgba(9, 7, 10, 0.28) 100%
            );
    }

    .coleccion-portada__interior {
        padding-top: 25px;
        padding-bottom: 42px;
    }

    .migas--claras {
        gap: 7px;
        margin-bottom: 40px;
        font-size: 0.74rem;
    }

    .coleccion-portada h1 {
        font-size: clamp(2.55rem, 14vw, 4.1rem);
        line-height: 0.94;
    }

    .coleccion-portada__descripcion {
        display: -webkit-box;
        margin-top: 18px;
        overflow: hidden;
        font-size: 0.91rem;
        line-height: 1.65;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
    }

    .coleccion-portada__dato {
        margin-top: 21px;
    }

    .coleccion-productos {
        padding: 50px 0 68px;
    }

    .coleccion-productos__encabezado,
    .coleccion-otras__encabezado {
        align-items: flex-start;
        margin-bottom: 22px;
        flex-direction: column;
        gap: 9px;
    }

    .coleccion-productos__encabezado > a,
    .coleccion-otras__encabezado > a {
        padding: 3px 0;
    }

    .coleccion-controles {
        grid-template-columns: 1fr;
        gap: 13px;
        padding: 16px;
        border-radius: 17px;
    }

    .coleccion-controles > button {
        grid-column: auto;
        width: 100%;
    }

    .coleccion-resumen {
        align-items: flex-start;
        margin-top: -8px;
        flex-direction: column;
        gap: 8px;
    }

    .coleccion-estado {
        min-height: 280px;
        margin-top: 28px;
        padding: 39px 20px;
        border-radius: 20px;
    }

    .coleccion-estado__acciones {
        width: 100%;
        flex-direction: column;
        gap: 9px;
    }

    .coleccion-estado__acciones a {
        width: 100%;
        margin-top: 18px;
    }

    .coleccion-estado__acciones a + a {
        margin-top: 0;
    }

    .pagina-coleccion .paginacion {
        margin-top: 38px;
    }

    .coleccion-otras {
        padding: 60px 0 70px;
    }

    .coleccion-otras__grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .coleccion-otras__grid article:last-child {
        grid-column: auto;
    }

    .coleccion-otras__grid article > a,
    .coleccion-otras__grid article:last-child > a {
        min-height: 280px;
        border-radius: 18px;
    }
}

@media (max-width: 420px) {
    .coleccion-portada {
        min-height: 530px;
    }

    .coleccion-portada__eyebrow {
        font-size: 0.68rem;
    }

    .coleccion-portada__dato {
        max-width: 100%;
    }

    .coleccion-portada__dato span {
        line-height: 1.3;
    }

    .coleccion-busqueda input,
    .coleccion-control select,
    .coleccion-controles > button {
        min-height: 48px;
    }
}

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .coleccion-portada__fondo,
    .coleccion-portada__contenido,
    .coleccion-grid .producto-tarjeta {
        animation: none;
    }

    .coleccion-otras__grid img,
    .coleccion-productos a,
    .coleccion-otras a,
    .coleccion-controles > button {
        transition: none;
    }
}