/* Night-mode refinements for the public storefront.
   Loaded after style.css so tokens and common surfaces stay consistent. */

[data-theme="dark"] {
    --cw-store-bg: #0b1228;
    --cw-store-surface: #1c2338;
    --cw-store-surface-2: #2a3148;
    --cw-store-title: #f3f5ff;
    --cw-store-muted: #b7c0d8;
    --cw-store-border: #3d4660;
    --cw-store-accent: #9eb0ff;
    --cw-store-accent-soft: #b5c4ff;
    --cw-store-chip-text: #f3f5ff;
    --cw-store-on-accent: #0d1430;
    color-scheme: dark;
    background-color: var(--cw-store-bg);
}

[data-theme="dark"] body,
[data-theme="dark"] #preloader {
    background-color: var(--cw-store-bg);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--cw-store-title);
}

[data-theme="dark"] p,
[data-theme="dark"] .text-muted,
[data-theme="dark"] small,
[data-theme="dark"] .page-heading h6 {
    color: var(--cw-store-muted);
}

[data-theme="dark"] .header-area,
[data-theme="dark"] .footer-nav-area,
[data-theme="dark"] .desktop-store-bar {
    background-color: var(--cw-store-surface);
    box-shadow: 0 1px 0 var(--cw-store-border);
}

[data-theme="dark"] .card,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .modal-content {
    background-color: var(--cw-store-surface);
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .qty-badge,
[data-theme="dark"] .cart-table .qty-text {
    background-color: var(--cw-store-surface-2) !important;
    border-color: var(--cw-store-border) !important;
    color: var(--cw-store-title) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--cw-store-muted);
    opacity: .85;
}

[data-theme="dark"] .btn-primary {
    background: var(--cw-store-accent-soft);
    border-color: transparent;
    color: var(--cw-store-on-accent);
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus {
    filter: brightness(1.06);
    color: var(--cw-store-on-accent);
}

[data-theme="dark"] .btn-outline-secondary,
[data-theme="dark"] .btn-outline-primary {
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
    background: transparent;
}

[data-theme="dark"] .alert-light {
    background: var(--cw-store-surface-2);
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .alert-success {
    background: rgba(56, 180, 120, .16);
    border-color: rgba(56, 180, 120, .3);
    color: #b8f0d2;
}

[data-theme="dark"] .alert-danger {
    background: rgba(227, 93, 106, .16);
    border-color: rgba(227, 93, 106, .3);
    color: #ffc2c9;
}

[data-theme="dark"] .alert-warning {
    background: rgba(240, 180, 41, .16);
    border-color: rgba(240, 180, 41, .3);
    color: #ffe09a;
}

[data-theme="dark"] .alert-info {
    background: rgba(90, 160, 230, .16);
    border-color: rgba(90, 160, 230, .3);
    color: #c5e2ff;
}

[data-theme="dark"] hr {
    border-top-color: var(--cw-store-border);
    opacity: 1;
}

[data-theme="dark"] .badge.bg-primary {
    background: var(--cw-store-accent-soft) !important;
    color: var(--cw-store-on-accent) !important;
}

[data-theme="dark"] .page-content-wrapper {
    color: var(--cw-store-title);
}

[data-theme="dark"] .suha-sidenav-wrapper.cw-site-menu {
    --menu-surface: var(--cw-store-surface);
    --menu-tint: var(--cw-store-surface-2);
    --menu-text: var(--cw-store-title);
    --menu-muted: var(--cw-store-muted);
    --menu-accent: var(--cw-store-accent-soft);
    --menu-border: var(--cw-store-border);
}

[data-theme="dark"] .cw-site-menu .sidenav-nav a:hover,
[data-theme="dark"] .cw-site-menu .sidenav-nav a:focus-visible {
    background: var(--cw-store-surface-2);
}

/* Soften the old bright white glows from legacy night CSS */
[data-theme="dark"] .header-area,
[data-theme="dark"] .footer-nav-area {
    -webkit-box-shadow: 0 1px 0 var(--cw-store-border);
    box-shadow: 0 1px 0 var(--cw-store-border);
}

[data-theme="dark"] .desktop-store-bar,
[data-theme="dark"] #headerArea {
    background-color: var(--cw-store-surface);
    border-color: var(--cw-store-border);
}

[data-theme="dark"] .desktop-store-brand,
[data-theme="dark"] .desktop-store-links a,
[data-theme="dark"] #headerArea .logo-wrapper a {
    color: var(--cw-store-title);
}

[data-theme="dark"] .back-button a {
    color: var(--cw-store-title);
}

[data-theme="dark"] .back-button a:hover,
[data-theme="dark"] .back-button a:focus-visible {
    color: var(--cw-store-accent-soft);
}

[data-theme="dark"] .suha-navbar-toggler span {
    background-color: var(--cw-store-title);
}

/* Cart / checkout shared surfaces */
[data-theme="dark"] .cart-page,
[data-theme="dark"] .checkout-page {
    --cart-ink: var(--cw-store-title);
    --cart-muted: var(--cw-store-muted);
    --cart-surface: var(--cw-store-surface);
    --cart-soft: var(--cw-store-surface-2);
    --cart-line: var(--cw-store-border);
    --cart-accent: var(--cw-store-accent-soft);
    --ck-ink: var(--cw-store-title);
    --ck-muted: var(--cw-store-muted);
    --ck-surface: var(--cw-store-surface);
    --ck-soft: var(--cw-store-surface-2);
    --ck-line: var(--cw-store-border);
    --ck-accent: var(--cw-store-accent-soft);
}

[data-theme="dark"] .featured-product-card,
[data-theme="dark"] .top-product-card,
[data-theme="dark"] .catagory-card {
    background-color: var(--cw-store-surface);
    border-color: var(--cw-store-border);
}

[data-theme="dark"] .section-heading h6,
[data-theme="dark"] .product-title,
[data-theme="dark"] .brand-name,
[data-theme="dark"] .cat-name {
    color: var(--cw-store-title);
}

[data-theme="dark"] .internet-connection-status {
    background: var(--cw-store-surface);
    color: var(--cw-store-title);
}

[data-theme="dark"] .btn-warning {
    background: #ffc107;
    border-color: transparent;
    color: #1a1408;
}

[data-theme="dark"] .btn-warning:hover,
[data-theme="dark"] .btn-warning:focus {
    background: #ffd454;
    border-color: transparent;
    color: #1a1408;
}

[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cw-store-title);
    --bs-table-border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--cw-store-surface);
    border-color: var(--cw-store-border);
}

[data-theme="dark"] .dropdown-item {
    color: var(--cw-store-title);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background: var(--cw-store-surface-2);
    color: var(--cw-store-title);
}

[data-theme="dark"] .top-search-form form .form-control {
    background: var(--cw-store-surface-2);
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .top-search-form form .form-control::placeholder {
    color: var(--cw-store-muted);
}

[data-theme="dark"] .top-search-form form button {
    color: var(--cw-store-title);
}

[data-theme="dark"] .footer-nav-area .footer-nav li a,
[data-theme="dark"] .footer-nav-area .footer-nav li a i {
    color: var(--cw-store-muted);
}

[data-theme="dark"] .footer-nav-area .footer-nav li a.active,
[data-theme="dark"] .footer-nav-area .footer-nav li a:hover,
[data-theme="dark"] .footer-nav-area .footer-nav li a:focus {
    color: var(--cw-store-accent-soft);
}

[data-theme="dark"] .product-description .sale-price,
[data-theme="dark"] .featured-product-card .product-description .sale-price,
[data-theme="dark"] .weekly-product-card .product-description .sale-price {
    color: var(--cw-store-accent-soft);
}

[data-theme="dark"] .product-description .product-title a,
[data-theme="dark"] .featured-product-card .product-description .product-title {
    color: var(--cw-store-title);
}

[data-theme="dark"] .card {
    background-color: var(--cw-store-surface);
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .modal-content {
    background-color: var(--cw-store-surface);
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--cw-store-border);
}

[data-theme="dark"] .list-group-item {
    background-color: var(--cw-store-surface);
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .pagination .page-link {
    background-color: var(--cw-store-surface);
    border-color: var(--cw-store-border);
    color: var(--cw-store-title);
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: var(--cw-store-accent-soft);
    border-color: var(--cw-store-accent-soft);
    color: var(--cw-store-on-accent);
}

[data-theme="dark"] .pagination .page-link:hover {
    background-color: var(--cw-store-surface-2);
    color: var(--cw-store-title);
}

[data-theme="dark"] .breadcrumb {
    background: transparent;
}

[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item a {
    color: var(--cw-store-muted);
}

[data-theme="dark"] .breadcrumb-item.active {
    color: var(--cw-store-title);
}

[data-theme="dark"] .google-maps-wrap {
    border-color: var(--cw-store-border);
    background: var(--cw-store-surface);
}

[data-theme="dark"] .btn-success {
    background: #2db87a;
    border-color: transparent;
    color: #04160e;
}

[data-theme="dark"] .btn-success:hover,
[data-theme="dark"] .btn-success:focus {
    background: #3dcd8d;
    border-color: transparent;
    color: #04160e;
}
