/* =========================================
   PROIVAL CATÁLOGO — CSS REFACTORIZADO
   Estructura:
   01. Tokens & Reset
   02. Tipografía
   03. Layout Base
   04. Header
   05. Búsqueda
   06. Carrito (botón)
   07. Banners & Vendor
   08. Catálogo Header & Breadcrumbs
   09. Controles & Ordenamiento
   10. Grid & Cards Base
   11. Tarjeta Categoría
   12. Tarjeta Producto
   13. Specs & Badges
   14. Selector de Tamaño (Custom Select)
   15. Bulk Table
   16. Modal Base
   17. Cart Sidebar
   18. Items del Carrito
   19. Checkout Form
   20. Modal Asesores
   21. Footer
   22. Utilidades & Accesibilidad
   23. Animaciones
   24. Media Queries
   ========================================= */


/* =========================================
   01. TOKENS & RESET
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* — Paleta principal — */
    --clr-bg:           #080c18;
    --clr-bg-2:         #0e1220;
    --clr-surface:      rgba(255 255 255 / 0.04);
    --clr-surface-2:    rgba(255 255 255 / 0.08);
    --clr-border:       rgba(255 255 255 / 0.08);
    --clr-border-accent:rgba(0 195 255 / 0.35);

    --clr-primary:      #0072d2;
    --clr-secondary:    #00c3ff;
    --clr-accent:       #00c3ff;
    --clr-accent-dim:   rgba(0 195 255 / 0.15);

    --clr-success:      #00cc6f;
    --clr-warning:      #ffb400;
    --clr-danger:       #ff4455;
    --clr-gray:         #6b7280;

    --clr-text:         #f0f4ff;
    --clr-text-muted:   rgba(240 244 255 / 0.55);
    --clr-text-dim:     rgba(240 244 255 / 0.35);

    /* — Gradientes — */
    --grad-primary:     linear-gradient(135deg, #0072d2 0%, #00c3ff 100%);
    --grad-bg:          linear-gradient(160deg, var(--clr-bg) 0%, var(--clr-bg-2) 100%);
    --grad-card-hover:  linear-gradient(135deg, transparent, rgba(0 195 255 / 0.06));

    /* — Tipografía — */
    --font-body:        'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --font-display:     'Space Grotesk', 'Segoe UI', system-ui, sans-serif;

    /* — Espaciado (escala 4px) — */
    --sp-1: 0.25rem;   /* 4px  */
    --sp-2: 0.5rem;    /* 8px  */
    --sp-3: 0.75rem;   /* 12px */
    --sp-4: 1rem;      /* 16px */
    --sp-5: 1.25rem;   /* 20px */
    --sp-6: 1.5rem;    /* 24px */
    --sp-8: 2rem;      /* 32px */
    --sp-10: 2.5rem;   /* 40px */
    --sp-12: 3rem;     /* 48px */

    /* — Radio de borde (sistema de 3 tamaños) — */
    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --radius-xl:  28px;
    --radius-full: 999px;

    /* — Sombras — */
    --shadow-sm:    0 2px 8px rgba(0 0 0 / 0.25);
    --shadow-md:    0 6px 20px rgba(0 0 0 / 0.35);
    --shadow-lg:    0 15px 40px rgba(0 0 0 / 0.45);
    --shadow-accent: 0 8px 28px rgba(0 195 255 / 0.30);
    --shadow-accent-lg: 0 15px 45px rgba(0 195 255 / 0.40);

    /* — Blur — */
    --blur-sm:  blur(8px);
    --blur-md:  blur(16px);

    /* — Transiciones — */
    --ease-out: cubic-bezier(0.2, 0, 0, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast:   160ms;
    --dur-normal: 280ms;
    --dur-slow:   420ms;

    /* — Max widths — */
    --max-w: 1400px;
}


/* =========================================
   02. TIPOGRAFÍA BASE
   ========================================= */

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--grad-bg);
    color: var(--clr-text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    letter-spacing: -0.02em;
}


/* =========================================
   03. LAYOUT BASE
   ========================================= */

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-8);
}


/* =========================================
   04. HEADER
   ========================================= */

.header {
    background: rgba(8 12 24 / 0.92);
    padding: var(--sp-4) var(--sp-8);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--clr-border-accent);
    transition: padding var(--dur-normal) var(--ease-out),
                box-shadow var(--dur-normal) var(--ease-out);
}

.header.scrolled {
    padding-block: var(--sp-3);
    box-shadow: var(--shadow-accent);
}

.header-content {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--sp-6);
}

.logo {
    flex-shrink: 0;
    transition: opacity var(--dur-fast);
}

.logo:hover { opacity: 0.85; }

.logo img {
    height: 46px;
    width: auto;
    display: block;
}


/* =========================================
   05. BÚSQUEDA
   ========================================= */

.search-container {
    flex-grow: 1;
    position: relative;
    max-width: 580px;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 2.75rem;
    background: var(--clr-surface-2);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-full);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--dur-normal) var(--ease-out),
                box-shadow var(--dur-normal) var(--ease-out),
                background var(--dur-normal);
}

#searchInput::placeholder { color: var(--clr-text-dim); }

#searchInput:focus {
    outline: none;
    border-color: var(--clr-accent);
    background: rgba(255 255 255 / 0.06);
    box-shadow: 0 0 0 3px rgba(0 195 255 / 0.15);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    translate: 0 -50%;
    color: var(--clr-text-dim);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--dur-normal);
}

#searchInput:focus ~ .search-icon { color: var(--clr-accent); }

.clear-search {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    translate: 0 -50%;
    background: var(--clr-surface-2);
    border: none;
    color: var(--clr-text-muted);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: background var(--dur-fast), color var(--dur-fast);
}

.clear-search:hover {
    background: var(--clr-danger);
    color: #fff;
}


/* =========================================
   06. BOTÓN CARRITO
   ========================================= */

.cart-btn {
    flex-shrink: 0;
    background: var(--grad-primary);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    box-shadow: var(--shadow-accent);
    transition: transform var(--dur-normal) var(--ease-spring),
                box-shadow var(--dur-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.cart-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255 255 255 / 0);
    transition: background var(--dur-fast);
}

.cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent-lg);
}

.cart-btn:hover::after { background: rgba(255 255 255 / 0.1); }
.cart-btn:active { transform: translateY(0); }

.cart-count {
    background: rgba(255 255 255 / 0.25);
    border-radius: var(--radius-full);
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.cart-count.updated {
    animation: pop var(--dur-normal) var(--ease-spring);
}


/* =========================================
   07. BANNERS & VENDOR
   ========================================= */

.info-banner {
    max-width: var(--max-w);
    margin: var(--sp-4) auto;
    padding: var(--sp-4) var(--sp-6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    animation: slideDown var(--dur-slow) var(--ease-out);
}

.vendor-info {
    background: linear-gradient(135deg,
        rgba(0 195 255 / 0.08) 0%,
        rgba(0 114 210 / 0.05) 100%);
    border: 1px solid var(--clr-border-accent);
}

.vendor-banner-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: var(--sp-4);
}

.vendor-profile-group {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.vendor-actions-group {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.vendor-contact-btn,
.vendor-change-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.vendor-change-btn {
    min-width: auto;
}

.vendor-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.vendor-avatar-wrapper img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--clr-accent);
    box-shadow: 0 0 12px rgba(0 195 255 / 0.35);
    display: block;
}

.online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: var(--clr-success);
    border-radius: 50%;
    border: 2px solid var(--clr-bg);
}

.vendor-message-text {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    line-height: 1.4;
}

.vendor-name { color: var(--clr-text); font-weight: 600; }

.vendor-contact-btn {
    white-space: nowrap;
    flex-shrink: 0;
}


/* =========================================
   08. CATÁLOGO HEADER & BREADCRUMBS
   ========================================= */

.catalog-header {
    margin-bottom: var(--sp-8);
    animation: fadeUp var(--dur-slow) var(--ease-out);
}

#catalogTitle {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-family: var(--font-display);
    font-weight: 700;
    background: linear-gradient(135deg, var(--clr-text) 30%, var(--clr-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--sp-2);
}

.catalog-subtitle {
    color: var(--clr-text-muted);
    font-size: 1rem;
    margin-bottom: var(--sp-4);
}

.catalog-nav {
    display: block;
    padding: 0.65rem var(--sp-4);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* hide scrollbar visually */
    scrollbar-width: thin;
    scrollbar-color: var(--clr-border-accent) transparent;
}

.catalog-nav::-webkit-scrollbar { height: 3px; }
.catalog-nav::-webkit-scrollbar-thumb {
    background: var(--clr-border-accent);
    border-radius: 99px;
}

.breadcrumb-item { color: var(--clr-text-muted); }

.breadcrumb-item.link {
    color: var(--clr-accent);
    cursor: pointer;
    font-weight: 500;
    transition: color var(--dur-fast);
    text-decoration: none;
}

.breadcrumb-item.link:hover { color: var(--clr-text); }

.breadcrumb-separator {
    margin-inline: var(--sp-2);
    color: var(--clr-text-dim);
}


/* =========================================
   09. CONTROLES & ORDENAMIENTO
   ========================================= */

.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-6);
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.results-count {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.sort-label {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
}

.sort-select {
    padding: 0.5rem 2rem 0.5rem 0.9rem;
    background: var(--clr-surface-2);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-sm);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='%2399c4ff' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    background-size: 20px;
    transition: border-color var(--dur-fast);
}

.sort-select:hover,
.sort-select:focus {
    outline: none;
    border-color: var(--clr-accent);
}


/* =========================================
   10. GRID & CARDS BASE
   ========================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-6);
    align-items: start;
}

/* Card base — compartida por categoría y producto */
.card {
    background: var(--clr-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--clr-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--clr-text);
    text-decoration: none;
    position: relative;
    /* Sombra como pseudo-elemento para no triggear layout */
    isolation: isolate;
    transition: transform var(--dur-normal) var(--ease-out),
                border-color var(--dur-normal),
                background var(--dur-normal);
}

/* Overlay de gradiente en hover — solo opacity, sin reflow */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-card-hover);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-normal);
    z-index: 0;
}

/* Sombra en pseudo-elemento separado */
.card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    box-shadow: var(--shadow-accent-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-normal);
    z-index: -1;
}

.card:hover {
    transform: translateY(-8px) scale(1.015);
    border-color: rgba(0 195 255 / 0.5);
    background: rgba(255 255 255 / 0.06);
}

.card:hover::before { opacity: 1; }
.card:hover::after  { opacity: 1; }

/* Estado activo en táctiles */
@media (hover: none) {
    .card:hover {
        transform: none;
        background: var(--clr-surface);
    }
    .card:hover::before,
    .card:hover::after { opacity: 0; }

    .card:active {
        background: var(--clr-surface-2);
        border-color: var(--clr-border-accent);
    }
}

/* Estados de carga y sin resultados */
.loading-indicator {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--sp-12);
    color: var(--clr-accent);
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--sp-12);
    color: var(--clr-text-muted);
}

.no-results-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: var(--sp-4);
    opacity: 0.4;
}


/* =========================================
   11. TARJETA DE CATEGORÍA
   ========================================= */

.category-card {
    cursor: pointer;
    min-height: 260px;
}

.category-image {
    width: 100%;
    height: 190px;
    overflow: hidden;
    position: relative;
    background: var(--clr-bg-2);
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--dur-slow) var(--ease-out);
}

.category-card:hover .category-image img {
    transform: scale(1.07);
}

/* Vignette sobre la imagen */
.category-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0 0 0 / 0.5));
    opacity: 0;
    transition: opacity var(--dur-normal);
}

.category-card:hover .category-image::after { opacity: 1; }

.category-info {
    padding: var(--sp-5);
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.category-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--clr-accent);
    margin-bottom: var(--sp-2);
}

.category-description {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.product-badge {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-3);
    background: var(--grad-primary);
    color: #fff;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}


/* =========================================
   12. TARJETA DE PRODUCTO
   ========================================= */

.product-card {
    transition: transform var(--dur-normal) var(--ease-out),
                border-color var(--dur-normal),
                box-shadow var(--dur-normal);
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0 195 255 / 0.45);
    box-shadow: var(--shadow-accent);
}

/* Layout compacto — columna en desktop */
.product-compact {
    display: flex;
    flex-direction: column;
}

/* Imagen */
.product-image,
.product-image-compact {
    overflow: hidden;
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 240px;
}

.product-image-compact {
    width: 100%;
    height: 200px;
}

.product-image img,
.product-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--dur-slow) var(--ease-out);
    display: block;
}

.product-image img          { padding: var(--sp-5); }
.product-image-compact img  { padding: var(--sp-2); }

.product-card:hover .product-image img,
.product-card:hover .product-image-compact img {
    transform: scale(1.08);
}

/* Info */
.product-info {
    padding: var(--sp-5);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info-compact {
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    flex: 1;
}

.product-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-accent);
    line-height: 1.3;
    margin-bottom: var(--sp-1);
}

.product-description {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    flex-grow: 1;
    margin-block: var(--sp-2) var(--sp-4);
}

.product-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--clr-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

/* Botón expandir */
.expand-btn {
    width: 100%;
    background: transparent;
    border: 1.5px solid var(--clr-border-accent);
    color: var(--clr-accent);
    padding: 0.6rem var(--sp-4);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    margin-top: auto;
    transition: background var(--dur-fast),
                color var(--dur-fast),
                border-color var(--dur-fast);
    position: relative;
    overflow: hidden;
}

.expand-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--clr-accent);
    scale: 0;
    transition: scale var(--dur-normal) var(--ease-out);
    border-radius: inherit;
    z-index: 0;
}

.expand-btn:hover::before { scale: 1; }

.expand-btn:hover {
    color: var(--clr-bg);
    border-color: var(--clr-accent);
}

.expand-btn span,
.expand-btn .expand-icon,
.expand-btn .expand-text { position: relative; z-index: 1; }

.expand-icon {
    display: inline-block;
    transition: rotate var(--dur-normal) var(--ease-out);
}

.product-card[data-expanded="true"] .expand-icon {
    rotate: 180deg;
}

/* Sección expandible */
.product-details {
    padding: 0 var(--sp-4) var(--sp-4);
    animation: fadeUp var(--dur-normal) var(--ease-out);
}

/* Botón ficha técnica */
.tech-sheet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    width: 100%;
    background: transparent;
    border: 1.5px solid var(--clr-border-accent);
    color: var(--clr-accent);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--sp-4);
    transition: background var(--dur-fast),
                color var(--dur-fast),
                box-shadow var(--dur-fast);
    position: relative;
    overflow: hidden;
}

.tech-sheet-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--clr-accent);
    scale: 0;
    transition: scale var(--dur-normal) var(--ease-out);
    border-radius: inherit;
}

.tech-sheet-btn:hover::before { scale: 1; }
.tech-sheet-btn:hover {
    color: var(--clr-bg);
    box-shadow: var(--shadow-accent);
}
.tech-sheet-btn span { position: relative; z-index: 1; }

/* Footer del producto */
.product-footer {
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--clr-border);
}

/* Botón añadir al carrito */
.add-to-cart-btn {
    width: 100%;
    background: var(--grad-primary);
    color: #fff;
    border: none;
    padding: 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    transition: transform var(--dur-normal) var(--ease-spring),
                box-shadow var(--dur-normal) var(--ease-out),
                filter var(--dur-fast);
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255 255 255 / 0);
    transition: background var(--dur-fast);
}

.add-to-cart-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-accent-lg);
}

.add-to-cart-btn:hover::after { background: rgba(255 255 255 / 0.1); }
.add-to-cart-btn:active:not(:disabled) { transform: scale(0.98); }

.add-to-cart-btn:disabled {
    background: linear-gradient(135deg, #3a3d4a, #2e3040);
    cursor: not-allowed;
    opacity: 0.5;
}

.add-to-cart-btn.added {
    background: var(--clr-success) !important;
}

.add-to-cart-btn span { position: relative; z-index: 1; }

/* Vista Lista */
.products-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.products-grid.list-view .product-card:hover {
    transform: translateX(4px) translateY(-2px);
}

.products-grid.list-view .product-compact {
    width: 100%;
    display: grid;
    grid-template-columns: 80px 2fr 1fr auto;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-3);
}

.products-grid.list-view .product-image-compact {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
}

.products-grid.list-view .product-info-compact { padding: 0; }
.products-grid.list-view .product-name { font-size: 1rem; }
.products-grid.list-view .expand-btn { width: auto; padding: 0.5rem var(--sp-4); }

.dn-range-display {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.85rem;
}

.dn-range-label { color: var(--clr-text-muted); }
.dn-range-value { color: var(--clr-accent); font-weight: 600; }


/* =========================================
   13. SPECS & BADGES
   ========================================= */

.product-specs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    padding-block: var(--sp-3);
}

.spec-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 0.2rem 0.6rem;
    background: var(--clr-accent-dim);
    border: 1px solid rgba(0 195 255 / 0.2);
    border-radius: var(--radius-full);
    white-space: nowrap;
    font-size: 0.72rem;
}

.spec-label {
    font-weight: 600;
    color: rgba(0 195 255 / 0.8);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.spec-value { color: var(--clr-text-muted); }


/* =========================================
   14. SELECTOR DE TAMAÑO (CUSTOM SELECT)
   ========================================= */

.size-selector { margin-bottom: var(--sp-5); }

.size-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--clr-text);
}

.size-count-badge {
    background: var(--clr-accent-dim);
    color: var(--clr-accent);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
}

/* Contenedor principal */
.custom-select-container { position: relative; width: 100%; }

/* Trigger */
.custom-select-trigger {
    background: var(--clr-bg);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 0.8rem var(--sp-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    min-height: 48px;
    transition: border-color var(--dur-fast), background var(--dur-fast);
}

.custom-select-trigger:hover {
    border-color: var(--clr-border-accent);
    background: var(--clr-surface);
}

.custom-select-container.open .custom-select-trigger {
    border-color: var(--clr-accent);
    background: var(--clr-surface-2);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.dropdown-arrow {
    color: var(--clr-accent);
    transition: rotate var(--dur-normal) var(--ease-out);
}

.custom-select-container.open .dropdown-arrow { rotate: 180deg; }

/* Dropdown */
.custom-select-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 1px);
    background: var(--clr-bg);
    border: 1.5px solid var(--clr-accent);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    transition: max-height var(--dur-slow) var(--ease-out),
                opacity var(--dur-normal);
}

.custom-select-container.open .custom-select-dropdown {
    max-height: 420px;
    opacity: 1;
}

/* Abrir hacia arriba */
.custom-select-container.open-upward .custom-select-dropdown {
    top: auto;
    bottom: calc(100% - 1px);
    border-top: 1.5px solid var(--clr-accent);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Lista de opciones */
.custom-select-options {
    max-height: 380px;
    overflow-y: auto;
    padding: var(--sp-2);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.custom-select-options::-webkit-scrollbar { display: none; }

/* Opción individual */
.custom-option {
    padding: 0.85rem var(--sp-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    gap: var(--sp-4);
    transition: background var(--dur-fast),
                border-color var(--dur-fast),
                translate var(--dur-fast);
    position: relative;
}

.custom-option + .custom-option {
    border-top: 1px solid var(--clr-border);
}

.custom-option:hover {
    background: var(--clr-accent-dim);
    border-color: rgba(0 195 255 / 0.2);
    translate: 3px 0;
}

.custom-option.selected {
    background: rgba(0 195 255 / 0.12);
    border-color: var(--clr-border-accent);
}

/* Barra lateral de selected/hover */
.custom-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--clr-accent);
    border-radius: 0 3px 3px 0;
    scale: 0 1;
    transform-origin: left;
    transition: scale var(--dur-fast);
}

.custom-option:hover::before,
.custom-option.selected::before { scale: 1 1; }

.option-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.option-main {
    font-weight: 600;
    color: var(--clr-text);
    font-size: 0.95rem;
}

.option-sub {
    font-size: 0.82rem;
    color: var(--clr-text-muted);
}

.option-price {
    font-weight: 700;
    color: var(--clr-accent);
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Scrollbar indicator */
.custom-scrollbar-indicator {
    position: absolute;
    right: 6px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    display: none;
    z-index: 10;
}

.custom-select-container.open .custom-scrollbar-indicator { display: block; }

.scrollbar-track {
    width: 100%;
    height: 100%;
    background: var(--clr-border);
    border-radius: 99px;
    position: relative;
}

.scrollbar-thumb {
    width: 100%;
    min-height: 30px;
    background: var(--clr-accent);
    border-radius: 99px;
    cursor: grab;
    position: absolute;
    top: 0;
    opacity: 0.7;
    transition: opacity var(--dur-fast);
}

.scrollbar-thumb:hover { opacity: 1; }
.scrollbar-thumb:active { cursor: grabbing; }

/* Select nativo (fallback, oculto en desktop) */
.size-select-hidden { display: none; }

.size-select {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem var(--sp-4);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-sm);
    background: var(--clr-surface-2);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='%2300c3ff' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 22px;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.size-select:hover  { border-color: var(--clr-border-accent); }
.size-select:focus  {
    outline: none;
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px rgba(0 195 255 / 0.15);
}

.size-select option { background: var(--clr-bg-2); color: var(--clr-text); }


/* =========================================
   15. BULK TABLE
   ========================================= */

.bulk-grid {
    display: grid;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    max-height: 280px;
    overflow-y: auto;
    padding-right: var(--sp-1);
    scrollbar-width: thin;
    scrollbar-color: var(--clr-border-accent) transparent;
}

.bulk-grid::-webkit-scrollbar { width: 4px; }
.bulk-grid::-webkit-scrollbar-thumb {
    background: var(--clr-border-accent);
    border-radius: 99px;
}

.bulk-row {
    display: grid;
    grid-template-columns: 1fr 90px;
    align-items: center;
    background: var(--clr-surface);
    padding: 0.7rem var(--sp-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--clr-border);
    transition: background var(--dur-fast), border-color var(--dur-fast);
}

.bulk-row:hover,
.bulk-row:focus-within {
    background: var(--clr-accent-dim);
    border-color: var(--clr-border-accent);
}

.bulk-info {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.bulk-size-text { font-weight: 600; color: var(--clr-text); font-size: 0.9rem; }
.bulk-meta-text { font-size: 0.78rem; color: var(--clr-text-dim); }

.bulk-qty-input {
    width: 100%;
    padding: 0.45rem var(--sp-2);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--clr-border);
    background: var(--clr-bg);
    color: var(--clr-text);
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.bulk-qty-input:focus {
    outline: none;
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 2px rgba(0 195 255 / 0.15);
}

.bulk-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, var(--clr-bg) 80%, transparent);
    padding-top: var(--sp-4);
    z-index: 10;
}


/* =========================================
   16. MODAL BASE
   ========================================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8 12 24 / 0.85);
    z-index: 500;
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    padding: var(--sp-8);
    overscroll-behavior: contain;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--dur-normal) var(--ease-out);
}

.modal-content {
    background: var(--clr-bg-2);
    border-radius: var(--radius-xl);
    padding: var(--sp-8);
    max-width: 1100px;
    width: 90%;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--clr-border-accent);
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--dur-slow) var(--ease-spring);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--clr-border);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.close-btn {
    background: var(--clr-surface-2);
    border: none;
    color: var(--clr-text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background var(--dur-fast), color var(--dur-fast), rotate var(--dur-normal);
}

.close-btn:hover {
    background: var(--clr-danger);
    color: #fff;
    rotate: 90deg;
}

/* Size Sheet Modal específico */
#sizeSheetModal .modal-content {
    max-width: 480px;
    padding: var(--sp-6);
    display: flex;
    flex-direction: column;
}

#sizeSheetOptions {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
    scrollbar-width: none;
}

#sizeSheetOptions::-webkit-scrollbar { display: none; }

.sheet-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.9rem var(--sp-5);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-2);
    transition: background var(--dur-fast), border-color var(--dur-fast);
    text-align: left;
}

.sheet-option-btn:hover {
    background: var(--clr-accent-dim);
    border-color: var(--clr-border-accent);
}

.sheet-option-price {
    font-weight: 700;
    color: var(--clr-accent);
    font-size: 0.9rem;
}


/* =========================================
   17. CART SIDEBAR
   ========================================= */

/* El modal del carrito usa una variante lateral */
.cart-overlay {
    justify-content: flex-end;
    padding: 0;
}

.cart-sidebar {
    background: var(--clr-bg-2);
    width: min(480px, 100vw);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--clr-border-accent);
    animation: slideInRight var(--dur-slow) var(--ease-spring);
}

.cart-sidebar-header {
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: rgba(8 12 24 / 0.8);
    backdrop-filter: var(--blur-sm);
}

.cart-sidebar-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.close-sidebar-btn {
    background: var(--clr-surface-2);
    border: none;
    color: var(--clr-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    transition: background var(--dur-fast), color var(--dur-fast);
}

.close-sidebar-btn:hover {
    background: var(--clr-danger);
    color: #fff;
}

.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-5) var(--sp-6);
    overscroll-behavior: contain;
}

.cart-sidebar-footer {
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--clr-border);
    flex-shrink: 0;
    background: rgba(8 12 24 / 0.8);
    backdrop-filter: var(--blur-sm);
}


/* =========================================
   18. ITEMS DEL CARRITO
   ========================================= */

.cart-item {
    display: flex;
    gap: var(--sp-4);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
    position: relative;
    animation: slideIn var(--dur-normal) var(--ease-out);
    transition: background var(--dur-fast), border-color var(--dur-fast);
}

.cart-item:hover {
    background: var(--clr-surface-2);
    border-color: var(--clr-border-accent);
}

.cart-item-image {
    width: 90px;
    height: 90px;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    min-width: 0;
    padding-right: var(--sp-8);
}

.cart-item-name {
    font-weight: 700;
    color: var(--clr-accent);
    font-size: 1rem;
    line-height: 1.3;
}

.remove-btn-mini {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    background: rgba(255 68 85 / 0.1);
    color: var(--clr-danger);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background var(--dur-fast), color var(--dur-fast), scale var(--dur-fast);
}

.remove-btn-mini:hover {
    background: var(--clr-danger);
    color: #fff;
    scale: 1.1;
}

.cart-item-details {
    color: var(--clr-text-muted);
    font-size: 0.85rem;
}

.cart-item-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
}

/* Selector de cantidad */
.qty-selector {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--clr-surface-2);
    border-radius: var(--radius-sm);
    padding: 0.3rem var(--sp-2);
    border: 1px solid var(--clr-border);
}

.qty-selector button {
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    color: var(--clr-accent);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background var(--dur-fast), border-color var(--dur-fast);
}

.qty-selector button:hover {
    background: var(--clr-accent);
    border-color: var(--clr-accent);
    color: var(--clr-bg);
}

.qty-selector span {
    min-width: 22px;
    text-align: center;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--clr-text);
    font-size: 0.9rem;
}

/* Total */
.cart-total {
    margin-bottom: var(--sp-5);
    animation: fadeIn var(--dur-normal);
}

/* Carrito vacío */
.empty-cart {
    text-align: center;
    padding: var(--sp-12) var(--sp-8);
    color: var(--clr-text-dim);
    animation: fadeIn var(--dur-normal);
}

.empty-cart-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: var(--sp-2);
    color: var(--clr-text-muted);
}

.empty-cart-subtext { font-size: 0.9rem; }


/* =========================================
   19. CHECKOUT FORM
   ========================================= */

.checkout-form { animation: fadeIn var(--dur-slow); }

.form-section-title {
    color: var(--clr-accent);
    margin-bottom: var(--sp-5);
    font-family: var(--font-display);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.form-group { margin-bottom: var(--sp-5); }

.form-label {
    display: block;
    margin-bottom: var(--sp-2);
    color: var(--clr-text);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.85rem var(--sp-4);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-sm);
    background: var(--clr-surface-2);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--clr-text-dim); }

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px rgba(0 195 255 / 0.12);
    background: rgba(255 255 255 / 0.06);
}

.location-info {
    background: var(--clr-accent-dim);
    padding: 0.75rem var(--sp-4);
    border-radius: var(--radius-sm);
    margin-top: var(--sp-2);
    font-size: 0.85rem;
    color: var(--clr-accent);
    border: 1px solid var(--clr-border-accent);
}

.form-divider {
    border: none;
    border-top: 1px solid var(--clr-border);
    margin-block: var(--sp-6);
}

/* Botón checkout */
.checkout-btn {
    width: 100%;
    background: var(--clr-accent);
    color: var(--clr-bg);
    border: none;
    padding: var(--sp-4);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    transition: transform var(--dur-normal) var(--ease-spring),
                box-shadow var(--dur-normal),
                filter var(--dur-fast);
    box-shadow: var(--shadow-accent);
}

.checkout-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-accent-lg);
    filter: brightness(1.1);
}

.checkout-btn:active { transform: scale(0.99); }

/* Botones genéricos */
.btn {
    padding: 0.9rem var(--sp-8);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--dur-normal) var(--ease-spring),
                box-shadow var(--dur-normal),
                background var(--dur-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent-lg);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--clr-surface-2);
    color: var(--clr-text);
    border: 1.5px solid var(--clr-border-accent);
}

.btn-secondary:hover {
    background: var(--clr-accent-dim);
    transform: translateY(-2px);
}

.btn-link {
    background: transparent;
    color: var(--clr-accent);
    border: 1px solid var(--clr-border-accent);
    min-width: auto;
}

.btn-link:hover { background: var(--clr-accent-dim); }

.btn-large {
    padding: var(--sp-4) var(--sp-8);
    font-size: 1.05rem;
    width: 100%;
    margin-bottom: var(--sp-4);
}

.button-group {
    display: flex;
    gap: var(--sp-4);
    justify-content: center;
    flex-wrap: wrap;
}


/* =========================================
   20. MODAL ASESORES
   ========================================= */

.advisor-modal { max-width: 100%; width: 100%; }

.welcome-text {
    font-size: 1.1rem;
    color: var(--clr-text-muted);
    text-align: center;
    margin-bottom: var(--sp-6);
    line-height: 1.6;
}

.advisor-subtitle {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--clr-text);
    margin-bottom: var(--sp-6);
    text-align: center;
    font-weight: 600;
}

.advisors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-5);
    margin-bottom: var(--sp-6);
}

.advisor-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform var(--dur-normal) var(--ease-spring),
                border-color var(--dur-normal),
                background var(--dur-normal),
                box-shadow var(--dur-normal);
}

.advisor-card:hover {
    transform: translateY(-5px);
    border-color: var(--clr-border-accent);
    background: var(--clr-surface-2);
    box-shadow: var(--shadow-accent);
}

.advisor-card.selected {
    border-color: var(--clr-accent);
    background: var(--clr-accent-dim);
    box-shadow: 0 0 0 3px rgba(0 195 255 / 0.2);
    transform: scale(1.02);
}

.advisor-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid var(--clr-accent);
    margin: 0 auto var(--sp-4);
    object-fit: cover;
    box-shadow: var(--shadow-accent);
    transition: transform var(--dur-normal) var(--ease-spring),
                box-shadow var(--dur-normal);
}

.advisor-card:hover .advisor-photo {
    transform: scale(1.06);
    box-shadow: var(--shadow-accent-lg);
}

.advisor-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: var(--sp-1);
}

.advisor-specialty {
    font-size: 0.85rem;
    color: var(--clr-accent);
    font-weight: 500;
    margin-bottom: var(--sp-3);
}

.advisor-contact {
    font-size: 0.8rem;
    color: var(--clr-text-muted);
}

/* Asesor seleccionado - confirmación */
.advisor-selected-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border-accent);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    margin-bottom: var(--sp-6);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-4);
    box-shadow: var(--shadow-accent);
}

.advisor-selected-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid var(--clr-accent);
    object-fit: cover;
    box-shadow: var(--shadow-accent);
}

.advisor-selected-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--sp-1);
}

.advisor-selected-specialty {
    font-size: 0.9rem;
    color: var(--clr-accent);
    font-weight: 500;
    margin-bottom: var(--sp-2);
}

.advisor-selected-contact {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
}


/* =========================================
   21. FOOTER
   ========================================= */

.footer {
    background: linear-gradient(to bottom,
        transparent,
        rgba(8 12 24 / 0.98) 20%);
    border-top: 1px solid var(--clr-border-accent);
    margin-top: var(--sp-12);
    padding: var(--sp-10) var(--sp-8) var(--sp-6);
}

.catalog-footer-layout {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--sp-10);
    padding-bottom: var(--sp-8);
    border-bottom: 1px solid var(--clr-border);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.footer-logo-img {
    width: 160px;
    height: auto;
    filter: brightness(1.05);
}

.footer-tagline {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.footer-social { margin-top: var(--sp-2); }

.social-link {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    border-radius: 50%;
    color: var(--clr-text-muted);
    text-decoration: none;
    transition: background var(--dur-fast),
                color var(--dur-fast),
                transform var(--dur-normal) var(--ease-spring),
                border-color var(--dur-fast);
}

.social-link:hover {
    background: var(--clr-accent);
    color: var(--clr-bg);
    border-color: var(--clr-accent);
    transform: translateY(-3px);
}

.footer-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-8);
}

.footer-category-column { display: flex; flex-direction: column; }

.footer-title {
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--clr-border);
}

.footer-title-link {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--clr-accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color var(--dur-fast);
}

.footer-title-link:hover { color: var(--clr-text); }

.footer-subcategories {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.footer-subcategory-link {
    color: var(--clr-text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    transition: color var(--dur-fast), translate var(--dur-fast);
}

.footer-subcategory-link::before {
    content: '›';
    color: var(--clr-border-accent);
    font-size: 1.1rem;
    line-height: 1;
    transition: color var(--dur-fast);
}

.footer-subcategory-link:hover {
    color: var(--clr-accent);
    translate: 4px 0;
}

.footer-subcategory-link:hover::before { color: var(--clr-accent); }

.footer-bottom {
    max-width: var(--max-w);
    margin: var(--sp-6) auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--clr-text-dim);
    font-size: 0.85rem;
}


/* =========================================
   22. UTILIDADES & ACCESIBILIDAD
   ========================================= */

/* Precio */
.product-price {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--clr-accent);
}

.price-note {
    font-size: 0.82rem;
    color: var(--clr-text-dim);
    margin-top: var(--sp-1);
}

/* Tooltips */
[data-tooltip] { position: relative; cursor: help; }

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    translate: -50% 0;
    background: var(--clr-bg);
    color: var(--clr-text);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    border: 1px solid var(--clr-border-accent);
    box-shadow: var(--shadow-md);
    transition: opacity var(--dur-fast), translate var(--dur-fast);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    translate: -50% -4px;
}

/* Focus visible para accesibilidad */
:focus-visible {
    outline: 2px solid var(--clr-accent);
    outline-offset: 2px;
}

/* Scroll personalizado */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--clr-border-accent);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--clr-accent); }

/* Bloqueo de scroll cuando modal abierto */
body.no-scroll { overflow: hidden; }

/* Clases desktop-only */
.desktop-only { display: initial; }


/* =========================================
   23. ANIMACIONES
   ========================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pop {
    0%   { scale: 1; }
    50%  { scale: 1.35; }
    100% { scale: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* Preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* =========================================
   24. MEDIA QUERIES
   (Mobile-first donde aplica, overrides donde no)
   ========================================= */

/* — Tablet — */
@media (max-width: 1024px) {
    .catalog-footer-layout {
        grid-template-columns: 1fr;
        gap: var(--sp-8);
    }

    .footer-brand {
        align-items: center;
        text-align: center;
        max-width: 480px;
        margin: 0 auto;
    }

    .advisors-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
}

/* — Mobile — */
@media (max-width: 768px) {
    .container { padding: var(--sp-4); }

    /* Header */
    .header { padding: var(--sp-3) var(--sp-4); }

    .header-content {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--sp-3);
    }

    .logo { order: 1; }
    .logo img { height: 38px; }
    .cart-btn { order: 2; padding: 0.65rem var(--sp-4); font-size: 0.88rem; }

    .search-container {
        order: 3;
        width: 100%;
        max-width: none;
    }

    /* Grid */
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-3);
    }

    /* Tarjeta producto en móvil — layout horizontal */
    .product-compact {
        flex-direction: row;
        align-items: flex-start;
        gap: var(--sp-3);
        padding: var(--sp-3);
    }

    .product-image-compact {
        width: 82px;
        height: 82px;
        min-width: 82px;
        border-radius: var(--radius-sm);
        flex-shrink: 0;
        align-self: flex-start;
    }

    .product-image-compact img { padding: 4px; }

    .product-info-compact {
        flex: 1;
        padding: 0;
        min-width: 0;
    }

    .product-name {
        font-size: 0.95rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
        top: -4px;
        left: -4px;
    }

    .expand-btn {
        padding: 0.45rem var(--sp-3);
        font-size: 0.82rem;
    }

    /* Sección expandida móvil */
    .product-details { padding: 0 var(--sp-3) var(--sp-3); }

    /* Footer sticky cuando expandido */
    .product-card[data-expanded="true"] .product-footer {
        position: sticky;
        bottom: 0;
        background: linear-gradient(to top, var(--clr-bg) 80%, transparent);
        padding: var(--sp-4);
        margin: 0 calc(-1 * var(--sp-3)) calc(-1 * var(--sp-3));
        border-top: 1px solid var(--clr-border-accent);
        z-index: 10;
        animation: slideUp var(--dur-normal) var(--ease-out);
    }

    /* Categorías */
    .category-card { min-height: 220px; }
    .category-image { height: 150px; }
    .category-info { padding: var(--sp-4); }
    .category-name { font-size: 1.1rem; }

    /* Controls */
    .catalog-controls { flex-direction: column; align-items: stretch; }
    .sort-container { justify-content: space-between; }

    /* Vendor banner */
    .vendor-banner-layout { flex-direction: column; align-items: stretch; }
    .vendor-contact-btn,
    .vendor-change-btn { width: 100%; text-align: center; justify-content: center; }

    /* Cart sidebar — full screen drawer desde abajo */
    .cart-overlay {
        justify-content: stretch;
        align-items: flex-end;
    }

    .cart-sidebar {
        width: 100%;
        height: 92vh;
        border-left: none;
        border-top: 1px solid var(--clr-border-accent);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        animation: slideUpBottomSheet var(--dur-slow) var(--ease-spring);
    }

    /* Handle indicator */
    .cart-sidebar::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--clr-border);
        border-radius: 99px;
        margin: var(--sp-4) auto 0;
    }

    /* Modal genérico también desde abajo */
    .modal.active { align-items: flex-end; padding: 0; }

    .modal-content {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        width: 100%;
        max-height: 92vh;
        padding: var(--sp-5);
        padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
        animation: slideUpBottomSheet var(--dur-slow) var(--ease-spring);
    }

    .modal-content::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--clr-border);
        border-radius: 99px;
        margin: calc(-1 * var(--sp-3)) auto var(--sp-5);
    }

    /* Cart items compactos */
    .cart-item-image { width: 70px; height: 70px; }
    .cart-item-name { font-size: 0.92rem; }

    /* Form */
    .form-input, .form-textarea { font-size: 0.95rem; }

    /* Footer */
    .footer { padding: var(--sp-8) var(--sp-4) var(--sp-5); margin-top: var(--sp-8); }
    .footer-categories-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-6); }
    .footer-bottom { flex-direction: column; gap: var(--sp-3); text-align: center; }

    /* Lista */
    .products-grid.list-view .product-compact {
        grid-template-columns: 60px 1fr auto;
        gap: var(--sp-3);
        padding: var(--sp-2);
    }
    .products-grid.list-view .product-image-compact { width: 60px; height: 60px; min-width: 60px; }
    .products-grid.list-view .dn-range-display { display: none; }

    /* Asesores */
    .advisors-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-3); }
    .advisor-photo { width: 110px; height: 110px; }

    .desktop-only { display: none !important; }
}

/* — Ultra-mobile — */
@media (max-width: 480px) {
    .footer-categories-grid { grid-template-columns: 1fr; }
    .advisors-grid { grid-template-columns: repeat(2, 1fr); }
    .advisor-photo { width: 90px; height: 90px; }
    .btn { min-width: auto; flex: 1 1 calc(50% - var(--sp-2)); }
    .btn-large { flex: 1 1 100%; }
}

/* — Animaciones adicionales para mobile — */
@keyframes slideUpBottomSheet {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}