/*
 * Brand theme for product listing pages.
 *
 *   Obataimu   white page, black text and icons   html.oba-brand-obataimu
 *   Yogataimu  black page, white text and icons   html.oba-brand-yogataimu
 *
 * The class on <html> is set before the page paints by a small script in the
 * head (function/oba-menu.php): the brand in the URL, else a product's own
 * brand, else the last brand this browser used, else Obataimu.
 * body.oba-listing marks the listing templates.
 *
 * The older stylesheets colour these pages with long, !important selectors,
 * so the overrides here are !important too.
 */

html.oba-brand-obataimu {
  --oba-page-bg: var(--oba-white, #fff);
  --oba-page-fg: var(--oba-black, #000);
}

html.oba-brand-yogataimu {
  --oba-page-bg: var(--oba-black, #000);
  --oba-page-fg: var(--oba-white, #fff);
}

/* ---------- Page and header background ---------- */

body.oba-listing,
body.oba-listing .pos-f-t,
body.oba-listing .pos-f-t.red-background,
body.oba-listing .navbar,
body.oba-listing #page,
body.oba-listing #content.site-content {
  background-color: var(--oba-page-bg, #fff) !important;
}

/* ---------- Text ---------- */

body.oba-listing #page,
body.oba-listing #page :is(h1, h2, h3, h4, h5, h6, p, a, span, li, bdi, label, div),
body.oba-listing #my-repeater-show-more-link,
body.oba-listing #back-to-top-link,
body.oba-listing .back-header {
  color: var(--oba-page-fg, #000) !important;
}

body.oba-listing #page a:visited {
  color: var(--oba-page-fg, #000) !important;
}

/*
 * Headings in the font of the menu items, Helvetica Black:
 *   - listing pages: "utilitarian comfort. (shop by product)"
 *   - product pages: the product name and the line under it
 *     ("kaziranga sunrise" / "(unconventional suit)")
 * The wording, its case, the size and the line spacing stay as they were.
 */
body.oba-listing .listing-page-final p.paragraph,
body.oba-product #page #content h1.product_title,
body.oba-product #page #content .packof-text {
  font-family: var(--oba-font-title, 'Helvetica Black', 'Helvetica Neue', Helvetica, Arial, sans-serif) !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em !important;
}

/* The product name used to be italic: Helvetica Black has no italic, so it is set upright like the menu. */
body.oba-product #page #content h1.product_title {
  font-style: normal !important;
}

/* The slanted dividers between the "shop by" links, and their underline. */
body.oba-listing .shop-by-dropdown-links li {
  border-right-color: var(--oba-page-fg, #000) !important;
}

body.oba-listing .shop-by-dropdown-links li:last-child {
  border-right-color: transparent !important;
}

body.oba-listing .shop-by-dropdown-links ul li a:hover,
body.oba-listing .shop-by-dropdown-links ul li a.active {
  border-bottom-color: var(--oba-page-fg, #000) !important;
}

/* ---------- Header icons ---------- */

/* Cart counter box. */
body.oba-listing .cart-button-header .cart-img-header,
body.oba-listing .cart-img-header {
  border-color: var(--oba-page-fg, #000) !important;
}

body.oba-listing .cart-number-header {
  color: var(--oba-page-fg, #000) !important;
}

/* Obataimu: the black triangle, search and menu icons. */
html.oba-brand-obataimu body.oba-listing .navbar .black-logo {
  display: block !important;
}

html.oba-brand-obataimu body.oba-listing .navbar .white-logo {
  display: none !important;
}

/* Yogataimu: their white versions. */
html.oba-brand-yogataimu body.oba-listing .navbar .black-logo {
  display: none !important;
}

html.oba-brand-yogataimu body.oba-listing .navbar .white-logo {
  display: block !important;
}

/* Black arrow artwork ("load more", "back to top") turns white on black. */
html.oba-brand-yogataimu body.oba-listing .load-more-styles,
html.oba-brand-yogataimu body.oba-listing .arrow-img img {
  filter: invert(1);
}

/* =========================================================================
 * Product pages (body.oba-product)
 *
 * Obataimu: the product page is already white with black type, so nothing
 * changes. Yogataimu: the same page on black.
 *
 * Pop-ups (.modal) keep their own colours. Colour swatches keep theirs too.
 * ====================================================================== */

/* ---------- Page and header ---------- */

html.oba-brand-yogataimu body.oba-product,
html.oba-brand-yogataimu body.oba-product .pos-f-t,
html.oba-brand-yogataimu body.oba-product .pos-f-t.red-background,
html.oba-brand-yogataimu body.oba-product .navbar,
html.oba-brand-yogataimu body.oba-product #page,
html.oba-brand-yogataimu body.oba-product #content.site-content {
  background-color: var(--oba-page-bg, #000) !important;
}

/* Search and menu icons only: a product page shows "BACK" in place of the triangle. */
html.oba-brand-yogataimu body.oba-product .navbar .right-nav .black-logo {
  display: none !important;
}

html.oba-brand-yogataimu body.oba-product .navbar .right-nav .white-logo {
  display: block !important;
}

html.oba-brand-yogataimu body.oba-product .navbar .back-header,
html.oba-brand-yogataimu body.oba-product .cart-number-header {
  color: var(--oba-page-fg, #fff) !important;
}

html.oba-brand-yogataimu body.oba-product .cart-button-header .cart-img-header,
html.oba-brand-yogataimu body.oba-product .cart-img-header {
  border-color: var(--oba-page-fg, #fff) !important;
}

/*
 * ---------- Buttons and option controls ----------
 * The black pills (buttons, the he / she choice, the "pick" drop-down, the
 * quantity stepper) and the outlined size circles are flipped as a whole:
 * black pills become white pills with black type, outlines become white.
 * Flipping them keeps every state the older stylesheets define (selected,
 * hover, disabled) without restating each one.
 */
html.oba-brand-yogataimu body.oba-product #page :is(.wapf-label-text, .btn, .wapf-input, .qib-container):not(.modal *) {
  filter: invert(1);
}

/*
 * The outlined size circles have no colour of their own: they take it from
 * their label. Keep that label dark so the flip above turns the text white
 * (it would otherwise be white already and flip to black).
 */
html.oba-brand-yogataimu body.oba-product #page .wapf-input-label:not(.modal *) {
  color: #1a1818 !important;
}

/* The colour swatches: their thin edge and the ring around the selected one
   are dark in the old theme, white here. */
html.oba-brand-yogataimu body.oba-product #page .control_indicator,
html.oba-brand-yogataimu body.oba-product #page .control_indicator::after {
  border-color: var(--oba-page-fg, #fff) !important;
}

/* ---------- Text and lines ---------- */

html.oba-brand-yogataimu body.oba-product #page,
html.oba-brand-yogataimu body.oba-product #page :is(h1, h2, h3, h4, h5, h6, p, span, div, a, li, bdi, b, strong, em, i, small, label, td, th):not(.modal, .modal *, .wapf-input-label, .wapf-label-text, .wapf-label-text *, .btn, .btn *, .wapf-input, .wapf-input *, .qib-container, .qib-container *) {
  color: var(--oba-page-fg, #fff) !important;
}

html.oba-brand-yogataimu body.oba-product #page :is(div, section, table, tr, td, th, hr, img, ul, li, a, p, span):not(.modal, .modal *, .wapf-label-text, .wapf-label-text *, .btn, .btn *, .wapf-input, .wapf-input *, .qib-container, .qib-container *, .control_indicator) {
  border-color: var(--oba-page-fg, #fff) !important;
}
