/* Fonts (self-hosted, latin subset) */
@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit-latin-var.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-800-latin.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.has-drawer { overflow: hidden; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: var(--fw-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  letter-spacing: var(--ls-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
b, strong { font-weight: var(--fw-bold); }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* Typography */
h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-heading);
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
  margin-bottom: 15px;
}
h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); }
h4, h5, h6, .label {
  font-family: var(--font-body);
  font-weight: var(--fw-body);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  line-height: var(--lh-base);
}

.rte p, .rte ul, .rte ol { margin-bottom: 15px; }
.rte a { text-decoration: underline; text-underline-offset: 2px; }
.rte > :last-child { margin-bottom: 0; }
.rte table { width: 100%; margin-bottom: 15px; border-collapse: collapse; font-size: var(--fs-small); }
.rte th, .rte td { padding: 6px 8px; border: 1px solid var(--color-border); text-align: center; }
.rte th { font-weight: var(--fw-bold); }
.rte .table-wrap, .modal__content { overflow-x: auto; }

/* Layout */
.page-width {
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}
.page-width--narrow { max-width: 1000px; }
.site-main { display: block; min-height: 50vh; }
.site-main:focus { outline: 0; }
.section { margin-block: var(--section-space); }
.section-header { text-align: center; margin-bottom: 30px; }

/* Utilities */
.text-center { text-align: center; }
.u-mt-30 { margin-top: 30px; }
.visually-hidden,
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 10px 15px; background: var(--color-bg); }

.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-weight);
  stroke-linejoin: miter;
  flex-shrink: 0;
}
.icon--fill { fill: currentColor; stroke: none; }

/* Buttons: "angled" style. The ::before paints a skewed parallelogram behind the label */
.btn,
.button,
button.button,
input[type="submit"].button {
  --btn-bg: var(--color-button);
  --btn-fg: var(--color-button-text);
  --btn-border: var(--color-button);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  margin-inline: 6px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 0;
  background: none;
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-button);
  line-height: 1.42;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn::before,
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  transform: skewX(var(--btn-skew));
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn:hover::before,
.button:hover::before { --btn-bg: var(--color-button-hover); }
.btn:hover, .button:hover { --btn-fg: var(--color-button-hover-text); } /* white on sand fails contrast */
.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--color-text);
  --btn-border: var(--color-text);
}
.btn--secondary:hover::before { --btn-bg: var(--color-text); }
.btn--secondary:hover { color: var(--color-bg); }
.btn--full { display: flex; width: calc(100% - 12px); }
/* Design v2 size (homepage, product page): 48px, small spaced caps */
.btn.btn--home {
  min-height: 48px;
  padding: 0 28px;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: 0.25em;
}
.btn[disabled], .btn.is-disabled, .button.disabled, .button:disabled { cursor: default; opacity: 0.5; }
.btn.is-loading, .button.is-loading { color: transparent; }
.btn.is-loading::after, .button.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: ci-spin 0.7s linear infinite;
}
@keyframes ci-spin { to { transform: rotate(360deg); } }

.text-link { text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; }

/* Prices (ci_price_html: cards, product page, sticky bar, cart) */
.price__compare { margin-right: 5px; }
.price__savings { margin-left: 5px; color: var(--color-savings); white-space: nowrap; }
.price__compare .woocommerce-Price-amount, .price__current .woocommerce-Price-amount { white-space: nowrap; }

/* Forms */
input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"],
input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: max(16px, var(--fs-small)); /* 16px min stops iOS zoom on focus */
  font-weight: 400;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 1px solid var(--color-text); outline-offset: 0; border-color: var(--color-text); }
label { display: inline-block; margin-bottom: 6px; }

/* Drawers: native <dialog>, slides in from the right */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(var(--drawer-width), calc(100% - 40px));
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-drawer);
  color: var(--color-drawer-text);
  transform: translateX(100%);
  transition: transform var(--dur-drawer) var(--ease-drawer);
  overscroll-behavior: contain;
}
.drawer.is-open { transform: none; }
.drawer::backdrop {
  background: var(--color-overlay);
  opacity: 0;
  transition: opacity var(--dur-drawer) ease;
}
.drawer.is-open::backdrop { opacity: var(--overlay-opacity); }
.drawer__inner { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding-inline: 20px 0;
}
.drawer__title { margin: 0; }
.drawer__close {
  display: inline-flex;
  margin-left: auto;
  padding: 9px 20px;
  border: 0;
  background: none;
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer::backdrop { transition: none; }
}

/* Modals: native <dialog data-modal="name">, opened by [data-modal-open="name"] */
.modal {
  width: min(700px, calc(100% - 34px));
  max-width: none;
  max-height: calc(100% - 60px);
  padding: 0;
  border: 0;
  background: var(--color-drawer);
  color: var(--color-drawer-text);
}
.modal[open] { animation: ci-fade-up 0.25s var(--ease-drawer); }
.modal::backdrop { background: var(--color-overlay); opacity: var(--overlay-opacity); }
.modal__inner { position: relative; padding: 45px 20px 30px; }
.modal__title { margin-bottom: 20px; text-align: center; }
.modal__close { position: absolute; top: 5px; right: 5px; display: inline-flex; padding: 10px; border: 0; background: none; }
@keyframes ci-fade-up { from { opacity: 0; transform: translateY(15px); } }
@media (min-width: 769px) { .modal__inner { padding: 50px 40px 40px; } }
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }

/* WooCommerce notices (can show up on any page after a form post) */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  margin: 0 0 25px;
  padding: 14px 18px;
  border-left: 3px solid var(--color-text);
  background: var(--color-section-alt);
  list-style: none;
  font-size: var(--fs-small);
}
.woocommerce-error { border-left-color: var(--color-savings); }
.woocommerce-error li + li { margin-top: 6px; }
/* Notice + button: text first, button on the right (wraps under the text on narrow screens, never overlaps it).
   WooCommerce puts the button before or after the text depending on the notice. */
.woocommerce-message:has(> .button), .woocommerce-info:has(> .button) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; }
.woocommerce-message .button, .woocommerce-info .button { order: 1; min-height: 0; margin-left: auto; padding: 6px 14px; font-size: 12px; }

/* Star rating: one element, partial fill (style="--rating:4.3"); used on product pages, Quick Shop, homepage */
.ci-stars {
  --star-size: 15px;
  --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.6 7.1.9-5.2 4.9 1.3 7.1L12 17.8l-6.3 3.5 1.3-7.1L1.8 9.3l7.1-.9z'/%3E%3C/svg%3E");
  display: inline-block;
  flex: none;
  width: calc(var(--star-size) * 5);
  height: var(--star-size);
  vertical-align: middle;
  background: linear-gradient(90deg, var(--color-star) calc(var(--rating, 0) / 5 * 100%), var(--color-star-empty) 0);
  -webkit-mask: var(--star-mask) left center / var(--star-size) var(--star-size) repeat-x;
  mask: var(--star-mask) left center / var(--star-size) var(--star-size) repeat-x;
}
.ci-stars--lg { --star-size: 22px; }

/* ---------- Section primitives (design v2: homepage + product page) ---------- */
.home-width {
  width: 100%;
  max-width: calc(var(--home-width) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}
.home-section { padding-block: var(--home-section-pad); }
.home-section--alt { background: var(--color-section-alt); color: var(--color-section-alt-text); }
.home-eyebrow {
  margin: 0 0 10px;
  color: var(--color-text-muted);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: 0.28em;
  line-height: 1.25;
  text-transform: uppercase;
}
.home-eyebrow--light { margin-bottom: 18px; color: var(--color-on-image); letter-spacing: var(--ls-wider); }
.home-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.home-heading--center { justify-content: center; text-align: center; }
.home-heading__title { margin: 0; font-size: var(--fs-section-title); line-height: 1.1; }
.home-heading__link {
  flex: none;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: 0.22em;
  line-height: 1.25;
  text-transform: uppercase;
}
.home-heading__link:hover { color: var(--color-text-muted); }

@media (min-width: 769px) {
  .home-heading { margin-bottom: 40px; }
}
