/* ================================================================ */
/* === ESTILOS GENERALES                                        === */
/* ================================================================ */
html {
    scroll-behavior: smooth; 
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f7f7f8;
    color: #222;
}

.media-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto 10px auto; 
    width: 100%;
    box-sizing: border-box;
}

.centered-logo { 
    max-width: 90%; 
    height: auto; 
    margin-bottom: 20px; 
}

/* Estilos para el contenedor y la imagen del GIF */
.gif-wrapper { 
    display: flex; 
    justify-content: center; 
    width: 100%; 
    margin-bottom: 12px; 
}

.centered-gif { 
    border-radius: 8px; 
    max-width: 80%; 
    height: auto; 
}

.info-text { 
    color: #333; 
    text-decoration: underline; 
    text-align: center; 
    font-size: 12px; 
    line-height: 1.4;
    margin-bottom: 12px; 
    text-transform: uppercase; 
    width: 100%; 
    font-weight: bold; 
}

/* ================================================================ */
/* === BARRA SUPERIOR FIJA (CATEGORÍAS + BOTÓN WHATSAPP EN 1 LÍNEA) === */
/* ================================================================ */
.sticky-nav-wrapper {
    width: 100%;
    padding: 8px 0;
    box-sizing: border-box;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 9999;
    background-color: #f7f7f8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sticky-nav-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 95%;
    max-width: 440px;
    margin: 0 auto;
}

.category-dropdown {
    flex: 1;
    height: 44px;
    padding: 0 36px;
    font-size: 13.5px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    text-align-last: center;
    color: #ffffff;
    background-color: #7a1c3d;
    color-scheme: light;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 3px 8px rgba(122, 28, 61, 0.28);
    transition: opacity 0.2s, transform 0.1s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"),
                      linear-gradient(135deg, #7a1c3d 0%, #a32954 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: right 14px center, 0 0;
    background-size: 15px, 100% 100%;
}

.category-dropdown:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.category-dropdown option {
    background-color: #ffffff !important;
    color: #111111 !important;
    font-weight: normal;
    text-transform: none;
}

/* Botón Circular de WhatsApp en la Barra */
.btn-whatsapp-sticky {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(37, 211, 102, 0.35);
    transition: background-color 0.2s, transform 0.1s;
}

.btn-whatsapp-sticky:hover {
    background-color: #1ebc59;
}

.btn-whatsapp-sticky:active {
    transform: scale(0.92);
}

.wa-icon-sticky {
    width: 24px;
    height: 24px;
    display: block;
}

/* ================================================================ */
/* === TÍTULOS DE CATEGORÍA                                     === */
/* ================================================================ */
.category-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0 16px 0;
    scroll-margin-top: 70px; 
}

.category-title {
    text-align: center;
    font-size: 19px;
    color: #111111;
    margin: 0;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.category-divider { 
    border: 0; 
    height: 1px; 
    background: #e2e2e2; 
    margin: 25px 0 15px 0; 
}

/* ================================================================ */
/* === ESTRUCTURA DEL CATÁLOGO (2 COLUMNAS EN CELULAR)          === */
/* ================================================================ */
.catalog-wrapper { 
    width: 95%; 
    max-width: 1200px;
    margin: 0 auto; 
    padding-bottom: 60px; 
}

.catalog-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
}

/* ================================================================ */
/* === TARJETA DE PRODUCTO MODERNA                              === */
/* ================================================================ */
.product-card { 
    background-color: #ffffff; 
    border: 1px solid #ebebeb; 
    border-radius: 12px; 
    padding: 8px; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
    overflow: hidden; 
    box-sizing: border-box;
}

/* Contenedor de la foto con proporción vertical (Aspect Ratio) */
.product-img-wrapper { 
    position: relative; 
    width: 100%; 
    aspect-ratio: 3 / 4;
    border-radius: 8px; 
    overflow: hidden; 
    cursor: pointer; 
    background-color: #f0f0f0;
}

.badge-ref {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(3px);
    z-index: 2;
    letter-spacing: 0.5px;
}

.catalogo-imagen { 
    width: 100%; 
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover; 
    object-position: top center; 
    display: block; 
    transition: transform 0.25s ease; 
}

.product-img-click:active .catalogo-imagen { 
    transform: scale(0.97); 
}

/* Información de Precio y Tela */
.product-info {
    width: 100%;
    padding: 8px 2px 6px 2px;
    box-sizing: border-box;
}

.product-price {
    font-size: 16px;
    font-weight: 800;
    color: #111111;
    line-height: 1.2;
}

.product-fabric {
    font-size: 11px;
    color: #666666;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fabric-tag {
    font-weight: 600;
    color: #333333;
}

/* ================================================================ */
/* === BOTONES MODERNOS                                         === */
/* ================================================================ */

/* Botón Principal: Fotos / Medidas */
.btn-fotos {
    display: block;
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    text-decoration: none;
    padding: 8px 6px;
    font-size: 11px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    font-weight: bold;
    margin-bottom: 6px;
    box-sizing: border-box;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-fotos:hover {
    background-color: #333333 !important;
}

.btn-fotos:active {
    transform: scale(0.97);
}

/* Botón Probador Virtual: Pruébatelo */
.btn-probar {
    display: block;
    background: linear-gradient(135deg, #7a1c3d 0%, #a32954 100%) !important;
    color: #ffffff !important;
    text-decoration: none;
    padding: 8px 6px;
    font-size: 11px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    font-weight: bold;
    margin-bottom: 6px;
    box-sizing: border-box;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-probar:hover {
    opacity: 0.92;
}

.btn-probar:active {
    transform: scale(0.97);
}

/* Botón Secundario: Disponibilidad */
.availability-wrapper { 
    width: 100%; 
}

.btn-disponibilidad { 
    background-color: #f2f2f3 !important; 
    color: #222222 !important; 
    border: 1px solid #dddddd !important; 
    padding: 8px 6px; 
    font-size: 11px; 
    border-radius: 6px; 
    cursor: pointer; 
    width: 100%; 
    text-align: center; 
    font-weight: 600; 
    transition: background-color 0.2s, border-color 0.2s; 
}

.btn-disponibilidad:hover { 
    background-color: #e8e8e9 !important; 
}

.btn-disponibilidad.active {
    background-color: #e4e4e6 !important;
    border-color: #bbbbbb !important;
}

/* Tabla de Disponibilidad */
.disponibilidad { 
    display: none; 
    margin-top: 8px; 
    width: 100%; 
    overflow-x: auto; 
}

.availability-table { 
    border-collapse: collapse; 
    width: 100%; 
    font-size: 9px; 
    background-color: #fafafa;
    border-radius: 6px;
    overflow: hidden;
}

.availability-table td { 
    width: auto !important; 
    text-align: center; 
    padding: 3px 1px; 
    vertical-align: middle; 
    border: 1px solid #ececec; 
    line-height: 1.2; 
    white-space: nowrap; 
}

.availability-table img { 
    max-width: 13px; 
    height: auto; 
    border-radius: 50%; 
    display: block; 
    margin: 0 auto; 
}

.error-message { 
    color: #c00; 
    font-weight: bold; 
    text-align: center; 
    padding: 20px; 
    border: 1px solid #fcc; 
    border-radius: 8px; 
    background-color: #fff4f4; 
    margin: 20px auto; 
    max-width: 80%; 
}

/* ================================================================ */
/* === LIGHTBOX MODAL (VISOR DE FOTOS CON ZOOM Y ESCALA)        === */
/* ================================================================ */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.lightbox-box {
    position: relative;
    background-color: #1a1a1a;
    width: 92%;
    max-width: 440px;
    max-height: 92dvh;
    max-height: 92vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.lightbox-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111111;
    color: #ffffff;
    padding: 8px 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #2a2a2a;
}

.lightbox-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.lightbox-title {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.lightbox-counter {
    font-size: 11px;
    color: #aaa;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lightbox-tool-btn {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border: none;
    font-size: 16px;
    line-height: 1;
    width: 28px !important;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    padding: 0 !important;
}

.lightbox-tool-btn:active {
    background-color: #555555 !important;
}

.lightbox-close-btn {
    background: transparent !important;
    color: #ffffff !important;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px !important;
    width: auto !important;
    margin-left: 6px;
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54dvh;
    height: 54vh;
    min-height: 240px;
    background-color: #0d0d0d;
    overflow: hidden;
}

.lightbox-img-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-main-img {
    max-width: 90%;
    max-height: 50dvh;
    max-height: 50vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
    border-radius: 4px;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
    border: none;
    font-size: 20px;
    width: 32px !important;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    z-index: 10;
    padding: 0 !important;
}

.lightbox-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.85) !important;
}

.lightbox-prev { left: 4px; }
.lightbox-next { right: 4px; }

.lightbox-footer-hint {
    background-color: #111111;
    color: #777777;
    font-size: 9.5px;
    text-align: center;
    padding: 6px 4px;
    border-top: 1px solid #222222;
}

/* ================================================================ */
/* === PANTALLAS GRANDES (PC Y TABLETS)                         === */
/* ================================================================ */
@media screen and (min-width: 768px) {
    
    .sticky-nav-inner {
        max-width: 500px;
        gap: 12px;
    }

    .category-dropdown {
        height: 48px;
        font-size: 15px;
    }

    .btn-whatsapp-sticky {
        width: 48px;
        height: 48px;
    }

    .wa-icon-sticky {
        width: 26px;
        height: 26px;
    }

    .category-title-wrapper {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        margin: 45px 0 24px 0;
        scroll-margin-top: 80px; 
    }
    
    .category-title { 
        font-size: 26px; 
    }

    .catalog-grid { 
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
        gap: 22px; 
    }

    .product-card { 
        padding: 12px; 
        border-radius: 14px;
    }

    .badge-ref {
        font-size: 11px;
        padding: 4px 10px;
    }

    .product-img-wrapper {
        aspect-ratio: 3 / 4;
        height: auto;
    }

    .catalogo-imagen { 
        height: 100%;
        aspect-ratio: 3 / 4;
        object-fit: cover;
        object-position: top center;
    }

    .product-price {
        font-size: 19px;
    }

    .product-fabric {
        font-size: 13px;
        margin-top: 4px;
    }

    .btn-fotos { 
        padding: 10px 14px; 
        font-size: 13px; 
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .btn-probar {
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .btn-disponibilidad {
        padding: 10px 14px; 
        font-size: 13px; 
        border-radius: 8px;
    }

    .availability-table { 
        font-size: 12px; 
    }

    .availability-table td { 
        padding: 5px 2px; 
    }

    .availability-table img { 
        max-width: 20px; 
    }
    
    .lightbox-box { 
        max-width: 580px; 
    }

    .lightbox-stage { 
        height: 64vh; 
    }

    .lightbox-main-img { 
        max-height: 58vh; 
    }

    .lightbox-nav-btn { 
        width: 40px !important; 
        height: 52px; 
        font-size: 26px; 
    }
}
