/* Cornerstone Scripts — Exo theme overlay, 2026-09-15.
   Load AFTER Exo styles.css and store.css. Keep Exo's scripts and templates.
   All selectors below target the legacy Exo markup, not the new Storefront builder. */
:root,
:root.color-scheme-light,
:root.color-scheme-dark,
:root.color-scheme-auto {
  color-scheme: light;
  --cs-paper: #e9eff6;
  --cs-sheet: #fbfcfe;
  --cs-tint: #eef3f8;
  --cs-ink: #12305a;
  --cs-muted: #4d627c;
  --cs-rule: #b9c7d6;
  --cs-blue: #2f6aa0;
  --cs-stamp: #b8441f;
  --cs-heading: "Barlow Condensed", "Arial Narrow", sans-serif;
  --cs-body: "Barlow", system-ui, sans-serif;
  --cs-mono: "JetBrains Mono", ui-monospace, monospace;
  --cs-shadow: 0 1px 0 rgb(18 48 90 / 8%), 0 12px 32px -20px rgb(18 48 90 / 35%);
  /* Exo's tokens also reach basket, login, options, tier and CMS templates. */
  --color-text: var(--cs-ink);
  --color-text-darker: #0b1f3d;
  --color-text-secondary: var(--cs-muted);
  --color-text-dark: var(--cs-sheet);
  --color-bg: var(--cs-paper);
  --color-brighter-bg: var(--cs-sheet);
  --color-input-bg: var(--cs-sheet);
  --color-popup-bg: rgb(18 48 90 / 42%);
  --color-primary: var(--cs-stamp);
  --color-primary-hover: #9e3717;
  --color-primary-text: var(--cs-sheet);
  --color-primary-text-hover: var(--cs-sheet);
  --color-secondary: var(--cs-sheet);
  --color-secondary-hover: #d6e4f1;
  --color-secondary-text: var(--cs-ink);
  --color-secondary-text-hover: #0b1f3d;
  --color-tertiary: transparent;
  --color-tertiary-hover: #d6e4f1;
  --color-tertiary-text: var(--cs-ink);
  --color-tertiary-text-hover: #0b1f3d;
  --color-removed: #9e3717;
  --layout-gap: 32px;
  --widget-padding: 24px;
  --content-padding: 24px;
  --content-inner-width: 1280px;
  --sidebar-width: 256px;
  --products-gap: 24px;
  --btn-size: 44px;
  --btn-size-small: 44px;
  --btn-size-xsmall: 44px;
  --bg-blur: none;
  --page-transition-duration: 0s;
  --tebex-legal-footer-background-color: #0b1f3d;
  --tebex-legal-footer-text-color: #dde8f3;
  --tebex-legal-footer-border-color: #7f95ad;
  --tebex-legal-footer-logo-color: #fbfcfe;
  --tebex-legal-footer-max-width: 1280px;
}

html { background: var(--cs-paper); scroll-padding-top: 90px; }
body {
  color: var(--cs-ink);
  font-family: var(--cs-body);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  background-color: var(--cs-paper);
  background-image: linear-gradient(rgb(18 48 90 / 4%) 1px, transparent 1px), linear-gradient(90deg, rgb(18 48 90 / 4%) 1px, transparent 1px);
  background-size: 32px 32px;
}
.site { font-size: 16px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--cs-blue);
  outline-offset: 3px;
}
::selection { background: #c3d7ea; color: #0b1f3d; }
:where(h1, h2, h3, h4, h5, h6, .menu-link) {
  font-family: var(--cs-heading);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}
:where(main, .store-sidebar, .store-product, .text-content) { min-width: 0; }
.btn-primary, .btn-secondary, .btn-tertiary {
  border-radius: 0;
  font-family: var(--cs-heading);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.btn-primary { border: 1px solid #9e3717; }
.btn-secondary { border: 1px solid #7f95ad; }
/* Respect Exo's native loading/disabled behavior and its hidden controls. */
:where(button, input, select, textarea):disabled { opacity: .55; cursor: not-allowed; }
:where(input, select, textarea) { accent-color: var(--cs-stamp); }
.store-form :where(input, select, textarea), .quantity-field,
.quantity-field .adjust, .quantity-field input {
  border: 1px solid var(--cs-rule);
  border-radius: 0;
  font-size: 16px;
}
.store-form textarea { resize: vertical; }

/* Header: retain every native login, basket and mobile-menu control. */
.cs-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  width: min(100%, var(--content-width));
  margin-inline: auto;
  padding: 8px var(--content-padding);
  border-bottom: 1px solid var(--cs-rule);
}
.cs-bar nav { display: flex; gap: 24px; flex-wrap: wrap; }
.cs-bar nav a { display: inline-flex; align-items: center; min-height: 36px; font-size: 14px; }
.cs-bar a:hover, .cs-footer-grid a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cs-kicker {
  color: var(--cs-muted);
  font-family: var(--cs-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.site-header-top { min-height: 52px; margin-top: -20px; }
.site-navigation { background: var(--cs-paper); border-block: 1px solid var(--cs-rule); }
.site-navigation .menu, .site-navigation:not(.stuck) .menu,
.site-navigation .menu-sub { border-radius: 0; background: var(--cs-sheet); backdrop-filter: none; }
.site-navigation .menu-link { font-size: 18px; line-height: 1.25; }
.site-navigation .menu-link:hover, .site-navigation .menu-link.link-active { color: var(--cs-ink); text-decoration: underline; text-underline-offset: 6px; }
.site-navigation .menu-sub .menu-link:hover,
.site-navigation .menu-sub .menu-link.link-active { background: #d6e4f1; color: var(--cs-ink); }
.site-title img {
  /* Use the real img src. A failed CSS replacement hides even a valid store logo. */
  content: normal;
  object-fit: contain;
  border-radius: 0 !important;
  width: 205px;
  height: 45px;
}
.site-header-top .site-title img { width: 150px; height: 33px; }

/* Compact layout for the supplied header.twig revision. Native action hooks remain. */
body #header.cs-site-header {
  height: auto;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  max-width: var(--content-width);
  color: var(--cs-ink);
}
#header.cs-site-header .site-header-inner {
  position: relative;
  display: grid;
  grid-template: "menu brand account" auto / auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 16px var(--content-padding);
}
#header.cs-site-header .site-header-inner > .actions {
  grid-area: menu;
  position: static;
  margin: 0;
  width: auto;
}
#header.cs-site-header .site-header-inner > .user-actions,
#header.cs-site-header .site-header-inner > .log-in {
  grid-area: account;
  position: static;
  justify-self: end;
  margin: 0;
  max-width: 100%;
}
#header.cs-site-header .site-header-inner > .user-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
body #header.cs-site-header .site-header-inner > .site-title {
  grid-area: brand;
  position: static;
  inset: auto;
  width: auto;
  max-width: 100%;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--cs-ink);
  font-size: 28px;
  line-height: 1.1;
  text-align: left;
  text-box-trim: none;
  white-space: normal;
  overflow: visible;
  filter: none;
}
#header.cs-site-header .site-title a { display: inline-flex; max-width: 100%; align-items: center; }
body #header.cs-site-header .site-title img {
  display: block;
  width: 228px;
  max-width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;
}
#header.cs-site-header .user-name { max-width: 220px; }
#header.cs-site-header .user-name .text-inner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#header.cs-site-header .cs-header-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding-top: 16px;
  border-top: 1px solid var(--cs-rule);
}
#header.cs-site-header .cs-header-links .info {
  position: static;
  display: grid;
  grid-template: "image title" auto "image action" auto / 32px minmax(0, 1fr);
  align-items: center;
  gap: 0 12px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
#header.cs-site-header .cs-header-links .image { grid-area: image; width: 32px; height: 32px; }
#header.cs-site-header .cs-header-links .title { grid-area: title; overflow-wrap: anywhere; }
#header.cs-site-header .cs-header-links .action { grid-area: action; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
#header.cs-site-header .site-sale-banner { margin: 0; padding: 12px var(--content-padding); background: var(--cs-ink); color: var(--cs-sheet); text-align: center; }
@media (width <= 600px) {
  #header.cs-site-header .site-header-inner { grid-template: "menu brand" auto "account account" auto / auto minmax(0, 1fr); gap: 12px; }
  #header.cs-site-header .site-header-inner > .site-title { justify-self: center; }
  #header.cs-site-header .site-header-inner > .user-actions { width: 100%; }
  body #header.cs-site-header .site-title img { width: 205px; }
  #header.cs-site-header .user-name { max-width: min(180px, 55vw); }
}
@media (width > 960px) {
  .site-navigation .menu { gap: 24px; padding-block: 12px; }
  .site-navigation .menu > .menu-item { flex: 1 1 auto; min-width: 0; }
  .site-navigation .menu > .menu-item > .menu-link { white-space: normal; max-width: none; }
  .site-navigation .has-children .toggle { --btn-size: 44px; }
  .site-navigation .menu-sub { border: 1px solid var(--cs-rule); box-shadow: var(--cs-shadow); }
  /* Exo's desktop submenu is hover-only by default; expose it to keyboard users. */
  .site-navigation .has-children:focus-within > .menu-sub {
    visibility: visible; opacity: 1; translate: 0;
  }
  .site-navigation .menu-sub .menu-link { padding: 12px 20px; }
}

/* Optional introductory sheet on the hosted store home. */
.cs-intro {
  order: -3;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 36px 0 40px;
  border-bottom: 1px solid var(--cs-rule);
  margin-bottom: 24px;
}
.cs-intro h2 { margin-top: 16px; font-size: clamp(3rem, 6.4vw, 6rem); line-height: .94; }
.cs-intro h2 span { color: var(--cs-blue); }
.cs-intro-copy { max-width: 56ch; margin-top: 24px; font-size: 18px; color: var(--cs-muted); }
.cs-intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.cs-intro-actions .btn-primary { min-height: 48px; gap: 24px; }
.cs-text-link { text-decoration: underline; text-underline-offset: 5px; }
.cs-title-block { border: 1px solid #7f95ad; background: var(--cs-sheet); font-family: var(--cs-mono); font-size: 11px; }
.cs-title-block > div { display: grid; grid-template-columns: 95px 1fr; border-bottom: 1px solid var(--cs-rule); }
.cs-title-block > div:last-child { border-bottom: 0; }
.cs-title-block dt, .cs-title-block dd { padding: 8px 12px; }
.cs-title-block dt { border-right: 1px solid var(--cs-rule); color: var(--cs-muted); }

/* Categories and product sheets. Exo supplies the links and all live data. */
.site-home-categories {
  order: -2;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.site-home-categories .category {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--cs-rule);
  border-radius: 0;
  background: var(--cs-sheet);
  box-shadow: var(--cs-shadow);
  text-shadow: none;
  font-family: var(--cs-heading);
  font-size: 28px;
  text-transform: uppercase;
}
.site-home-categories .category:hover { color: var(--cs-ink); border-color: var(--cs-blue); background: var(--cs-tint); }
.site-home-categories .category .image { max-height: 135px; border-radius: 0; }
.category-header { border-bottom: 1px solid var(--cs-rule); padding-block: 12px 24px; color: var(--cs-muted); }
.category-header h2 { color: var(--cs-ink); font-size: clamp(2.5rem, 5vw, 3.75rem); margin-bottom: 12px; }
.store-products-images { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.store-products-images .store-product { display: flex; }
.store-product:not(.store-product-full) {
  padding: 16px;
  border: 1px solid var(--cs-rule);
  background: var(--cs-sheet);
  box-shadow: var(--cs-shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.store-product:not(.store-product-full):hover,
.store-product:not(.store-product-full):focus-within { border-color: var(--cs-blue); box-shadow: 0 8px 24px -16px rgb(18 48 90 / 50%); }
.store-products-images .image-link { aspect-ratio: 16 / 10; background: var(--cs-tint); }
.store-products-images .image-link .image { width: 100%; height: 100%; object-fit: contain; }
.store-product .image, .media-slider .slide-image, .media-slider .slide-video,
.media-slider .thumb, .media-slider .open-lightbox { border-radius: 0; }
.store-product .product-title { font-size: 28px; font-weight: 700; }
.store-product .product-title a:hover { color: var(--cs-blue); }
.store-product .price, .basket .price, .basket .total, .quantity-field input { font-family: var(--cs-mono); }
.store-product:not(.store-product-full) .actions { border-top: 1px solid var(--cs-rule); padding-top: 16px; }
.store-product:not(.store-product-full) .add {
  --btn-color-bg: var(--cs-sheet);
  --btn-color-bg-hover: #d6e4f1;
  --btn-color-text: var(--cs-ink);
  --btn-color-text-hover: var(--cs-ink);
  border-color: #7f95ad;
}
.store-product-full { padding: 24px; background: var(--cs-sheet); border: 1px solid var(--cs-rule); }
.store-product-full .product-title { font-size: clamp(2rem, 4vw, 3.5rem); }
.store-product-full .media-slider { background: var(--cs-tint); border: 1px solid var(--cs-rule); }
.store-product-full .descr { font-size: 16px; line-height: 1.65; }
.media-slider .thumb.active { outline: 2px solid var(--cs-blue); outline-offset: -2px; }
.media-slider .open-lightbox:focus-visible { visibility: visible; opacity: 1; }
@media (width > 960px) {
  .store-product-full { grid-template: "image title" auto "image actions" auto "descr descr" auto / minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; }
  .store-product-full .descr { padding-top: 24px; border-top: 1px solid var(--cs-rule); }
}

.widget, .store-home .store-text, .no-products {
  border: 1px solid var(--cs-rule);
  border-radius: 0;
  background: var(--cs-sheet);
  box-shadow: var(--cs-shadow);
}
.store-home .store-text { width: 100%; padding: 28px; line-height: 1.65; }
.widget-title { font-family: var(--cs-heading); font-size: 24px; }
.widget { padding: 16px; }
.widget-title { margin-bottom: 16px; }
.widget .store-product { border: 0; box-shadow: none; padding: 0; }
.no-products { padding: 32px 24px; }
.text-content { line-height: 1.65; overflow-wrap: anywhere; }
.text-content :where(h1, h2, h3, h4) { line-height: 1.1; }
.text-content a { color: var(--cs-blue); text-decoration: underline; text-underline-offset: 3px; }
.text-content :where(img, video, iframe) { max-width: 100%; }
.text-content iframe[src*="youtube.com"], .text-content iframe[src*="youtube-nocookie.com"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.text-content pre { padding: 16px; background: #0b1f3d; color: #dde8f3; overflow-x: auto; }
.text-content :where(code, pre) { font-family: var(--cs-mono); font-size: .875em; }
.text-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.text-content :where(th, td) { padding: 10px; border: 1px solid var(--cs-rule); }
.popup .popup-content, .popup.drawer .popup-content,
.basket-popup-content, .login-popup-content { background: var(--cs-sheet); border-radius: 0; }
.basket .basket-item { border-bottom: 1px solid var(--cs-rule); padding-bottom: 16px; }

/* The brand footer is additional; the native payment and legal footers remain. */
.site-footer { background: var(--cs-ink); color: #dde8f3; padding-top: 0; }
.cs-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  max-width: var(--content-inner-width);
  margin-inline: auto;
  border-block: 1px solid rgb(221 232 243 / 25%);
}
.cs-footer-grid > * { padding: 32px 24px; border-right: 1px solid rgb(221 232 243 / 25%); min-width: 0; }
.cs-footer-grid > :last-child { border-right: 0; }
.cs-footer-grid h2 { color: var(--cs-sheet); font-size: 22px; margin-bottom: 16px; }
.cs-footer-grid p { max-width: 32ch; font-size: 14px; line-height: 1.6; }
.cs-footer-grid a { display: block; width: fit-content; padding-block: 7px; font-size: 14px; overflow-wrap: anywhere; }
.cs-footer-brand img { width: 228px; max-width: 100%; height: auto; margin-bottom: 20px; }
.site-footer .site-footer-inner { padding-block: 24px; }
.site-footer .copyright { color: #dde8f3; font-size: 12px; }
.site-footer .we-accept { background: var(--cs-sheet); padding: 12px; }

@media (width <= 960px) {
  :root { --content-padding: 20px; --layout-gap: 24px; }
  .site-header-top { margin-top: -24px; margin-bottom: 0; border-bottom: 1px solid var(--cs-rule); }
  .site-navigation { border: 0; }
  .cs-intro { grid-template-columns: 1fr; padding-top: 12px; }
  .cs-title-block { width: fit-content; }
  .cs-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-footer-grid > * { border-bottom: 1px solid rgb(221 232 243 / 25%); }
  .store-product-full { display: flex; flex-direction: column; }
  .store-product-full .media-slider { order: -1; }
}
@media (width <= 600px) {
  :root { --content-padding: 16px; --widget-padding: 16px; }
  .cs-bar { gap: 0 16px; }
  .cs-bar .cs-kicker { width: 100%; padding-top: 4px; }
  .cs-bar nav { gap: 20px; }
  .cs-intro h2 { font-size: clamp(2.8rem, 12vw, 4rem); }
  .cs-intro-copy { font-size: 17px; }
  .cs-footer-grid { grid-template-columns: 1fr; }
  .cs-footer-grid > * { border-right: 0; padding: 24px 16px; }
  .store-product-full, .store-home .store-text { padding: 16px; }
  .site-home-categories { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site *, .popup * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
