/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: calc(1rem * var(--body-scale, 1));
  line-height: 1.6;
  color: var(--color-text, #171717);
  background: var(--color-bg, #fff);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading, Georgia, serif);
  text-transform: var(--heading-transform, none);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: calc(2.2rem * var(--heading-scale, 1)); }
h2 { font-size: calc(1.75rem * var(--heading-scale, 1)); }
h3 { font-size: calc(1.3rem * var(--heading-scale, 1)); }
p { margin: 0 0 1em; }

.skip-to-content {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 0.75rem 1rem; background: var(--color-bg); color: var(--color-text);
}
.skip-to-content:focus { left: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── layout ────────────────────────────────────────────────────────────── */
.page-width { width: 100%; max-width: var(--page-width, 1400px); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 750px) { .page-width { padding: 0 2rem; } }
.section { padding-block: var(--section-spacing, 48px); }
.section--tight { padding-block: calc(var(--section-spacing, 48px) / 2); }
.section__header { text-align: center; margin-bottom: 1.5rem; }
.section__header p { color: var(--color-text-muted); margin: 0; }

.grid { display: grid; gap: var(--grid-gap, 20px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 750px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 990px)  { .grid { grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr)); } }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── buttons ───────────────────────────────────────────────────────────── */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.6rem; border-radius: var(--button-radius, 4px);
  background: var(--button-bg, #171717); color: var(--button-text, #fff);
  border: var(--button-border-width, 0) solid currentColor;
  font: inherit; text-transform: var(--button-transform, none); text-decoration: none;
  cursor: pointer; transition: opacity 0.15s ease;
}
.button:hover { opacity: 0.85; }
.button[disabled] { opacity: 0.4; cursor: not-allowed; }
.button--secondary { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.button--full { width: 100%; }

/* ── forms ─────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-size: 0.85rem; color: var(--color-text-muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.7rem 0.85rem; font: inherit; color: inherit;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--button-radius, 4px);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--color-accent); outline-offset: 1px;
}
.form__error { color: var(--color-sale); font-size: 0.9rem; }
.form__success { color: var(--color-accent); font-size: 0.9rem; }

/* ── header ────────────────────────────────────────────────────────────── */
.header { border-bottom: 1px solid var(--color-border); background: var(--color-bg); }
.header-sticky .header { position: sticky; top: 0; z-index: 20; }
.header__inner { display: flex; align-items: center; gap: 1rem; padding-block: 1rem; }
.header__logo { font-family: var(--font-heading); font-size: 1.25rem; text-decoration: none; }
.header__logo img { width: var(--logo-width, 130px); }
.header__nav { display: none; margin-inline: auto; }
@media (min-width: 990px) { .header__nav { display: block; } .header__toggle { display: none; } }
.header--center .header__inner { flex-direction: column; text-align: center; }
.header__menu { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.header__menu a { text-decoration: none; padding-block: 0.5rem; display: inline-block; }
.header__menu a[aria-current="page"] { text-decoration: underline; }
.header__item { position: relative; }
.header__submenu {
  position: absolute; top: 100%; left: 0; min-width: 200px; z-index: 30;
  display: none; list-style: none; margin: 0; padding: 0.5rem 0;
  background: var(--color-bg); border: 1px solid var(--color-border);
}
.header__item:hover > .header__submenu, .header__item:focus-within > .header__submenu { display: block; }
.header__submenu a { padding: 0.4rem 1rem; display: block; }
.header__actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.header__actions a, .header__actions button {
  background: none; border: 0; padding: 0.4rem; color: inherit; cursor: pointer; display: inline-flex;
}
.header__toggle { order: -1; }
.drawer-menu { display: none; border-top: 1px solid var(--color-border); padding-block: 0.5rem; }
.drawer-menu[open], .drawer-menu.is-open { display: block; }
.drawer-menu ul { list-style: none; margin: 0; padding: 0; }
.drawer-menu a { display: block; padding: 0.6rem 0; text-decoration: none; }

/* ── announcement ──────────────────────────────────────────────────────── */
.announcement { text-align: center; padding: 0.6rem 1rem; font-size: 0.9rem; }
.announcement a { color: inherit; }

/* ── cards ─────────────────────────────────────────────────────────────── */
.card { display: block; text-decoration: none; }
.card__media {
  position: relative; overflow: hidden; background: var(--color-surface);
  border-radius: var(--button-radius, 4px);
}
.card__media--square    { aspect-ratio: 1 / 1; }
.card__media--portrait  { aspect-ratio: 4 / 5; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__badge {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 2;
  background: var(--color-sale); color: var(--color-badge-text);
  font-size: 0.72rem; padding: 0.2rem 0.5rem; border-radius: 999px;
}
.card__info { padding-top: 0.7rem; display: grid; gap: 0.2rem; }
.card__title { font-size: 0.98rem; margin: 0; font-family: inherit; }
.card__vendor { font-size: 0.8rem; color: var(--color-text-muted); }
.card__quick { margin-top: 0.5rem; }

.price { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.price__compare { text-decoration: line-through; color: var(--color-text-muted); font-size: 0.9em; }
.price--on-sale .price__current { color: var(--color-sale); }

/* ── media / banners ───────────────────────────────────────────────────── */
.banner { position: relative; display: grid; }
.banner__media img { width: 100%; object-fit: cover; }
.banner--small .banner__media { min-height: 240px; }
.banner--medium .banner__media { min-height: 400px; }
.banner--large .banner__media { min-height: 560px; }
.banner__content {
  padding: 2rem 1rem; display: grid; gap: 0.75rem; justify-items: center; text-align: center;
}
@media (min-width: 750px) {
  .banner--overlay { position: relative; }
  .banner--overlay .banner__content {
    position: absolute; inset: 0; align-content: center;
    background: linear-gradient(transparent, rgba(0,0,0,0.35));
    color: #fff;
  }
}
.banner__content--left { justify-items: start; text-align: left; }
.banner__content--right { justify-items: end; text-align: right; }

/* ── slideshow ─────────────────────────────────────────────────────────── */
.slideshow { position: relative; }
.slideshow__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slideshow__track::-webkit-scrollbar { display: none; }
.slideshow__slide { flex: 0 0 100%; scroll-snap-align: start; }
.slideshow__dots { display: flex; gap: 0.5rem; justify-content: center; padding-top: 0.75rem; }
.slideshow__dot {
  width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--color-border);
}
.slideshow__dot[aria-current="true"] { background: var(--color-text); }

/* ── product ───────────────────────────────────────────────────────────── */
.product { display: grid; gap: 2rem; }
@media (min-width: 750px) { .product { grid-template-columns: 1fr 1fr; align-items: start; } }
.product__gallery { display: grid; gap: 0.75rem; }
.product__thumbs { display: flex; gap: 0.5rem; overflow-x: auto; }
.product__thumbs img { width: 72px; height: 72px; object-fit: cover; cursor: pointer; }
.product__meta { display: grid; gap: 0.35rem; }
.product__price { font-size: 1.3rem; }
.product__options { display: grid; gap: 0.75rem; margin-block: 1rem; }
.product__qty { display: flex; align-items: center; gap: 0.5rem; }
.product__qty input { width: 4rem; text-align: center; }
.product__description { margin-top: 1.5rem; }

/* ── collection / facets ───────────────────────────────────────────────── */
.collection__toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; margin-bottom: 1.5rem;
}
.facets { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.facets select { padding: 0.5rem; border: 1px solid var(--color-border); background: var(--color-bg); }

/* ── pagination ────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 0.4rem; justify-content: center; padding-block: 2rem; list-style: none; }
.pagination a, .pagination span {
  display: inline-flex; min-width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); text-decoration: none; border-radius: var(--button-radius, 4px);
}
.pagination [aria-current="page"] { background: var(--color-text); color: var(--color-bg); }

/* ── cart ──────────────────────────────────────────────────────────────── */
.cart__row { display: grid; grid-template-columns: 72px 1fr auto; gap: 1rem; align-items: start; padding-block: 1rem; border-bottom: 1px solid var(--color-border); }
.cart__totals { display: grid; gap: 0.5rem; padding-top: 1.5rem; max-width: 360px; margin-left: auto; }
.cart__totals-row { display: flex; justify-content: space-between; }
.cart-drawer {
  position: fixed; inset-block: 0; right: 0; width: min(420px, 100%); z-index: 40;
  background: var(--color-bg); border-left: 1px solid var(--color-border);
  transform: translateX(100%); transition: transform 0.25s ease; display: flex; flex-direction: column;
}
.cart-drawer.is-open { transform: none; }
.cart-drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid var(--color-border); }
.cart-drawer__body { flex: 1; overflow-y: auto; padding: 1rem; }
.cart-drawer__foot { padding: 1rem; border-top: 1px solid var(--color-border); }
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 39; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ── rich text / newsletter ────────────────────────────────────────────── */
.rich-text { max-width: 46rem; margin-inline: auto; text-align: center; }
.rich-text--left { text-align: left; margin-inline: 0; }
.newsletter { text-align: center; background: var(--color-surface); border-radius: var(--button-radius, 4px); padding: 2rem 1rem; }
.newsletter__form { display: flex; gap: 0.5rem; max-width: 26rem; margin: 1rem auto 0; flex-wrap: wrap; }
.newsletter__form input { flex: 1 1 12rem; }

/* ── footer ────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--color-border); background: var(--color-surface); margin-top: var(--section-spacing, 48px); }
.footer__grid { display: grid; gap: 2rem; padding-block: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 750px) { .footer__grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.footer__block h3 { font-size: 1rem; }
.footer__block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer__block a { text-decoration: none; }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--color-border); padding-block: 1rem; font-size: 0.85rem;
  color: var(--color-text-muted);
}
.social { display: flex; gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.social a { display: inline-flex; }
.payment-icons { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ── breadcrumbs / misc ────────────────────────────────────────────────── */
.breadcrumbs { font-size: 0.85rem; color: var(--color-text-muted); padding-block: 1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumbs a { text-decoration: none; }
.spinner { width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding-block: 3rem; color: var(--color-text-muted); }
