/* ─── SAV Market — Store Styles v2.0 ───────────────────────────── */

/* ─── VARIABLES ─────────────────────────────────────────────────── */
:root {
    --store-primary: #1B4FDB;
    --store-primary-dark: #1440C4;
    --store-accent: #00C896;
    --store-orange: #FF6B35;
    --store-bg: #F0F4FF;
    --store-surface: #FFFFFF;
    --store-text: #0F172A;
    --store-text-muted: #64748B;
    --store-border: #E2E8F0;
    --store-card-radius: 16px;
    --store-shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --store-shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.04);
    --store-shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
}

/* ─── BASE ───────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--store-bg);
    color: var(--store-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--store-primary);
}

.container-fluid {
    max-width: 1440px;
    margin: 0 auto;
}

/* ─── NAVBAR ─────────────────────────────────────────────────────── */
.store-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: #ffffff;
    box-shadow: 0 1px 0 var(--store-border), var(--store-shadow-sm);
}

.store-navbar .navbar-brand {
    color: var(--store-primary) !important;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.store-navbar .nav-link {
    color: var(--store-text);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
    position: relative;
}

.store-navbar .nav-link:hover {
    color: var(--store-primary);
    background: rgba(27, 79, 219, 0.06);
}

.store-navbar .nav-link.active {
    color: var(--store-primary);
    font-weight: 600;
}

.store-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--store-primary);
    border-radius: 2px;
}

/* Mobile collapsed menu: give icon-only quick links a visible label + a proper ≥44px tappable row */
@media (max-width: 991.98px) {
    .store-navbar .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    /* Left-align icon+label rows so they match Inicio/Catálogo instead of the desktop-only centered layout */
    .store-navbar .quick-links-nav {
        align-items: stretch !important;
    }

    .store-navbar .quick-links-nav .nav-link {
        justify-content: flex-start;
    }

    /* Mobile nav menu redesign — rows, dividers, auth section */
    .store-navbar .navbar-nav .nav-link > i.mobile-nav-icon {
        margin-right: 12px !important;
    }

    .store-navbar .navbar-nav .nav-item {
        border-bottom: 1px solid var(--store-border);
    }

    .store-navbar .navbar-nav .nav-item:last-of-type {
        border-bottom: none;
    }

    .store-navbar .navbar-nav .nav-link:hover,
    .store-navbar .navbar-nav .nav-link:focus-visible {
        background: #F8FAFC;
    }

    .store-navbar .navbar-nav .nav-link:active {
        background: #EEF2FF;
    }

    /* Registrarse/Iniciar sesión section — separated from the row list above (anonymous only) */
    .store-navbar .auth-buttons-list {
        border-top: 1px solid var(--store-border);
        padding-top: 16px;
        padding-bottom: 8px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .store-navbar .auth-buttons-list .nav-item {
        border-bottom: none;
        width: 100%;
    }

    .store-navbar .auth-buttons-list .btn {
        width: 100%;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Persistent mobile search row (docs/wireframes/store-mobile-header-search-spec.md): 40px input +
       8px top/bottom padding = 56px row, no separate max-width cap like the desktop instance. */
    .mobile-search-row {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .mobile-search-row .navbar-search {
        max-width: none;
    }

    /* Top bar: center the brand/logo in the row (grid keeps the collapsed menu below unaffected,
       unlike absolute positioning which would re-center against the expanded menu's height). */
    .store-navbar > .container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        column-gap: 0.5rem;
    }

    .store-navbar .navbar-brand {
        grid-column: 2;
        justify-self: center;
        margin: 0;
    }

    .store-navbar .navbar-toggler {
        grid-column: 3;
        justify-self: end;
    }

    .store-navbar .navbar-collapse {
        grid-column: 1 / -1;
    }
}

/* Navbar inline search */
.navbar-search {
    max-width: 420px;
}

.navbar-search .form-control {
    border-radius: 50rem 0 0 50rem;
    border-right: none;
    background: var(--store-bg);
    border-color: var(--store-border);
    font-size: 0.875rem;
    padding-left: 1rem;
}

.navbar-search .form-control:focus {
    box-shadow: none;
    border-color: var(--store-primary);
    background: #fff;
}

.navbar-search .btn-search-nav {
    border-radius: 0 50rem 50rem 0;
    border-left: none;
    background: var(--store-primary);
    color: #fff;
    border: 1px solid var(--store-primary);
    font-size: 0.875rem;
    padding: 0.375rem 1rem;
}

.navbar-search .btn-search-nav:hover {
    background: var(--store-primary-dark);
    border-color: var(--store-primary-dark);
    color: #fff;
}

/* ─── CART BADGE ─────────────────────────────────────────────────── */
.cart-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 50rem;
}

/* ─── HERO CAROUSEL ──────────────────────────────────────────────── */
.hero-carousel {
    width: 100%;
    overflow: hidden;
}

.hero-carousel-slide {
    min-height: var(--hero-h, 480px);
    display: flex;
    align-items: center;
}

/* Imagen/video de fondo como elemento (no background-image) */
.hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-slide-content {
    position: relative;
    z-index: 2;
    min-height: var(--hero-h, 480px);
}

.hero-slide-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Diapositiva a tamaño natural: la imagen define la altura (banners con texto embebido) */
.hero-carousel-slide.hero-slide-natural {
    min-height: 0;
    display: block;
}

.hero-img-natural {
    display: block;
    width: 100%;
    height: auto;
}

.hero-slide-natural .hero-slide-content {
    position: absolute;
    inset: 0;
    min-height: 0;
}

/* Overlay for image and video backgrounds (color/intensidad configurables por diapositiva) */
.hero-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.30) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    box-shadow: var(--store-shadow-md);
}

.hero-carousel .carousel-control-prev {
    left: 12px;
}

.hero-carousel .carousel-control-next {
    right: 12px;
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(25%) sepia(77%) saturate(1200%) hue-rotate(206deg);
}

.hero-carousel .carousel-indicators {
    bottom: 14px;
    gap: 4px;
}

.hero-carousel .carousel-indicators button {
    width: 24px;
    height: 5px;
    border-radius: 50rem;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    transition: width 0.3s ease, background 0.3s ease;
}

.hero-carousel .carousel-indicators button.active {
    width: 40px;
    background: #ffffff;
}

@media (max-width: 576px) {
    .hero-carousel-slide,
    .hero-slide-content {
        min-height: min(var(--hero-h, 480px), 300px);
    }

    .hero-carousel-slide.hero-slide-natural,
    .hero-slide-natural .hero-slide-content {
        min-height: 0;
    }

    /* Reserve space so slide text never renders under the prev/next controls */
    .hero-carousel-slide .container {
        padding-left: 52px;
        padding-right: 52px;
    }

    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next {
        width: 32px;
        height: 32px;
    }

    .hero-carousel .carousel-control-prev-icon,
    .hero-carousel .carousel-control-next-icon {
        width: 12px;
        height: 12px;
    }

    .hero-carousel .carousel-control-prev {
        left: 6px;
    }

    .hero-carousel .carousel-control-next {
        right: 6px;
    }
}

/* ─── TRUST BAR ──────────────────────────────────────────────────── */
.trust-bar {
    border-bottom: 1px solid var(--store-border);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.trust-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(27, 79, 219, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--store-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.trust-item-text .title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--store-text);
    line-height: 1.3;
}

.trust-item-text .subtitle {
    font-size: 0.72rem;
    color: var(--store-text-muted);
    line-height: 1.3;
}

@media (min-width: 768px) {
    .trust-divider {
        border-right: 1px solid var(--store-border);
    }
}

/* ─── SECTION TITLES ─────────────────────────────────────────────── */
.section-title {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--store-text);
    line-height: 1.2;
    margin-bottom: 0;
}

.section-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(27, 79, 219, 0.1);
    color: var(--store-primary);
    padding: 3px 10px;
    border-radius: 50rem;
    margin-bottom: 6px;
}

@media (max-width: 576px) {
    /* Title (row 2) to "Ver todo(s)" button (row 3) gap once the header wraps */
    .section-header-row.flex-wrap {
        gap: 12px !important;
    }
}

/* ─── CATEGORY CARDS ─────────────────────────────────────────────── */
.category-card {
    border-radius: var(--store-card-radius) !important;
    border: none !important;
    padding: 1.25rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--store-shadow-md) !important;
}

.category-card .cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin: 0 auto 0.6rem;
}

.category-card .cat-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

/* Gradient cycling (6 hues) — selector targets .col wrapper, not .category-card directly */
.col:nth-child(6n+1) .category-card { background: linear-gradient(135deg, #1B4FDB, #3B6EE8); }
.col:nth-child(6n+2) .category-card { background: linear-gradient(135deg, #00C896, #00A87E); }
.col:nth-child(6n+3) .category-card { background: linear-gradient(135deg, #7C3AED, #9F67F5); }
.col:nth-child(6n+4) .category-card { background: linear-gradient(135deg, #FF6B35, #E85A24); }
.col:nth-child(6n+5) .category-card { background: linear-gradient(135deg, #EF4444, #DC2626); }
.col:nth-child(6n+6) .category-card { background: linear-gradient(135deg, #059669, #047857); }

/* Category skeleton */
.category-skeleton {
    border-radius: var(--store-card-radius);
    background: #E2E8F0;
    height: 110px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* ─── PRODUCT CARDS ──────────────────────────────────────────────── */
.product-card {
    border-radius: var(--store-card-radius) !important;
    border: 1px solid var(--store-border) !important;
    background: var(--store-surface);
    box-shadow: var(--store-shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: var(--store-shadow-lg);
    transform: translateY(-4px);
}

.product-card .product-img-wrap {
    height: 200px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-card .product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.product-card .product-img-wrap .product-img-icon {
    font-size: 3.5rem;
    color: #CBD5E1;
}

.product-badge-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.product-badge-stock.in-stock { background: #22C55E; }
.product-badge-stock.out-of-stock { background: #94A3B8; }

/* ── Wishlist button ────────────────────────────────────────────────── */
.btn-wishlist {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.92);
    color: #CBD5E1;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    transition: color 0.2s, transform 0.15s;
    z-index: 2;
}
.btn-wishlist:hover { color: #EF4444; transform: scale(1.15); }
.btn-wishlist.active { color: #EF4444; }
.btn-wishlist.active:hover { color: #B91C1C; }

.product-card .price-cop {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--store-primary);
}

.product-card .btn-add {
    border-radius: 50rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.15s ease, transform 0.1s ease;
}

.product-card .btn-add:active {
    transform: scale(0.95);
}

/* ─── FEATURED SCROLL ────────────────────────────────────────────── */
.products-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.products-scroll::-webkit-scrollbar {
    display: none;
}

.products-scroll .product-card {
    flex-shrink: 0;
    width: 260px;
    scroll-snap-align: start;
}

@media (max-width: 576px) {
    .products-scroll,
    .cat-scroll {
        scroll-padding-right: 96px;
    }

    .products-scroll .product-card {
        width: 220px;
    }
}

/* ─── MOBILE STATIC GRID (≤767.98px) — replaces horizontal-scroll carousel ─── */
@media (max-width: 767.98px) {
    .products-scroll {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        overflow-x: visible;
        scroll-snap-type: none;
        padding-bottom: 0;
    }

    .products-scroll .product-card,
    .products-scroll .featured-extra {
        width: 100%;
    }

    .products-scroll .featured-extra {
        display: none;
    }

    .products-scroll .scroll-end-spacer {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .products-scroll {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Trailing spacer so the last row item clears the bottom-left AI FAB when scrolled to the end */
.scroll-end-spacer {
    flex-shrink: 0;
    scroll-snap-align: start;
}

@media (max-width: 576px) {
    .scroll-end-spacer {
        width: 80px;
    }
}

/* Scroll arrow buttons */
.scroll-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--store-border);
    background: #fff;
    color: var(--store-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--store-shadow-sm);
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
    line-height: 1;
}

.scroll-arrow:hover {
    background: var(--store-primary);
    color: #fff;
    border-color: var(--store-primary);
    box-shadow: var(--store-shadow-md);
}

/* ─── PROMO BANNER ───────────────────────────────────────────────── */
.promo-banner {
    background: linear-gradient(135deg, #00C896 0%, #00966F 100%);
    position: relative;
    overflow: hidden;
}

.promo-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

/* ─── CART ───────────────────────────────────────────────────────── */
.cart-qty-input {
    width: 70px;
    text-align: center;
}

.cart-summary-card {
    border-radius: var(--store-card-radius) !important;
    border: 2px solid transparent !important;
    background-image: linear-gradient(#fff, #fff),
        linear-gradient(135deg, var(--store-primary), var(--store-accent));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: var(--store-shadow-md);
}

@media (min-width: 992px) {
    .cart-summary-card {
        position: sticky;
        top: 90px;
    }
}

.cart-item-row:hover {
    background: rgba(27, 79, 219, 0.03);
}

/* ─── CATALOG SEARCH BAR ─────────────────────────────────────────── */
.search-bar-group {
    border-radius: 50rem;
    overflow: hidden;
    box-shadow: var(--store-shadow-sm);
}

.search-bar-group .input-group-text {
    background: #fff;
    border-right: none;
    padding-left: 1rem;
}

.search-bar-group .form-control {
    border-left: none;
    border-right: none;
    border-radius: 0;
}

.search-bar-group .form-control:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

.search-bar-group .btn-search {
    border-radius: 0 50rem 50rem 0;
    font-weight: 600;
    background: var(--store-primary);
    border-color: var(--store-primary);
    color: #fff;
    padding: 0 1.5rem;
}

.search-bar-group .btn-search:hover {
    background: var(--store-primary-dark);
    border-color: var(--store-primary-dark);
    color: #fff;
}

/* ─── PAGINATION ─────────────────────────────────────────────────── */
.page-link {
    color: var(--store-primary);
    border-color: var(--store-border);
    border-radius: 8px !important;
    margin: 0 2px;
    font-weight: 500;
}

.page-link:hover {
    color: var(--store-primary-dark);
    background: rgba(27, 79, 219, 0.08);
    border-color: var(--store-primary);
}

.page-item.active .page-link {
    background-color: var(--store-primary);
    border-color: var(--store-primary);
    color: #fff;
}

.pagination-mobile-caption {
    font-size: 0.8125rem;
    color: var(--store-text-muted);
    margin-top: 8px;
    text-align: center;
}

@media (max-width: 576px) {
    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.625rem 0.875rem;
    }
}

/* ─── EMPTY STATE ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--store-text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    color: var(--store-border);
    margin-bottom: 1rem;
    display: block;
}

/* ─── CATEGORY SIDEBAR FILTER ────────────────────────────────────── */
.category-filter-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    padding: 6px 10px 6px 12px;
    border-radius: 8px;
    color: var(--store-text);
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-filter-link:hover {
    background: rgba(27, 79, 219, 0.06);
    color: var(--store-primary);
}

.category-filter-link.active {
    background: rgba(27, 79, 219, 0.07);
    color: var(--store-primary);
    font-weight: 600;
    border-left-color: var(--store-primary);
}

/* ─── FOOTER ─────────────────────────────────────────────────────── */
.store-footer {
    background-color: #0F172A;
    color: rgba(255, 255, 255, 0.6);
}

.store-footer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.store-footer a:hover {
    color: #ffffff;
}

.store-footer .footer-heading {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.875rem;
}

.store-footer .footer-brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.store-footer .brand-tagline {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
    margin-bottom: 0;
}

.store-footer .footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

.store-footer .footer-bottom {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

.store-footer .footer-bottom a {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
}

.store-footer .footer-bottom a:hover {
    color: rgba(255, 255, 255, 0.65);
}

.footer-contact-icon {
    color: rgba(255, 255, 255, 0.35);
}

/* ─── MISC UTILITIES ─────────────────────────────────────────────── */
.price-cop {
    font-weight: 700;
    color: var(--store-primary);
    font-size: 1.15rem;
}

.text-store-primary {
    color: var(--store-primary) !important;
}

.btn-store-primary {
    background: var(--store-primary);
    border-color: var(--store-primary);
    color: #fff;
    font-weight: 600;
    border-radius: 50rem;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-store-primary:hover {
    background: var(--store-primary-dark);
    border-color: var(--store-primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-store-outline {
    border: 2px solid var(--store-primary);
    color: var(--store-primary);
    background: transparent;
    font-weight: 600;
    border-radius: 50rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-store-outline:hover {
    background: var(--store-primary);
    color: #fff;
}

.rounded-store {
    border-radius: var(--store-card-radius);
}

.product-img-placeholder {
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

/* Hide scrollbar utility */
.hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}


/* =====================
   NAVBAR
===================== */
.store-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.store-navbar .navbar-brand {
    color: var(--store-primary) !important;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.store-navbar .nav-link {
    color: #374151;
    font-weight: 500;
    transition: color 0.15s ease;
}

.store-navbar .nav-link:hover {
    color: var(--store-primary);
}

/* =====================
   PRODUCT CARD
===================== */
.product-card {
    border-radius: var(--store-card-radius);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    background-color: #ffffff;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.product-card .badge-ai {
    background-color: #F9A825;
    color: #212121;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: 50rem;
}

/* =====================
   PRICE COP
===================== */
.price-cop {
    font-weight: 700;
    color: var(--store-primary);
    font-size: 1.15rem;
}

/* =====================
   HERO SECTION
===================== */
.hero-section {
    background: linear-gradient(135deg, var(--store-primary) 0%, var(--store-accent) 100%);
    min-height: 340px;
    display: flex;
    align-items: center;
}

/* =====================
   FEATURE FLAG BADGE
===================== */
.feature-flag-badge {
    background-color: #FFF8E1;
    color: #E65100;
    border: 1px solid #FFB300;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2em 0.55em;
    border-radius: 4px;
}

/* =====================
   CATEGORY CARD
===================== */
.category-card {
    border-radius: var(--store-card-radius);
    border: 1px solid rgba(0, 0, 0, 0.07) !important;
    background-color: var(--store-bg);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.12);
    border-color: var(--store-primary) !important;
}

/* =====================
   SECTION TITLES
===================== */
.section-title {
    font-weight: 700;
    color: #1a1a2e;
    border-left: 4px solid var(--store-primary);
    padding-left: 0.75rem;
}

/* =====================
   CART BADGE
===================== */
.cart-badge {
    position: relative;
    top: -8px;
    right: 4px;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 4px;
}

/* =====================
   EMPTY STATE
===================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

/* =====================
   FOOTER
===================== */
.store-footer {
    background-color: #212529;
    color: rgba(255, 255, 255, 0.75);
}

.store-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.15s ease;
}

.store-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 576px) {
    .hero-section {
        min-height: 220px;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-section .lead {
        font-size: 0.95rem;
    }
}


/* === Catalog === */
.product-card { transition: transform .15s ease, box-shadow .15s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.product-img-placeholder { background: #f4f6f8; display: flex; align-items: center; justify-content: center; height: 180px; }

/* === Cart === */
.cart-qty-input { width: 70px; }

/* === Pagination === */
.page-link { color: var(--store-primary); }
.page-item.active .page-link { background-color: var(--store-primary); border-color: var(--store-primary); color: #fff; }

/* ─── MEGA MENU ───────────────────────────────────────────────────── */

/* El panel se posiciona relativo al <nav> (position:sticky) */
.mega-menu-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #ffffff;
    border-top: 1px solid var(--store-border);
    box-shadow: 0 12px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    pointer-events: none;
}

.mega-menu-panel.is-open,
.mega-menu-trigger.is-open .mega-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Puente invisible que cubre el gap entre el <li> y el panel */
.mega-menu-trigger::after {
    content: '';
    position: fixed;
    top: 56px;         /* justo encima del panel */
    left: 0;
    right: 0;
    height: 16px;      /* cubre el hueco entre nav-link y panel */
    z-index: 1039;
    display: none;
}

.mega-menu-trigger.is-open::after {
    display: block;
}

/* Solo activar hover en desktop */
@media (max-width: 991.98px) {
    .mega-menu-trigger:hover:not(.is-open) .mega-menu-panel {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    .mega-menu-panel.is-open {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border-top: none;
        border-bottom: 1px solid var(--store-border);
    }
}

.mega-chevron {
    font-size: 0.7rem;
    transition: transform .2s ease;
}

.mega-menu-trigger.is-open .mega-chevron {
    transform: rotate(180deg);
}

.mega-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--store-text-muted);
}

/* Tarjeta de categoría horizontal */
.mega-cat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--cat-bg, #F8FAFC);
    border: 1px solid transparent;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    cursor: pointer;
}

.mega-cat-card:hover {
    border-color: var(--store-border);
    box-shadow: var(--store-shadow-sm);
    transform: translateY(-2px);
}

.mega-cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
}

.mega-cat-info {
    flex: 1;
    min-width: 0;
}

.mega-cat-name {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--store-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 576px) {
    .mega-cat-name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
}

.mega-cat-count {
    font-size: .72rem;
    color: var(--store-text-muted);
    line-height: 1.3;
}

.mega-cat-arrow {
    font-size: .65rem;
    color: var(--store-text-muted);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s ease;
}

.mega-cat-card:hover .mega-cat-arrow {
    opacity: 1;
}

/* Panel derecho CTA */
.mega-cta-panel {
    background: linear-gradient(145deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1px solid rgba(27,79,219,.12);
}

/* ─── CATEGORY CHIP SCROLL ─────────────────────────────────────────── */
.cat-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 6px 2px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }

/* Cada chip: contenedor vertical fijo */
.cat-chip {
    flex-shrink: 0;
    width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    scroll-snap-align: start;
    cursor: pointer;
}

.cat-chip-inner {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

.cat-chip:hover .cat-chip-inner {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,.2);
}

.cat-chip-icon {
    font-size: 1.6rem;
    color: #fff;
}

.cat-chip-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--store-text);
    text-align: center;
    line-height: 1.3;
    max-width: 96px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

/* ─── MOBILE STATIC GRID (≤767.98px) — replaces horizontal-scroll carousel ─── */
@media (max-width: 767.98px) {
    .cat-scroll {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px 12px;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    .cat-scroll .scroll-end-spacer {
        display: none;
    }

    .cat-chip {
        width: 100%;
        min-width: 0;
    }

    .cat-chip-name {
        max-width: 100%;
        overflow: hidden;
    }
}

/* Skeleton placeholder */
.cat-chip-skeleton {
    flex-shrink: 0;
    width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cat-chip-skeleton::before {
    content: '';
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: #E2E8F0;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    display: block;
}

.cat-chip-skeleton::after {
    content: '';
    width: 60px;
    height: 10px;
    border-radius: 4px;
    background: #E2E8F0;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    display: block;
}

/* ─── SEARCH AUTOCOMPLETE DROPDOWN ───────────────────────────────── */
.navbar-search { position: relative; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
    z-index: 2000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    border: 1px solid var(--store-border);
}

.search-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cada resultado */
.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none !important;
    color: var(--store-text);
    transition: background .1s ease;
    border-bottom: 1px solid var(--store-border);
}

.search-result-item:last-of-type { border-bottom: none; }

.search-result-item:hover,
.search-result-item.kbd-active {
    background: var(--store-bg);
    color: var(--store-text);
}

.search-result-item .sri-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
    color: #CBD5E1;
    overflow: hidden;
}

.search-result-item .sri-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.search-result-item .sri-info { flex: 1; min-width: 0; }

.search-result-item .sri-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--store-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .sri-name mark {
    background: #FEF08A;
    color: var(--store-text);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}

.search-result-item .sri-meta {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.search-result-item .sri-sku {
    font-size: .7rem;
    color: var(--store-text-muted);
    background: #F1F5F9;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.search-result-item .sri-cat {
    font-size: .7rem;
    color: var(--store-text-muted);
}

.search-result-item .sri-right {
    text-align: right;
    flex-shrink: 0;
}

.search-result-item .sri-price {
    font-size: .9rem;
    font-weight: 700;
    color: var(--store-primary);
    line-height: 1.2;
}

.search-result-item .sri-stock {
    font-size: .68rem;
    font-weight: 600;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.search-result-item .sri-stock::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.search-result-item .sri-stock.in-stock { color: #16A34A; }
.search-result-item .sri-stock.in-stock::before { background: #16A34A; }
.search-result-item .sri-stock.out-stock { color: #94A3B8; }
.search-result-item .sri-stock.out-stock::before { background: #94A3B8; }

/* Footer "Ver todos" */
.search-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--store-bg);
    color: var(--store-primary);
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid var(--store-border);
    transition: background .12s ease;
}

.search-dropdown-footer:hover {
    background: #E8EDFB;
    color: var(--store-primary);
}

/* Loading / empty states */
.search-dropdown-loading,
.search-dropdown-empty {
    padding: 20px 16px;
    text-align: center;
    font-size: .875rem;
    color: var(--store-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Explicit overlay close button (mobile only) — hidden on desktop, JS sets its `top` inline */
.search-dropdown-close {
    display: none;
}

/* Mobile: full-viewport overlay instead of a small floating panel (spec §4) */
@media (max-width: 991.98px) {
    .search-dropdown {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        box-shadow: none;
        max-height: none;
        border: none;
        border-top: 1px solid var(--store-border);
    }

    /* Absolute (not fixed) relative to the already-fixed .search-dropdown: the dropdown's own
       `transform` (open/close animation) creates a containing block for fixed descendants, so a
       `position: fixed` child here would anchor to the dropdown box, not the viewport. Absolute
       positioning avoids that pitfall and still stays put while .search-dropdown-content scrolls underneath. */
    .search-dropdown-close {
        display: flex;
        position: absolute;
        top: 8px;
        right: 12px;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--store-text-muted);
        font-size: 1.25rem;
        z-index: 2001;
    }
}

/* ─── AUTH PAGES (Login / Register) ─────────────────────────────── */
.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: stretch;
}

.auth-split {
    display: flex;
    width: 100%;
    flex: 1;
}

/* Panel izquierdo — branding */
.auth-brand-panel {
    flex: 1;
    background: linear-gradient(145deg, var(--store-primary) 0%, color-mix(in srgb, var(--store-primary) 65%, #000) 100%);
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.auth-brand-content { position: relative; z-index: 1; max-width: 420px; }

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.4px;
}

.auth-brand-logo i { font-size: 1.8rem; }

.auth-brand-logo-img {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

.auth-brand-logo-img img {
    max-height: 56px;
    max-width: 220px;
    object-fit: contain;
}

.auth-brand-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: .75rem;
}

.auth-brand-sub {
    color: rgba(255,255,255,.72);
    font-size: .9375rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.auth-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.85);
    font-size: .9rem;
    font-weight: 500;
}

.auth-brand-features li i {
    color: var(--store-accent);
    font-size: 1rem;
    flex-shrink: 0;
}

/* Panel derecho — formulario */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--store-bg);
    padding: 2rem 1.5rem;
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--store-shadow-lg);
    padding: 2.5rem 2rem;
}

.auth-form-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    font-size: .8125rem;
    color: var(--store-text-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color .15s ease;
}
.auth-back-link:hover { color: var(--store-primary); }

.auth-form-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--store-primary), var(--store-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 6px 20px rgba(27,79,219,.3);
}

.auth-form-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--store-text);
    margin-bottom: .25rem;
}

.auth-form-sub {
    font-size: .875rem;
    color: var(--store-text-muted);
    margin-bottom: 0;
}

/* Campos */
.auth-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--store-text);
    margin-bottom: .4rem;
    display: block;
}

.auth-input {
    border-radius: 12px;
    border: 1.5px solid var(--store-border);
    padding: .625rem .875rem;
    font-size: .9rem;
    transition: border-color .15s ease, box-shadow .15s ease;
    background: #FAFBFF;
}

.auth-input:focus {
    border-color: var(--store-primary);
    box-shadow: 0 0 0 3px rgba(27,79,219,.12);
    background: #fff;
    outline: none;
}

.auth-input.is-invalid { border-color: #EF4444; }

.auth-error {
    font-size: .75rem;
    color: #EF4444;
    margin-top: .25rem;
    display: block;
}

/* Contraseña con ojo */
.auth-password-wrap { position: relative; }
.auth-password-wrap .auth-input { padding-right: 2.75rem; }

.auth-eye-btn {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: var(--store-text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: color .15s ease;
}
.auth-eye-btn:hover { color: var(--store-primary); }

/* Recordarme */
.auth-remember-label {
    font-size: .8125rem;
    color: var(--store-text-muted);
}

/* Olvidé contraseña */
.auth-forgot-link {
    font-size: .75rem;
    color: var(--store-primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-forgot-link:hover { text-decoration: underline; }

/* Botones */
.auth-submit-btn {
    background: var(--store-primary);
    border: none;
    color: #fff;
    border-radius: 12px;
    padding: .75rem 1rem;
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: -.1px;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
    box-shadow: 0 4px 14px rgba(27,79,219,.3);
}
.auth-submit-btn:hover {
    background: var(--store-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(27,79,219,.4);
}
.auth-submit-btn:active { transform: scale(.98); }

.auth-register-btn {
    background: transparent;
    border: 1.5px solid var(--store-border);
    color: var(--store-text);
    border-radius: 12px;
    padding: .625rem 1rem;
    font-size: .875rem;
    font-weight: 600;
    transition: border-color .15s ease, background .15s ease;
}
.auth-register-btn:hover {
    border-color: var(--store-primary);
    color: var(--store-primary);
    background: rgba(27,79,219,.04);
}

/* Divisor */
.auth-divider {
    text-align: center;
    margin: 1.25rem 0;
    position: relative;
    color: var(--store-text-muted);
    font-size: .75rem;
}
.auth-divider::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: var(--store-border);
}
.auth-divider span {
    background: #fff;
    padding: 0 .75rem;
    position: relative;
}

.auth-terms {
    font-size: .72rem;
    color: var(--store-text-muted);
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0;
}
.auth-terms a { color: var(--store-primary); text-decoration: none; }
.auth-terms a:hover { text-decoration: underline; }

/* ─── CART REDESIGN ──────────────────────────────────────────────── */

/* Empty state */
.cart-empty-state {
    text-align: center;
    padding: 4rem 1rem;
}
.cart-empty-icon {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--store-bg);
    border: 2px solid var(--store-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: #CBD5E1;
    margin: 0 auto 1.5rem;
}

/* Items list */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item-card {
    background: #fff;
    border-radius: var(--store-card-radius);
    box-shadow: var(--store-shadow-sm);
    border: 1px solid var(--store-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    transition: box-shadow .15s ease;
}
.cart-item-card:hover {
    box-shadow: var(--store-shadow-md);
}

/* Thumb */
.cart-item-thumb {
    width: 72px; height: 72px;
    border-radius: 12px;
    background: #F1F5F9;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; color: #CBD5E1;
    overflow: hidden;
}
.cart-item-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}

/* Info */
.cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.cart-item-name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--store-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-item-name:hover { color: var(--store-primary); }
.cart-item-sku {
    font-size: .72rem;
    background: #F1F5F9;
    color: var(--store-text-muted);
    padding: 1px 7px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    font-weight: 500;
}

/* ─── ORDER TRACKING ────────────────────────────────────────────── */
.tracking-timeline {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem 0;
    overflow-x: auto;
}
.tracking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    flex: 1;
    text-align: center;
}
.step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E2E8F0;
    color: #94A3B8;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
    transition: background .3s ease, color .3s ease;
    border: 3px solid #E2E8F0;
}
.tracking-step.completed .step-circle {
    background: var(--store-primary);
    color: #fff;
    border-color: var(--store-primary);
}
.tracking-step.current .step-circle {
    background: var(--store-primary);
    color: #fff;
    border-color: var(--store-primary);
    box-shadow: 0 0 0 4px rgba(27,79,219,.2);
}
.tracking-connector {
    flex: 1;
    height: 3px;
    background: #E2E8F0;
    margin-top: 22px;
    transition: background .3s ease;
}
.tracking-connector.filled { background: var(--store-primary); }
.step-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--store-text-muted);
    margin-top: .5rem;
    line-height: 1.3;
}
.tracking-step.completed .step-label,
.tracking-step.current .step-label { color: var(--store-primary); }
.step-desc {
    font-size: .7rem;
    color: var(--store-text-muted);
    margin-top: .2rem;
    max-width: 100px;
}

/* Vertical timeline (mobile) */
.tracking-timeline-vertical { padding: 1rem 0; }
.tracking-step-v {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 0;
}
.step-circle-v {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E2E8F0;
    color: #94A3B8;
    font-size: 1.1rem;
    border: 3px solid #E2E8F0;
}
.tracking-step-v.completed .step-circle-v {
    background: var(--store-primary);
    color: #fff;
    border-color: var(--store-primary);
}
.tracking-step-v.current .step-circle-v {
    background: var(--store-primary);
    color: #fff;
    border-color: var(--store-primary);
    box-shadow: 0 0 0 4px rgba(27,79,219,.2);
}
.step-connector-v {
    width: 3px;
    background: #E2E8F0;
    flex-grow: 1;
    margin: 0 18.5px;
    min-height: 28px;
}
.step-connector-v.filled { background: var(--store-primary); }

/* Live indicator dot */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
    animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(.8); }
}
.cart-item-unit-price {
    font-size: .8125rem;
    color: var(--store-text-muted);
    margin-top: 2px;
}

/* Stepper */
.cart-item-stepper { flex-shrink: 0; }
.qty-stepper {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--store-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.qty-btn {
    width: 34px; height: 36px;
    background: none; border: none;
    font-size: 1.1rem; font-weight: 600;
    color: var(--store-text);
    cursor: pointer;
    transition: background .1s ease, color .1s ease;
    padding: 0; line-height: 1;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--store-bg); color: var(--store-primary); }
.qty-btn:active { background: rgba(27,79,219,.1); }
.qty-value {
    min-width: 34px;
    text-align: center;
    font-size: .9rem;
    font-weight: 700;
    color: var(--store-text);
    user-select: none;
    border-left: 1px solid var(--store-border);
    border-right: 1px solid var(--store-border);
    height: 36px; line-height: 36px;
    padding: 0 4px;
}

/* Total linea */
.cart-item-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--store-primary);
    flex-shrink: 0;
    min-width: 70px;
    text-align: right;
}

/* Remove */
.cart-remove-btn {
    width: 32px; height: 32px;
    border: none; border-radius: 8px;
    background: #FEF2F2;
    color: #EF4444;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: .875rem;
    transition: background .12s ease, color .12s ease;
    padding: 0;
    flex-shrink: 0;
}
.cart-remove-btn:hover { background: #EF4444; color: #fff; }

/* Ghost danger btn */
.btn-ghost-danger {
    background: none;
    border: 1px solid #EF4444;
    color: #EF4444;
    border-radius: 8px;
    font-size: .8125rem;
    font-weight: 600;
    padding: .3rem .75rem;
    transition: background .12s ease, color .12s ease;
}
.btn-ghost-danger:hover { background: #EF4444; color: #fff; }

/* Summary card */
.cart-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .875rem;
    color: var(--store-text-muted);
    padding: .375rem 0;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--store-text);
}
.cart-summary-total span:last-child {
    color: var(--store-primary);
}

.cart-checkout-btn {
    background: linear-gradient(135deg, var(--store-primary), #3B6EE8);
    border: none;
    color: #fff;
    border-radius: 12px;
    padding: .75rem;
    font-size: .9375rem;
    font-weight: 700;
}
.cart-checkout-btn:disabled {
    background: linear-gradient(135deg, var(--store-primary), #3B6EE8);
    color: #fff;
    opacity: .5;
}

/* Trust badges */
.cart-secure-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--store-border);
}
.cart-secure-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .775rem;
    color: var(--store-text-muted);
}
.cart-secure-item i { font-size: .9rem; flex-shrink: 0; }

@media (max-width: 575.98px) {
    .cart-item-card { flex-wrap: wrap; }
    .cart-item-thumb { width: 56px; height: 56px; }
    .cart-item-total { min-width: auto; }
}

/* ─── ACCOUNT PAGES ─────────────────────────────────────────────── */
.account-sidebar {
    background: #fff;
    border-radius: var(--store-card-radius);
    box-shadow: var(--store-shadow-sm);
    border: 1px solid var(--store-border);
    overflow: hidden;
    position: sticky;
    top: 80px;
}
.account-avatar {
    background: linear-gradient(135deg, var(--store-primary), #3B6EE8);
    padding: 1.5rem;
    text-align: center;
}
.account-avatar i { font-size: 2.5rem; color: #fff; margin-bottom: .5rem; display: block; }
.account-email { font-size: .75rem; color: rgba(255,255,255,.8); word-break: break-all; }
.account-level-badge {
    display: inline-block; margin-top: .5rem;
    background: rgba(255,255,255,.2); color: #fff;
    font-size: .65rem; font-weight: 700; letter-spacing: .05em;
    padding: 2px 10px; border-radius: 50rem; text-transform: uppercase;
}
.account-nav { padding: .5rem; }
.account-nav-link {
    display: flex; align-items: center;
    padding: .6rem .875rem; border-radius: 10px;
    text-decoration: none; font-size: .875rem; font-weight: 500;
    color: var(--store-text); transition: background .12s ease, color .12s ease;
    margin-bottom: 2px;
}
.account-nav-link:hover { background: var(--store-bg); color: var(--store-primary); }
.account-nav-link.active { background: rgba(27,79,219,.08); color: var(--store-primary); font-weight: 600; }

/* Order cards */
.order-card {
    background: #fff; border: 1px solid var(--store-border);
    border-radius: var(--store-card-radius);
    box-shadow: var(--store-shadow-sm);
    margin-bottom: 12px; overflow: hidden;
    transition: box-shadow .15s ease;
}
.order-card:hover { box-shadow: var(--store-shadow-md); }
.order-card-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px;
    padding: .875rem 1.125rem;
    border-bottom: 1px solid var(--store-border);
    background: #FAFBFF;
}
.order-number { font-family: 'Courier New', monospace; font-weight: 700; font-size: .9rem; color: var(--store-primary); }
.order-card-body { padding: .875rem 1.125rem; }
.order-card-footer {
    padding: .75rem 1.125rem; border-top: 1px solid var(--store-border);
    display: flex; align-items: center; justify-content: space-between;
    background: #FAFBFF;
}
.order-total { font-size: 1rem; font-weight: 700; color: var(--store-primary); }
.order-item-line { font-size: .8125rem; color: var(--store-text-muted); padding: 2px 0; }

/* ─── PAYMENT METHOD CARDS ──────────────────────────────────────── */
.payment-method-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 1.25rem .75rem; border-radius: 14px; cursor: pointer;
    border: 1.5px solid var(--store-border); background: #fff;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
    text-align: center; user-select: none; width: 100%;
}
.payment-method-card:hover:not(.disabled) {
    border-color: var(--store-primary); background: rgba(27,79,219,.03);
    box-shadow: var(--store-shadow-sm);
}
.payment-method-card.selected,
.payment-method-card:has(.payment-radio:checked) {
    border-color: var(--store-primary); background: rgba(27,79,219,.06);
    box-shadow: 0 0 0 3px rgba(27,79,219,.12);
}
.payment-method-card.disabled { cursor: not-allowed; opacity:.7; }
.payment-radio { display: none; }
.pm-icon { font-size: 1.75rem; color: var(--store-primary); margin-bottom: .5rem; line-height: 1; }
.pm-label { font-size: .875rem; font-weight: 700; color: var(--store-text); margin-bottom: .25rem; }
.pm-desc { font-size: .72rem; color: var(--store-text-muted); }

/* ─── AI CHAT WIDGET ─────────────────────────────────────────────── */
.ai-fab {
    position: fixed; bottom: 28px; right: 28px; z-index: 1100;
    width: 56px; height: 56px; border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--store-primary), #3B6EE8);
    color: #fff; font-size: 1.4rem; cursor: pointer;
    box-shadow: 0 4px 20px rgba(27,79,219,.45);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ai-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(27,79,219,.55); }
.ai-fab .ai-badge {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #EF4444; color: #fff; font-size: .65rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; border: 2px solid #fff;
}

.ai-panel {
    position: fixed; bottom: 96px; right: 28px; z-index: 1099;
    width: 340px; max-height: 540px;
    display: flex; flex-direction: column;
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    transform-origin: bottom right;
    transform: scale(0.8) translateY(20px);
    opacity: 0; visibility: hidden;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s ease, visibility .2s ease;
}
.ai-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1; visibility: visible;
}

.ai-panel-header {
    background: linear-gradient(135deg, var(--store-primary), #3B6EE8);
    color: #fff; padding: .875rem 1rem;
    display: flex; align-items: center; gap: 10px;
}
.ai-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.ai-header-info { flex: 1; }
.ai-header-name { font-weight: 700; font-size: .9rem; }
.ai-header-status { font-size: .72rem; opacity: .8; display: flex; align-items: center; gap: 4px; }
.ai-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }
.ai-close-btn {
    background: none; border: none; color: rgba(255,255,255,.8);
    cursor: pointer; padding: 4px; border-radius: 8px; line-height: 1;
    font-size: 1.1rem; transition: color .15s ease, background .15s ease;
}
.ai-close-btn:hover { color: #fff; background: rgba(255,255,255,.15); }

.ai-messages {
    flex: 1; overflow-y: auto; padding: .875rem;
    background: #F8FAFF; min-height: 200px; max-height: 340px;
    scrollbar-width: thin;
}
.ai-msg { display: flex; margin-bottom: 10px; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.bot { justify-content: flex-start; align-items: flex-end; gap: 6px; }
.ai-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--store-primary), #3B6EE8);
    color: #fff; font-size: .75rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ai-bubble {
    max-width: 82%; padding: .5rem .875rem;
    border-radius: 16px; font-size: .8375rem; line-height: 1.5;
    word-break: break-word;
}
.ai-msg.user .ai-bubble {
    background: var(--store-primary); color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-msg.bot .ai-bubble {
    background: #fff; color: var(--store-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.ai-bubble strong { color: var(--store-primary); }
.ai-msg.bot .ai-bubble strong { color: var(--store-primary); }
.ai-msg.user .ai-bubble strong { color: rgba(255,255,255,.9); }

/* Quick reply options */
.ai-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ai-option-btn {
    background: #EEF2FF; border: 1.5px solid rgba(27,79,219,.15);
    color: var(--store-primary); border-radius: 50rem;
    padding: .25rem .75rem; font-size: .75rem; font-weight: 600;
    cursor: pointer; transition: background .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.ai-option-btn:hover { background: rgba(27,79,219,.12); border-color: var(--store-primary); }

/* Typing indicator */
.ai-typing .ai-bubble { background: #fff; padding: .5rem .875rem; }
.ai-typing-dots { display: flex; gap: 4px; align-items: center; height: 16px; }
.ai-typing-dots span {
    width: 6px; height: 6px; border-radius: 50%; background: #CBD5E1;
    animation: typingBounce .9s ease infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: .15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%,80%,100% { transform: scale(.8); } 40% { transform: scale(1.2); background: var(--store-primary); } }

.ai-input-row {
    background: #fff; border-top: 1px solid var(--store-border);
    padding: .625rem .875rem; display: flex; gap: 6px; align-items: center;
}
.ai-input {
    flex: 1; border: 1.5px solid var(--store-border); border-radius: 50rem;
    padding: .4rem .875rem; font-size: .8375rem; outline: none;
    transition: border-color .15s ease; font-family: inherit;
}
.ai-input:focus { border-color: var(--store-primary); }
.ai-send-btn {
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: var(--store-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .9rem; flex-shrink: 0;
    transition: background .15s ease, transform .1s ease;
}
.ai-send-btn:hover { background: var(--store-primary-dark); }
.ai-send-btn:active { transform: scale(.92); }
.ai-footer { padding: .375rem; text-align: center; background: #fff; }
.ai-footer small { font-size: .65rem; color: var(--store-text-muted); }

/* ── Live Chat Mode ──────────────────────────────────────────────────────── */
.live-chat-mode { padding: 6px 12px; background: #e8f4fd; border-bottom: 1px solid #b8d8f0; font-size: 13px; }
.live-chat-status { display: flex; align-items: center; gap: 8px; color: #1a3a6b; }
.live-chat-queue { color: #6c757d; }
.agent-avatar { background: #1a3a6b !important; }
.agent-bubble { background: #e8f4fd !important; color: #1a3a6b !important; border: 1px solid #b8d8f0; }

@media (max-width: 576px) {
    .ai-fab {
        right: 16px; left: auto; bottom: 16px;
        width: 44px; height: 44px; font-size: 1.1rem;
    }
    .ai-fab .ai-badge {
        width: 16px; height: 16px;
    }
    .ai-panel {
        right: 12px; left: auto; bottom: 68px;
        width: calc(100vw - 24px);
        transform-origin: bottom right;
    }

    /* Defensive clearance so fixed floating buttons (AI FAB + tenant-injected QR button)
       never sit on top of the last row of scrollable content when scrolled to the bottom */
    main.container-fluid {
        padding-bottom: 160px;
    }
}

/* Auto-shrink FAB while the user is actively scrolling (body.is-scrolling toggled via JS in _AIChatWidget.cshtml) */
@media (max-width: 767.98px) {
    body.is-scrolling .ai-fab {
        width: 32px; height: 32px; opacity: 0.55; pointer-events: none;
        font-size: 0.85rem;
        transition: transform .2s ease, opacity .2s ease, width .2s ease, height .2s ease;
    }
}

/* ── AI Suggested Orders ─────────────────────────────────────────────────── */
.ai-suggestions-card { border-radius: 12px; overflow: hidden; }
.ai-suggestions-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ai-product-chip { min-width: 160px; max-width: 180px; flex-shrink: 0; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ai-product-chip img { width: 100%; height: 80px; object-fit: contain; border-radius: 6px; background: #f8fafc; }
.ai-product-chip .chip-name { font-size: 0.75rem; font-weight: 600; color: #0f172a; line-height: 1.3; }
.ai-product-chip .chip-reason { font-size: 0.65rem; color: #64748b; line-height: 1.3; }
.ai-product-chip .chip-price { font-size: 0.8rem; font-weight: 700; color: #1B4FDB; }
.ai-product-chip .chip-qty-row { display: flex; align-items: center; gap: 4px; margin-top: auto; }
.ai-product-chip .chip-qty-label { font-size: 0.65rem; color: #64748b; flex-shrink: 0; }
.ai-product-chip .chip-qty-input { width: 52px; height: 28px; font-size: 0.75rem; text-align: center; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 4px; }
.ai-product-chip .chip-price-inline { flex: 1; text-align: right; }
.ai-product-chip .chip-add-btn { margin-top: 6px; }

/* ── Catalog quantity input ─────────────────────────────────────────────── */
.catalog-qty-group { width: 100px; flex-shrink: 0; }
.catalog-qty-group .btn { padding: 0 6px; font-size: 0.85rem; line-height: 1; }
.catalog-qty-input { font-size: 0.8rem; padding: 0 2px; height: 30px; }
.catalog-add-form { flex-wrap: nowrap; }
.catalog-add-btn { white-space: nowrap; }

/* ── Catalog page header (breadcrumb + title) ───────────────────────────── */
@media (max-width: 576px) {
    /* !important needed: Bootstrap's .py-3 utility class is itself !important */
    .catalog-page-header {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    .catalog-page-header .breadcrumb {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    .catalog-page-header h1.h4 {
        font-size: 1.1rem;
    }
}

/* ── Discounts Badge ── */
.discount-nav-link .discount-live-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--store-accent);
    border: 1.5px solid var(--store-surface, #fff);
    animation: discount-dot-pulse 2.5s ease-in-out infinite;
}
@keyframes discount-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

/* Mobile: dot reads as an inline badge attached to the "Ofertas" label instead of floating at the row's edge */
@media (max-width: 991.98px) {
    .discount-nav-link .discount-live-dot {
        position: relative;
        top: -6px;
        right: auto;
        display: inline-block;
        margin-left: 4px;
    }
}

/* ── Price-gate CTAs (register/login invitation, replaces cold "lock" messaging) ── */
.btn-outline-accent {
    color: var(--store-accent);
    border-color: var(--store-accent);
    background-color: transparent;
}
.btn-outline-accent:hover,
.btn-outline-accent:focus,
.btn-outline-accent:active {
    color: #fff;
    background-color: var(--store-accent);
    border-color: var(--store-accent);
}

.btn-accent {
    color: #fff;
    background-color: var(--store-accent);
    border-color: var(--store-accent);
}
.btn-accent:hover,
.btn-accent:focus,
.btn-accent:active {
    color: #fff;
    background-color: #00A87D;
    border-color: #00A87D;
}

/* ─── HOME: bloques configurables desde Nexus ────────────────────── */
.home-preview-bar {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #FEF3C7;
    color: #92400E;
    border-bottom: 1px solid #FCD34D;
    font-size: .875rem;
    padding: 8px 16px;
    text-align: center;
}

.home-promo {
    position: relative;
    overflow: hidden;
}

.section-subtitle {
    color: var(--store-text-muted);
    font-size: .95rem;
    margin-top: .25rem;
}

.home-block-dark .section-title,
.home-block-dark .section-subtitle,
.home-block-dark .cat-chip-name {
    color: #fff;
}

.home-block-dark .section-badge {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.home-richtext {
    font-size: 1rem;
    line-height: 1.7;
}

.home-richtext img {
    max-width: 100%;
    height: auto;
}
