/*
 * base.css
 * Global reset and base typography ONLY.
 *
 * RULES:
 *   1. No component styles here. No .product-card, no .header, nothing.
 *   2. No class selectors except for utility-level helpers used site-wide.
 *   3. Every value is a var(--theme-*) from tokens.css.
 *   4. This file is loaded on every page via theme.liquid.
 *      Keep it as small as possible.
 */

/* ─── SELF-HOSTED FONTS ──────────────────────────────────────────*/
@font-face {
  font-family: 'Quattrocento Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('quattrocento-sans-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Quattrocento Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('quattrocento-sans-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── BOX SIZING ─────────────────────────────────────────────────*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ─── RESET ──────────────────────────────────────────────────────*/
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-normal);
  line-height: var(--theme-leading-base);
  color: var(--theme-color-text-primary);
  background-color: var(--theme-color-bg-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
  font-family: var(--theme-font-heading);
  font-weight: var(--theme-weight-bold);
  line-height: var(--theme-leading-tight);
  letter-spacing: var(--theme-tracking-tight);
  color: var(--theme-color-text-primary);
}

h1 { font-size: var(--theme-text-4xl); }
h2 { font-size: var(--theme-text-3xl); }
h3 { font-size: var(--theme-text-2xl); }
h4 { font-size: var(--theme-text-xl); }
h5 { font-size: var(--theme-text-lg); }
h6 { font-size: var(--theme-text-md); }

/* Paragraphs */
p {
  margin: 0 0 var(--theme-space-md);
  padding: 0;
}

p:last-child {
  margin-bottom: 0;
}

/* Links */
a {
  color: var(--theme-color-text-link);
  text-decoration: none;
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

a:hover {
  color: var(--theme-color-text-link-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: var(--theme-border-width-thick) solid var(--theme-color-brand-gold);
  outline-offset: 2px;
  border-radius: var(--theme-radius-sm);
}

/* Lists */
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Images */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Embeds */
iframe,
video,
embed,
object {
  display: block;
  max-width: 100%;
}

/* HR */
hr {
  margin: var(--theme-space-lg) 0;
  border: none;
  border-top: var(--theme-border-width) solid var(--theme-color-border);
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
}

/* SVG */
svg {
  display: block;
  overflow: hidden;
}

/* Buttons (bare reset — styled in base-buttons below) */
button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Inputs */
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Address */
address {
  font-style: normal;
}

/* Figure */
figure {
  margin: 0;
}

/* ─── PAGE LAYOUT SHELL ──────────────────────────────────────────
 * These are structural—not component—rules that apply globally.
 * The .page-wrapper constrains width and handles gutters.
 */
.page-wrapper {
  width: 100%;
  max-width: var(--theme-max-width-site);
  margin: 0 auto;
  padding: 0 var(--theme-gutter-desktop);
}

@media (max-width: 767px) {
  .page-wrapper {
    padding: 0 var(--theme-gutter);
  }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: var(--theme-space-lg);
  right: var(--theme-space-lg);
  width: 44px;
  height: 44px;
  border-radius: var(--theme-radius-full);
  border: var(--theme-border-width) solid var(--theme-color-border);
  background: var(--theme-color-bg-card, #fff);
  color: var(--theme-color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--theme-z-sticky);
  box-shadow: var(--theme-shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.15s ease;
}

.back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--theme-color-brand-dark);
  color: var(--theme-color-white);
  border-color: var(--theme-color-brand-dark);
}

@media (max-width: 767px) {
  .back-to-top {
    bottom: var(--theme-space-md);
    right: var(--theme-space-md);
    width: 40px;
    height: 40px;
  }
}

/* Narrow wrapper for text-heavy pages (blog, policy, etc.) */
.page-wrapper--narrow {
  max-width: var(--theme-max-width-narrow);
}

/* Main content area — clears header height */
.page-main {
  min-height: 60vh;
}

/* ─── BREADCRUMB ─────────────────────────────────────────────────*/
.breadcrumb {
  padding: var(--theme-space-xs) 0;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  font-weight: var(--theme-weight-medium);
  color: var(--theme-color-text-muted);
  white-space: nowrap;
}

.breadcrumb__link {
  color: var(--theme-color-text-muted);
  text-decoration: none;
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.breadcrumb__link:hover {
  color: var(--theme-color-brand-gold);
}

.breadcrumb__link--home {
  display: flex;
  align-items: center;
}

.breadcrumb__separator {
  color: var(--theme-color-border);
  margin: 0 var(--theme-space-2xs);
  display: flex;
  align-items: center;
}

.breadcrumb__text--current {
  color: var(--theme-color-text-primary);
  font-weight: var(--theme-weight-semibold);
}

/* ─── GLOBAL TYPOGRAPHY UTILITIES ────────────────────────────────
 * Only include utilities used across many components.
 * If something is only used in one component, put it there.
 */

/* Uppercase label — used on badge text, section labels, step headers */
.text-label {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-xs);
  font-weight: var(--theme-weight-semibold);
  letter-spacing: var(--theme-tracking-widest);
  text-transform: uppercase;
}

/* Price display */
.text-price {
  font-family: var(--theme-font-ui);
  font-weight: var(--theme-weight-semibold);
  color: var(--theme-color-text-primary);
  font-size: var(--theme-text-xl);
}

.text-price--large {
  font-size: var(--theme-text-2xl);
}

.text-price--was {
  font-size: var(--theme-text-md);
  color: var(--theme-color-text-muted);
  text-decoration: line-through;
}

/* Visually hidden (accessible) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── BASE BUTTON STYLES ─────────────────────────────────────────
 * Shared structure for all button variants.
 * Variant-specific colour comes from modifier classes.
 * These live here rather than a separate file because they are
 * used across every page and component.
 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--theme-space-2xs);
  height: var(--theme-btn-height-md);
  padding: 0 var(--theme-btn-padding-x-md);
  font-family: var(--theme-font-ui);
  font-size: var(--theme-btn-font-size);
  font-weight: var(--theme-btn-font-weight);
  letter-spacing: var(--theme-btn-tracking);
  text-transform: uppercase;
  text-decoration: none;
  border: var(--theme-border-width) solid transparent;
  border-radius: var(--theme-btn-radius);
  cursor: pointer;
  transition:
    background-color var(--theme-duration-base) var(--theme-ease-out),
    color            var(--theme-duration-base) var(--theme-ease-out),
    border-color     var(--theme-duration-base) var(--theme-ease-out),
    box-shadow       var(--theme-duration-base) var(--theme-ease-out);
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: var(--theme-border-width-thick) solid var(--theme-color-brand-gold);
  outline-offset: 2px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — gold fill. Used for Add to Basket, wizard Continue, etc. */
.btn--primary {
  background-color: var(--theme-btn-primary-bg);
  color: var(--theme-btn-primary-text);
  border-color: var(--theme-btn-primary-border);
}

.btn--primary:hover {
  background-color: var(--theme-btn-primary-bg-hover);
  border-color: var(--theme-btn-primary-bg-hover);
  color: var(--theme-btn-primary-text);
  text-decoration: none;
}

.btn--primary:active {
  background-color: var(--theme-btn-primary-bg-active);
}

/* Secondary — gold outline */
.btn--secondary {
  background-color: var(--theme-btn-secondary-bg);
  color: var(--theme-btn-secondary-text);
  border-color: var(--theme-btn-secondary-border);
}

.btn--secondary:hover {
  background-color: var(--theme-btn-secondary-bg-hover);
  color: var(--theme-btn-secondary-text-hover);
  text-decoration: none;
}

/* Ghost — subtle, for low-emphasis actions */
.btn--ghost {
  background-color: var(--theme-btn-ghost-bg);
  color: var(--theme-btn-ghost-text);
  border-color: var(--theme-btn-ghost-border);
}

.btn--ghost:hover {
  background-color: var(--theme-btn-ghost-bg-hover);
  text-decoration: none;
}

/* Inverse — for use on dark backgrounds (header, wizard) */
.btn--inverse {
  background-color: transparent;
  color: var(--theme-color-white);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--inverse:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
  color: var(--theme-color-white);
  text-decoration: none;
}

/* Size modifiers */
.btn--sm {
  height: var(--theme-btn-height-sm);
  padding: 0 var(--theme-btn-padding-x-sm);
  font-size: var(--theme-text-xs);
}

.btn--lg {
  height: var(--theme-btn-height-lg);
  padding: 0 var(--theme-btn-padding-x-lg);
  font-size: var(--theme-text-md);
}

/* Full width */
.btn--full {
  width: 100%;
}

/* Icon only */
.btn--icon {
  width: var(--theme-btn-height-md);
  padding: 0;
}

/* ─── FOCUS MANAGEMENT ───────────────────────────────────────────*/
:focus:not(:focus-visible) {
  outline: none;
}

/* ─── SCROLL LOCK — applied by JS when modal is open ─────────────*/
body.scroll-locked {
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: var(--scroll-y, 0);
  /* Prevent layout shift from scrollbar disappearing */
  padding-right: var(--scrollbar-width, 0px);
}

/* ─── REDUCE MOTION ──────────────────────────────────────────────*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
