:root {
    /* Colors derived from logo.png - Optimized for luxury minimal */
    --primary-color: #295E8A;
    --primary-light: #3D77A5;
    --primary-dark: #1C4568;
    
    --secondary-color: #86868b;
    --secondary-light: rgba(0,0,0,0.06);
    
    --background-color: #fbfbfd;
    --surface-color: #ffffff;
    --text-dark: #1d1d1f;
    --text-gray: #86868b;
    --text-light: #ffffff;
    
    --danger: #ff3b30; /* iOS red */
    
    /* Layout */
    --container-width: 1800px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--surface-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    letter-spacing: -0.011em;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.022em;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ====================
   Top Bar
   ==================== */
.top-bar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--secondary-light);
    font-size: 13px;
    color: var(--text-gray);
    padding: 8px 0;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left span {
    margin-right: 15px;
}
.top-bar-left i {
    color: var(--primary-color);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 30px;
}
.top-bar-right a {
    /* margins handled by flex gap */
}
.top-bar-right a:hover {
    color: var(--primary-color);
}

/* ====================
   Main Header
   ==================== */
.main-header {
    background-color: rgba(251, 251, 253, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 0;
    border-bottom: 1px solid var(--secondary-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    height: 90px;
    max-width: 250px;
    object-fit: contain;
}

/* Buscador */
.search-container {
    flex-grow: 1;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    width: 280px;
    height: 46px;
    padding: 0 18px;
    background: #f5f5f7;
    border-radius: 980px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background 0.3s ease;
}

.search-form:hover,
.search-form:focus-within {
    width: min(460px, 45vw);
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 0 0 4px rgba(61, 119, 165, 0.1);
}

.search-icon {
    color: #8a8f98;
    font-size: 15px;
    flex: 0 0 auto;
}

.search-input {
    width: 100%;
    flex-grow: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
}

.search-input::placeholder {
    color: #a0a5ad;
}

/* Dropdown de sugerencias (autocompletado) */
.search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    z-index: 1200;
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
}

.search-suggestions[hidden] {
    display: none;
}

.search-suggestions .sugg-group {
    margin-bottom: 6px;
}

.search-suggestions .sugg-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9aa0a8;
    padding: 8px 12px 4px;
}

.search-suggestions .sugg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    text-align: left;
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
}

.search-suggestions .sugg-item:hover,
.search-suggestions .sugg-item.active {
    background: #f4f6fb;
}

.search-suggestions .sugg-ico {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
    font-size: 13px;
    flex: 0 0 auto;
}

.search-suggestions .sugg-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggestions .sugg-sub {
    color: #9aa0a8;
    font-size: 12px;
    flex: 0 0 auto;
}

.search-suggestions .sugg-empty {
    padding: 16px 12px;
    color: #9aa0a8;
    font-size: 13px;
    text-align: center;
}

/* User Actions */
.header-actions {
    display: flex;
    gap: 25px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.action-item i {
    font-size: 24px;
    color: var(--text-dark);
}

.action-text {
    display: flex;
    flex-direction: column;
}

.action-text small {
    font-size: 11px;
    color: var(--text-gray);
}

.action-text span {
    font-size: 14px;
    font-weight: 600;
}

.cart-btn:hover i, .cart-btn:hover span {
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: -3px;
    left: 12px;
    border: 2px solid var(--surface-color);
    background-color: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    height: 18px;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ====================
   Navigation
   ==================== */
.main-nav {
    background-color: var(--primary-color);
    color: var(--text-light);
    position: sticky;
    top: 80px; /* Below the main header */
    z-index: 1000;
    max-width: var(--container-width);
    margin: 10px auto;
    border-radius: 980px;
    box-shadow: 0 8px 30px rgba(41, 94, 138, 0.15);
}

.nav-inner {
    display: flex;
}

.nav-links {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.nav-links li {
    flex: 0 1 auto;
    display: flex;
    align-items: stretch;
}

.nav-links a {
    color: var(--text-light) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 5px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 500;
    text-align: center;
    min-height: 48px;
}

.nav-links a:hover, .nav-links li.active > a {
    background-color: var(--primary-dark);
}

/* Dropdown y Mega-Menú */
.has-dropdown {
    position: relative;
}
.dropdown-menu, .mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05);
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    text-align: left;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(8px);
}

/* CSS hover — el panel es hijo del mismo <li> así que :hover
   sigue activo mientras el ratón esté sobre el panel */
.has-dropdown:hover > .dropdown-menu,
.has-dropdown:hover > .mega-menu,
.has-dropdown.open > .dropdown-menu,
.has-dropdown.open > .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Pinned = fijo aunque el ratón salga */
.mega-menu.pinned,
.dropdown-menu.pinned {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.dropdown-menu {
    min-width: 250px;
}

.dropdown-menu li, .mega-menu li {
    display: block;
    width: 100%;
    border-bottom: 1px solid #f1f1f1;
}

.dropdown-menu a, .mega-menu a {
    color: var(--text-dark) !important;
    padding: 10px 20px;
    font-size: 13px;
    transition: all 0.2s;
}

.dropdown-menu a:hover, .mega-menu a:hover {
    background-color: var(--surface-color);
    color: var(--primary-color);
    padding-left: 25px;
}

/* Columnas del Mega Menú */
.mega-menu {
    min-width: 600px;
    display: flex;
    padding: 10px;
}

.mega-column {
    flex: 1;
    padding: 10px;
}

.mega-column h4 {
    color: var(--primary-dark);
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--secondary-light);
}

.mega-column ul li {
    border-bottom: none;
}
.mega-column ul a {
    padding: 8px 10px;
}
.mega-column ul a:hover {
    padding-left: 15px;
}


/* ====================
   Desktop Mega Menu Sidebar & Tabs
   ==================== */
.mega-menu {
    display: flex;
    padding: 0;
    width: 900px; /* Ancho fijo para que no baile */
}

/* En pantallas medianas el mega menú de 900px no cabe; se reduce para que
   la alineación JS (izquierda/derecha/centrado) pueda mantenerlo en pantalla. */
@media (max-width: 1200px) {
    .mega-menu { width: 760px; }
    .mega-content { width: 510px; }
}

.mega-sidebar {
    min-width: 250px;
    width: max-content;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-x: hidden;
    padding-right: 10px;
}

.tab-btn {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: calc(100% - 20px);
    margin: 5px 10px;
    padding: 10px 15px;
    background: none;
    border: none;
    border-radius: 20px;
    text-align: left;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-text {
    display: inline-flex;
    flex-wrap: wrap;
    max-width: calc(100% - 40px);
    word-break: keep-all;
    line-height: 1.2;
}

.tab-btn .tab-pin-btn {
    margin-right: 10px;
    color: #999;
}

.tab-btn:hover {
    background: #f1f1f1;
    color: var(--primary-color);
}

.tab-btn.active {
    background: #ffe6e6; /* Light red */
    color: #d32f2f; /* Dark red */
    font-weight: 600;
}

.tab-btn.active .tab-pin-btn {
    color: #d32f2f;
}

.tab-btn.tab-pinned .fa-thumbtack {
    color: #d32f2f;
}

.mega-content {
    width: 650px;
    padding: 20px;
    background: white;
    min-height: 300px;
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}
.mobile-tab-title {
    display: none;
}
.pane-grid {
    display: flex;
    gap: 20px;
    padding: 15px;
    flex-wrap: wrap;
}

/* Mobilesentrix-style model grid */
.mega-model-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 15px 15px 5px;
}
.mega-col {
    flex: 0 0 auto;
    min-width: 160px;
    max-width: max-content;
    padding: 0 15px 10px 0;
}
.mega-col-title {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.mega-col-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mega-col-list li a {
    display: block;
    padding: 3px 0;
    font-size: 13px;
    color: #444 !important;
    text-decoration: none;
    transition: color 0.15s, padding-left 0.15s;
}
.mega-col-list li a:hover {
    color: var(--primary-color) !important;
    padding-left: 5px;
}

.nav-links li.ofertas > a {
    background-color: var(--danger);
    font-weight: 600;
}
.nav-links li.ofertas a:hover {
    background-color: #b02a37;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    padding: 15px;
    cursor: pointer;
}

/* ====================
   Main Content
   ==================== */
main {
    padding: 40px 0;
}

.section-title {
    font-size: 24px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-light);
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background-color: var(--primary-color);
}

/* Hero Grid */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    height: 400px;
    margin-bottom: 40px;
}

.hero-banner {
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    background-color: #E2E8F0;
    display: flex;
    align-items: center;
    padding: 40px;
}

/* Carousel: los slides inactivos quedan apilados (opacity:0) y bloquean los clics.
   Solo el slide visible debe capturar eventos. */
.carousel-slide {
    pointer-events: none;
}
.carousel-slide.active {
    pointer-events: auto;
}

.main-banner {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    background: linear-gradient(135deg, var(--background-color) 0%, #e0eaf5 100%);
    border: 1px solid var(--secondary-light);
}

.secondary-banner {
    padding: 20px 30px;
}
.secondary-banner.top {
    background: #f1f5f9;
}
.secondary-banner.bottom {
    background: #e2e8f0;
}

.banner-content h2 {
    font-size: 36px;
    color: var(--primary-dark);
    margin-bottom: 15px;
    line-height: 1.2;
}

.banner-content p {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 25px;
}

.banner-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 980px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(41, 94, 138, 0.39);
}
.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(41, 94, 138, 0.23);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 50px;
}

.category-card {
    background: white;
    border: 1px solid var(--secondary-light);
    border-radius: var(--border-radius);
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.category-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 14px;
    font-weight: 500;
}

.category-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.product-card {
    background: white;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 15px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.product-badge.discount {
    background: var(--danger);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.product-image {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
}
.product-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover .product-image img {
    transform: scale(1.04);
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--text-dark);
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 15px;
    margin-top: auto;
}
.product-price del {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 400;
    margin-right: 5px;
}
.tax-info {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-gray);
}

.btn-add-cart {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    width: 100%;
    padding: 8px;
}
.btn-add-cart:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ====================
   Footer
   ==================== */
.main-footer {
    background-color: #1a1a1a;
    color: #ccc;
    padding-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    height: 80px;
    margin-bottom: 20px;
    filter: invert(1);
    mix-blend-mode: screen;
}

.footer-col h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a:hover {
    color: white;
}

.social-links {
    margin-top: 20px;
}
.social-links a {
    display: inline-block;
    width: 35px;
    height: 35px;
    background: #333;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    margin-right: 10px;
    color: white;
}
.social-links a:hover {
    background: var(--primary-color);
}

.contact-info li {
    display: flex;
    gap: 10px;
}
.contact-info i {
    margin-top: 5px;
    color: var(--primary-color);
}

.footer-bottom {
    background: #111;
    padding: 20px 0;
    text-align: center;
    font-size: 12px;
}

/* ====================
   Responsive
   ==================== */
@media (max-width: 1024px) {
    .category-card { padding: 15px; }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .hero-grid { grid-template-columns: 1fr; grid-template-rows: auto auto auto; height: auto; }
    .hero-img { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    
    /* Fix Banners Height Collapse */
    .main-banner { min-height: 350px; }
    .secondary-banner { min-height: 200px; }
}

@media (max-width: 768px) {
    /* Top Bar Mobile */
    .top-bar-left { display: none; }
    .top-bar-right { display: flex; width: 100%; justify-content: flex-end; }
    .top-bar-right > a { display: none; }
    
    /* Header Mobile */
    .header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
    .logo-container { order: 1; flex: 0 0 auto; }
    .logo { height: 40px; }
    .header-actions { order: 2; flex: 1; justify-content: flex-end; gap: 15px; }
    .action-text { display: none; }
    .action-item i { font-size: 24px; }
    
    /* Search Mobile */
    .search-container { order: 3; width: 100%; max-width: 100%; margin-top: 5px; display: block; }
    .search-form { width: 100%; height: 42px; border-radius: 40px; border: 1px solid #e8e8e8; background: #ffffff; }
    .search-input { height: 100%; margin: 0; border: none; flex-grow: 1; width: 100%; }
    
    /* Menu Mobile */
    .nav-inner { flex-direction: column; }
    .mobile-menu-toggle { display: block; width: 100%; text-align: left; background: transparent; border: none; color: white; font-size: 16px; padding: 15px; cursor: pointer; }
    .nav-links { display: none; flex-direction: column; width: 100%; }
    .nav-links.active { display: flex; }
    .nav-links li { flex-direction: column; align-items: stretch; width: 100%; }
    .nav-links a { text-align: left; padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.1); justify-content: flex-start; }

    /* Mobile: el .main-nav mantiene border-radius: 980px del escritorio; con el
       menú desplegado (altura enorme) esa curvatura lo convierte en un óvalo azul.
       Forzar esquinas redondeadas normales -> rectángulo azul, nunca óvalo. */
    .main-nav { border-radius: 16px; }
    
    /* Mobile Mega Menu Accordion Fix */
    .mega-menu { display: none !important; flex-direction: column; position: static; min-width: 100%; box-shadow: none; border: none; background: #f8f9fa; padding: 0; }
    .has-dropdown.open > .mega-menu { display: flex !important; opacity: 1; visibility: visible; }

    /* Mobile: the desktop .tabbed-mega-menu rules (absolute + !important) must NOT
       apply here: force in-flow block, opaque bg, small radius (never an oval) and
       no clipping so all categories are visible. */
    .mega-menu.tabbed-mega-menu,
    .mega-menu.tabbed-mega-menu:hover,
    .tabbed-mega-menu,
    .has-dropdown.open > .tabbed-mega-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        border-top: none !important;
        border-radius: 16px !important;
        background: #f8f9fa !important;
        overflow: visible !important;
    }
    .mega-body { max-height: none !important; min-height: 0 !important; overflow: visible !important; }
    .mega-body .mega-content { overflow: visible !important; max-height: none !important; }

    
    /* Hide horizontal tabs and show all panes vertically */
    .mega-sidebar { display: none !important; }
    .tab-pane { display: block !important; margin-bottom: 5px; background: white; border: 1px solid #eee; border-radius: 8px; }
    .mobile-tab-title { display: block; font-size: 16px; font-weight: 700; padding: 12px 15px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; margin: 0; color: var(--primary-dark); }
    
    .mega-content { width: 100%; padding: 10px; background: #f8f9fa; min-width: 100%; }
    
    .mega-model-grid { flex-direction: column; padding: 0; gap: 15px; }
    .mega-col { width: 100%; max-width: 100%; padding: 0; }
    .mega-col-title { font-size: 14px; color: var(--primary-dark); border-bottom: 2px solid var(--primary-light); padding-bottom: 5px; margin-bottom: 10px; }
    .mega-col-list li a { color: var(--text-dark) !important; padding: 12px 5px; font-size: 14px; border-bottom: 1px solid #f1f1f1; display: block; width: 100%; text-align: left; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .product-title { font-size: 13px; }
    .product-price { font-size: 16px; }
    .section-title { font-size: 20px; }
    
    /* Banner Typography tweaks for mobile */
    .banner-content h2 { font-size: 1.8rem !important; }
    .banner-content h3 { font-size: 1.5rem !important; }
    .banner-content p { font-size: 1rem !important; }
    .main-banner { min-height: 300px; }
    .secondary-banner { min-height: 180px; }
}

@media (max-width: 480px) {
}

/* ====================
   Cart Sidebar
   ==================== */
.cart-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}
.cart-sidebar {
    position: fixed;
    top: 0; right: -100%;
    width: 100%; max-width: 400px; height: 100vh;
    background: white;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}
.cart-sidebar.active {
    right: 0;
}
.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--secondary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.close-cart {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-gray);
}
.cart-items {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.empty-cart-msg {
    text-align: center;
    color: var(--text-gray);
    margin-top: 20px;
}
.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--secondary-light);
    background: #f9f9f9;
}
.cart-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-gray);
}
.cart-total-line.total {
    font-weight: bold;
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 0;
}
.w-100 { width: 100%; }
.mt-15 { margin-top: 15px; }

.cart-item-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.cart-item-title { font-size: 13px; font-weight: 500; }
.cart-item-price { font-weight: bold; color: var(--primary-dark); }


.shipping-countdown-banner {
    display: none; /* hidden by default, toggled by JS */
    justify-content: center;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
    width: 100%;
}
.shipping-countdown-banner i {
    font-size: 16px;
    animation: truckMove 2s infinite alternate ease-in-out;
}
@keyframes truckMove {
    0% { transform: translateX(-2px); }
    100% { transform: translateX(4px); }
}
.countdown-time-box {
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* ====================
   Shipping Widget (Mobilesentrix Style)
   ==================== */
.shipping-widget-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.shipping-widget {
    background-color: #f3f4f6;
    border-radius: 8px;
    padding: 6px 10px;
    display: none; /* toggled by JS */
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}
.shipping-widget-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #d1d5db;
    padding-right: 12px;
}
.shipping-widget-carrier {
    font-weight: 900;
    color: #dc2626;
    font-size: 15px;
    font-style: italic;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.shipping-widget-sub {
    font-size: 9px;
    color: #4b5563;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
}
.shipping-widget-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.shipping-widget-timer {
    background-color: #000;
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
#countdown-text-suffix {
    font-size: 9px;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.shipping-widget-details {
    background-color: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 1px 10px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.shipping-widget-details:hover {
    background-color: #e5e7eb;
    color: #000;
}

@media (max-width: 768px) {
    .shipping-widget-wrapper { display: flex; }
    .shipping-widget { padding: 2px 6px; gap: 6px; }
    .shipping-widget-left { display: none; }
    .shipping-widget-timer { flex-direction: row; gap: 5px; padding: 3px 8px; font-size: 11px; white-space: nowrap; }
    #countdown-text-suffix { font-size: 8px; }
    .shipping-widget-details { display: none; }
}

/* Hero Banners Hover */
.carousel-slide .banner-content {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.carousel-slide.active:hover .banner-content {
    transform: translateY(-4px);
}

/* VAT Toggle Switch (iOS Style) */
.switch {
    position: relative;
    display: inline-block;
    width: 44px !important;
    height: 24px !important;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e9e9ea !important;
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px !important;
}
.switch input:checked + .slider { 
    background-color: #34c759 !important; 
}
.switch input:focus + .slider { 
    box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2) !important; 
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.16), 0 3px 1px rgba(0,0,0,0.1);
}
.switch input:checked + .slider:before { 
    transform: translateX(20px); 
}


/* ====================
   Google Translate Custom Styling
   ==================== */
/* Hide the top Google frame that pushes the page down */
body { top: 0 !important; }
.skiptranslate iframe { display: none !important; }

/* Hide the Google logo and 'Select Language' text inside the widget */
.goog-te-gadget {
    color: transparent !important;
    font-size: 0 !important;
}
.goog-te-gadget .goog-logo-link {
    display: none !important;
}
.goog-te-gadget .goog-te-combo {
    color: var(--text-dark) !important;
    background-color: white !important;
    border: 1px solid var(--secondary-light) !important;
    border-radius: 4px !important;
    padding: 2px 5px !important;
    font-size: 12px !important;
    font-family: 'Inter', sans-serif !important;
    outline: none !important;
    cursor: pointer !important;
    margin: 0 !important;
    height: 24px !important;
}

/* Fix alignment in the top bar */
#google_translate_element {
    display: inline-flex !important;
    align-items: center !important;
    height: 100% !important; min-height: 0 !important;
    margin-top: 0 !important;
}

/* Extra aggressive Google Translate hides */
.goog-te-gadget > span > a { display: none !important; }
.goog-te-gadget > span { display: none !important; }
.goog-te-gadget > div { display: inline-block !important; }

/* Completely hide Google branding and floating bars */
.goog-te-banner-frame.skiptranslate { display: none !important; }
body { top: 0px !important; }
#goog-gt-tt { display: none !important; }
.goog-tooltip { display: none !important; }
.goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background-color: transparent !important; box-shadow: none !important; }


/* ====================
   Account Dashboard
   ==================== */
.account-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    align-items: start;
}

.account-sidebar {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--secondary-light);
    overflow: hidden;
}

.account-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.account-sidebar li {
    border-bottom: 1px solid var(--secondary-light);
}

.account-sidebar li:last-child {
    border-bottom: none;
}

.account-sidebar button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.account-sidebar button i {
    font-size: 16px;
    color: var(--text-gray);
    width: 20px;
    text-align: center;
    transition: var(--transition);
}

.account-sidebar button:hover {
    background-color: var(--surface-color);
    color: var(--primary-color);
}

.account-sidebar button.active {
    background-color: var(--primary-color);
    color: white;
}

.account-sidebar button.active i {
    color: white;
}

.account-content {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--secondary-light);
    padding: 30px;
    min-height: 400px;
}

.dashboard-tab {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dashboard-tab.active {
    display: block;
}

.dashboard-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--secondary-light);
}

.dashboard-header h3 {
    margin: 0;
    font-size: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--secondary-light);
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: var(--text-gray);
    font-size: 13px;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--secondary-light);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

@media (max-width: 768px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
}


/* ====================
   RMA Modal Styles
   ==================== */
.rma-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.rma-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.rma-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.rma-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--secondary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
}

.rma-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-dark);
}

.rma-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-gray);
    transition: var(--transition);
}

.rma-modal-close:hover {
    color: var(--danger);
}

.rma-modal-body {
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}

/* Order Item List */
.rma-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rma-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--secondary-light);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.rma-list-item:hover {
    border-color: var(--primary-color);
    background-color: var(--surface-color);
}

.rma-list-item-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rma-list-item-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
}

.rma-list-item-subtitle {
    font-size: 13px;
    color: var(--text-gray);
}

.rma-list-item-right {
    font-weight: 700;
    color: var(--primary-color);
}

/* Product Selection Layout */
.rma-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--secondary-light);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.rma-product-item:hover {
    border-color: var(--primary-color);
    background-color: var(--surface-color);
}

.rma-product-img {
    width: 50px;
    height: 50px;
    background: var(--secondary-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 20px;
}

.rma-back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rma-back-btn:hover {
    text-decoration: underline;
}

/* Selected Product Display in Form */
.rma-selected-product {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    margin-top: 10px;
}

/* Custom layout grids for responsive forms and pages */
.product-layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 50px; }
.checkout-layout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.form-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.products-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.gap-20 { gap: 20px; }

@media (max-width: 768px) {
    .product-layout-grid { grid-template-columns: 1fr; gap: 20px; }
    .checkout-layout-grid { grid-template-columns: 1fr; gap: 20px; }
    .form-grid-2col { grid-template-columns: 1fr; }
    .form-grid-3col { grid-template-columns: 1fr; }
    .products-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
    .products-grid-3 { grid-template-columns: 1fr !important; }
}


/* ====================
   Category Layout & Mobile Filters
   ==================== */
.category-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.filter-sidebar {
    position: fixed;
    top: 0; left: -100%;
    width: 100%; max-width: 320px;
    height: 100vh;
    background: white;
    z-index: 1005;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
}
.filter-sidebar.active {
    left: 0;
}
.filter-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.filter-header-mobile {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid var(--secondary-light);
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
}
.filter-header-mobile h3 { margin: 0; font-size: 18px; }
.close-filters { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-dark); }
.filter-footer-mobile {
    display: block;
    padding: 20px;
    border-top: 1px solid var(--secondary-light);
    background: var(--surface-color);
    position: sticky;
    bottom: 0;
}
.filter-box-desktop { border: none !important; border-radius: 0 !important; }
.filter-title-desktop { display: none; }

.filter-toggle-btn {
    display: inline-block;
    background: var(--surface-color);
    border: 1px solid var(--secondary-light);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
}
.filter-toggle-btn i { margin-right: 5px; }

.category-top-actions { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}



.hero-section { margin-top: 60px; margin-bottom: 40px; }

/* ====== Optimized Product Images ====== */
.product-img-wrap {
    width: 100%;
    height: 130px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Skeleton shimmer while image loads */
.product-img-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: imgShimmer 1.5s ease-in-out infinite;
    z-index: 0;
}

@keyframes imgShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Image loaded — hide skeleton, fade in */
.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-img-wrap img[src] {
    opacity: 1;
}

/* Logo propio en lugar del placeholder de MobileSentrix (cuadrado, mismo área que la foto MS) */
.product-img-wrap img.product-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1;
    padding: 0 !important;
    transition: transform 0.3s ease;
}

/* En ordenador, escalar para que ocupe mas espacio visual en la caja estrecha */
@media (min-width: 769px) {
    .product-img-wrap img.product-logo {
        transform: none;
    }
}

/* En movil (pantalla partida en 2 columnas), max 175px de ancho. */
@media (max-width: 768px) {
    .product-img-wrap img.product-logo {
        transform: none;
    }
}

/* Icon fallback (no skeleton needed) */
.product-img-wrap.product-img-icon {
    color: #ccc;
}
.product-img-wrap.product-img-icon::before {
    display: none;
}

/* Translation layout protection */
.product-card h4, .product-card .product-title {
    word-break: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}
/* --- Banner de Cookies --- */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #222;
    color: #fff;
    padding: 15px 20px;
    z-index: 99999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    font-size: 14px;
}
#cookie-banner .cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}
#cookie-banner p {
    margin: 0;
    line-height: 1.5;
}
#cookie-banner a {
    color: var(--primary-color, #0d6efd);
    text-decoration: underline;
}
#cookie-banner .cookie-buttons {
    display: flex;
    gap: 10px;
}
@media (min-width: 768px) {
    #cookie-banner .cookie-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}


/* Hover Effect for Product Links */
.product-card a.product-link { text-decoration: none; color: inherit; display: block; }
.product-card:hover .product-title { color: var(--primary-color); text-shadow: 0 0 2px var(--primary-color); transition: all 0.2s ease; }
.product-card:hover .product-image { opacity: 0.9; }
/* Z-Index Fix for Mega-Menu over Login Panel */
header.main-header {
    position: relative;
    z-index: 1000;
}
nav.main-nav {
    position: relative;
    z-index: 1001;
}
.mega-menu {
    z-index: 1005 !important;
}
.cart-overlay {
    z-index: 9999 !important;
}
.cart-sidebar {
    z-index: 10000 !important;
}

/* ====================
   Toasts (Glassmorphism)
   ==================== */
#jj-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.jj-toast {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 5px solid #3b82f6;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 10px 32px rgba(17, 24, 39, 0.18);
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
    transform: translateX(120%);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    cursor: pointer;
    word-break: break-word;
}
.jj-toast.show {
    transform: translateX(0);
    opacity: 1;
}
.jj-toast-success { border-left-color: #10b981; }
.jj-toast-error   { border-left-color: #ef4444; }
.jj-toast-info    { border-left-color: #3b82f6; }

/* ====================
   Skeleton Loading
   ==================== */
.skeleton-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.skeleton-block,
.skeleton-line {
    background: #dfe5ee;
    border-radius: 6px;
}
.skeleton-line { display: block; }
.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(100deg, #dfe5ee 40%, #f4f7fb 50%, #dfe5ee 60%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 120% 0; }
    100% { background-position: -80% 0; }
}
.skeleton-card .skeleton-line {
    margin-top: 8px;
}

/* Skeleton de la página de producto (sustituye a la rueda girando) */
.product-skeleton {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
}
.product-skeleton .skeleton-block {
    background: #eef2f7;
}
@media (max-width: 768px) {
    .product-skeleton { grid-template-columns: 1fr; gap: 20px; }
}

/* Barra de progreso fija arriba (imposible de no ver mientras carga) */
#jj-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color, #e3000f), #ff7a5c);
    z-index: 99999;
    pointer-events: none;
}
#jj-loading-bar.active {
    animation: jj-loading 1.3s ease-in-out infinite;
}
#jj-loading-bar.done {
    width: 100% !important;
    animation: none;
    transition: width .25s ease;
}
@keyframes jj-loading {
    0%   { width: 0; margin-left: 0; }
    60%  { width: 55%; margin-left: 0; }
    100% { width: 20%; margin-left: 80%; }
}

/* Rótulo "Cargando repuestos…" dentro de la grilla */
.skeleton-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 14px;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 15px;
}
.skeleton-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #d0d7e2;
    border-top-color: var(--primary-color, #e3000f);
    border-radius: 50%;
    animation: jj-spin .7s linear infinite;
}
@keyframes jj-spin { to { transform: rotate(360deg); } }

/* ====================
   Botón de pago sticky en móvil (checkout)
   ==================== */
@media (max-width: 768px) {
    #checkoutBtn {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 16px 20px !important;
        z-index: 1040;
        box-shadow: 0 -6px 24px rgba(13, 110, 253, 0.35);
    }
    #payment-message { margin-bottom: 70px; }
}

/* ====================
   Carrito flotante en móvil (FAB)
   ==================== */
.mobile-cart-fab {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1030;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.45);
    text-decoration: none;
}
.mobile-cart-fab:hover { color: #fff; background: var(--primary-dark); }
.mobile-cart-fab .cart-badge {
    position: absolute;
    top: 2px;
    left: auto;
    right: 2px;
    border: 2px solid #fff;
}
@media (max-width: 768px) {
    .mobile-cart-fab { display: flex; }
}

/* ========================================== */
/* TOAST NOTIFICATIONS (Glassmorphism) */
/* ========================================== */
#jj-toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.jj-toast {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px 24px;
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
    pointer-events: auto;
    animation: toastSlideUp 0.3s ease forwards;
    transition: opacity 0.3s ease;
    max-width: 90vw;
}
.jj-toast.error { background: rgba(220, 53, 69, 0.9); border-color: rgba(220, 53, 69, 0.5); }
.jj-toast.success { background: rgba(40, 167, 69, 0.9); border-color: rgba(40, 167, 69, 0.5); }
.jj-toast.info { background: rgba(23, 162, 184, 0.9); border-color: rgba(23, 162, 184, 0.5); }
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================== */
/* SKELETON LOADING */
/* ========================================== */
.skeleton-card {
    background: var(--bg-dark-secondary);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 350px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}
.skeleton-img {
    width: 100%;
    height: 180px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}
.skeleton-title {
    width: 80%;
    height: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}
.skeleton-price {
    width: 40%;
    height: 24px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    margin-top: 10px;
}
.skeleton-btn {
    width: 100%;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    margin-top: auto;
}
.skeleton-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    100% { left: 150%; }
}

/* ========================================== */
/* MEGA-MENU SEARCH BAR                       */
/* ========================================== */
.mega-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    margin: 10px 14px 12px 14px;
}
.mega-search-bar i {
    color: var(--text-muted, #aaa);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.mega-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary, #eee);
    font-size: 0.88rem;
    font-family: inherit;
    min-width: 0;
}
.mega-search-input::placeholder {
    color: var(--text-muted, #888);
}

/* ========================================== */
/* MODEL PREVIEW PANEL (MobileSentrix style)  */
/* ========================================== */
#model-preview-panel {
    position: absolute;
    z-index: 99999;
    width: 180px;
    background: rgba(20,20,30,0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    padding: 14px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px) scale(0.97);
    transition: opacity 0.18s ease, transform 0.18s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#model-preview-panel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.mpanel-img-wrap {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
}
.mpanel-img {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
    /* Clip just the top portion, like MobileSentrix does */
    object-position: top center;
}
.mpanel-info {
    width: 100%;
    text-align: center;
}
.mpanel-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #eee;
    line-height: 1.3;
    margin-bottom: 4px;
}
.mpanel-compat {
    font-size: 0.72rem;
    color: #888;
    letter-spacing: 0.03em;
    font-family: monospace;
}

/* Hide preview on mobile/tablet */
@media (max-width: 992px) {
    #model-preview-panel { display: none !important; }
    .mega-search-bar { margin: 6px 8px 8px 8px; }
}

/* ========================================== */
/* TOAST NOTIFICATIONS (Glassmorphism) */
/* ========================================== */
#jj-toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.jj-toast {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px 24px;
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
    pointer-events: auto;
    animation: toastSlideUp 0.3s ease forwards;
    transition: opacity 0.3s ease;
    max-width: 90vw;
}
.jj-toast.error { background: rgba(220, 53, 69, 0.9); border-color: rgba(220, 53, 69, 0.5); }
.jj-toast.success { background: rgba(40, 167, 69, 0.9); border-color: rgba(40, 167, 69, 0.5); }
.jj-toast.info { background: rgba(23, 162, 184, 0.9); border-color: rgba(23, 162, 184, 0.5); }
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================== */
/* SKELETON LOADING */
/* ========================================== */
.skeleton-card {
    background: var(--bg-dark-secondary);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 350px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}
.skeleton-img {
    width: 100%;
    height: 180px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}
.skeleton-title {
    width: 80%;
    height: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}
.skeleton-price {
    width: 40%;
    height: 24px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    margin-top: 10px;
}
.skeleton-btn {
    width: 100%;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    margin-top: auto;
}
.skeleton-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    100% { left: 150%; }
}

/* ============================================================ */
/* MEGA-MENU: MobileSentrix-style layout                         */
/* ============================================================ */

/* Override: mega-body replaces the old flex on mega-content */
.mega-body {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    max-height: 420px;
}
.mega-body .mega-sidebar {
    flex-shrink: 0;
}
.mega-body .mega-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Top header bar: search + preview (like MobileSentrix) */
.mega-ms-header {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
    padding: 10px 14px;
    min-height: 64px;
    flex-shrink: 0;
}

/* Search input area */
.mega-ms-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 8px 14px;
    margin-right: 16px;
}
.mega-ms-search i {
    color: var(--text-muted, #aaa);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.mega-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary, #eee);
    font-size: 0.88rem;
    font-family: inherit;
    min-width: 0;
}
.mega-search-input::placeholder {
    color: var(--text-muted, #888);
}
.mega-ms-clear {
    background: none;
    border: none;
    color: var(--text-muted, #aaa);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.2s;
    line-height: 1;
    flex-shrink: 0;
}
.mega-ms-clear:hover { color: #fff; }

/* Preview panel (right side of header) */
.mega-ms-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    min-width: 200px;
    max-width: 320px;
}
.msp-compat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}
.msp-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #aaa);
    letter-spacing: 0.04em;
}
.msp-code {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.78rem;
    font-family: monospace;
    color: #e2e2e2;
    margin-right: 4px;
}
.msp-model {
    font-size: 0.82rem;
    color: #ccc;
    font-style: normal;
}
.msp-img-wrap {
    width: 70px;
    height: 52px;
    overflow: hidden;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;   /* clip from top, showing camera area */
    justify-content: center;
    background: rgba(255,255,255,0.04);
}
.msp-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top center;
    /* Show only the top 52px (camera area) — like MobileSentrix */
    min-height: 100px;
    margin-top: 0;
}

/* Highlight hovered model */
.mega-model-link.mhp-active {
    background: rgba(0,0,0,0.05); /* fixed red flash */
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
}

/* Fix mega-menu min/max height when mega-body present */
.tabbed-mega-menu {
    display: flex;
    flex-direction: column !important;
}
.tabbed-mega-menu .mega-sidebar,
.tabbed-mega-menu .mega-content {
    /* Remove old flex-direction row from parent — now it's in .mega-body */
}

/* ============================================================ */
/* TOAST NOTIFICATIONS (Glassmorphism)                           */
/* ============================================================ */
#jj-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    align-items: center;
}
.jj-toast {
    background: rgba(30, 30, 35, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 12px 22px;
    color: #fff;
    font-weight: 500;
    font-size: 0.93rem;
    text-align: center;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    max-width: 90vw;
    cursor: pointer;
}
.jj-toast.show { opacity: 1; transform: translateY(0); }
.jj-toast-error   { border-left: 3px solid #e53e3e; }
.jj-toast-success { border-left: 3px solid #38a169; }
.jj-toast-info    { border-left: 3px solid #3182ce; }

/* ============================================================ */
/* SKELETON LOADING                                              */
/* ============================================================ */
.skeleton-card {
    background: var(--bg-dark-secondary, #1a1a2e);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 320px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.07);
}
.skeleton-img { width: 100%; height: 160px; background: rgba(255,255,255,0.05); border-radius: 8px; }
.skeleton-title { width: 80%; height: 18px; background: rgba(255,255,255,0.05); border-radius: 4px; }
.skeleton-price { width: 40%; height: 22px; background: rgba(255,255,255,0.05); border-radius: 4px; margin-top: 8px; }
.skeleton-btn   { width: 100%; height: 38px; background: rgba(255,255,255,0.05); border-radius: 20px; margin-top: auto; }
.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 100% { left: 160%; } }

@media (max-width: 992px) {
    .mega-ms-header { padding: 8px; min-height: 50px; }
    /* removed bad rule */
    .mega-body { max-height: none; }
}

/* ============================================================ */
/* MEGA-MENU: Fix flex-direction for new header + body layout   */
/* ============================================================ */
.tabbed-mega-menu {
    flex-direction: column !important;
    width: 900px;
    overflow: hidden;
}
@media (max-width: 1200px) {
    .tabbed-mega-menu { width: 760px; }
}
.mega-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    max-height: 400px;
    min-height: 280px;
}
.mega-body .mega-sidebar {
    max-height: none;
    height: auto;
}
.mega-body .mega-content {
    max-height: none;
    height: auto;
    overflow-y: auto;
}

/* Make search input + preview take the right portion */
.mega-ms-header {
    width: 100%;
    box-sizing: border-box;
}

/* ================================================================ */
/* MEGA-MENÚ: FULL WIDTH (como MobileSentrix)                        */
/* La clave: .has-dropdown { position:static } y el mega-menu se    */
/* posiciona relativo al .main-nav que es sticky.                    */
/* ================================================================ */

/* 1. El <li> ya NO es el padre relativo del mega-menu */
.has-dropdown {
    position: static !important;
}

/* 2. La barra de nav SÍ es el padre relativo */
.main-nav {
    position: sticky !important;
    top: 0;
    z-index: 1000;
}
.nav-inner {
    position: relative;
}

/* 3. El mega-menu ocupa toda la pantalla desde el borde izquierdo */
.mega-menu.tabbed-mega-menu,
.tabbed-mega-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
    box-sizing: border-box;
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
    border-top: 3px solid var(--primary-color);
    flex-direction: column !important;
    overflow: hidden;
}

/* Anula el JS de alineación (alignMegaMenus) — ya no hace falta */
/* (el JS sigue corriendo pero el !important lo sobrescribe) */

/* 4. El mega-body ocupa el ancho completo en fila */
.mega-body {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    max-height: 420px;
    min-height: 260px;
    overflow: hidden;
}
.mega-body .mega-sidebar {
    min-width: 200px;
    max-width: 240px;
    width: 220px;
    max-height: none;
    flex-shrink: 0;
    overflow-y: auto;
}
.mega-body .mega-content {
    flex: 1;
    width: auto;
    max-height: none;
    overflow-y: auto;
}

/* ================================================================ */
/* BARRA DE BÚSQUEDA EN MEGA-MENÚ                                    */
/* Redondita, compacta, se expande al hacer hover/focus              */
/* ================================================================ */
.mega-ms-header {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 20px;
    background: rgba(0,0,0,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: 60px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}
.mega-ms-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 50px;
    padding: 7px 16px;
    /* Compact by default, expands on hover/focus — like the site's search bar */
    width: 220px;
    transition: width 0.35s cubic-bezier(0.4,0,0.2,1), background 0.2s;
    overflow: hidden;
    flex-shrink: 0;
}
.mega-ms-search:hover,
.mega-ms-search:focus-within {
    width: 420px;
    background: rgba(255,255,255,0.13);
}
.mega-ms-search i {
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    flex-shrink: 0;
}
.mega-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.87rem;
    font-family: inherit;
    min-width: 0;
}
.mega-search-input::placeholder { color: rgba(255,255,255,0.5); }
.mega-ms-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}
.mega-ms-search:focus-within .mega-ms-clear { opacity: 1; }
.mega-ms-clear:hover { color: #fff; }

/* Preview panel — a la derecha de la barra de búsqueda */
.mega-ms-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    padding-left: 20px;
}
.msp-compat {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.msp-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
    margin-right: 4px;
}
.msp-code {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.76rem;
    font-family: monospace;
    color: #ddd;
}
.msp-model { font-size: 0.82rem; color: #ccc; }
.msp-img-wrap {
    width: 80px;
    height: 56px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
}
.msp-img {
    width: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: top center;
}
.mega-model-link.mhp-active {
    background: rgba(0,0,0,0.05); /* fixed red flash */
    border-radius: 4px;
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* ================================================================ */
/* SKELETON: Fondo gris neutro (no azul)                             */
/* ================================================================ */
.skeleton-card {
    background: #242428 !important;  /* neutral dark gray, no blue */
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
    position: relative;
    overflow: hidden;
}
.skeleton-img,
.skeleton-title,
.skeleton-price,
.skeleton-btn {
    background: rgba(255,255,255,0.06) !important;
}
.skeleton-card::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent) !important;
}

/* ================================================================ */
/* MOBILE: ocultar preview, search compacto                          */
/* ================================================================ */
@media (max-width: 992px) {
    /* removed bad rule */
    .mega-ms-search { width: 100%; }
    .mega-ms-search:hover,
    .mega-ms-search:focus-within { width: 100%; }
    .mega-body { max-height: none; flex-direction: column !important; }
}

/* ================================================================ */
/* SKELETON FIX: placeholder cuadro menos brillante                  */
/* ================================================================ */
.skeleton-img {
    background: rgba(255,255,255,0.08) !important;
}
.skeleton-title,
.skeleton-price,
.skeleton-btn {
    background: rgba(255,255,255,0.07) !important;
}
/* Shimmer más sutil */
.skeleton-card::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.05) 50%,
        transparent 100%) !important;
}

/* ================================================================ */
/* BARRA DE BÚSQUEDA: pastilla compacta, no full-width               */
/* ================================================================ */

/* El header tiene flex-row: search a la izq, preview a la der */
.mega-ms-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 10px 24px !important;
    gap: 16px !important;
}

/* La búsqueda NO crece — tamaño fijo que expande en hover */
.mega-ms-search {
    flex: 0 0 auto !important;  /* no crece, no encoge */
    width: 240px !important;
    max-width: 240px;
    min-width: 0;
    border-radius: 50px !important;
    border: 1.5px solid rgba(255,255,255,0.2) !important;
    background: rgba(255,255,255,0.08) !important;
    padding: 8px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: width 0.35s cubic-bezier(0.4,0,0.2,1),
                background 0.2s, border-color 0.2s !important;
    overflow: hidden;
}
.mega-ms-search:hover,
.mega-ms-search:focus-within {
    width: 440px !important;
    max-width: 440px !important;
    background: rgba(255,255,255,0.13) !important;
    border-color: rgba(255,255,255,0.35) !important;
}
.mega-ms-search i {
    color: rgba(255,255,255,0.65) !important;
    font-size: 0.9rem !important;
    flex-shrink: 0 !important;
}
.mega-search-input {
    flex: 1 !important;
    background: none !important;
    border: none !important;
    outline: none !important;
    color: #fff !important;
    font-size: 0.87rem !important;
    font-family: inherit !important;
    min-width: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mega-search-input::placeholder {
    color: rgba(255,255,255,0.45) !important;
}
.mega-ms-clear {
    background: none !important;
    border: none !important;
    color: rgba(255,255,255,0.4) !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    cursor: pointer;
    padding: 0 !important;
    flex-shrink: 0 !important;
    opacity: 0;
    transition: opacity 0.2s;
}
.mega-ms-search:focus-within .mega-ms-clear { opacity: 1; }
.mega-ms-clear:hover { color: #fff !important; }

/* El preview (foto + compat) ocupa el resto a la derecha */
.mega-ms-preview {
    flex: 1 !important;  /* crece y ocupa el resto del espacio */
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 16px !important;
    min-width: 0;
    overflow: hidden;
}

/* ================================================================ */
/* MOBILE                                                             */
/* ================================================================ */
@media (max-width: 992px) {
    .mega-ms-search,
    .mega-ms-search:hover,
    .mega-ms-search:focus-within {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* removed bad rule */
}

/* ================================================================ */
/* BARRA DE BÚSQUEDA: texto oscuro (fondo blanco del mega-menú)     */
/* ================================================================ */
.mega-ms-header {
    background: #f5f5f7 !important;     /* gris muy claro, como Apple */
    border-bottom: 1px solid #e0e0e0 !important;
    padding: 10px 24px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
}
.mega-ms-search {
    background: #ffffff !important;
    border: 1.5px solid #d0d0d0 !important;
    border-radius: 50px !important;
    padding: 8px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    width: 240px !important;
    max-width: 240px !important;
    transition: width 0.35s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.2s, border-color 0.2s !important;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.mega-ms-search:hover,
.mega-ms-search:focus-within {
    width: 420px !important;
    max-width: 420px !important;
    border-color: var(--primary-color, #d32f2f) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}
.mega-ms-search i {
    color: #555 !important;
    font-size: 0.88rem !important;
    flex-shrink: 0 !important;
}
.mega-search-input {
    color: #222 !important;
    font-size: 0.87rem !important;
    font-family: inherit !important;
    background: none !important;
    border: none !important;
    outline: none !important;
    flex: 1 !important;
    min-width: 0 !important;
}
.mega-search-input::placeholder {
    color: #999 !important;
}
.mega-ms-clear {
    color: #999 !important;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    background: none !important;
    border: none !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}
.mega-ms-search:focus-within .mega-ms-clear { opacity: 1; }
.mega-ms-clear:hover { color: #333 !important; }

/* Preview panel — fondo claro */
.mega-ms-preview {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 16px !important;
    min-width: 0;
    overflow: hidden;
}
.msp-label {
    color: #666 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    margin-right: 4px !important;
}
.msp-code {
    background: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
    border-radius: 5px !important;
    padding: 2px 8px !important;
    font-size: 0.76rem !important;
    font-family: monospace !important;
}
.msp-model { color: #555 !important; font-size: 0.82rem !important; }
.msp-img-wrap { background: #fff !important; border-radius: 8px !important; width: 160px !important; height: 60px !important; min-height: 0 !important; overflow: hidden !important; flex-shrink: 0 !important; }

/* ================================================================ */
/* SKELETON: fondo gris claro tipo card real                         */
/* ================================================================ */
.skeleton-card {
    background: #f0f0f2 !important;
    border: 1px solid #e8e8ec !important;
    border-radius: 12px !important;
    position: relative !important;
    overflow: hidden !important;
}
.skeleton-img {
    background: #e0e0e5 !important;
    border-radius: 8px !important;
}
.skeleton-title,
.skeleton-price,
.skeleton-btn {
    background: #e0e0e5 !important;
}
.skeleton-card::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.7) 50%,
        transparent 100%
    ) !important;
}

@media (max-width: 992px) {
    .mega-ms-search,
    .mega-ms-search:hover,
    .mega-ms-search:focus-within {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* removed bad rule */
}

/* ================================================================ */
/* MEGA-MENÚ: Abrir solo con CLICK, no con hover                    */
/* ================================================================ */

/* Anular el hover para mega-menus (mantenemos hover para dropdowns normales) */
.has-dropdown:hover > .mega-menu.tabbed-mega-menu,
.has-dropdown:hover > .tabbed-mega-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Solo se abre con la clase .open (puesta por JS al hacer click) */
.has-dropdown.open > .mega-menu,
.has-dropdown.open > .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* La flecha/indicador de dropdown en la categoría del nav */
.has-dropdown > a::after {
    content: ' ▾';
    font-size: 0.7em;
    opacity: 0.7;
    transition: transform 0.2s;
    display: inline-block;
}
.has-dropdown.open > a::after {
    transform: rotate(180deg);
}

/* ================================================================ */
/* FIX: .open gana siempre al hover (selector más específico)       */
/* ================================================================ */

/* Cuando está ABIERTO, mostrar siempre aunque el ratón esté encima */
.has-dropdown.open > .mega-menu.tabbed-mega-menu,
.has-dropdown.open:hover > .mega-menu.tabbed-mega-menu,
.has-dropdown.open > .tabbed-mega-menu,
.has-dropdown.open:hover > .tabbed-mega-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Quitar las flechas ▾ de las categorías */
.has-dropdown > a::after {
    content: none !important;
    display: none !important;
}

/* ================================================================ */
/* DEVICE IMAGE in mega-menu header — MobileSentrix style            */
/* ================================================================ */

.mega-ms-preview {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
    max-width: 320px;
}
.msp-compat {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 5px !important;
    min-width: 0;
}
.msp-label {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: #555 !important;
    white-space: nowrap !important;
    flex-basis: 100%;
}
.msp-code {
    display: inline-block !important;
    background: #fff !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 5px !important;
    padding: 2px 7px !important;
    font-size: 0.76rem !important;
    font-family: 'SF Mono', 'Consolas', monospace !important;
    color: #1a1a1a !important;
    font-weight: 500 !important;
}
.msp-model {
    color: #666 !important;
    font-style: italic !important;
    font-size: 0.82rem !important;
}
.msp-imgs {
    display: flex;
    align-items: flex-start;
    height: 56px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 8px;
}

@media (max-width: 992px) {
    /* removed bad rule */
}

/* ================================================================ */
/* FIX: compat codes en línea, máximo 2 filas                       */
/* ================================================================ */
.msp-compat {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    max-height: 52px !important;
    overflow: hidden !important;
    max-width: 260px !important;
    min-width: 0 !important;
}
.msp-label {
    flex-basis: auto !important;
    width: auto !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #555 !important;
    white-space: nowrap !important;
    margin-right: 4px !important;
}
.msp-code {
    display: inline-block !important;
    background: #fff !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 5px !important;
    padding: 2px 7px !important;
    font-size: 0.74rem !important;
    font-family: 'SF Mono', 'Consolas', monospace !important;
    color: #1a1a1a !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* ================================================================ */
/* MEGA-MENU PREVIEW — ancho fijo, sin saltos de layout             */
/* ================================================================ */

/* Contenedor preview: ancho fijo siempre */
.mega-ms-preview {
    flex: 0 0 310px !important;
    width: 450px !important;
    min-width: 450px !important;
    display: flex !important; align-items: center !important; gap: 10px !important; max-width: 450px !important; margin-left: auto !important; justify-content: flex-end !important; 
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-left: 16px !important;
    overflow: hidden !important;
}

/* Zona de códigos: altura fija (2 filas reservadas) */
.msp-compat {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px 5px !important;
    min-height: 48px !important;
    max-height: 52px !important;
    overflow: hidden !important;
    align-content: center !important;
}
.msp-label {
    flex-basis: auto !important;
    width: auto !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #888 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.msp-code {
    display: inline-block !important;
    background: #fff !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 5px !important;
    padding: 2px 7px !important;
    font-size: 0.73rem !important;
    font-family: 'SF Mono', 'Consolas', monospace !important;
    color: #1a1a1a !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1.4 !important;
}
.msp-model {
    color: #999 !important;
    font-style: italic !important;
    font-size: 0.8rem !important;
}

/* Zona imagen: ancho fijo siempre, aunque esté vacía */
.msp-imgs {
    flex: 0 0 90px !important;
    width: 90px !important;
    min-width: 90px !important;
    height: 56px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: flex-start !important;
    background: transparent !important;
}
.msp-img-back { height: 100% !important; min-height: 0 !important; width: 100% !important; object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    visibility: visible !important;   /* hidden por defecto, no display:none, para mantener el espacio */
    opacity: 1 !important;
    transition: opacity 0.2s ease !important;
}
.msp-img-back.loaded {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ================================================================ */
/* HEADER 3 ZONAS: [search] [compat fijo] [imagen derecha]          */
/* ================================================================ */

.mega-ms-header {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 10px 18px !important;
    border-bottom: 1px solid #e8e8e8 !important;
    background: #f9f9fb !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ZONA 1: Barra de búsqueda — ancho fijo */
.mega-ms-search {
    flex: 0 0 auto !important;
    margin-right: 24px !important;
}

/* ZONA 2: Compatibility — ocupa el espacio central restante, posición fija */
.msp-compat {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px 5px !important;
    min-height: 44px !important;
    max-height: 52px !important;
    overflow: hidden !important;
    align-content: center !important;
}

/* ZONA 3: Imagen — siempre al extremo derecho, ancho fijo */
.msp-imgs {
    flex: 0 0 90px !important;
    width: 90px !important;
    min-width: 90px !important;
    height: 56px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: flex-start !important;
    margin-left: 16px !important;
}

/* La imagen en sí */
.msp-img-back { height: 100% !important; min-height: 0 !important; width: 100% !important; object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 0.25s ease !important;
}
.msp-img-back.loaded {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Labels y badges */
.msp-label {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #888 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-right: 5px !important;
    line-height: 1.6 !important;
}
.msp-code {
    display: inline-block !important;
    background: #fff !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 5px !important;
    padding: 2px 7px !important;
    font-size: 0.73rem !important;
    font-family: 'SF Mono', 'Consolas', monospace !important;
    color: #1a1a1a !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1.4 !important;
}
.msp-model {
    color: #999 !important;
    font-style: italic !important;
    font-size: 0.8rem !important;
}

/* Eliminar .mega-ms-preview que ya no se usa */
/* Removed */

@media (max-width: 992px) {
    /* removed to show preview on all desktop sizes */
}

/* Fix para el logo fallback en el mega menu */
.msp-img-back.is-logo {
    height: 100% !important; min-height: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 0.5 !important; /* un poco de transparencia para que no destaque tanto como un producto real */
}

.tab-btn .fa-thumbtack { transition: transform 0.2s ease; }
.tab-btn.tab-pinned .fa-thumbtack { transform: rotate(-45deg); color: #d32f2f; }




