/* All reusable UI components. Pure CSS variables — no hardcoded brand values. */

/* ─────────────────────────── Site header ─────────────────────────── */

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  gap: var(--space-4);
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}
.site-header__logo:hover { text-decoration: none; }
.site-header__logo img { height: 32px; width: auto; color: var(--color-primary); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
}
.site-header__menu-toggle:hover { background: var(--color-secondary); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
/* Nav labels are uppercase with extra letter-spacing — a deliberate brand
 * cue that distinguishes navigation from body links. */
.site-nav__link {
  color: var(--color-text);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.site-nav__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
}
.site-nav__cart:hover { text-decoration: none; background: var(--color-secondary); }
.site-nav__cart-icon { width: 22px; height: 22px; display: block; }
.site-nav__cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--color-primary);
  color: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0 var(--space-1);
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Border in the page bg colour gives a subtle visual separator from
   * the icon button underneath so the badge reads cleanly. */
  border: 2px solid var(--color-bg);
  box-sizing: content-box;
}
.site-nav__cart-count[data-empty="true"] { display: none; }

/* Account icon button — matches the cart's shape so the right-side action
 * cluster reads as a pair. Tints to brand primary when the visitor is
 * signed in, so the state is visible at a glance without an extra dot. */
.site-nav__account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
}
.site-nav__account:hover { text-decoration: none; background: var(--color-secondary); }
.site-nav__account-icon { width: 22px; height: 22px; display: block; }
.site-nav__account--signed-in { color: var(--color-primary); border-color: var(--color-primary); }

/* Mobile: nav collapses behind a hamburger and drops down under the header. */
@media (max-width: 767px) {
  .site-header__menu-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-3);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform 180ms, opacity 180ms, visibility 180ms;
  }
  .site-nav--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .site-nav__link {
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
  }
  .site-nav__link:hover { background: var(--color-secondary); text-decoration: none; }
}

/* ─────────────────────────── Buttons ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
  min-height: 44px;
  transition: opacity 120ms, background 120ms, border-color 120ms;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
}
.btn--primary:hover:not(:disabled) { opacity: 0.9; }

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--secondary:hover:not(:disabled) { background: var(--color-secondary); }

.btn--ghost { background: transparent; color: var(--color-text); }
.btn--ghost:hover:not(:disabled) { background: var(--color-secondary); }

.btn--destructive { color: var(--color-error); background: transparent; }
.btn--destructive:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-error) 8%, transparent);
}

.btn--compact {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  min-height: 36px;
}

.btn--block { width: 100%; }

/* ─────────────────────────── Forms ─────────────────────────── */

.form-field { display: flex; flex-direction: column; gap: var(--space-2); }
.form-field__label { font-size: var(--text-sm); font-weight: 600; }
.form-field__required { color: var(--color-error); margin-left: var(--space-1); }

.form-field__input,
.form-field__select,
.form-field__textarea {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  width: 100%;
  min-height: 44px;
}
.form-field__textarea { min-height: 140px; resize: vertical; }

.form-field__input:focus,
.form-field__select:focus,
.form-field__textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

.form-field__hint { font-size: var(--text-xs); color: var(--color-muted); }
.form-field__hint--error { color: var(--color-error); }
.form-field__error { font-size: var(--text-xs); color: var(--color-error); }

.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); align-items: end; }
@media (min-width: 768px) {
  .form-grid--2 { grid-template-columns: 1fr 1fr; }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* ─────────────────────────── Hero (with overlay image) ─────────────────────────── */

.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Gradient tint (dark on the left, fading out) keeps the headline + CTA readable
 * over any image without dimming the whole thing. */
.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: var(--space-9) 0;
  background: linear-gradient(to right, var(--overlay-tint), color-mix(in srgb, var(--overlay-tint) 20%, transparent) 70%);
}

.hero__headline {
  color: var(--color-on-overlay);
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
  max-width: 720px;
}

.hero__sub {
  color: var(--color-on-overlay);
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 0 var(--space-6);
  opacity: 0.92;
}

@media (max-width: 767px) {
  .hero { min-height: 380px; }
  .hero__inner {
    padding: var(--space-7) 0;
    /* On narrow screens, content is centred — use a uniform tint so text reads everywhere. */
    background: var(--overlay-tint);
  }
  .hero__headline { font-size: var(--text-2xl); }
  .hero__sub { font-size: var(--text-base); }
}

/* ─────────────────────────── Home CTA cards ─────────────────────────── */

/* Three equally-sized image cards on the homepage below the featured grid.
 * Each is a clickable card with a CTA button anchored bottom-right corner. */
.home-cta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .home-cta-grid { grid-template-columns: repeat(3, 1fr); }
}

.home-cta-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-secondary);
}
.home-cta-card:hover { text-decoration: none; }
.home-cta-card:hover .home-cta-card__image { transform: scale(1.04); }

.home-cta-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms;
}

/* Subtle dark gradient at the bottom ensures the corner button reads
 * cleanly over any image without dimming the whole card. */
.home-cta-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--overlay-tint) 80%, transparent), transparent 55%);
  pointer-events: none;
}

.home-cta-card__cta {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────── Product card ─────────────────────────── */

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 150ms;
}
.product-card:hover { box-shadow: var(--shadow-sm); }

.product-card__image-link { display: block; }
.product-card__image {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--color-secondary);
  object-fit: cover;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  flex: 1;
}

.product-card__name-link { color: inherit; }
.product-card__name-link:hover { text-decoration: none; color: var(--color-primary); }
.product-card__name { font-size: var(--text-base); font-weight: 500; margin: 0; }

.product-card__price {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-top: var(--space-1);
}

.product-card__cta-wrap { padding: 0 var(--space-4) var(--space-4); }
.product-card--sold-out .product-card__image { opacity: 0.6; }

/* ─────────────────────────── Filter pills ─────────────────────────── */

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.filter-pill {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: var(--text-sm);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 36px;
}
.filter-pill:hover { background: var(--color-secondary); }
.filter-pill--active {
  background: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
}

/* ─────────────────────────── Product detail ─────────────────────────── */

.product-gallery__main {
  aspect-ratio: 1 / 1;
  background: var(--color-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.product-gallery__main img { width: 100%; height: 100%; object-fit: cover; }

.product-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.product-gallery__thumb {
  aspect-ratio: 1 / 1;
  background: var(--color-secondary);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery__thumb--active { border-color: var(--color-primary); }

.product-detail__name { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.product-detail__price { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-4); }
.product-detail__price-vat {
  font-size: var(--text-sm);
  color: var(--color-muted);
  font-weight: 400;
  margin-left: var(--space-2);
}
.product-detail__desc { margin-bottom: var(--space-5); line-height: var(--leading-body); }
.product-detail h2 { margin-top: var(--space-7); margin-bottom: var(--space-3); }
.product-detail__stock { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-4); }
.product-detail__stock--low { color: var(--color-error); }
.product-detail__stock--out { color: var(--color-error); font-weight: 600; }

/* Buy section: qty stepper + Add to basket + Buy now.
 * The "one primary action per view" DESIGN.md rule gets one explicit exception
 * here — the dual CTA reduces checkout friction for known-want buyers without
 * losing the cart for browsing buyers. */
.product-detail__buy {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-5);
}
@media (max-width: 767px) {
  .product-detail__buy { flex-direction: column; align-items: stretch; }
  .product-detail__buy .qty-stepper { align-self: flex-start; }
  .product-detail__buy .btn { width: 100%; }
}

.specs-table { width: 100%; border-collapse: collapse; }
.specs-table th, .specs-table td {
  text-align: left;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
.specs-table th { width: 35%; color: var(--color-muted); font-weight: 500; }

/* ─────────────────────────── Related products ─────────────────────────── */

/* Cross-sell rail that sits between the buy split and the FAQ on product
 * detail pages. Inner grid reuses .product-grid so the cards inherit the
 * same responsive layout used on the listing and homepage. */
.related-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.related-section__heading {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

/* ─────────────────────────── FAQ (collapsible) ─────────────────────────── */

/* FAQ sits below the gallery + detail split — full width container,
 * inner content capped at a comfortable reading width. */
.faq-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.faq-section__inner {
  max-width: 800px;
  margin: 0 auto;
}
.faq-section__heading {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  font-size: var(--text-base);
}
.faq-item summary::-webkit-details-marker { display: none; }
/* Chevron sits on the LEFT of the summary text — consistent with other
 * collapsibles across the family of stores. */
.faq-item summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 6px solid var(--color-text);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 150ms;
  flex-shrink: 0;
}
.faq-item[open] summary::before { transform: rotate(90deg); }
.faq-item__body {
  padding: 0 0 var(--space-4) calc(6px + var(--space-3));
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

/* ─────────────────────────── Quantity stepper ─────────────────────────── */

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-stepper__btn {
  width: 36px;
  height: 36px;
  color: var(--color-text);
  font-size: var(--text-lg);
}
.qty-stepper__btn:hover:not(:disabled) { background: var(--color-secondary); }
.qty-stepper__value {
  min-width: 36px;
  text-align: center;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────── Cart row + summary ─────────────────────────── */

.cart-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}
.cart-row__image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: var(--color-secondary);
  object-fit: cover;
}
.cart-row__name { font-size: var(--text-base); margin-bottom: var(--space-1); }
.cart-row__price { font-size: var(--text-sm); color: var(--color-muted); }

@media (max-width: 767px) {
  .cart-row {
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
    column-gap: var(--space-3);
    row-gap: var(--space-2);
  }
  .cart-row__image { grid-row: span 2; width: 64px; height: 64px; }
  .cart-row__controls {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.cart-summary {
  background: var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cart-summary__row { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.cart-summary__row--total {
  font-size: var(--text-base);
  font-weight: 600;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.cart-summary__row--vat {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: calc(-1 * var(--space-2));
}
.cart-summary__discount {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.cart-summary__discount input { flex: 1; }

.cart-summary__hint {
  font-size: var(--text-xs);
  color: var(--color-muted);
  text-align: center;
  margin: var(--space-1) 0 0;
}
.cart-summary__hint--error { color: var(--color-error); }

.cart-row__warning {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin: var(--space-1) 0 0;
}

/* ─────────────────────────── Order row + summary ─────────────────────────── */

/* Order history list (account page). One block per order, with a header
 * row (date + id, status pill + total) and a list of items beneath. */
.order-row {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}
.order-row__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
.order-row__date {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 0 0 var(--space-1);
}
.order-row__id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-sm);
  margin: 0;
}
.order-row__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.order-row__totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.order-row__total {
  font-weight: 600;
  font-size: var(--text-base);
}
.order-row__vat {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin: 0;
}
.order-row__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.order-row__item {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.order-row__item-name { color: var(--color-text); }

/* Status pill — used in order history. Variants tint by current status. */
.status-pill {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: capitalize;
  background: var(--color-secondary);
  color: var(--color-muted);
}
.status-pill--paid,
.status-pill--fulfilled {
  background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success);
}
.status-pill--cancelled,
.status-pill--refunded {
  background: color-mix(in srgb, var(--color-error) 15%, transparent);
  color: var(--color-error);
}

/* Receipt block on /checkout-success.html. Same visual language as
 * .cart-summary but compact (no controls, just totals). */
.order-summary {
  background: var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
  max-width: 480px;
  margin: 0 auto var(--space-6);
}
.order-summary__row { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.order-summary__row--total {
  font-size: var(--text-base);
  font-weight: 600;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.order-summary__row--vat {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: calc(-1 * var(--space-2));
}

/* Order skeleton — used while order history loads on /account.html and
 * while the success page polls for the just-written order row. */
.order-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.order-skeleton__row {
  height: 56px;
  border-radius: var(--radius-md);
}
.order-skeleton__row--short { width: 70%; }

/* ─────────────────────────── State views ─────────────────────────── */

.state-empty,
.state-error {
  text-align: center;
  padding: var(--space-9) var(--space-4);
  color: var(--color-muted);
}
.state-empty__title,
.state-error__title {
  color: var(--color-text);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}
.state-error__title { color: var(--color-error); }
.state-empty__body, .state-error__body { margin-bottom: var(--space-5); }

/* ─────────────────────────── Skeleton loading ─────────────────────────── */

/* Shared skeleton block. Per DESIGN.md, loading states are skeletons that
 * mirror the final layout — never generic spinners. The shimmer is defined
 * here once so any skeleton variant inherits it. */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-secondary);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--color-bg) 55%, transparent),
    transparent
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 1200ms infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* Product-card skeleton: same outer shape as .product-card so the grid
 * height doesn't jump when real data lands. */
.product-card-skeleton {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.product-card-skeleton__image { aspect-ratio: 1 / 1; width: 100%; }
.product-card-skeleton__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.product-card-skeleton__line { height: 14px; border-radius: var(--radius-sm); }
.product-card-skeleton__line--short { width: 60%; }
.product-card-skeleton__cta { height: 44px; border-radius: var(--radius-md); margin-top: var(--space-2); }

/* Product-detail skeleton mirrors the split layout (gallery + detail column). */
.product-detail-skeleton__gallery { aspect-ratio: 1 / 1; border-radius: var(--radius-md); }
.product-detail-skeleton__lines { display: flex; flex-direction: column; gap: var(--space-3); }
.product-detail-skeleton__title { height: 28px; width: 70%; }
.product-detail-skeleton__price { height: 22px; width: 40%; }
.product-detail-skeleton__desc  { height: 14px; }
.product-detail-skeleton__desc--short { width: 80%; }

/* ─────────────────────────── Confirmation ─────────────────────────── */

.confirmation {
  text-align: center;
  padding: var(--space-9) 0;
  max-width: 480px;
  margin: 0 auto;
}
.confirmation__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success);
  margin-bottom: var(--space-5);
  font-size: var(--text-2xl);
  font-weight: 700;
}
.confirmation__title { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
.confirmation__body { color: var(--color-muted); margin-bottom: var(--space-6); }
.confirmation__order {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  background: var(--color-secondary);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: var(--space-6);
}

/* ─────────────────────────── Prose / About page ─────────────────────────── */

.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { margin-top: var(--space-7); margin-bottom: var(--space-3); }
.prose h3 { margin-top: var(--space-5); margin-bottom: var(--space-2); font-size: var(--text-lg); }
.prose p { margin-bottom: var(--space-4); line-height: var(--leading-body); }
.prose ul, .prose ol { margin: 0 0 var(--space-4) var(--space-5); line-height: var(--leading-body); }
.prose li { margin-bottom: var(--space-2); }
.prose__lead { font-size: var(--text-lg); color: var(--color-text); }
.prose__meta {
  margin: var(--space-4) 0 var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.prose__meta dt { font-weight: 600; color: var(--color-text); }
.prose__meta dd { margin: 0 0 var(--space-2) 0; }

.value-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .value-grid { grid-template-columns: repeat(3, 1fr); }
}
.value-card {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.value-card__title { margin-bottom: var(--space-2); }
.value-card__body { color: var(--color-muted); font-size: var(--text-sm); }

.cta-block {
  text-align: center;
  padding: var(--space-7) 0;
}
.cta-block h2 { margin-bottom: var(--space-4); }

/* ─────────────────────────── Contact page ─────────────────────────── */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-7);
  }
}
.contact-info__row { margin-bottom: var(--space-4); }
.contact-info__row > strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: var(--space-1);
  font-weight: 600;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ─────────────────────────── Account page ─────────────────────────── */

/* Sign-in is the one page where we override the global page-header pattern:
 * a centered card reads as "this is a single focused action" and matches
 * the convention every customer has seen on other webstores. The signed-in
 * dashboard view keeps the page-header pattern. */
.account-layout {
  min-height: calc(100vh - 320px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) 0;
}

.account-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.account-card__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
  text-align: center;
}
.account-card__subtitle {
  color: var(--color-muted);
  text-align: center;
  font-size: var(--text-sm);
  margin: 0 0 var(--space-5);
}

.account-section { margin-top: var(--space-7); }
.account-section__heading {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

/* ─────────────────────────── Blog page ─────────────────────────── */

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 768px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.blog-card__image-link { display: block; }
.blog-card__image {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--color-secondary);
  object-fit: cover;
}
.blog-card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.blog-card__date { font-size: var(--text-xs); color: var(--color-muted); }
.blog-card__title { font-size: var(--text-lg); }
.blog-card__title a { color: var(--color-text); }
.blog-card__title a:hover { color: var(--color-primary); text-decoration: none; }
.blog-card__excerpt { font-size: var(--text-sm); color: var(--color-muted); }

/* ─────────────────────────── Post detail ─────────────────────────── */

.post-detail { max-width: 760px; margin: 0 auto; }
.post-detail__cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}
.post-detail__header { margin-bottom: var(--space-6); }
.post-detail__title {
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-2);
  line-height: var(--leading-tight);
}
.post-detail__meta { color: var(--color-muted); font-size: var(--text-sm); margin: 0; }
.post-detail__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-5) 0;
}
.post-detail__body blockquote {
  border-left: 3px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
  color: var(--color-muted);
  margin: var(--space-4) 0;
}
.post-detail__body code {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 0.95em;
  background: var(--color-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.post-detail__body pre {
  background: var(--color-secondary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: var(--text-sm);
  margin: var(--space-4) 0;
}
.post-detail__body pre code { background: transparent; padding: 0; }

/* ─────────────────────────── Site footer ─────────────────────────── */

.site-footer {
  background: var(--color-secondary);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-9);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 480px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }

.site-footer__heading {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}
.site-footer__list { display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer__list a { color: var(--color-text); font-size: var(--text-sm); }
.site-footer__bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.site-footer__social { display: flex; gap: var(--space-3); }
.site-footer__social a { color: var(--color-muted); font-size: var(--text-sm); }

/* ─────────────────────────── Admin ─────────────────────────── */

/* Admin lives at /admin.html — hidden from nav, accessed by URL. The page
 * reuses the site header/footer so brand consistency stays intact and there's
 * no second mini-shell to maintain. All admin-specific UI lives below. */

.admin-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
  overflow-x: auto;
}
.admin-tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--color-text); }
.admin-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Admin table: dense, sortable-feeling, compact buttons inside.
 * Horizontal scroll on narrow screens rather than reflowing to cards —
 * admin is a desktop-first surface, the owner is at a laptop. */
.admin-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: var(--color-bg);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 720px;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.admin-table thead th {
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  background: var(--color-secondary);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--color-secondary); }
.admin-table__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-secondary);
  object-fit: cover;
}
.admin-table__id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.admin-table__actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  white-space: nowrap;
}
.admin-table__num { font-variant-numeric: tabular-nums; }

.admin-flag {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-secondary);
  color: var(--color-muted);
}
.admin-flag--on {
  background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success);
}
.admin-flag--off {
  background: color-mix(in srgb, var(--color-error) 12%, transparent);
  color: var(--color-error);
}

/* Drawer used for product create/edit. Slides in from the right on desktop,
 * full-screen takeover on mobile (matches cart on mobile). */
.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-tint);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms, visibility 180ms;
}
.admin-drawer-backdrop--open { opacity: 1; visibility: visible; }

.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: var(--color-bg);
  z-index: 101;
  box-shadow: var(--shadow-md);
  transform: translateX(100%);
  transition: transform 220ms ease;
  display: flex;
  flex-direction: column;
}
.admin-drawer--open { transform: translateX(0); }
.admin-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.admin-drawer__title { font-size: var(--text-lg); margin: 0; }
.admin-drawer__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xl);
  color: var(--color-muted);
}
.admin-drawer__close:hover { background: var(--color-secondary); color: var(--color-text); }
.admin-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.admin-drawer__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* Specs editor — a vertical list of (key, value) input pairs with a
 * remove button on each row and an "Add row" button below. */
.specs-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.specs-editor__row {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  gap: var(--space-2);
  align-items: center;
}
.specs-editor__row input { min-height: 36px; }
.specs-editor__remove {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-size: var(--text-lg);
}
.specs-editor__remove:hover { background: var(--color-secondary); color: var(--color-error); }

/* Image manager in the product drawer: a grid of thumbnails with a remove
 * overlay, plus a dashed "upload" tile that triggers the file picker. */
.image-manager {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--space-3);
}
.image-manager__item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-secondary);
}
.image-manager__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-manager__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--overlay-tint);
  color: var(--color-on-overlay);
  font-size: var(--text-sm);
  line-height: 1;
}
.image-manager__remove:hover { background: var(--color-error); }
.image-manager__upload {
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-muted);
  background: transparent;
  cursor: pointer;
}
.image-manager__upload:hover {
  background: var(--color-secondary);
  color: var(--color-text);
}
.image-manager__upload--busy {
  opacity: 0.6;
  cursor: progress;
}

/* Order detail expand: each row in the orders table can flip open to show
 * its line items + shipping address without leaving the page. */
.admin-order-detail {
  background: var(--color-secondary);
  padding: var(--space-4);
}
.admin-order-detail__items {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
}
.admin-order-detail__item {
  display: flex;
  justify-content: space-between;
}
.admin-order-detail__address {
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: pre-line;
}

/* Status select in the orders table — matches form-field styling but compact. */
.admin-status-select {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  min-height: 32px;
}

/* Inline notice strip used for save/delete confirmations and errors. */
.admin-notice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.admin-notice--success {
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
}
.admin-notice--error {
  background: color-mix(in srgb, var(--color-error) 12%, transparent);
  color: var(--color-error);
}

@media (max-width: 767px) {
  .admin-drawer { width: 100vw; }
  .admin-table { font-size: var(--text-xs); }
}
