:root {
    --azul-fondo: #6b7d8d;
    --azul-card: rgba(240, 242, 245, 0.92);
    --azul-panel: rgba(245, 247, 250, 0.95);
    --dorado: #b8963e;
    --dorado-brillante: #c9a84c;
    --texto: #2d3436;
    --muted: #636e72;
    --sombra-dorada: rgba(184, 150, 62, 0.15);
    --borde: rgba(184, 150, 62, 0.2);
    --transicion: 0.3s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    min-height: 100vh;
}

/* ===== TOP BAR ===== */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 101;
    background: linear-gradient(90deg, #7a8d9c, #c9a84c, #7a8d9c);
    text-align: center;
    padding: 8px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.top-bar a:hover {
    color: #fff7d2;
}

/* ===== HEADER ===== */
.proto-header {
    text-align: center;
    padding: 40px 20px 30px;
    border-bottom: 1px solid var(--borde);
}

.proto-logo {
    height: 80px;
    width: auto;
    margin-bottom: 16px;
    border-radius: 10%;
}

/* ===== BOTON VOLVER FLOTANTE ===== */
.btn-volver-float {
    position: fixed;
    bottom: 90px;
    right: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--azul-panel);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 50px;
    color: var(--dorado-brillante);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background var(--transicion), transform var(--transicion), box-shadow var(--transicion);
}

.btn-volver-float:hover {
    background: var(--dorado);
    color: #1a2530;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--sombra-dorada);
}

.proto-header h1 {
    margin: 0 0 8px;
    font-size: 2.2rem;
    color: #1a1a1a;
}

.proto-subtitle {
    margin: 0;
    color: #555;
    font-size: 1rem;
}

/* ===== CATALOGO ===== */
.catalogo {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== CATEGORIA ===== */
.categoria {
    background: var(--azul-panel);
    border: 1px solid var(--borde);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color var(--transicion), box-shadow var(--transicion);
}

.categoria:hover {
    border-color: rgba(212, 175, 55, 0.4);
}

.categoria.active {
    border-color: var(--dorado);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.15);
}

/* Header de categoría */
.categoria-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 28px;
    cursor: pointer;
    transition: background var(--transicion);
}

.categoria-header:hover {
    background: rgba(212, 175, 55, 0.04);
}

.categoria-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(184, 150, 62, 0.12), rgba(184, 150, 62, 0.04));
    border: 1px solid rgba(184, 150, 62, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.categoria-icon i {
    font-size: 1.4rem;
    color: var(--dorado);
}

.categoria-info {
    flex: 1;
}

.categoria-info h2 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    color: #1a1a1a;
}

.categoria-info p {
    margin: 0;
    font-size: 0.88rem;
    color: #555;
}

/* Preview thumbnails (visibles cuando la categoría está cerrada) */
.preview-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.preview-thumbs img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform var(--transicion);
}

.preview-thumbs img:hover {
    transform: scale(1.15);
}

/* Ocultar miniaturas cuando la categoría está abierta */
.categoria.active .preview-thumbs {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
}

.categoria-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(184, 150, 62, 0.25);
    background: rgba(184, 150, 62, 0.06);
    color: var(--dorado);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transicion), background var(--transicion);
}

.categoria-toggle:hover {
    background: rgba(184, 150, 62, 0.14);
}

.categoria.active .categoria-toggle {
    transform: rotate(180deg);
    background: var(--dorado);
    color: #1a2530;
}

/* Grid de productos (colapsado por defecto) */
.categoria-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    padding: 0 28px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                padding 0.4s ease;
}

.categoria.active .categoria-productos {
    max-height: 600px;
    opacity: 1;
    padding: 4px 28px 28px;
}

/* Producto individual */
.producto-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transicion),
                border-color var(--transicion),
                background var(--transicion),
                box-shadow var(--transicion);
}

.producto-item:hover {
    transform: translateY(-4px);
    border-color: var(--dorado);
    background: rgba(212, 175, 55, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.producto-img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.producto-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.producto-nombre {
    font-size: 0.84rem;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.3;
}

.producto-desc {
    font-size: 0.74rem;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.4;
    margin-top: 2px;
    font-weight: 400;
}

/* ===== LIGHTBOX MODAL ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 2001;
}

.lightbox-close:hover {
    transform: scale(1.2);
    color: var(--dorado);
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 500px;
    width: 90%;
    animation: lightboxIn 0.3s ease;
}

.lightbox-content img {
    width: 280px;
    height: 280px;
    object-fit: contain;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-info {
    text-align: center;
}

.lightbox-info h3 {
    margin: 0 0 8px;
    color: var(--dorado);
    font-size: 1.4rem;
}

.lightbox-info p {
    margin: 0 0 18px;
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
}

.lightbox-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #25d366;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-btn:hover {
    background: #1da851;
    transform: translateY(-2px);
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
    .lightbox-content img {
        width: 200px;
        height: 200px;
        padding: 16px;
    }

    .lightbox-info h3 {
        font-size: 1.1rem;
    }
}

/* ===== FOOTER ===== */
.proto-footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--borde);
    margin-top: 40px;
}

.proto-footer p {
    margin: 0 0 8px;
    color: var(--muted);
}

.proto-note {
    font-size: 0.85rem;
    color: rgba(181, 194, 206, 0.6);
    font-style: italic;
}

/* ===== FOOTER WHATSAPP ===== */
.footer-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #25d366;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 8px;
    transition: opacity var(--transicion);
}

.footer-whatsapp:hover {
    opacity: 0.8;
}

/* ===== WHATSAPP FLOTANTE ===== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    border: 2px solid var(--dorado);
    animation: pulseGold 2.5s infinite;
}

.whatsapp-float i {
    font-size: 28px;
}

.float-text {
    font-size: 15px;
    font-weight: 700;
    margin-left: 10px;
    white-space: nowrap;
}

.whatsapp-float:hover {
    transform: scale(1.05);
    background-color: #128c7e;
    box-shadow: 0 6px 20px var(--sombra-dorada);
}

@keyframes pulseGold {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7), 0 4px 15px rgba(0, 0, 0, 0.4); }
    70% { box-shadow: 0 0 0 14px rgba(212, 175, 55, 0), 0 4px 15px rgba(0, 0, 0, 0.4); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0), 0 4px 15px rgba(0, 0, 0, 0.4); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .catalogo {
        padding: 0 12px;
        margin: 24px auto;
    }

    .categoria-header {
        padding: 18px 20px;
        gap: 14px;
    }

    .categoria-icon {
        width: 44px;
        height: 44px;
    }

    .categoria-info h2 {
        font-size: 1.02rem;
    }

    .categoria-productos {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .categoria.active .categoria-productos {
        padding: 4px 20px 20px;
    }

    .producto-img {
        width: 80px;
        height: 80px;
    }

    .producto-nombre {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .categoria-productos {
        grid-template-columns: repeat(2, 1fr);
    }

    .proto-header h1 {
        font-size: 1.6rem;
    }

    .btn-volver-float {
        position: static;
        margin-bottom: 16px;
    }

    .float-text {
        display: none;
    }

    .whatsapp-float {
        padding: 14px;
        right: 18px;
        bottom: 18px;
        border-radius: 50%;
    }
}

/* ===== Animaciones ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.categoria.active .producto-item {
    animation: fadeInUp 0.4s ease backwards;
}

.categoria.active .producto-item:nth-child(1) { animation-delay: 0.05s; }
.categoria.active .producto-item:nth-child(2) { animation-delay: 0.1s; }
.categoria.active .producto-item:nth-child(3) { animation-delay: 0.15s; }
.categoria.active .producto-item:nth-child(4) { animation-delay: 0.2s; }
.categoria.active .producto-item:nth-child(5) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
