/* ---------------------------------------------------------------------------
   Dark mode for the customer-facing mall surfaces
   (shop, product detail, cart, checkout).

   Activation is automatic based on the device's `prefers-color-scheme`: a tiny
   inline script in the <head> of each page applies `body.dark-mode` when the
   OS is in dark mode and removes it when it isn't. It also listens for OS-level
   theme changes so the site flips live without a reload.
--------------------------------------------------------------------------- */

/* Small transition when the OS theme changes so the flip feels intentional. */
body.dark-mode,
body.dark-mode * {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ===========================================================================
   1. Design tokens: redefine so anything referencing these vars adapts.
   =========================================================================== */
body.dark-mode {
    --primary-blue: #4d8dff;
    --primary-dark: #0a1220;

    --text-dark: #f1f5f9;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #94a3b8;

    --bg-light: #0f172a;           /* overall app surface */
    --white: #1e293b;              /* card surface (anywhere `var(--white)` is used as bg) */
    --card-bg: #1e293b;
    --border-color: #334155;

    --shadow: 0 4px 6px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);

    background-color: #0f172a;
    color: var(--text-body);
    color-scheme: dark;
}

/* ===========================================================================
   2. Global surfaces shared by all pages (header, footer, menus, cards)
   =========================================================================== */
body.dark-mode header,
body.dark-mode .header,
body.dark-mode .main-header,
body.dark-mode footer,
body.dark-mode .footer {
    background-color: #111a2e;
    border-color: var(--border-color);
    color: var(--text-body);
}

/* -----------------------------------------------------------------
   Search bar — dark variant of the unified pill design.
   ----------------------------------------------------------------- */
body.dark-mode .sticky-search-bar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.dark-mode .header-search,
body.dark-mode .sticky-search-bar .header-search,
body.dark-mode .main-header .header-search {
    background: linear-gradient(180deg, #1e293b 0%, #18223a 100%) !important;
    border: 1px solid #334155 !important;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .header-search:hover {
    border-color: #3f5170 !important;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .header-search:focus-within {
    border-color: var(--primary-blue) !important;
    box-shadow:
        0 0 0 4px rgba(77, 141, 255, 0.18),
        0 8px 26px rgba(77, 141, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .header-search::before {
    color: #64748b;
}
body.dark-mode .header-search:focus-within::before {
    color: var(--primary-blue);
}

body.dark-mode .header-search input {
    color: var(--text-dark) !important;
    background: transparent !important;
}

body.dark-mode .header-search input::placeholder {
    color: #64748b;
    opacity: 1;
}

body.dark-mode .search-icon-btn,
body.dark-mode .header-search button {
    background: linear-gradient(180deg, #5a96ff 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    box-shadow:
        0 4px 14px rgba(77, 141, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
body.dark-mode .search-icon-btn:hover,
body.dark-mode .header-search button:hover {
    background: linear-gradient(180deg, #74a8ff 0%, #3875ef 100%) !important;
    box-shadow:
        0 6px 20px rgba(77, 141, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

body.dark-mode .search-suggestions,
body.dark-mode .search-suggestions-dropdown {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
}
body.dark-mode .search-suggestions .suggestion-item,
body.dark-mode .search-suggestions-dropdown .suggestion-item {
    border-color: var(--border-color);
    color: var(--text-body);
}
body.dark-mode .search-suggestions .suggestion-item:hover,
body.dark-mode .search-suggestions-dropdown .suggestion-item:hover,
body.dark-mode .search-suggestions .suggestion-item.selected {
    background: #263247;
}
body.dark-mode .suggestion-name {
    color: var(--text-dark);
}
body.dark-mode .suggestion-category {
    color: var(--text-muted);
}
body.dark-mode .suggestion-image-placeholder {
    background: #0f172a;
    color: var(--text-muted);
}

body.dark-mode .header a,
body.dark-mode .header .nav-links a,
body.dark-mode .main-header a,
body.dark-mode footer a,
body.dark-mode .footer a {
    color: var(--text-body);
}

body.dark-mode .header .nav-links a:hover,
body.dark-mode .header a:hover,
body.dark-mode .main-header a:hover {
    color: var(--primary-blue);
}

body.dark-mode .nav-dropdown .dropdown-menu,
body.dark-mode .user-menu-dropdown,
body.dark-mode .notification-dropdown,
body.dark-mode .search-suggestions-dropdown {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
    color: var(--text-body);
}

/* ---------- Mobile side menu (dark mode) ---------- */
body.dark-mode .mobile-menu {
    background: linear-gradient(180deg, #111a30 0%, #0b1220 100%);
    color: var(--text-body);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
}

body.dark-mode .mobile-menu-overlay {
    background: rgba(4, 8, 18, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* "Menu" title + close (X) icon. */
body.dark-mode .mobile-menu-top h3 {
    color: var(--text-dark);
}
body.dark-mode .mobile-menu-top .close-icon {
    /* index.css sets both background: #f1f5f9 and color: #64748b on the
       close circle. In dark mode we flip `color` to --text-dark which is
       also near-white (#f1f5f9), so the X ends up white on a white
       circle and disappears. Override the background too so the X has
       real contrast. */
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    opacity: 0.95;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
body.dark-mode .mobile-menu-top .close-icon:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.4);
    opacity: 1;
    transform: rotate(90deg);
}

/* Nav link rows (anchors AND dropdown trigger buttons — the "Services"
   item is a <button class="dropdown-trigger">, so it needs explicit rules). */
body.dark-mode .mobile-nav-links-wrapper > a,
body.dark-mode .mobile-menu .dropdown-trigger,
body.dark-mode .mobile-nav-links-wrapper a.header-icon-link {
    color: var(--text-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: transparent !important;
    font-weight: 500;
}

body.dark-mode .mobile-nav-links-wrapper > a i,
body.dark-mode .mobile-menu .dropdown-trigger i {
    color: var(--text-muted) !important;
}

body.dark-mode .mobile-nav-links-wrapper > a:hover,
body.dark-mode .mobile-menu .dropdown-trigger:hover,
body.dark-mode .mobile-nav-links-wrapper a.header-icon-link:hover {
    color: var(--primary-blue) !important;
}
body.dark-mode .mobile-nav-links-wrapper > a:hover i,
body.dark-mode .mobile-menu .dropdown-trigger:hover i {
    color: var(--primary-blue) !important;
}

/* Dropdown (Services) sub-links. */
body.dark-mode .mobile-nav-links-wrapper .nav-dropdown .dropdown-menu a {
    color: var(--text-body) !important;
}
body.dark-mode .mobile-nav-links-wrapper .nav-dropdown .dropdown-menu a:hover {
    color: var(--primary-blue) !important;
}

/* Cart badge in mobile menu — keep the primary-blue chip readable. */
body.dark-mode .mobile-nav-links-wrapper .cart-count-badge {
    background: var(--primary-blue);
    color: #ffffff;
}

/* Auth area at the bottom — add a subtle divider so the buttons
   visually belong to the menu instead of floating alone. Keep the
   existing margin-top: auto (from style.css) so they stay pinned
   to the bottom of the drawer. */
body.dark-mode .mobile-auth-wrapper {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
}

/* Primary "My Dashboard" button — keep the branded gradient feel. */
body.dark-mode .mobile-auth-wrapper .btn-primary,
body.dark-mode .mobile-auth-wrapper .btn-dashboard {
    background: linear-gradient(135deg, #2563eb, #4d8dff);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
body.dark-mode .mobile-auth-wrapper .btn-primary:hover,
body.dark-mode .mobile-auth-wrapper .btn-dashboard:hover {
    filter: brightness(1.08);
}

/* Secondary / Logout button — dark surface instead of glaring white. */
body.dark-mode .mobile-auth-wrapper .btn-secondary,
body.dark-mode .mobile-auth-wrapper .btn-logout {
    background: #1a2236 !important;
    color: var(--text-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}
body.dark-mode .mobile-auth-wrapper .btn-logout i {
    color: #f87171;
}
body.dark-mode .mobile-auth-wrapper .btn-secondary:hover,
body.dark-mode .mobile-auth-wrapper .btn-logout:hover {
    background: #222c44 !important;
    border-color: rgba(248, 113, 113, 0.35) !important;
    color: #f87171 !important;
}
body.dark-mode .mobile-auth-wrapper .btn-logout:hover i {
    color: #f87171;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .section-title {
    color: var(--text-dark);
}

body.dark-mode .text-muted,
body.dark-mode .meta,
body.dark-mode small.text-muted {
    color: var(--text-muted) !important;
}

/* Inputs, selects, textareas */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode input[type="search"],
body.dark-mode input[type="url"],
body.dark-mode input[type="date"],
body.dark-mode select,
body.dark-mode textarea {
    background: #0f172a;
    color: var(--text-dark);
    border-color: var(--border-color);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #64748b;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.22);
}

body.dark-mode .btn-secondary,
body.dark-mode button.btn-secondary {
    background: #1e293b;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}
body.dark-mode .btn-secondary:hover {
    background: #273449;
}

body.dark-mode hr {
    border-color: var(--border-color);
}

/* Generic card-ish surfaces that use hardcoded backgrounds */
body.dark-mode .card,
body.dark-mode .section-card,
body.dark-mode .modal-content,
body.dark-mode .modal,
body.dark-mode .dropdown-menu {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
    box-shadow: var(--card-shadow);
}

/* Images look too harsh with bright thumbnails on a dark surface. */
body.dark-mode .product-card img,
body.dark-mode .product-thumbnail img,
body.dark-mode .cart-item img,
body.dark-mode .checkout-item img {
    filter: brightness(0.94);
}

/* ===========================================================================
   3. Shop page  (css/shop.css)
   =========================================================================== */
body.dark-mode .shop-page,
body.dark-mode .shop-main-layout {
    background: transparent;
    color: var(--text-body);
}

body.dark-mode .shipping-info-bar {
    background-color: #0a1224;
    color: var(--text-body);
    border-bottom: 1px solid var(--border-color);
}

/* Sidebar (Categories / Price / Shipping filters) */
body.dark-mode .shop-sidebar {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
    box-shadow: var(--shadow-lg);
}

body.dark-mode .filter-group {
    border-bottom-color: var(--border-color);
}

body.dark-mode .filter-group-header:hover {
    background: #263247;
}

body.dark-mode .filter-group-header h3,
body.dark-mode .filter-group h3 {
    color: var(--text-dark);
    border-color: var(--border-color);
}

body.dark-mode .filter-group-header i {
    color: var(--text-muted);
}

body.dark-mode .category-list a {
    color: var(--text-body);
}

body.dark-mode .category-list a:hover {
    color: var(--primary-blue);
    background-color: #1b2438;
}

body.dark-mode .category-list a.active {
    background: var(--primary-blue);
    color: #ffffff;
}

/* Hero / promotions slider — dark adjustments. The slider is already designed
   around a dark base, so we only need to:
     - Reinforce the gradient base for the container
     - Tweak the top-edge highlight so it reads correctly on a dark surface
     - Deepen the shadow and slightly cool the skeleton shimmer. */
body.dark-mode .hero-slider-container {
    background: linear-gradient(135deg, #18223a 0%, #0b1220 100%);
    box-shadow:
        0 22px 50px -18px rgba(0, 0, 0, 0.8),
        0 12px 28px -14px rgba(0, 0, 0, 0.55);
}
body.dark-mode .hero-slider-container::before {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0) 45%,
            rgba(77, 141, 255, 0.28));
}

/* On mobile/tablet — match shop.css: remove all pseudo overlays and ensure
   the container + every slide share the exact same opaque dark colour so
   the subpixel seam between loop slides stays invisible. See
   css/shop.css @ the "Mobile/tablet seam fix" comment for the full
   rationale. */
@media (max-width: 992px) {
    body.dark-mode .hero-slider-container::before,
    body.dark-mode .hero-slider-container::after {
        display: none !important;
        content: none !important;
        background: none !important;
        border: none !important;
    }

    body.dark-mode .hero-slider-container {
        background: #0b1220 !important;
        background-clip: padding-box !important;
        border: none !important;
        outline: none !important;
    }

    /* Keep slide background identical to the container so boundaries vanish. */
    body.dark-mode .hero-slider-container .swiper-slide {
        background: #0b1220 !important;
    }

    /* Dark-mode darkening overlay — purely VERTICAL so there's no
       horizontal colour variation between adjacent loop slides. Slightly
       darker stops than light-mode because the dark-mode slide bg is
       already deeper. See shop.css @ "Mobile/tablet seam fix (v2)". */
    body.dark-mode .hero-slider-container .swiper-slide::before {
        content: '' !important;
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        background: linear-gradient(180deg,
            rgba(4, 8, 18, 0.55) 0%,
            rgba(4, 8, 18, 0.35) 45%,
            rgba(4, 8, 18, 0.7) 100%) !important;
        z-index: 2 !important;
        pointer-events: none !important;
    }
}

body.dark-mode .swiper-slide {
    background: #0b1220;
}

body.dark-mode .swiper-slide.skeleton-slide {
    background: linear-gradient(90deg, #152035 25%, #1e2a46 50%, #152035 75%) !important;
    background-size: 200% 100% !important;
}

body.dark-mode .hero-slider-container .swiper-button-next,
body.dark-mode .hero-slider-container .swiper-button-prev {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

body.dark-mode .hero-slider-container .swiper-button-next:hover,
body.dark-mode .hero-slider-container .swiper-button-prev:hover,
body.dark-mode .hero-slider-container .swiper-button-next:focus-visible,
body.dark-mode .hero-slider-container .swiper-button-prev:focus-visible {
    background: transparent;
    box-shadow: none;
}

body.dark-mode .hero-slider-container .swiper-button-next:hover::after,
body.dark-mode .hero-slider-container .swiper-button-prev:hover::after,
body.dark-mode .hero-slider-container .swiper-button-next:focus-visible::after,
body.dark-mode .hero-slider-container .swiper-button-prev:focus-visible::after {
    filter: drop-shadow(0 0 10px rgba(77, 141, 255, 0.7));
}

/* Product grid cards */
body.dark-mode .product-card {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--card-shadow);
    color: var(--text-body);
}

body.dark-mode .product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

body.dark-mode .product-card .product-image-wrapper {
    background-color: #152035 !important;
}

body.dark-mode .product-card .product-title,
body.dark-mode .product-card .product-title a {
    color: var(--text-dark);
}

body.dark-mode .product-card .product-price {
    color: var(--text-dark);
}

body.dark-mode .product-card .stock-status {
    color: var(--text-muted);
}

/* Skeleton loading shimmer */
body.dark-mode .skeleton-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}
body.dark-mode .skeleton-img,
body.dark-mode .skeleton-line,
body.dark-mode .skeleton-box {
    background: linear-gradient(90deg, #1b2438 25%, #263149 50%, #1b2438 75%) !important;
    background-size: 200% 100%;
}

/* Product detail skeleton cards — match the real dark gallery / info
   cards so there's no visual jump when the content loads. */
body.dark-mode .product-gallery-skeleton {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.dark-mode .thumbnails-skeleton {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}
body.dark-mode .product-info-skeleton {
    background: var(--card-bg) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.4),
        0 12px 32px -12px rgba(0, 0, 0, 0.7) !important;
}

/* Toolbar: "All Products" / sort dropdown / pagination */
body.dark-mode .product-grid-header,
body.dark-mode .shop-toolbar,
body.dark-mode .no-results,
body.dark-mode .info-message {
    background: transparent;
    color: var(--text-body);
}

/* Custom select dropdown */
body.dark-mode .custom-select-trigger {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-body);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode .custom-select-trigger:hover,
body.dark-mode .custom-select.is-open .custom-select-trigger {
    background: rgba(77, 141, 255, 0.12);
    border-color: var(--primary-blue);
    box-shadow: 0 6px 22px -10px rgba(77, 141, 255, 0.55);
}

body.dark-mode .custom-select-trigger:focus-visible {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.28);
}

body.dark-mode .custom-select-value {
    color: var(--text-dark);
}

body.dark-mode .custom-select-label,
body.dark-mode .custom-select-caret {
    color: var(--text-muted);
}

body.dark-mode .custom-select-options {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 50px -20px rgba(0, 0, 0, 0.7),
        0 10px 26px -14px rgba(0, 0, 0, 0.5);
}

body.dark-mode .custom-select-option {
    color: var(--text-body);
}

body.dark-mode .custom-select-option i {
    color: var(--text-muted);
}

body.dark-mode .custom-select-option:hover,
body.dark-mode .custom-select-option:focus {
    background: rgba(77, 141, 255, 0.15);
    color: #ffffff;
}

body.dark-mode .custom-select-option:hover i,
body.dark-mode .custom-select-option:focus i {
    color: #ffffff;
}

body.dark-mode .custom-select-option.is-selected {
    background: linear-gradient(135deg, rgba(77, 141, 255, 0.22), rgba(0, 195, 255, 0.12));
    color: #ffffff;
}

body.dark-mode .custom-select-option.is-selected i,
body.dark-mode .custom-select-option.is-selected::after {
    color: #4d8dff;
}

body.dark-mode .custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(77, 141, 255, 0.35);
}

body.dark-mode .pagination button,
body.dark-mode .pagination .page-link {
    background: var(--card-bg);
    color: var(--text-body);
    border-color: var(--border-color);
}
body.dark-mode .pagination .page-link.active,
body.dark-mode .pagination button.active {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

/* Image submission / upload area */
body.dark-mode #image-submission-area,
body.dark-mode .image-submission-area {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
}

/* ===========================================================================
   4. Product detail page  (css/product-detail.css)
   =========================================================================== */
body.dark-mode .breadcrumb-current {
    color: var(--text-dark);
}

body.dark-mode .product-image-main,
body.dark-mode .product-thumbnails,
body.dark-mode .main-image-wrapper,
body.dark-mode .thumbnail {
    background: #152035 !important;
    border-color: var(--border-color);
}

/* Gallery custom swipe controls (product detail). */
body.dark-mode #gallery-main {
    background: transparent !important;
    border: none !important;
}
body.dark-mode #gallery-main .swiper-slide {
    background: transparent;
}
body.dark-mode .gallery-indicator {
    background: rgba(4, 8, 20, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}
/* Arrows stay naked white chevrons with a drop-shadow for readability. */
body.dark-mode #gallery-main .swiper-button-next,
body.dark-mode #gallery-main .swiper-button-prev {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.65)) !important;
}
body.dark-mode #gallery-main .swiper-button-disabled {
    opacity: 0.3 !important;
}
body.dark-mode #gallery-main .swiper-button-next:hover,
body.dark-mode #gallery-main .swiper-button-prev:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
body.dark-mode #gallery-thumbs .swiper-slide {
    border-color: transparent;
}
body.dark-mode #gallery-thumbs .swiper-slide-thumb-active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.28);
}

body.dark-mode .share-btn-desktop {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
}
body.dark-mode .share-btn-desktop:hover {
    background: #273449;
}

body.dark-mode .product-info,
body.dark-mode .product-info-section,
body.dark-mode .product-description,
body.dark-mode .product-tab-content,
body.dark-mode .tab-content,
body.dark-mode .shipping-info-box,
body.dark-mode .related-products {
    background: transparent;
    color: var(--text-body);
}

/* =========================================================
   Redesigned related-product card (dark mode)
   ========================================================= */
body.dark-mode .related-product-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--text-body);
}
body.dark-mode .related-product-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    color: var(--text-body);
}
body.dark-mode .related-product-image {
    background: #152035;
}
body.dark-mode .related-product-title {
    color: var(--text-dark);
}
body.dark-mode .related-product-price {
    color: var(--primary-blue);
}
body.dark-mode .related-product-price .price-ghs-equiv {
    color: var(--text-muted) !important;
}
body.dark-mode .related-products-section .section-title {
    color: var(--text-dark) !important;
}

/* =========================================================
   Description preview + See-more button (dark mode)
   ========================================================= */
body.dark-mode .description-preview {
    color: var(--text-body);
}
body.dark-mode .description-preview::after {
    /* Fade to the product-info card background instead of pure white. */
    background: linear-gradient(180deg,
        rgba(26, 34, 54, 0) 0%,
        rgba(26, 34, 54, 0.92) 70%,
        var(--card-bg) 100%);
}
body.dark-mode .description-see-more {
    color: var(--primary-blue);
}
body.dark-mode .description-see-more:hover {
    color: #6aa0ff;
}

/* =========================================================
   Description bottom-sheet modal (dark mode)
   ========================================================= */
body.dark-mode .description-modal-backdrop {
    background: rgba(4, 8, 18, 0.72);
}
body.dark-mode .description-modal-sheet {
    background: var(--card-bg);
    box-shadow:
        0 24px 60px -12px rgba(0, 0, 0, 0.75),
        0 8px 24px -8px rgba(0, 0, 0, 0.55);
}
body.dark-mode .description-modal-handle::before {
    background: rgba(255, 255, 255, 0.18);
}
body.dark-mode .description-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
body.dark-mode .description-modal-header h3 {
    color: var(--text-dark);
}
body.dark-mode .description-modal-close {
    background: #1a2236;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-dark);
}
body.dark-mode .description-modal-close:hover,
body.dark-mode .description-modal-close:focus-visible {
    background: #24304a;
}
body.dark-mode .description-modal-body {
    color: var(--text-body);
}

body.dark-mode .product-description,
body.dark-mode .tab-content,
body.dark-mode .shipping-info-box {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
}

body.dark-mode .product-info h1,
body.dark-mode .product-info h2,
body.dark-mode .product-title {
    color: var(--text-dark);
}

/* Variant & general option buttons.
   The product-detail sheet hard-codes `.variant-btn { background: #fff; border: #e5e7eb; }`
   (and the mobile breakpoint also sets `color: #1f2937`), so we override all of
   those or the text disappears against a white pill. */
body.dark-mode .variant-btn,
body.dark-mode .product-variant-option,
body.dark-mode .variant-option-btn,
body.dark-mode .general-option-btn,
body.dark-mode .option-btn,
body.dark-mode .variant-value-btn {
    background: #0f172a !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
body.dark-mode .variant-btn:hover,
body.dark-mode .product-variant-option:hover,
body.dark-mode .variant-option-btn:hover,
body.dark-mode .general-option-btn:hover,
body.dark-mode .option-btn:hover,
body.dark-mode .variant-value-btn:hover {
    border-color: var(--primary-blue) !important;
    background: #152035 !important;
    color: var(--text-dark) !important;
}
body.dark-mode .variant-btn.selected,
body.dark-mode .product-variant-option.selected,
body.dark-mode .variant-option-btn.selected,
body.dark-mode .general-option-btn.selected,
body.dark-mode .option-btn.selected,
body.dark-mode .variant-value-btn.selected {
    background: var(--primary-blue) !important;
    color: #ffffff !important;
    border-color: var(--primary-blue) !important;
}
body.dark-mode .variant-btn.disabled,
body.dark-mode .product-variant-option.disabled {
    opacity: 0.4;
    color: var(--text-muted) !important;
}

body.dark-mode .tab-button,
body.dark-mode .product-tab-btn {
    color: var(--text-muted);
}
body.dark-mode .tab-button.active,
body.dark-mode .product-tab-btn.active {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

body.dark-mode .qty-input,
body.dark-mode .qty-btn,
body.dark-mode .quantity-selector button,
body.dark-mode .quantity-selector input {
    background: #0f172a;
    color: var(--text-dark);
    border-color: var(--border-color);
}

body.dark-mode .sticky-add-to-cart,
body.dark-mode .mobile-add-bar {
    background: #111a2e;
    border-color: var(--border-color);
    color: var(--text-body);
}

/* --- Product detail redesign (2026) — dark mode overrides --- */
/* On mobile the product-detail page wraps its content in white cards
   (.product-gallery, .product-info-details). Swap those for dark cards. */
body.dark-mode .product-info-details,
body.dark-mode .product-secondary-info {
    background: var(--card-bg) !important;
    color: var(--text-body);
    box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.6);
}
body.dark-mode .product-secondary-info {
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.4),
        0 12px 32px -12px rgba(0, 0, 0, 0.7) !important;
}
body.dark-mode .product-info-details h1 {
    color: var(--text-dark);
}
body.dark-mode .product-pricing-section {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}
body.dark-mode .price-current {
    color: #4d8dff;
}
body.dark-mode .price-current .price-ghs-equiv {
    color: var(--text-muted) !important;
}
body.dark-mode .meta-item-mobile {
    background: #1a2236;
    color: var(--text-body);
}
body.dark-mode .meta-item-mobile i {
    color: #4d8dff;
}
body.dark-mode .shipping-info-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(22, 32, 58, 0.6) 100%) !important;
    border-color: rgba(77, 141, 255, 0.18) !important;
}
body.dark-mode .shipping-info-box strong {
    color: var(--text-dark);
}
body.dark-mode .shipping-info-box p {
    color: var(--text-body);
}
body.dark-mode .product-detail-tabs {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}
body.dark-mode .tab-headers {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
body.dark-mode .tab-link {
    color: var(--text-muted);
}
body.dark-mode .tab-link.active {
    color: #4d8dff;
    border-bottom-color: #4d8dff;
}
body.dark-mode .tab-content {
    color: var(--text-body);
}
body.dark-mode .tab-content h4 {
    color: var(--text-dark);
}

/* Mobile mirrors the desktop design — the gallery has no card
   wrapper at any viewport width. The image sits directly on the
   page background. */
body.dark-mode .product-gallery {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Give the main gallery frame a subtle dark placeholder so video/image
   loading doesn't flash white. */
@media (max-width: 768px) {
    body.dark-mode #gallery-main {
        background: #1e293b !important;
    }
}

body.dark-mode .gallery-thumbnails-bar {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode #gallery-thumbs .swiper-slide {
    background: #121a2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
body.dark-mode #gallery-thumbs .swiper-slide:hover {
    border-color: rgba(77, 141, 255, 0.5) !important;
    box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.5) !important;
}
body.dark-mode #gallery-thumbs .swiper-slide-thumb-active {
    border-color: #4d8dff !important;
    box-shadow:
        0 0 0 3px rgba(77, 141, 255, 0.18),
        0 8px 18px -6px rgba(77, 141, 255, 0.45) !important;
}
body.dark-mode #gallery-thumbs .swiper-slide::after {
    background: #4d8dff;
}

/* --- Redesigned info section elements in dark mode --- */
body.dark-mode .product-info-details,
body.dark-mode .product-secondary-info {
    border-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.4),
        0 12px 32px -12px rgba(0, 0, 0, 0.7) !important;
}

body.dark-mode .product-meta .meta-item {
    background: #1a2236 !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-body) !important;
}
body.dark-mode .product-meta .meta-item strong {
    color: var(--text-dark) !important;
}

body.dark-mode .product-sales-metrics .sales-badge {
    background: rgba(77, 141, 255, 0.14) !important;
    color: #4d8dff !important;
}

body.dark-mode .variant-option-group label,
body.dark-mode .quantity-selector-group label {
    color: var(--text-muted) !important;
}

body.dark-mode .quantity-control {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
body.dark-mode .quantity-control:hover,
body.dark-mode .quantity-control:focus-within {
    background: #131b2e !important;
    border-color: #4d8dff !important;
    box-shadow: 0 6px 16px -6px rgba(77, 141, 255, 0.35) !important;
}
body.dark-mode .qty-btn-minus,
body.dark-mode .qty-btn-plus {
    color: var(--text-dark) !important;
    background: transparent !important;
}
body.dark-mode .qty-btn-minus:hover,
body.dark-mode .qty-btn-plus:hover {
    background: #4d8dff !important;
    color: #ffffff !important;
}
body.dark-mode .qty-input {
    color: var(--text-dark) !important;
    background: transparent !important;
}

body.dark-mode #add-to-cart-btn {
    background: linear-gradient(135deg, #2563eb 0%, #4d8dff 100%) !important;
    box-shadow:
        0 10px 26px -8px rgba(77, 141, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
body.dark-mode #add-to-cart-btn:disabled {
    background: #24304a !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
}

body.dark-mode .shipping-info-box {
    background: linear-gradient(135deg, rgba(77, 141, 255, 0.08) 0%, rgba(22, 32, 58, 0.5) 100%) !important;
    border-color: rgba(77, 141, 255, 0.2) !important;
}
body.dark-mode .shipping-info-box::before {
    background: linear-gradient(180deg, #4d8dff 0%, #2563eb 100%) !important;
}
body.dark-mode .shipping-info-box i {
    background: #1a2236 !important;
    color: #4d8dff !important;
    box-shadow: 0 4px 10px -4px rgba(77, 141, 255, 0.3) !important;
}

body.dark-mode .tab-headers {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
body.dark-mode .tab-link.active::after {
    background: linear-gradient(90deg, #4d8dff 0%, #93c5fd 100%) !important;
}

body.dark-mode .stock-error-message {
    background: rgba(220, 38, 38, 0.12) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
    color: #fca5a5 !important;
}
/* Mobile-only: gallery card already has rounded corners & no divider. */
@media (max-width: 992px) {
    body.dark-mode .gallery-thumbnails-bar {
        background: transparent !important;
        border-top: none !important;
    }
}

/* Quantity control in new design. */
body.dark-mode .quantity-control {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .quantity-control button {
    background: #152035;
    color: var(--text-dark);
}
body.dark-mode .quantity-control button:hover:not(:disabled) {
    background: var(--primary-blue);
    color: #ffffff;
}
body.dark-mode .quantity-control input {
    background: #0f172a;
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Floating bottom action bar — dark glass instead of white. */
/* =========================================================
   Floating liquid-glass bottom bar — dark mode variant.
   Darker tint under the blur, thin pale edge highlight, and
   deeper drop shadow to carry on dark content.
   ========================================================= */
body.dark-mode .mobile-product-actions {
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.02) 100%),
        rgba(11, 18, 32, 0.55) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.14) !important;
    border-top-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow:
        0 14px 40px -10px rgba(0, 0, 0, 0.7),
        0 6px 14px -6px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .action-icon-btn {
    color: var(--text-body);
}
body.dark-mode .action-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #4d8dff;
}
body.dark-mode .action-icon-btn:active,
body.dark-mode .action-icon-btn.active {
    background: rgba(77, 141, 255, 0.18);
    color: #93c5fd;
}
body.dark-mode .action-icon-btn:not(:last-child)::after {
    background: rgba(255, 255, 255, 0.1);
}

/* Hairline divider between the icon cluster and the CTA in dark mode. */
body.dark-mode .action-icons::after {
    background: rgba(255, 255, 255, 0.16);
}
body.dark-mode .btn-action.btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
body.dark-mode .btn-action.btn-secondary:hover:not(:disabled),
body.dark-mode .btn-action.btn-secondary:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}
body.dark-mode .btn-action.btn-primary {
    background: linear-gradient(135deg, #1e6bff 0%, #4d8dff 55%, #6ea5ff 100%) !important;
    color: #ffffff !important;
    box-shadow:
        0 10px 24px -6px rgba(77, 141, 255, 0.5),
        0 2px 6px -2px rgba(77, 141, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
body.dark-mode .btn-action.btn-primary:hover:not(:disabled) {
    filter: brightness(1.08);
}

/* Mobile body background — must stay dark in dark mode. In light mode,
   body is #f7f8fb on mobile; this rule was flipping it to var(--bg-body),
   but --bg-body is #FFFFFF at :root and never redefined for dark mode,
   which forced the body white on phones and made every gap between
   sections show through as a white band. Pin to the dark app surface. */
@media (max-width: 768px) {
    body.dark-mode {
        background: #0f172a !important;
    }
}

/* The hardcoded .related-image / thumbnail backgrounds */
body.dark-mode [class*="related"] img,
body.dark-mode .thumb,
body.dark-mode .related-image {
    background-color: #152035 !important;
}

/* ===========================================================================
   5. Cart page  (css/cart.css)
   =========================================================================== */
body.dark-mode .cart-page,
body.dark-mode .cart-wrapper,
body.dark-mode .cart-container,
body.dark-mode .cart-main {
    background: transparent;
    color: var(--text-body);
}

body.dark-mode .cart-items,
body.dark-mode .cart-summary,
body.dark-mode .cart-item,
body.dark-mode .saved-items-section,
body.dark-mode .saved-item-card,
body.dark-mode .shared-item-card {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
    box-shadow: var(--card-shadow);
}

/* The outer `.cart-items-list` wrapper is stripped on both desktop and
   mobile now — each `.cart-item` is its own standalone card — so the
   list element itself stays transparent. */
body.dark-mode .cart-items-list {
    background: transparent;
    border: none;
    box-shadow: none;
}
body.dark-mode .cart-list-header {
    background: transparent;
    border-bottom: none;
    color: var(--text-muted);
}
body.dark-mode .cart-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
body.dark-mode .cart-item:hover {
    background: #1e293b;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .cart-item .item-title,
body.dark-mode .cart-item h3,
body.dark-mode .cart-item h4 {
    color: var(--text-dark);
}

body.dark-mode .cart-item .meta-row,
body.dark-mode .cart-item .variant-meta {
    color: var(--text-muted);
}

body.dark-mode .cart-summary-row,
body.dark-mode .summary-row {
    border-color: var(--border-color);
}

body.dark-mode .cart-quantity-controls,
body.dark-mode .qty-control,
body.dark-mode .quantity-control {
    background: #0f172a;
    border-color: var(--border-color);
    color: var(--text-dark);
}

body.dark-mode .cart-empty,
body.dark-mode .empty-cart-state {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
}

/* ===========================================================================
   6. Checkout page  (css/checkout.css)
   =========================================================================== */
body.dark-mode .checkout-page,
body.dark-mode .checkout-container,
body.dark-mode .checkout-wrapper {
    background: transparent;
    color: var(--text-body);
}

body.dark-mode .checkout-section,
body.dark-mode .checkout-card,
body.dark-mode .order-summary,
body.dark-mode .shipping-option,
body.dark-mode .payment-option,
body.dark-mode .address-card,
body.dark-mode .modal-container {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-body);
    box-shadow: var(--card-shadow);
}

/* Saved-address cards are rendered by js/checkout.js with inline
   `style="background: #f0f5ff"` (selected) or `background: var(--white)`
   (unselected) plus inline text colors. In dark mode those pale blue / white
   backgrounds stay light while the inherited text becomes light too, making
   the card contents unreadable. The !important beats the inline style. */
body.dark-mode .address-option {
    background: #0f172a !important;
    border-color: var(--border-color) !important;
    color: var(--text-body) !important;
}
body.dark-mode .address-option:hover {
    background: #152035 !important;
    border-color: #3b5373 !important;
}
body.dark-mode .address-option[style*="#f0f5ff"],
body.dark-mode .address-option[style*="rgb(240, 245, 255)"] {
    /* selected state */
    background: rgba(77, 141, 255, 0.12) !important;
    border-color: var(--primary-blue) !important;
}
/* Reassert readable colors for every text element inside the address card —
   these are set via inline `color: var(--text-body|text-muted)` which, in dark
   mode, resolves to the correct light tone but only because we redefined the
   vars. We pin them explicitly anyway so nothing inherited from `.card-bg`
   context washes them out. */
body.dark-mode .address-option strong,
body.dark-mode .address-option p {
    color: var(--text-dark) !important;
}
body.dark-mode .address-option p[style*="--text-muted"],
body.dark-mode .address-option p[style*="text-muted"] {
    color: var(--text-muted) !important;
}
body.dark-mode .address-option .fa-check-circle {
    color: var(--primary-blue) !important;
}
/* "Use a Different Address" toggle button sitting under the card. */
body.dark-mode #use-different-address-btn,
body.dark-mode .use-different-address-btn {
    background: var(--card-bg) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode #use-different-address-btn:hover,
body.dark-mode .use-different-address-btn:hover {
    background: #273449 !important;
}

body.dark-mode .checkout-section h2,
body.dark-mode .checkout-card h3,
body.dark-mode .order-summary h3,
body.dark-mode .step-title {
    color: var(--text-dark);
}

/* --- Shipping-warning modal -------------------------------------------------
   checkout.css hardcodes light-on-light colors for several text elements in
   the "Important Shipping Notice" modal (#374151, #4B5563, etc.). Those
   disappear on the dark card surface, so we explicitly restate them here. */
body.dark-mode .modal-title {
    color: var(--text-dark) !important;
}
body.dark-mode .modal-subtitle {
    color: var(--text-body) !important;
}
body.dark-mode .checkbox-label {
    color: var(--text-dark) !important;
}
body.dark-mode .checkbox-visual {
    background: #0f172a;
    border-color: var(--border-color);
}
body.dark-mode .close-modal-btn {
    background: #263247;
    color: var(--text-body);
}
body.dark-mode .close-modal-btn:hover {
    background: #334155;
    color: var(--text-dark);
}
body.dark-mode .modal-header-icon {
    /* keep the red accent but shift the halo so it works on a dark card */
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--card-bg);
    color: #f87171;
}
/* The warning / tip boxes keep their light-red and light-blue backgrounds on
   purpose (semantic colors), but we want to make sure the inner text stays
   dark and readable — no inherited color leakage from the dark body. */
body.dark-mode .warning-box { color: #7F1D1D; }
body.dark-mode .warning-text { color: #7F1D1D !important; }
body.dark-mode .tip-box { color: #1E3A8A; }
body.dark-mode .tip-text { color: #1E3A8A !important; }

body.dark-mode .btn-secondary-action:disabled {
    background: #1b2438 !important;
    color: #64748b !important;
    border-color: var(--border-color) !important;
    opacity: 0.7;
}
body.dark-mode .btn-secondary-action:not(:disabled):hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

body.dark-mode .shipping-option.selected,
body.dark-mode .payment-option.selected,
body.dark-mode .address-card.selected {
    border-color: var(--primary-blue);
    background: rgba(77, 141, 255, 0.08);
}

body.dark-mode .order-summary-row,
body.dark-mode .summary-line,
body.dark-mode .checkout-item,
body.dark-mode .summary-item {
    border-color: var(--border-color);
}

/* Checkout items + sidebar summary items — text colors for dark mode.
   The baseline stylesheet uses `var(--primary-dark)` for prices, which
   in dark mode is #0a1220 (essentially invisible against the dark
   card). Rebind to readable colors here. */
body.dark-mode .checkout-item-name {
    color: var(--text-dark);
}
body.dark-mode .checkout-item-name:hover {
    color: var(--primary-blue);
}
body.dark-mode .checkout-item-variant,
body.dark-mode .checkout-item-quantity {
    color: var(--text-muted);
}
body.dark-mode .checkout-item-variant strong {
    color: var(--text-body);
}
body.dark-mode .checkout-item-price,
body.dark-mode .summary-item-price {
    color: var(--text-dark);
}
body.dark-mode .checkout-item-price .price-ghs-equiv,
body.dark-mode .summary-item-price .price-ghs-equiv {
    color: var(--text-muted);
}
body.dark-mode .summary-item-name {
    color: var(--text-dark);
}
body.dark-mode .summary-item-details {
    color: var(--text-muted);
}

/* "Total" label — baseline uses `var(--primary-dark)` (#0a1220 in
   dark mode) which is essentially invisible against the dark card. */
body.dark-mode .summary-row.total span:first-child {
    color: var(--text-dark);
}
body.dark-mode .summary-row span:last-child {
    color: var(--text-dark);
}

/* Shipping-fee disclaimer block — soft blue tinted card that reads
   in both themes. */
body.dark-mode .summary-note {
    background: linear-gradient(135deg,
        rgba(77, 141, 255, 0.1) 0%,
        rgba(77, 141, 255, 0.02) 100%);
    border: 1px solid rgba(77, 141, 255, 0.22);
    border-left: 3px solid var(--primary-blue);
    color: var(--text-body);
}
body.dark-mode .summary-note i {
    color: var(--primary-blue);
}

/* The hardcoded `.custom-checkbox-wrapper:hover { background: #F9FAFB }` etc. */
body.dark-mode .custom-checkbox-wrapper {
    background: transparent;
}
body.dark-mode .custom-checkbox-wrapper:hover {
    background: #1b2438 !important;
}

body.dark-mode .btn-secondary-action {
    background: #1e293b !important;
    color: var(--text-dark);
    border-color: var(--border-color);
}
body.dark-mode .btn-secondary-action:hover {
    background: #273449 !important;
}

/* Warning / info banners (#fff3cd, #fffbeb, etc.) */
body.dark-mode .alert-warning,
body.dark-mode [style*="#fff3cd"],
body.dark-mode [style*="#FFF3CD"] {
    background: #3a2f12 !important;
    color: #fde68a !important;
    border-color: #6b5016 !important;
}

body.dark-mode .checkout-banner,
body.dark-mode .info-banner,
body.dark-mode .warning-banner {
    background: #1f2937;
    border-color: #374151;
    color: var(--text-body);
}

/* ===========================================================================
   7. Misc: toasts, alerts, skeleton shimmers
   =========================================================================== */
body.dark-mode .toast,
body.dark-mode .alert-dialog,
body.dark-mode .notification-toast {
    background: var(--card-bg);
    color: var(--text-body);
    border-color: var(--border-color);
}

/* Catch-all: any element using an inline hardcoded white/light surface. */
body.dark-mode [style*="background:#fff"]:not([style*="background:#fff3"]):not([style*="background:#fffb"]),
body.dark-mode [style*="background: #fff"]:not([style*="background: #fff3"]):not([style*="background: #fffb"]),
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #ffffff"] {
    background-color: var(--card-bg) !important;
    color: var(--text-body) !important;
}

/* ===========================================================================
   8. Marketing / info pages (index, about, contact, get-quote,
      affiliate-apply, maintenance)

   Most of these pages pull colors from CSS custom properties that we already
   redefine in the design-token block at the top of this file, so most cards,
   backgrounds and text auto-adapt. The rules below cover the leftover
   hard-coded values (white/gray backgrounds, clipped-text gradients,
   inline-form surfaces, etc).
   =========================================================================== */

/* --- Gradients -----------------------------------------------------------
   `.section-title` + `.text-gradient-dark` use `var(--gradient-dark)` with
   `-webkit-text-fill-color: transparent`, which would clip invisible dark
   text onto the dark background. Redefine the gradient so the clipped text
   is visible again. */
body.dark-mode {
    --gradient-dark: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
}

/* --- Shared text / utility colors -------------------------------------- */
body.dark-mode .text-dark { color: var(--text-dark) !important; }
body.dark-mode .text-muted,
body.dark-mode p.text-muted,
body.dark-mode small.text-muted { color: var(--text-muted) !important; }
body.dark-mode .section-subtitle { color: var(--text-muted); }
body.dark-mode .hero-lead,
body.dark-mode .lead { color: var(--text-body); }

/* --- Home hero (index.html) ------------------------------------------- */
body.dark-mode .hero-section {
    background: linear-gradient(180deg, #0b1220 0%, #111a2e 100%);
}
body.dark-mode .hero-blob {
    background: radial-gradient(circle, rgba(77, 141, 255, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
}
body.dark-mode .hero-badge {
    background: #1e293b;
    color: var(--text-dark);
    border-color: var(--border-color);
}
body.dark-mode .hero-title { color: var(--text-dark); }
body.dark-mode .feature-pill {
    background: #1e293b;
    color: var(--text-body);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
body.dark-mode .feature-pill:hover {
    border-color: var(--primary-blue);
    background: #22304a;
}
body.dark-mode .feature-pill i { color: var(--primary-blue); }
body.dark-mode .floating-card {
    background: #1e293b;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
body.dark-mode .floating-card .label { color: var(--text-muted); }
body.dark-mode .floating-card .value { color: var(--text-dark); }
body.dark-mode .avatar {
    background: #0f172a;
    color: var(--text-dark);
    border: 2px solid #1e293b;
}

/* --- Mall highlight / services / process / stats ---------------------- */
body.dark-mode .mall-highlight-wrapper {
    background: #111a2e;
}
body.dark-mode .category-card,
body.dark-mode .service-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}
body.dark-mode .service-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
body.dark-mode .category-card i { color: var(--primary-blue); }
body.dark-mode .category-card span { color: var(--text-dark); }

body.dark-mode .process {
    background: #0b1220;
}
body.dark-mode .step-icon-wrapper {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
body.dark-mode .step-icon-wrapper i { color: var(--primary-blue); }
body.dark-mode .process-step:not(:last-child)::after {
    background: var(--border-color);
}

/* Stats sections use `background: var(--primary-dark)` which is already
   very dark. Keep the white text but soften the stat labels. */
body.dark-mode .stats { background: #0a1220; }
body.dark-mode .stats .stat-item h3,
body.dark-mode .stats .stat-number { color: #fff; }
body.dark-mode .stats .stat-label { color: rgba(255, 255, 255, 0.75); }

/* --- Trending / promo / CTA cards on index ---------------------------- */
body.dark-mode .trending-products-section { background: transparent; }
body.dark-mode .promo-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}
body.dark-mode .shop-cta-box,
body.dark-mode .cta {
    background: linear-gradient(135deg, #0b1220 0%, #111a2e 100%);
    color: var(--text-dark);
}
body.dark-mode .cta h2,
body.dark-mode .cta-content h2 { color: #fff; }
body.dark-mode .cta p,
body.dark-mode .cta-content p { color: rgba(255, 255, 255, 0.85); }

/* --- Shop-local / buy-for-me / benefits-grid (index) ------------------ */
body.dark-mode .shop-local-section,
body.dark-mode .buy-for-me,
body.dark-mode .benefits-section { background: transparent; }
body.dark-mode .benefit-card,
body.dark-mode .feature-item .icon-circle {
    background: var(--card-bg);
    border-color: var(--border-color);
}
body.dark-mode .feature-item h5 { color: var(--text-dark); }
body.dark-mode .feature-item p { color: var(--text-muted); }
body.dark-mode .step-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
}
body.dark-mode .step-item .step-content h4 { color: var(--text-dark); }
body.dark-mode .step-item .step-content p { color: var(--text-muted); }
body.dark-mode .step-item .step-number {
    background: var(--primary-blue);
    color: #fff;
}
body.dark-mode .platform-logo-mini {
    background: var(--card-bg);
    color: var(--text-body);
    border: 1px solid var(--border-color);
}

/* "We Buy For You" panel (index).
   `.buy-for-me-wrapper` has a hard-coded white background that wraps both
   the blue procurement text (left) and the white steps panel (right). In
   dark mode, flip the outer wrapper + the steps panel to the card surface
   so the whole panel reads as one dark, unified card. */
body.dark-mode .buy-for-me-wrapper {
    background: var(--card-bg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
}
body.dark-mode .procurement-text {
    background: #0a1220;
}
body.dark-mode .procurement-steps {
    background: #111a2e;
}
body.dark-mode .procurement-steps h3,
body.dark-mode .procurement-steps h4,
body.dark-mode .procurement-steps .step-content h4 { color: var(--text-dark); }
body.dark-mode .procurement-steps .step-content p,
body.dark-mode .procurement-steps p.text-muted { color: var(--text-muted); }

/* --- Affiliate promo strip on index -----------------------------------
   Structure is:
      .affiliate-promo-section > .affiliate-promo-wrapper (white card) >
          .affiliate-promo-content (left text + right stat cards)
   Flip the white wrapper to a dark card and make sure its heading
   (`.display-3` uses --primary-dark → effectively invisible in dark mode)
   and the benefit-item h4 titles stay legible. */
body.dark-mode .affiliate-promo-section {
    background: linear-gradient(135deg, #0b1220 0%, #111a2e 100%);
    color: var(--text-dark);
}
body.dark-mode .affiliate-promo-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
body.dark-mode .affiliate-promo-text .display-3,
body.dark-mode .affiliate-promo-text h2 { color: var(--text-dark); }
body.dark-mode .affiliate-promo-text .lead,
body.dark-mode .affiliate-promo-text .lead.text-muted { color: var(--text-body); }
body.dark-mode .affiliate-benefit-item h4 { color: var(--text-dark); }
body.dark-mode .affiliate-benefit-item p { color: var(--text-muted); }
body.dark-mode .affiliate-benefit-item i { color: var(--primary-blue); }

/* Keep the stat showcase cards blue — they read as a strong CTA block
   against the dark card surface. (Previously forced to a translucent
   white which rendered invisible against the white wrapper.) */
body.dark-mode .stat-showcase-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2458c9 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
body.dark-mode .stat-showcase-card .stat-icon,
body.dark-mode .stat-showcase-card .stat-number,
body.dark-mode .stat-showcase-card .stat-label { color: #fff; }

/* --- About page ------------------------------------------------------- */
body.dark-mode .story-section,
body.dark-mode .values-section,
body.dark-mode .journey-section,
body.dark-mode .affiliate-about-cta { background: transparent; }

/* `.story-content` has `background: white` + a hard-coded `#1a202c`
   heading color defined in index.css. Flip both so "Our Story" is
   readable on the dark card surface. */
body.dark-mode .story-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
body.dark-mode .story-content h2 { color: var(--text-dark); }
body.dark-mode .story-content p { color: var(--text-muted); }

body.dark-mode .value-card {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
body.dark-mode .value-card h3 { color: var(--text-dark); }
body.dark-mode .value-card p { color: var(--text-muted); }
body.dark-mode .value-icon {
    background: rgba(77, 141, 255, 0.15);
    color: var(--primary-blue);
}

/* Journey timeline items + line */
body.dark-mode .journey-timeline { border-left-color: var(--border-color); }
body.dark-mode .journey-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
body.dark-mode .journey-item h3,
body.dark-mode .journey-item h4 { color: var(--text-dark); }
body.dark-mode .journey-item p { color: var(--text-muted); }
body.dark-mode .journey-item::before {
    background: var(--card-bg);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 1px var(--border-color);
}
body.dark-mode .journey-item:hover::before { background: var(--primary-blue); }
body.dark-mode .journey-year { color: var(--primary-blue); }

/* About & contact hero sections keep their colorful animated gradient;
   only soften the grid / glow overlays so they aren't over-bright. */
body.dark-mode .about-hero,
body.dark-mode .contact-hero {
    /* Subtle dim so the rainbow gradient fits the dark surface. */
    filter: saturate(0.85) brightness(0.9);
}

/* --- Contact page ----------------------------------------------------- */
body.dark-mode .contact-main-section {
    background: transparent;
}
body.dark-mode .contact-block {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
body.dark-mode .contact-block h4 { color: var(--text-dark); }
body.dark-mode .contact-block p { color: var(--text-muted); }
body.dark-mode .contact-block a { color: var(--primary-blue); }
body.dark-mode .contact-block h4::before {
    background: var(--primary-blue);
    color: #fff;
}

body.dark-mode .contact-form-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
body.dark-mode .contact-form-card h3 { color: var(--text-dark); }
body.dark-mode .form-group label { color: var(--text-dark); }
body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
    background: #0f172a;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}
body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
    background: #0b1220;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(77, 141, 255, 0.18);
}

/* Contact page's submit button stays black-on-white in light mode;
   in dark mode, use a blue pill instead of the solid-black pill so it is
   legible against the dark card. */
body.dark-mode .contact-form-card .btn-primary {
    background: var(--primary-blue);
    color: #fff;
}
body.dark-mode .contact-form-card .btn-primary:hover {
    background: #2d6ae0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

/* Lower CTA card on contact / get-quote pages — already dark, tweak dots. */
body.dark-mode .contact-lower-cta-section {
    background: transparent;
}
body.dark-mode .lower-cta-card {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}
body.dark-mode .lower-cta-card .phone-number,
body.dark-mode .lower-cta-card .email-address {
    background: var(--card-bg);
    color: var(--text-dark);
}
body.dark-mode .lower-cta-card .phone-number i,
body.dark-mode .lower-cta-card .email-address i {
    color: var(--primary-blue);
}

/* Contact FAQ section inline style bg (#f8f9fa). */
body.dark-mode .faq-section[style*="background"] {
    background: transparent !important;
}
body.dark-mode .faq-container .faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-body);
}
body.dark-mode .faq-container .faq-item h4,
body.dark-mode .faq-container .faq-item strong { color: var(--text-dark); }
body.dark-mode .faq-container .faq-item p { color: var(--text-muted); }

/* --- Get Quote page (shipping calculator) ----------------------------- */
body.dark-mode .shipping-calculator-section {
    background: transparent;
}
body.dark-mode .calculator-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
body.dark-mode .calculator-tabs {
    background: #0f172a;
    border-bottom-color: var(--border-color);
}
body.dark-mode .calculator-tab-btn {
    color: var(--text-muted);
}
body.dark-mode .calculator-tab-btn.active {
    background: var(--card-bg);
    color: var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
body.dark-mode .calculator-result {
    background: rgba(77, 141, 255, 0.12);
    border: 1px solid rgba(77, 141, 255, 0.35);
    color: var(--text-body);
}
body.dark-mode .calculator-result h4 { color: #7bb3ff; }
body.dark-mode .calculator-disclaimer { color: var(--text-muted); }
body.dark-mode .form-group-checkbox label { color: var(--text-body); }

/* --- Affiliate apply page --------------------------------------------- */
body.dark-mode .affiliate-hero-section {
    background: linear-gradient(180deg, #0b1220 0%, #111a2e 100%);
}
body.dark-mode .badge-pill {
    background: rgba(77, 141, 255, 0.15);
    color: var(--primary-blue);
}
body.dark-mode .affiliate-stats-grid .stat-item,
body.dark-mode .stat-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
/* The "Why Choose C2G" stat tiles on index have no base padding
   (they inherit `text-align: center` only), so without this the dark
   shell hugs the content with no breathing room. */
body.dark-mode .stats .stat-item {
    padding: 32px 20px;
}
body.dark-mode .stat-item .stat-value,
body.dark-mode .stat-item .stat-number { color: var(--text-dark); }
body.dark-mode .stat-item .stat-label { color: var(--text-muted); }
body.dark-mode .stat-icon { color: var(--primary-blue); }

body.dark-mode .benefits-section { background: transparent; }
body.dark-mode .benefit-card h3 { color: var(--text-dark); }
body.dark-mode .benefit-card p { color: var(--text-muted); }

body.dark-mode .application-form-section {
    background: #0b1220;
}
body.dark-mode .form-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
body.dark-mode .form-header h2 { color: var(--text-dark); }
body.dark-mode .form-header p,
body.dark-mode .form-text,
body.dark-mode .field-help-text { color: var(--text-muted); }

body.dark-mode .social-account-card {
    background: #0f172a;
    border-color: var(--border-color);
}
body.dark-mode .social-card-header { border-bottom-color: var(--border-color); }
body.dark-mode .social-card-title { color: var(--primary-blue); }

body.dark-mode .checkbox-container,
body.dark-mode .checkbox-container label { color: var(--text-body); }

body.dark-mode .faq-section-affiliate { background: transparent; }
body.dark-mode .faq-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}
body.dark-mode .faq-card h3 { color: var(--text-dark); }
body.dark-mode .faq-card p { color: var(--text-muted); }

/* CTA section on affiliate page keeps its blue gradient — OK as is. */
body.dark-mode .cta-section-affiliate {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2d6ae0 100%);
}
body.dark-mode .cta-section-affiliate .cta-content h2,
body.dark-mode .cta-section-affiliate .cta-content p { color: #fff; }
body.dark-mode .btn-cta {
    background: #fff;
    color: var(--primary-blue);
}

/* --- Maintenance page ------------------------------------------------- */
body.dark-mode .maintenance-container h1 { color: var(--text-dark); }
body.dark-mode .maintenance-container p { color: var(--text-muted); }
body.dark-mode .maintenance-icon { color: var(--primary-blue); }
body.dark-mode .admin-access-link { color: var(--text-muted); }
body.dark-mode .admin-access-link:hover { color: var(--primary-blue); }

/* --- Shared message / status boxes ------------------------------------ */
body.dark-mode .form-message.success,
body.dark-mode .auth-message.success {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.35);
}
body.dark-mode .form-message.error,
body.dark-mode .auth-message.error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

/* --- Back-to-top + floating WhatsApp button --------------------------- */
body.dark-mode .back-to-top-btn {
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
body.dark-mode .back-to-top-btn:hover {
    background: var(--primary-blue);
    color: #fff;
}
/* WhatsApp float stays brand-green — just beef up the shadow. */
body.dark-mode .whatsapp-float {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

/* --- Floating 3D bubbles inside hero sections ------------------------- */
body.dark-mode .about-hero .floating-3d-element,
body.dark-mode .contact-hero .floating-3d-element {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* --- Public "Track Your Order" widget --------------------------------
   Rendered by js/order-tracking.js with inline styles (background: white,
   light gradient section bg, hard-coded --text-dark colors). Inline styles
   beat external CSS on specificity, so we need `!important` overrides to
   flip the whole widget into dark mode on index.html and get-quote.html. */
body.dark-mode .order-tracking-section {
    background: linear-gradient(135deg, #0b1220 0%, #111a2e 100%) !important;
}
body.dark-mode .order-tracking-section .tracking-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}
body.dark-mode .order-tracking-section .tracking-title {
    color: var(--text-dark) !important;
}
body.dark-mode .order-tracking-section .tracking-title i,
body.dark-mode .order-tracking-section .tracking-card i.fa-search-location {
    color: var(--primary-blue) !important;
}
body.dark-mode .order-tracking-section .tracking-description {
    color: var(--text-muted) !important;
}
body.dark-mode #tracking-input {
    background: #0f172a !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode #tracking-input::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}
body.dark-mode #tracking-input:focus {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.18) !important;
}
/* Timeline connector line sitting inside the result card. */
body.dark-mode .tracking-timeline .timeline-line {
    background: rgba(255, 255, 255, 0.08) !important;
}
