/*
 * PROMO THEME - storefront colour overrides on top of the Cartzilla theme.
 *
 * Every accent colour in this file is a --zit-* token defined right below.
 * The active palette is chosen by <html data-zit-theme="..."> (set by
 * base.html from the "Site colour theme" field at /team/banner/strip/), so a
 * seasonal switch is an admin change, not a CSS edit or a deploy.
 *
 *   default      Zit amber  #FFA303
 *   blackfriday  Black Friday red #E10606 (the zit.ng wordmark red)
 *   christmas    Christmas green #0B7A3B
 *
 * Adding a palette: copy the blackfriday block, give it a new name, and add the
 * same name to THEME_CHOICES *and* APP_PALETTES in home/site_banner.py — the
 * second is what the mobile app paints with (it is served the colours, so a new
 * palette needs no app release). home/test_site_theme.py fails if a theme has
 * one and not the other, or if the app's accent drifts from --zit-accent here.
 *
 * Each token has one job, and the contrast it was chosen for:
 *   --zit-accent             fills: buttons, badges, bars, focus rings
 *   --zit-accent-hover       hover/pressed fill
 *   --zit-on-accent          text ON an accent fill (amber takes black, red white)
 *   --zit-accent-text        accent-coloured TEXT on white (>= 4.5:1)
 *   --zit-accent-text-hover  its hover
 *   --zit-accent-on-dark     accent text/links on the black header and footer
 *   --zit-accent-soft        lighter accent for text on dark (dark-mode emphasis)
 *   --zit-accent-subtle      pale tinted background
 *   --zit-accent-subtle-2    second, slightly stronger tint
 *   --zit-accent-border-subtle  pale border
 * Dark-mode variants (*-dm) are used inside [data-bs-theme=dark].
 *
 * TO DISABLE: Remove the inline_style/link for this file in base.html,
 * product_new.html and the blog templates. Cartzilla's own defaults are
 *   --cz-primary #f55266, --cz-warning #fc9231, --cz-success #33b36b, --cz-info #2f6ed5
 */

:root, [data-bs-theme=light], [data-bs-theme=dark] {
    --zit-accent: #FFA303;
    --zit-accent-rgb: 255, 163, 3;
    --zit-accent-hover: #cc8200;
    --zit-accent-hover-rgb: 204, 130, 0;
    --zit-on-accent: #000000;
    /* #cc8200 was only 3.11:1 on white and failed WCAG AA everywhere a plain
       link sits on the page background — Lighthouse caught it on the homepage
       category tiles. #996200 is the same gold at 5.12:1; the hover is
       #7a4e00 (7.2:1) so it still darkens on hover. */
    --zit-accent-text: #996200;
    --zit-accent-text-rgb: 153, 98, 0;
    --zit-accent-text-hover: #7a4e00;
    --zit-accent-text-hover-rgb: 122, 78, 0;
    --zit-accent-on-dark: #FFA303;            /* 9.65:1 on #0e0e0e */
    --zit-accent-soft: #ffcc66;
    --zit-accent-soft-rgb: 255, 204, 102;
    --zit-accent-subtle: #fff4e0;
    --zit-accent-subtle-2: #ffe8b8;
    --zit-accent-border-subtle: #ffcc66;
    --zit-accent-subtle-dm: #3d2e00;
    --zit-accent-subtle-2-dm: #4a3800;
    --zit-accent-border-subtle-dm: #996200;
    --zit-accent-emphasis-dm: #ffcc66;
    --zit-accent-emphasis-2-dm: #ffe8b8;
}

/* Black Friday red. Chosen to the same contrast jobs as the amber above:
   white on #E10606 4.96:1 and on #B00404 7.33:1; #C40505 text on white 6.23:1;
   #FF5A5A on the #0e0e0e header 6.31:1. */
html[data-zit-theme=blackfriday],
html[data-zit-theme=blackfriday] [data-bs-theme=light],
html[data-zit-theme=blackfriday] [data-bs-theme=dark] {
    --zit-accent: #E10606;
    --zit-accent-rgb: 225, 6, 6;
    --zit-accent-hover: #B00404;
    --zit-accent-hover-rgb: 176, 4, 4;
    --zit-on-accent: #ffffff;
    --zit-accent-text: #C40505;
    --zit-accent-text-rgb: 196, 5, 5;
    --zit-accent-text-hover: #9A0404;
    --zit-accent-text-hover-rgb: 154, 4, 4;
    --zit-accent-on-dark: #FF5A5A;
    --zit-accent-soft: #FF8A8A;
    --zit-accent-soft-rgb: 255, 138, 138;
    --zit-accent-subtle: #FDECEC;
    --zit-accent-subtle-2: #F9D4D4;
    --zit-accent-border-subtle: #F5A3A3;
    --zit-accent-subtle-dm: #3d0b0b;
    --zit-accent-subtle-2-dm: #4a1010;
    --zit-accent-border-subtle-dm: #9A0404;
    --zit-accent-emphasis-dm: #FF8A8A;
    --zit-accent-emphasis-2-dm: #FFC2C2;
}

/* Christmas green. Same contrast jobs again: white on #0B7A3B 5.44:1 and on
   #075C2B 8.16:1; #0A6B31 text on white 6.64:1; #4ADE80 on the #0e0e0e header
   11.08:1. Everything that takes the accent goes green with it, the "Sale"
   flag on the cards included. */
html[data-zit-theme=christmas],
html[data-zit-theme=christmas] [data-bs-theme=light],
html[data-zit-theme=christmas] [data-bs-theme=dark] {
    --zit-accent: #0B7A3B;
    --zit-accent-rgb: 11, 122, 59;
    --zit-accent-hover: #075C2B;
    --zit-accent-hover-rgb: 7, 92, 43;
    --zit-on-accent: #ffffff;
    --zit-accent-text: #0A6B31;
    --zit-accent-text-rgb: 10, 107, 49;
    --zit-accent-text-hover: #064D22;
    --zit-accent-text-hover-rgb: 6, 77, 34;
    --zit-accent-on-dark: #4ADE80;
    --zit-accent-soft: #86EFAC;
    --zit-accent-soft-rgb: 134, 239, 172;
    --zit-accent-subtle: #E9F7EE;
    --zit-accent-subtle-2: #CFEEDB;
    --zit-accent-border-subtle: #9BD9B4;
    --zit-accent-subtle-dm: #0B2E1A;
    --zit-accent-subtle-2-dm: #103D23;
    --zit-accent-border-subtle-dm: #075C2B;
    --zit-accent-emphasis-dm: #86EFAC;
    --zit-accent-emphasis-2-dm: #BBF7D0;
}

:root, [data-bs-theme=light] {
    --cz-primary: var(--zit-accent) !important;
    --cz-primary-rgb: var(--zit-accent-rgb) !important;

    --cz-warning: var(--zit-accent) !important;
    --cz-warning-rgb: var(--zit-accent-rgb) !important;

    --cz-info: var(--zit-accent-hover) !important;
    --cz-info-rgb: var(--zit-accent-hover-rgb) !important;

    --cz-primary-text-emphasis: var(--zit-accent-hover) !important;
    --cz-warning-text-emphasis: var(--zit-accent-hover) !important;
    --cz-info-text-emphasis: var(--zit-accent-text) !important;

    --cz-primary-bg-subtle: var(--zit-accent-subtle) !important;
    --cz-warning-bg-subtle: var(--zit-accent-subtle) !important;
    --cz-info-bg-subtle: var(--zit-accent-subtle-2) !important;

    --cz-primary-border-subtle: var(--zit-accent-border-subtle) !important;
    --cz-warning-border-subtle: var(--zit-accent-border-subtle) !important;
    --cz-info-border-subtle: var(--zit-accent) !important;

    --cz-link-color: var(--zit-accent-text) !important;
    --cz-link-hover-color: var(--zit-accent-text-hover) !important;
    --cz-link-color-rgb: var(--zit-accent-text-rgb) !important;
    --cz-link-hover-color-rgb: var(--zit-accent-text-hover-rgb) !important;
}

/* Dark theme overrides */
[data-bs-theme=dark] {
    --cz-primary-text-emphasis: var(--zit-accent-emphasis-dm) !important;
    --cz-warning-text-emphasis: var(--zit-accent-emphasis-dm) !important;
    --cz-info-text-emphasis: var(--zit-accent-emphasis-2-dm) !important;

    --cz-primary-bg-subtle: var(--zit-accent-subtle-dm) !important;
    --cz-warning-bg-subtle: var(--zit-accent-subtle-dm) !important;
    --cz-info-bg-subtle: var(--zit-accent-subtle-2-dm) !important;

    --cz-primary-border-subtle: var(--zit-accent-border-subtle-dm) !important;
    --cz-warning-border-subtle: var(--zit-accent-border-subtle-dm) !important;
    --cz-info-border-subtle: var(--zit-accent-hover) !important;

    --cz-link-color: var(--zit-accent-soft) !important;
    --cz-link-hover-color: var(--zit-accent) !important;
    --cz-link-color-rgb: var(--zit-accent-soft-rgb) !important;
    --cz-link-hover-color-rgb: var(--zit-accent-rgb) !important;
}

/* Specific button overrides */
.btn-warning {
    background-color: var(--zit-accent) !important;
    border-color: var(--zit-accent) !important;
    color: var(--zit-on-accent) !important;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background-color: var(--zit-accent-hover) !important;
    border-color: var(--zit-accent-hover) !important;
    color: var(--zit-on-accent) !important;
}

.btn-outline-warning {
    color: var(--zit-accent-text) !important;
    border-color: var(--zit-accent) !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    background-color: var(--zit-accent) !important;
    border-color: var(--zit-accent) !important;
    color: var(--zit-on-accent) !important;
}

/* Primary button overrides — a solid accent fill, as on the /lg/ page.
   (Was black with amber text; the button shape lives in zit-ui.css.) */
.btn-primary {
    background-color: var(--zit-accent) !important;
    border-color: var(--zit-accent) !important;
    color: var(--zit-on-accent) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--zit-accent-hover) !important;
    border-color: var(--zit-accent-hover) !important;
    color: var(--zit-on-accent) !important;
}

.btn-outline-primary {
    color: #0e0e0e !important;
    border-color: #0e0e0e !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #0e0e0e !important;
    border-color: #0e0e0e !important;
    color: #ffffff !important;
}

/* Navbar and header overrides */
.navbar-warning,
.bg-warning {
    background-color: var(--zit-accent) !important;
    color: var(--zit-on-accent) !important;
}

/* Don't override text-warning and text-primary on dark backgrounds */
.bg-black .text-warning,
.navbar.bg-black .text-warning {
    color: var(--zit-accent-on-dark) !important;
}

/* Accent text on light backgrounds uses the AA-safe text shade. */
.bg-light .text-warning,
.text-warning:not(.bg-black *, .navbar.bg-black *) {
    color: var(--zit-accent-text) !important;
}

.bg-light .text-primary,
.text-primary:not(.bg-black *, .navbar.bg-black *, .dropdown-menu *) {
    color: var(--zit-accent-text) !important;
}

/* Dropdown menu text-primary should be dark for readability */
.dropdown-menu .text-primary {
    color: var(--zit-accent-text) !important;
}

/* Alert overrides */
.alert-warning {
    background-color: var(--zit-accent-subtle) !important;
    border-color: var(--zit-accent-border-subtle) !important;
    color: var(--zit-accent-text) !important;
}

.alert-primary {
    background-color: var(--zit-accent-subtle) !important;
    border-color: var(--zit-accent) !important;
    color: var(--zit-accent-text) !important;
}

/* Badge overrides */
.badge.bg-warning,
.badge.bg-primary {
    background-color: var(--zit-accent) !important;
    color: var(--zit-on-accent) !important;
}

/* .text-bg-warning is the theme's own utility and it hard-codes white text.
   That was fine against the stock #fc9231, and is 2.0:1 against this promo's
   lighter #FFA303 — same reasoning as .badge.bg-warning right above. The
   token flips to white for the red theme. */
.text-bg-warning {
    color: var(--zit-on-accent) !important;
}

/* White on the theme green (#33b36b) is 2.69:1. #1f7a4d is the same green,
   two steps darker, at 5.32:1 against the badge's white text. */
.badge.bg-success {
    background-color: #1f7a4d !important;
    color: #ffffff !important;
}

/* Border overrides */
.border-warning {
    border-color: var(--zit-accent) !important;
}

.border-primary {
    border-color: #000000 !important;
}

/* Progress bar overrides */
.progress-bar,
.progress-bar-warning {
    background-color: var(--zit-accent) !important;
}

/* Form control focus overrides */
.form-control:focus,
.form-select:focus {
    border-color: var(--zit-accent) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--zit-accent-rgb), 0.25) !important;
}

/* Dropdown menu items should be dark for readability */
.dropdown-menu a,
.dropdown-item,
.dropdown-menu .nav-link {
    color: #333333 !important;
}

.dropdown-menu a:hover,
.dropdown-item:hover,
.dropdown-menu .nav-link:hover {
    color: var(--zit-on-accent) !important;
    background-color: var(--zit-accent) !important;
}

/* Navigation bar links - keep them visible based on their background */
.navbar .nav-link,
.navbar .dropdown-toggle {
    /* Don't override - let original styling work */
}

/* Modal menu with light background needs dark text */
.modal-body.bg-light .nav-link,
.modal-body.bg-light a,
.modal-content.bg-light .nav-link,
.modal-content.bg-light a,
.bg-light .nav-link,
.list-group-item.bg-light .nav-link,
.list-group.bg-light .nav-link,
.list-group-item.bg-light a {
    color: #333333 !important;
}

.modal-body.bg-light .nav-link:hover,
.modal-body.bg-light a:hover,
.modal-content.bg-light a:hover,
.modal-content.bg-light .nav-link:hover,
.bg-light .nav-link:hover,
.list-group-item.bg-light .nav-link:hover,
.list-group.bg-light .nav-link:hover,
.list-group-item.bg-light a:hover {
    color: var(--zit-accent-text) !important;
}

/* Product links, breadcrumb links, card links */
.product-card a,
.breadcrumb a,
.card a:not(.btn) {
    color: #000000 !important;
}

.product-card a:hover,
.breadcrumb a:hover,
.card a:not(.btn):hover {
    color: var(--zit-accent-text) !important;
}

/* Footer links - accent on the dark background */
.footer a {
    color: var(--zit-accent-on-dark) !important;
}

.footer a:hover {
    color: var(--zit-accent-soft) !important;
}

/* Toast overrides */
.toast-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Note: Scrolling banner animation is now in base.css (.promo-banner-text) */

/* Cart and product specific overrides */
.price-text,
.product-price {
    color: #000000 !important;
}

/* Rating stars stay gold in every theme — they are ratings, not brand
   accent, and a red star reads as a warning. The cards mark them up as
   .ci-star-* .text-warning, and .text-warning above is more specific (its
   :not() counts as two more classes), so these repeat that :not() to outrank it. #C27F00 is
   3.32:1 on white, clearing the 3:1 non-text contrast bar. */
.ci-star-filled,
.ci-star-filled.text-warning:not(.bg-black *, .navbar.bg-black *),
.ci-star-half.text-warning:not(.bg-black *, .navbar.bg-black *),
.ci-star.text-warning:not(.bg-black *, .navbar.bg-black *) {
    color: #C27F00 !important;
}

/* List group overrides */
.list-group-item.active {
    background-color: #000000 !important;
    border-color: var(--zit-accent) !important;
    color: var(--zit-accent-on-dark) !important;
}

/* Navigation menu consistency fixes */
.navbar.bg-black .nav-link {
    color: #ffffff !important;
}

.navbar.bg-black .nav-link:hover,
.navbar.bg-black .nav-link:focus {
    color: var(--zit-accent-on-dark) !important;
}

/* Keep the text-light class working properly */
.navbar.bg-black .text-light {
    color: #ffffff !important;
}

/* Ensure dropdown links in the black navbar work properly */
.navbar.bg-black .dropdown-menu .dropdown-item {
    color: #333333 !important;
}

.navbar.bg-black .dropdown-menu .dropdown-item:hover {
    background-color: var(--zit-accent) !important;
    color: var(--zit-on-accent) !important;
}

/* Override any links in the black navigation bar - but NOT in modals */
.navbar.bg-black > .container a,
.navbar.bg-black > div:not(.modal) a {
    color: #ffffff !important;
}

.navbar.bg-black > .container a:hover,
.navbar.bg-black > div:not(.modal) a:hover {
    color: var(--zit-accent-on-dark) !important;
}

/* Info box override - black and gold radial gradient */
.info-box {
    background: radial-gradient(circle, #1a1a1a, #000000, #0000) !important;
}

/* IMPORTANT: Modal inside navbar must have dark text on light background */
.navbar .modal .bg-light a,
.navbar .modal .bg-light .nav-link,
.navbar .modal-content.bg-light a,
.navbar .modal-content.bg-light .nav-link,
.navbar .modal-body.bg-light a,
.navbar .modal-body.bg-light .nav-link,
.modal .list-group-item.bg-light a,
.modal .list-group-item.bg-light .nav-link {
    color: #333333 !important;
}

.navbar .modal .bg-light a:hover,
.navbar .modal .bg-light .nav-link:hover,
.navbar .modal-content.bg-light a:hover,
.navbar .modal-content.bg-light .nav-link:hover,
.navbar .modal-body.bg-light a:hover,
.navbar .modal-body.bg-light .nav-link:hover,
.modal .list-group-item.bg-light a:hover,
.modal .list-group-item.bg-light .nav-link:hover {
    color: var(--zit-accent-text) !important;
}

/* ============================================================
   Site chrome — black header/footer (Jul 2026)
   The black chrome introduced on the LG storefront (/brands/lg/)
   promoted site-wide: the amber top bar and the gray footer go
   near-black, with the logo/hamburger inverted to white.
   Dropdown menus and modals inside the header keep their own
   light styling (hence the :not(...) guards).
   ============================================================ */
#topnav.bg-warning,
#topnav.navbar-warning {
    background-color: #0e0e0e !important;
    color: #ffffff !important;
}

#topnav a:not(.dropdown-menu *, .modal *),
#topnav .nav-link:not(.dropdown-menu *, .modal *),
#topnav .text-dark:not(.dropdown-menu *, .modal *),
#topnav .text-black:not(.dropdown-menu *, .modal *) {
    color: #ffffff !important;
}

/* Accents inside the black bar keep the bright brand tone
   (the global .text-warning rule darkens them for light bgs) */
#topnav .text-warning {
    color: var(--zit-accent-on-dark) !important;
}

/* Mobile header rows */
header .navbar.bg-light {
    background-color: #0e0e0e !important;
}
header .navbar.bg-light a:not(.dropdown-menu *, .modal *),
header .navbar.bg-light .text-black:not(.dropdown-menu *, .modal *),
header .navbar.bg-light .text-dark:not(.dropdown-menu *, .modal *) {
    color: #ffffff !important;
}

/* Hamburger icon → white. Legacy dark logo assets are inverted too, so any
   page still referencing them renders white-on-black; the dedicated white
   logo (zit-logo-white.webp) needs no filter and must not get one (invert
   would turn its amber dots blue). */
header .navbar-toggler-icon,
header .navbar-brand img[src*="zitmall-bf"],
header .navbar-brand img[data-src*="zitmall-bf"],
header .navbar-brand img[src*="zit-orange-logo"] {
    filter: brightness(0) invert(1);
}

/* Footer matches the header black (was Bootstrap bg-dark gray) */
footer.footer {
    background-color: #0e0e0e !important;
}

/* ============================================================
   zit.ng wordmark (templates/includes/zit-wordmark.html)
   Inline SVG: "zit" white on the black header, ".ng" in the theme
   accent — amber normally, red for Black Friday. Never give it a
   CSS filter (the legacy invert rule above targets old <img> logos
   by filename and would turn the red cyan).
   ============================================================ */
.zit-wordmark { display: block; width: auto; }
.zit-wordmark .zw-zit { fill: #ffffff; }
.zit-wordmark .zw-ng { fill: var(--zit-accent); }
.zit-wordmark--header { height: 40px; }
.zit-wordmark--mobile { height: 30px; margin: 12px auto; }
.zit-wordmark--on-light .zw-zit { fill: #0e0e0e; }
.zit-wordmark-link { display: inline-block; line-height: 0; }

/* The desktop top bar (#topnav) is position:fixed and .nav-spacer (base.css)
   reserves 66px under it (the menu bar lands at 68px). The bar used to reach 66px only because the old
   49px logo <img> carried the .h1 class's bottom margin; with the 40px
   wordmark it came up ~13px short and the spacer showed as a white strip
   between it and the menu. Pin the bar to the spacer instead of relying on
   the logo's size. (Mobile uses its own header row, unaffected.) */
@media (min-width: 576px) {
    #topnav { min-height: 68px; }   /* the menu bar starts 2px below the 66px spacer */
}
