/* ==========================================================================
   Collection Chic - stylesheet
   --------------------------------------------------------------------------
   Single source of truth. One token block, no duplicate rules.

   01. Tokens          07. Hero            13. Thank you
   02. Reset & base    08. Categories      14. Forms
   03. Layout          09. Product grid    15. Modals
   04. Buttons         10. Services        16. Admin
   05. Header          11. Product page    17. Responsive
   06. Footer          12. Cart
   ========================================================================== */

/* ==========================================================================
   01. Tokens
   ========================================================================== */

:root {
  /* One brand accent (berry) + warm neutrals. */
  --paper: #fbf9f7;
  --surface: #ffffff;
  --surface-sunk: #f4f0ed;
  --ink: #211c1d;
  --muted: #756a6c;
  --line: #e9e3df;
  --line-strong: #d8cfca;
  --berry: #9c2f4a;
  --berry-dark: #7e2439;
  --berry-tint: #fbeff2;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(33, 28, 29, 0.04);
  --shadow-md: 0 4px 16px rgba(33, 28, 29, 0.07);
  --shadow-lg: 0 18px 48px rgba(33, 28, 29, 0.14);

  --header-h: 72px;
  --container: 1200px;
  --container-narrow: 720px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ==========================================================================
   02. Reset & base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.85rem);
}

h2 {
  font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

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

/* Prices/totals must not jitter as they update. */
.product-price,
.product-page-price,
.dimension-price,
.dimension-total,
.dimension-qty-input,
.admin-list-price,
.footer-phone {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--berry);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--berry);
  color: #fff;
}

/* Toggled by app.js for category filtering. */
.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   03. Layout
   ========================================================================== */

main {
  display: block;
  min-height: 60vh;
}

/* Standard constrained block + gutter. */
.product-page,
.cart-page,
.thank-you-page,
.admin-shell,
.admin-login,
.section-head {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* Categories & products bleed full-width: no left/right gutter on desktop. */
.category-row,
.product-grid {
  width: 100%;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* Vertical rhythm between sections. */
.product-grid,
.services-row,
.product-page,
.cart-page,
.thank-you-page,
.category-row {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.section-head {
  padding-top: clamp(1.25rem, 2.5vw, 2.25rem);
  text-align: center;
}

.section-head + .category-row {
  padding-top: clamp(1.25rem, 2.5vw, 2rem);
}

.section-eyebrow {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--berry);
}

.section-title {
  margin-bottom: 0.4rem;
}

.section-sub {
  max-width: 46ch;
  margin-inline: auto;
  color: var(--muted);
}

/* ==========================================================================
   04. Buttons
   ========================================================================== */

.hero-cta,
.add-to-cart-btn,
.buy-now-btn,
.order-submit-btn,
.header-call-btn,
.admin-btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-border: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.15s var(--ease);
}

.hero-cta:hover,
.add-to-cart-btn:hover,
.buy-now-btn:hover,
.order-submit-btn:hover,
.header-call-btn:hover,
.admin-btn:hover {
  transform: translateY(-1px);
}

.hero-cta:active,
.add-to-cart-btn:active,
.buy-now-btn:active,
.order-submit-btn:active,
.admin-btn:active {
  transform: translateY(0);
}

/* Primary = berry. One per view. */
.buy-now-btn,
.order-submit-btn,
.admin-btn-primary {
  --btn-bg: var(--berry);
  --btn-border: var(--berry);
}

.buy-now-btn:hover,
.order-submit-btn:hover,
.admin-btn-primary:hover {
  --btn-bg: var(--berry-dark);
  --btn-border: var(--berry-dark);
}

/* Secondary = outline. */
.add-to-cart-btn,
.header-call-btn,
.admin-btn-muted {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
}

.add-to-cart-btn:hover,
.header-call-btn:hover,
.admin-btn-muted:hover {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-border: var(--ink);
}

.hero-cta svg,
.add-to-cart-btn svg,
.buy-now-btn svg,
.header-call-btn svg,
.order-submit-btn svg,
.admin-btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

/* ==========================================================================
   05. Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  background: rgba(251, 249, 247, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

/* Mark + wordmark grouped inside the one link. */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.logo-image {
  width: 38px;
  height: 38px;
  flex: none;
  object-fit: contain;
}

.logo span {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--ink);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.header-nav a {
  position: relative;
  padding-block: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.header-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--berry);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.header-nav a:hover {
  color: var(--ink);
}

.header-nav a:hover::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  transition: background 0.2s var(--ease);
}

.header-cart-btn:hover {
  background: var(--surface-sunk);
}

.header-cart-btn svg {
  width: 21px;
  height: 21px;
}

.cart-count-badge {
  position: absolute;
  top: 3px;
  right: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  background: var(--berry);
  color: #fff;
  border: 2px solid var(--paper);
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
}

/* ==========================================================================
   06. Footer
   ========================================================================== */

.site-footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 4vw, 2.5rem);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.site-footer p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.footer-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  color: #fff;
  transition: color 0.2s var(--ease);
}

.footer-phone svg {
  width: 22px;
  height: 22px;
}

.footer-phone:hover {
  color: var(--berry-tint);
}

.footer-note {
  padding-top: 1.5rem;
  max-width: var(--container);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   07. Hero
   ========================================================================== */

.hero-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(420px, 62vh, 620px);
  overflow: hidden;
}

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

/* Scrim keeps the headline legible without flattening the photo. */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(24, 18, 19, 0.78) 0%,
    rgba(24, 18, 19, 0.45) 42%,
    rgba(24, 18, 19, 0.12) 100%
  );
}

.hero-content {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 2.5rem);
  color: #fff;
}

.hero-title {
  max-width: 20ch;
  margin: 0 0 0.7rem;
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem);
  color: #fff;
}

.hero-subtitle {
  max-width: 42ch;
  margin: 0 0 1.75rem;
  font-size: clamp(0.98rem, 0.9rem + 0.3vw, 1.1rem);
  color: rgba(255, 255, 255, 0.85);
}

.hero-cta {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
  --btn-border: #fff;
  padding-inline: 1.9rem;
}

.hero-cta:hover {
  --btn-bg: var(--berry);
  --btn-fg: #fff;
  --btn-border: var(--berry);
}

/* ==========================================================================
   08. Categories
   ========================================================================== */

/* Amazon-style: a responsive grid of big, image-first cards. */
.category-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: clamp(0.8rem, 2vw, 1.4rem);
  align-items: stretch;
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

/* Image occupies most of the card; label sits below it. */
.category-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--surface-sunk);
}

.category-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.category-card:hover .category-card-media img {
  transform: scale(1.06);
}

/* Selected state driven by aria-pressed in app.js */
.category-card[aria-pressed="true"] {
  border-color: var(--berry);
  box-shadow: 0 0 0 2px var(--berry), var(--shadow-sm);
}

/* Label block below the image. */
.category-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.8rem 0.88rem 0.92rem;
  border-top: 1px solid var(--line);
}

.category-card-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--ink);
}

.category-card-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.category-card:hover .category-card-label,
.category-card[aria-pressed="true"] .category-card-label {
  color: var(--berry-dark);
}

.category-card:hover .category-card-hint {
  color: var(--berry);
}

/* ==========================================================================
   09. Product grid
   ========================================================================== */

/* Products live on their own white band, clearly separated from the
   paper-background category row above it. */
.product-section {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

/* --- Section toolbar --- */

.product-toolbar {
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  text-align: center;
}

.product-toolbar-head .section-title {
  margin-bottom: 0;
}

.product-count {
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  margin: 0.9rem auto 1.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem);
  align-items: start;
  justify-content: safe center;
}

/* Clean, image-forward tiles - deliberately unlike the bordered
   category cards above. */
.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  transition: transform 0.25s var(--ease);
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.6rem;
  object-fit: cover;
  background: var(--surface-sunk);
  border-radius: var(--radius-lg);
  transition: transform 0.5s var(--ease), box-shadow 0.35s var(--ease);
}

.product-card:hover .product-image {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.product-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding-inline: 0.15rem;
  text-align: center;
}

.product-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease);
}

.product-card:hover .product-title {
  color: var(--berry-dark);
}

.product-price {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--berry);
}

.product-link-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--berry);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.product-link-hint svg {
  width: 13px;
  height: 13px;
}

.product-card:hover .product-link-hint {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   10. Services band
   ========================================================================== */

.services-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  background: var(--surface-sunk);
  border-block: 1px solid var(--line);
}

/* Inner constraint without an extra wrapper in the markup. */
.services-row > .service-item:first-child {
  margin-inline-start: auto;
}

.services-row > .service-item:last-child {
  margin-inline-end: auto;
}

.service-item {
  max-width: 34ch;
  margin-inline: auto;
  text-align: center;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--berry);
  box-shadow: 0 0 0 1px var(--line);
}

.service-icon svg {
  width: 21px;
  height: 21px;
}

.service-item h3 {
  margin-bottom: 0.4rem;
  font-size: 1.08rem;
}

.service-item p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ==========================================================================
   11. Product page
   ========================================================================== */

.product-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

.product-media {
  min-width: 0;
}

.product-media-main {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: none;
  cursor: zoom-in;
}

.product-media-zoom {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}

.product-media-zoom svg {
  width: 17px;
  height: 17px;
}

.product-media-main:hover .product-media-zoom,
.product-media-main:focus-visible .product-media-zoom {
  opacity: 1;
}

.image-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.product-page-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface-sunk);
  border-radius: var(--radius-lg);
}

.product-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.gallery-thumb {
  position: relative;
  width: 76px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.gallery-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery-thumb:hover {
  border-color: var(--berry);
  transform: translateY(-2px);
}

.gallery-thumb-label {
  display: block;
  padding: 0.3rem 0.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.66rem;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
}

/* --- Info column --- */

.product-page-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.product-page-title {
  margin-bottom: 0.5rem;
}

.product-page-price {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem);
  color: var(--berry);
}

.product-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.product-tag {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.product-page-description {
  max-width: 52ch;
  margin-bottom: 1.75rem;
  color: var(--muted);
  line-height: 1.7;
}

/* Markdown-rendered description typography. */
.product-page-description h1,
.product-page-description h2,
.product-page-description h3,
.product-page-description h4 {
  margin: 1.4em 0 0.5em;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}

.product-page-description h1:first-child,
.product-page-description h2:first-child,
.product-page-description h3:first-child,
.product-page-description p:first-child {
  margin-top: 0;
}

.product-page-description p {
  margin: 0 0 1em;
}

.product-page-description ul,
.product-page-description ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.product-page-description li {
  margin-bottom: 0.35em;
}

.product-page-description li::marker {
  color: var(--berry);
}

.product-page-description strong {
  color: var(--ink);
  font-weight: 600;
}

.product-page-description a {
  color: var(--berry);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-page-description code {
  padding: 0.15em 0.4em;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
}

.product-page-description blockquote {
  margin: 0 0 1em;
  padding: 0.15em 0 0.15em 1em;
  border-left: 3px solid var(--berry);
  color: var(--muted);
}

.product-page-description hr {
  margin: 1.75em 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

/* --- Variant / quantity picker --- */

.product-dimensions {
  width: 100%;
  margin-bottom: 1.75rem;
}

.product-dimensions > h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.dimension-card {
  padding: 1rem 1.1rem;
  margin-bottom: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.dimension-card:hover {
  border-color: var(--line-strong);
}

.dimension-card:focus-within {
  border-color: var(--berry);
  box-shadow: 0 0 0 3px var(--berry-tint);
}

.dimension-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.dimension-name {
  font-weight: 500;
  color: var(--ink);
}

.dimension-price {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--berry);
}

.dimension-description {
  margin: 0.35rem 0 0;
  font-size: 0.83rem;
  color: var(--muted);
}

.dimension-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.dimension-qty-label {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* Standalone number input - this is how cart.js injects it. */
.dimension-qty-input {
  width: 74px;
  height: 42px;
  padding: 0 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: center;
}

/* Stepper: minus / input / plus as one segmented control. */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  overflow: hidden;
}

.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.qty-btn:hover {
  background: var(--berry);
  color: #fff;
}

/* Inside the stepper the input drops its own chrome. */
.qty-stepper .dimension-qty-input {
  width: 52px;
  border: 0;
  border-inline: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-weight: 500;
}

/* Native spinners fight the custom stepper. */
.dimension-qty-input::-webkit-outer-spin-button,
.dimension-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dimension-qty-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.dimension-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.product-total-box {
  display: flex;
  flex-direction: column;
}

.product-total-box .dimension-total {
  margin-top: 0.5rem;
}

.dimension-total > span:first-child {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.dimension-total-lite {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.dimension-total-lite > span:first-child {
  color: var(--muted);
}

.dimension-total > span:last-child {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

/* Simple (no-variant) quantity row */
.simple-cart-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
  padding-block: 1.1rem;
  border-block: 1px solid var(--line);
}

/* --- Actions --- */

.product-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
}

.product-actions-row > button {
  flex: 1 1 190px;
}

.product-out-of-stock {
  width: 100%;
  padding: 1rem 1.1rem;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* Reassurance strip under the buy buttons. */
.product-reassurance {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin: 1.5rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.product-reassurance li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.product-reassurance svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--berry);
}

/* ==========================================================================
   12. Cart
   ========================================================================== */

.cart-page {
  max-width: var(--container-narrow);
}

.cart-page > h1 {
  margin-bottom: 1.75rem;
}

#cart-items-container {
  margin-bottom: 0.5rem;
}

#cart-empty-msg {
  padding: 3rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

#cart-empty-msg a {
  color: var(--berry);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-remove-btn {
  min-height: 38px;
  padding-inline: 1rem;
  font-size: 0.82rem;
}

/* ==========================================================================
   13. Thank you
   ========================================================================== */

.thank-you-page {
  max-width: 46rem;
  padding-block: clamp(3.5rem, 8vw, 6rem);
  text-align: center;
}

.thank-you-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  margin-bottom: 1.75rem;
  border-radius: var(--radius-pill);
  background: var(--berry-tint);
  color: var(--berry);
}

.thank-you-icon svg {
  width: 30px;
  height: 30px;
}

.thank-you-page p {
  max-width: 44ch;
  margin-inline: auto;
  color: var(--muted);
}

.thank-you-page .admin-btn {
  margin-top: 2rem;
}

/* ==========================================================================
   14. Forms
   ========================================================================== */

.admin-form,
.order-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.order-form {
  margin-top: 1.75rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.admin-form label,
.order-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.order-form input,
.order-form select,
.order-form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.admin-form textarea,
.order-form textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus {
  outline: none;
  border-color: var(--berry);
  box-shadow: 0 0 0 3px var(--berry-tint);
}

.admin-form input[type="file"] {
  padding: 0.55rem;
  background: var(--surface-sunk);
  font-size: 0.85rem;
}

.admin-form input[type="checkbox"] {
  width: auto;
  accent-color: var(--berry);
}

.order-form .order-submit-btn,
.admin-form .order-submit-btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

#buy-now-form .order-submit-btn {
  align-self: center;
}

/* Two-up fields once there is room. */
@media (min-width: 640px) {
  .order-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
  }

  .order-form > .order-submit-btn {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   15. Modals
   ========================================================================== */

.modal-overlay {
  /* display is toggled to flex by cart.js */
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(24, 18, 19, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.2s var(--ease);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 26rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-rise 0.25s var(--ease);
}

.modal-card h2 {
  margin-bottom: 0.35rem;
  padding-right: 2rem;
  font-size: 1.3rem;
}

.modal-card > p {
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.modal-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.modal-close-btn svg {
  width: 17px;
  height: 17px;
}

.modal-close-btn:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}

.modal-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-btn-row > * {
  width: 100%;
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1rem;
  border-radius: var(--radius-pill);
  background: var(--berry-tint);
  color: var(--berry);
}

.modal-icon svg {
  width: 22px;
  height: 22px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* ==========================================================================
   16. Admin
   ========================================================================== */

.admin-shell {
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.admin-nav a {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.admin-nav a:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}

.admin-nav-logout {
  margin-inline-start: auto;
  color: var(--berry);
}

.admin-nav-logout:hover {
  background: var(--berry-tint);
  color: var(--berry-dark);
}

.admin-body > h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.admin-page-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

/* Admin buttons are more compact than storefront CTAs. */
.admin-btn {
  min-height: 40px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.admin-inline-form {
  display: inline;
}

/* --- List rows --- */

.admin-list-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.admin-list-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.admin-thumb {
  width: 54px;
  height: 54px;
  flex: none;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-sunk);
}

.admin-list-info {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  min-width: 0;
}

.admin-list-title {
  flex: 1 1 12rem;
  min-width: 0;
  font-weight: 500;
}

.admin-list-price {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--berry);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.admin-badge-ok {
  background: #e8f3ec;
  color: #2f6b45;
}

.admin-badge-off {
  background: var(--berry-tint);
  color: var(--berry);
}

/* --- Order cards --- */

.admin-order-card {
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-order-card p {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-order-name {
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
}

.admin-order-card p.admin-order-name {
  font-size: 1.2rem;
  color: var(--ink);
}

.admin-order-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--berry);
}

.admin-order-phone svg {
  width: 16px;
  height: 16px;
}

.admin-order-phone:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-order-card p.admin-order-details {
  padding: 0.7rem 0.85rem;
  margin-block: 0.6rem;
  background: var(--surface-sunk);
  border-radius: var(--radius);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  word-break: break-word;
}

.admin-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

/* --- Login --- */

.admin-login {
  max-width: 24rem;
  padding-block: clamp(3rem, 7vw, 5rem);
}

.admin-login h1 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.admin-login .admin-form {
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.admin-login .admin-btn {
  --btn-bg: var(--berry);
  --btn-border: var(--berry);
  --btn-fg: #fff;
  width: 100%;
  margin-top: 0.5rem;
}

.admin-login .admin-btn:hover {
  --btn-bg: var(--berry-dark);
  --btn-border: var(--berry-dark);
}

.admin-error {
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  background: var(--berry-tint);
  border: 1px solid #f0cdd6;
  border-radius: var(--radius);
  font-size: 0.87rem;
  color: var(--berry-dark);
  text-align: center;
}

.admin-form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

/* --- Product form extras --- */

.admin-checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.admin-form label.admin-checkbox-label {
  flex-direction: row;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.admin-current-image {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunk);
}

.admin-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-form label.admin-tag-option {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.83rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.admin-form label.admin-tag-option:hover {
  border-color: var(--berry);
  background: var(--berry-tint);
}

.admin-form label.admin-tag-option:has(input:checked) {
  border-color: var(--berry);
  background: var(--berry-tint);
  color: var(--berry-dark);
}

.admin-dimension-list,
.existing-subimages {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dimension-row,
.existing-subimage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dimension-row input,
.existing-subimage-row input {
  flex: 1 1 8rem;
  min-width: 0;
}

.existing-subimage-row img {
  width: 46px;
  height: 46px;
  flex: none;
  object-fit: cover;
  border-radius: 4px;
}

.remove-dimension-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.remove-dimension-btn:hover {
  background: var(--berry);
  border-color: var(--berry);
  color: #fff;
}

/* ==========================================================================
   17. Responsive
   ========================================================================== */

@media (min-width: 900px) {
  .product-page {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }

  /* Gallery follows the reader down a long variant list. */
  .product-media {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}

.header-call-btn .call-number {
  display: none;
}

@media (max-width: 899px) and (min-width: 768px) {
  /* Tablet phone CTA keeps only its icon when space is tight. */
  .header-call-btn {
    width: 44px;
    padding: 0;
  }

  .header-call-btn span {
    display: none;
  }
}

@media (max-width: 899px) {
  .header-call-btn .call-label {
    display: none;
  }
}

@media (max-width: 767px) {
  .header-call-btn .call-number {
    display: inline;
  }

  .header-nav {
    display: none;
  }

  .logo span {
    font-size: 1.05rem;
  }

  /* Categories use a tighter grid on small screens. */
  .category-row {
    grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
    gap: 0.6rem;
    padding-inline: clamp(1rem, 4vw, 2.5rem);
  }

  .category-card-body {
    padding: 0.56rem 0.64rem 0.64rem;
  }

  .category-card-label {
    font-size: 1rem;
  }

  .category-card-hint {
    font-size: 0.74rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  }

  .product-actions-row > button {
    flex-basis: 100%;
  }
}

@media (max-width: 420px) {
  .logo span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
