/* =============================================================
   Cottage Law Baking Co. — app.css
   Design tokens → reset → typography → layout → components
   ============================================================= */

/* -------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------- */
:root {
  /* Brand colors */
  --brown-900: #2c1a0e;
  --brown-700: #3b2314;
  --brown-500: #6b4226;
  --brown-300: #c4956a;
  --brown-100: #f5e8d8;
  --cream:     #fdf7f0;
  --teal-700:  #1a8a9e;
  --teal-500:  #24afc3;
  --teal-300:  #7dd4e4;
  --black:     #0a0a0a;
  --white:     #ffffff;

  /* Semantic */
  --color-bg:          var(--cream);
  --color-text:        var(--brown-900);
  --color-text-muted:  var(--brown-500);
  --color-primary:     var(--brown-700);
  --color-accent:      var(--teal-500);
  --color-accent-dark: var(--teal-700);
  --color-nav-bg:      var(--brown-900);
  --color-nav-text:    var(--cream);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --nav-h:       64px;
  --nav-safe-h:  calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  --container:   1200px;
  --section-pad: clamp(3rem, 7vw, 5.5rem);
  --gap:         1.5rem;

  /* Radii */
  --radius:     8px;
  --radius-lg:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(44,26,14,.12);
  --shadow-md: 0 4px 16px rgba(44,26,14,.12);
  --shadow-lg: 0 8px 32px rgba(44,26,14,.16);

  /* Transitions */
  --ease: cubic-bezier(.25,.46,.45,.94);
}

/* -------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
body {
  overscroll-behavior-y: none;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

#main-content {
  background: var(--color-bg);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* -------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; }

p { max-width: 65ch; }

/* -------------------------------------------------------------
   4. Layout utilities
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
}

.section {
  padding-block: var(--section-pad);
}

.section--cream { background: var(--cream); }
.section--white { background: var(--white); }

.section__heading {
  text-align: center;
  margin-bottom: .75rem;
}

.section__subheading {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: 3rem;
}

.section__cta {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* -------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .15s var(--ease),
              box-shadow .2s var(--ease);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn:active { transform: scale(.97); }

.btn--lg { padding: .8rem 2rem; font-size: 1rem; }

.btn--primary {
  background: var(--brown-700);
  color: var(--cream);
  border-color: var(--brown-700);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--brown-900);
  border-color: var(--brown-900);
  box-shadow: var(--shadow-sm);
}

.btn--accent {
  background: var(--teal-500);
  color: var(--white);
  border-color: var(--teal-500);
}
.btn--accent:hover, .btn--accent:focus-visible {
  background: var(--teal-700);
  border-color: var(--teal-700);
  box-shadow: var(--shadow-sm);
}

.btn--outline-light {
  background: transparent;
  color: var(--cream);
  border-color: rgba(253,247,240,.6);
}
.btn--outline-light:hover, .btn--outline-light:focus-visible {
  background: rgba(253,247,240,.12);
  border-color: var(--cream);
}

/* Theme-aware outline button — uses CSS variables so themes override naturally */
.btn--outline {
  background: transparent;
  color: var(--brown-700);
  border-color: var(--brown-700);
}
.btn--outline:hover, .btn--outline:focus-visible {
  background: var(--brown-700);
  color: var(--white);
}

/* Pay-at-pickup button — sits below payment options as a secondary choice.
   Uses border + muted text so it's visible but clearly secondary to Stripe/PayPal above.
   Avoids CSS variables that the theme-switcher might partially override mid-render. */
.btn--pickup {
  background: #f5f0ea;
  color: #5a3e28;
  border: 2px solid #c4a882;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.btn--pickup:hover, .btn--pickup:focus-visible {
  background: #e8ddd0;
  color: #3d2412;
  border-color: #8b6040;
}

/* -------------------------------------------------------------
   6. Navbar
   ------------------------------------------------------------- */
.navbar {
  position: fixed;         /* Critical for iOS PWA sticky nav */
  top: 0; left: 0; right: 0;
  height: var(--nav-safe-h);
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
  background: var(--brown-900);
  color: var(--cream);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  /* Forces GPU compositing layer — prevents iOS rubber-band bounce
     from temporarily pulling the navbar out of its fixed position */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

.navbar__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
}

/* Logo */
.navbar__logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
  text-decoration: none;
}

.navbar__logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--black);
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.12);
}

.navbar__logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.navbar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.navbar__logo-top {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: .02em;
}

.navbar__logo-bottom {
  font-family: var(--font-display);
  font-size: .82rem;
  color: var(--teal-300);
  letter-spacing: .02em;
}

/* Desktop nav links */
.navbar__links {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}

.navbar__link {
  padding: .4rem .8rem;
  font-size: .9rem;
  font-weight: 600;
  color: rgba(253,247,240,.8);
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  text-decoration: none;
}

.navbar__link:hover, .navbar__link:focus-visible {
  color: var(--cream);
  background: rgba(255,255,255,.08);
}

.navbar__link--active {
  color: var(--teal-300);
}

/* Actions */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: .75rem;
}

.navbar__cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  color: rgba(253,247,240,.8);
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.navbar__cart:hover { color: var(--cream); background: rgba(255,255,255,.08); }

.navbar__cart-count {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--teal-500);
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 3px;
}

/* Hamburger */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 8px;
  border-radius: var(--radius);
  transition: background .15s;
}
.navbar__hamburger:hover { background: rgba(255,255,255,.08); }

.navbar__hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s;
}

/* Hamburger → X state */
.navbar__hamburger[aria-expanded="true"] .navbar__hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar__hamburger[aria-expanded="true"] .navbar__hamburger-bar:nth-child(2) {
  opacity: 0;
}
.navbar__hamburger[aria-expanded="true"] .navbar__hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.navbar__mobile {
  background: var(--brown-700);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: .75rem 0;
}

.navbar__mobile[hidden] { display: none; }

.navbar__mobile-link {
  display: block;
  padding: .75rem clamp(1rem, 5vw, 2rem);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(253,247,240,.85);
  transition: color .15s, background .15s;
  text-decoration: none;
}
.navbar__mobile-link:hover, .navbar__mobile-link--active {
  color: var(--cream);
  background: rgba(255,255,255,.06);
}

.navbar__mobile-divider {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: .5rem 0;
}

/* Spacer — pushes content below fixed nav */
.navbar__spacer {
  height: var(--nav-safe-h);
}

/* Navbar scroll shadow (JS adds .navbar--scrolled) */
.navbar--scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

/* Responsive: show hamburger, hide links on mobile */
@media (max-width: 768px) {
  .navbar__links   { display: none; }
  .navbar__hamburger { display: flex; }
}

/* -------------------------------------------------------------
   7. Hero
   ------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--black);
  min-height: calc(100svh - var(--nav-safe-h));
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__img-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hero__img {
  height: 100%;
  width: auto;
  max-width: 65%;
  object-fit: contain;
  object-position: center;
  opacity: .9;
}

/* Left gradient fade so text is readable */
.hero__img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--black) 30%,
    rgba(10,10,10,.7) 55%,
    transparent 75%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
  padding-block: 4rem;
}

.hero__eyebrow {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-300);
  margin-bottom: 1rem;
  max-width: none;
}

.hero__heading {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 1.25rem;
  max-width: 9ch;
}

.hero__heading-accent { color: var(--teal-300); }

.hero__tagline {
  font-size: clamp(.95rem, 1.8vw, 1.15rem);
  color: rgba(253,247,240,.8);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 38ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 600px) {
  .hero {
    align-items: flex-start;
    min-height: auto; /* was locked to ~full viewport height — that's what kept both gaps large regardless of align-items */
  }

  .hero__content {
    /* Same fluid value used for both top and bottom, per request —
       shrinks on narrow phones, more generous on wider ones. */
    padding-top: clamp(1rem, 6vw, 2rem);
    padding-bottom: clamp(1rem, 6vw, 2rem);
  }

  .hero__img-wrap {
    justify-content: flex-start;
    align-items: flex-start;
  }

  .hero__img {
    position: absolute;
    /* top scaled -7% from previous; width/size confirmed good, untouched */
    top: clamp(3.45rem, calc(6.72vw + 2.34rem), 4.58rem);
    left: 57%;
    height: auto;
    width: clamp(133px, 41.1vw, 242px);
    max-width: none;
    opacity: .9; /* same as desktop — never faded out */
    object-fit: contain;
    object-position: top left;
  }

  .hero__img-wrap::before {
    /* lighter than before — donkey stays visible, text gets a shadow instead for legibility */
    background: linear-gradient(to bottom, rgba(10,10,10,.45) 0%, rgba(10,10,10,.7) 55%, rgba(10,10,10,.85) 100%);
  }
  .hero__heading,
  .hero__eyebrow,
  .hero__tagline {
    text-shadow: 0 2px 12px rgba(0,0,0,.8), 0 1px 3px rgba(0,0,0,.9);
  }
  .hero__heading { max-width: none; }
  .hero__tagline { max-width: none; }
}

/* -------------------------------------------------------------
   8. Teal strip
   ------------------------------------------------------------- */
.strip-teal {
  background: var(--teal-700);
  color: var(--white);
  padding-block: .9rem;
}

.strip-teal__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.strip-teal p {
  font-size: .95rem;
  max-width: none;
}

.strip-teal__cta {
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  text-decoration: underline;
  color: var(--white);
  opacity: .9;
  transition: opacity .15s;
}
.strip-teal__cta:hover { opacity: 1; }

/* -------------------------------------------------------------
   9. Features grid
   ------------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.feature-card__icon {
  width: 52px; height: 52px;
  background: var(--brown-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--brown-700);
}

.feature-card__icon svg {
  width: 28px; height: 28px;
}

.feature-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--brown-700);
  margin-bottom: .5rem;
}

.feature-card__body {
  font-size: .9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: none;
}

/* -------------------------------------------------------------
   10. Products preview placeholders
   ------------------------------------------------------------- */
.products-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.product-placeholder {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.product-placeholder__img {
  height: 220px;
  background: linear-gradient(90deg, #f0e8df 25%, #f8f0e8 50%, #f0e8df 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite;
}

.product-placeholder__lines {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.product-placeholder__line {
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #f0e8df 25%, #f8f0e8 50%, #f0e8df 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite;
}
.product-placeholder__line--title { height: 16px; width: 70%; }
.product-placeholder__line--price { height: 14px; width: 35%; }

/* -------------------------------------------------------------
   11. Order banner
   ------------------------------------------------------------- */
.order-banner {
  background: var(--brown-700);
  padding-block: var(--section-pad);
  color: var(--cream);
}

.order-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.order-banner__heading {
  font-family: var(--font-display);
  color: var(--white);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: .5rem;
}

.order-banner__body {
  color: rgba(253,247,240,.8);
  font-size: .95rem;
  max-width: 44ch;
}

/* -------------------------------------------------------------
   12. Footer
   ------------------------------------------------------------- */
.footer {
  background: var(--brown-900);
  color: rgba(253,247,240,.75);
  padding-top: clamp(3rem, 6vw, 4.5rem);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .footer__inner { grid-template-columns: 1.5fr 1fr 1fr; }
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  text-decoration: none;
}

.footer__logo-badge {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--black);
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.1);
}
.footer__logo-badge img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.footer__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.footer__logo-top {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--cream);
}
.footer__logo-bottom {
  font-family: var(--font-display);
  font-size: .82rem;
  color: var(--teal-300);
}

.footer__tagline {
  font-size: .875rem;
  line-height: 1.6;
  max-width: 28ch;
}

.footer__nav-heading {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 1rem;
}

.footer__nav ul { display: flex; flex-direction: column; gap: .5rem; }

.footer__nav a,
.footer__contact a {
  font-size: .9rem;
  color: rgba(253,247,240,.7);
  transition: color .15s;
  text-decoration: none;
}
.footer__nav a:hover,
.footer__contact a:hover { color: var(--teal-300); }

.footer__contact p {
  font-size: .9rem;
  margin-bottom: .5rem;
  max-width: none;
}

.footer__hours {
  color: rgba(253,247,240,.55);
  font-size: .85rem;
  line-height: 1.6;
}

.footer__bottom {
  margin-top: 3rem;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-block: 1.25rem;
}

.footer__bottom p {
  font-size: .8rem;
  color: rgba(253,247,240,.4);
  max-width: none;
}

/* -------------------------------------------------------------
   13. Error / 404 page
   ------------------------------------------------------------- */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding-block: 4rem;
}

.error-page__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.error-page__donkey img {
  width: 200px;
  border-radius: var(--radius-lg);
  margin-inline: auto;
  opacity: .85;
}

.error-page__heading {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.error-page__body {
  color: var(--color-text-muted);
  max-width: 36ch;
  margin-inline: auto;
}

/* -------------------------------------------------------------
   14. Focus styles (accessibility)
   ------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--teal-500);
  outline-offset: 3px;
  border-radius: 3px;
}

/* -------------------------------------------------------------
   15. Utility classes
   ------------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted   { color: var(--color-text-muted); }
.mt-2         { margin-top: 2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* =============================================================
   Stage 3 — Auth, Admin, Catalog styles
   ============================================================= */

/* -------------------------------------------------------------
   Shared form components
   ------------------------------------------------------------- */
.form-group         { display:flex; flex-direction:column; gap:.35rem; }
.form-label         { font-size:.875rem; font-weight:600; color:var(--color-text); }
.form-label__link   { float:right; font-weight:400; color:var(--color-accent); font-size:.8rem; }
.form-label__opt    { font-weight:400; color:var(--color-text-muted); font-size:.8rem; }
.form-input {
  width:100%; padding:.6rem .85rem;
  font-family:inherit; font-size:.95rem; font-size:16px;
  border:1.5px solid var(--brown-100); border-radius:var(--radius);
  background:var(--white); color:var(--color-text);
  transition:border-color .15s;
}
.form-input:focus   { outline:none; border-color:var(--teal-500); box-shadow:0 0 0 3px rgba(36,175,195,.15); }
.form-textarea      { resize:vertical; min-height:100px; }
.form-hint          { font-size:.78rem; color:var(--color-text-muted); }
.form-check         { display:flex; align-items:center; gap:.5rem; cursor:pointer; font-size:.9rem; }
.form-check input   { width:16px; height:16px; accent-color:var(--teal-500); cursor:pointer; }
.form-group--checks { gap:.6rem; }
.input-prefix-wrap  { display:flex; align-items:stretch; }
.input-prefix {
  background:var(--brown-100); border:1.5px solid var(--brown-100);
  border-right:none; border-radius:var(--radius) 0 0 var(--radius);
  padding:.6rem .75rem; font-weight:600; color:var(--color-text-muted);
}
.form-input--prefixed { border-radius:0 var(--radius) var(--radius) 0; }
.form-input-file    { font-size:.875rem; }
.btn--full          { width:100%; justify-content:center; }
.btn--sm            { padding:.35rem .85rem; font-size:.82rem; }

/* -------------------------------------------------------------
   Auth pages
   ------------------------------------------------------------- */
.auth-page {
  min-height:80vh; display:flex;
  align-items:center; justify-content:center; padding:2rem;
}
.auth-card {
  background:var(--white); border-radius:var(--radius-lg);
  padding:2.5rem; width:100%; max-width:420px;
  box-shadow:var(--shadow-lg);
}
.auth-card__logo { display:flex; align-items:center; gap:.75rem; margin-bottom:1.5rem; }
.auth-card__logo img { border-radius:50%; background:#000; object-fit:cover; object-position:center 20%; }
.auth-card__brand { display:flex; flex-direction:column; }
.auth-card__brand-top { font-family:var(--font-display); font-weight:700; font-size:1rem; color:var(--brown-700); }
.auth-card__brand-bottom { font-family:var(--font-display); font-size:.85rem; color:var(--teal-500); }
.auth-card__heading { font-size:1.5rem; margin-bottom:.25rem; }
.auth-card__sub { color:var(--color-text-muted); font-size:.9rem; margin-bottom:1.5rem; max-width:none; }
.auth-alert { padding:.75rem 1rem; border-radius:var(--radius); margin-bottom:1.25rem; font-size:.9rem; }
.auth-alert--error { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.auth-alert--info  { background:#eff6ff; color:#1e40af; border:1px solid #bfdbfe; }
.auth-alert ul     { margin:0; padding-left:1.25rem; }
.auth-form { display:flex; flex-direction:column; gap:1.1rem; }
.auth-card__footer { text-align:center; margin-top:1.5rem; font-size:.9rem; color:var(--color-text-muted); max-width:none; }
.auth-card__footer a { color:var(--color-primary); font-weight:600; }

/* -------------------------------------------------------------
   Admin layout
   ------------------------------------------------------------- */
.admin-wrap    { display:flex; min-height:calc(100vh - var(--nav-h)); }
.admin-sidebar {
  width:220px; flex-shrink:0;
  background:var(--brown-900);
  display:flex; flex-direction:column;
  position:sticky; top:var(--nav-safe-h); height:calc(100vh - var(--nav-h)); overflow-y:auto;
}
.admin-sidebar__logo {
  display:flex; align-items:center; gap:.6rem;
  padding:1.25rem 1rem; border-bottom:1px solid rgba(255,255,255,.08);
  color:var(--cream); font-weight:700; font-size:.9rem; flex-shrink:0;
}
.admin-sidebar__logo img { border-radius:50%; background:var(--black); object-fit:cover; object-position:center 20%; }
.admin-sidebar__nav  { flex:1; padding:.75rem 0; }
.admin-sidebar__link {
  display:flex; align-items:center; gap:.6rem; padding:.65rem 1rem;
  font-size:.875rem; color:rgba(253,247,240,.7);
  text-decoration:none; transition:background .15s, color .15s;
}
.admin-sidebar__link:hover       { background:rgba(255,255,255,.06); color:var(--cream); }
.admin-sidebar__link--active     { background:rgba(255,255,255,.1); color:var(--cream); }
.admin-sidebar__footer           { border-top:1px solid rgba(255,255,255,.08); padding:.75rem 0; flex-shrink:0; }
.admin-main   { flex:1; padding:2rem; overflow:auto; max-width:1100px; }
.admin-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:1.5rem; gap:1rem; flex-wrap:wrap;
}
.admin-title  { font-size:1.5rem; margin:0; }

/* Stats */
.admin-stats  { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:1rem; margin-bottom:2rem; }
.stat-card    { background:var(--white); border-radius:var(--radius-lg); padding:1.25rem; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:.25rem; }
.stat-card--teal { border-left:4px solid var(--teal-500); }
.stat-card__num   { font-size:2rem; font-weight:700; font-family:var(--font-display); color:var(--brown-700); }
.stat-card__label { font-size:.75rem; color:var(--color-text-muted); font-weight:700; text-transform:uppercase; letter-spacing:.05em; }

/* Table */
.admin-section       { background:var(--white); border-radius:var(--radius-lg); padding:1.5rem; box-shadow:var(--shadow-sm); }
.admin-section__title{ font-size:1.1rem; margin-bottom:1rem; }
.admin-section__more { margin-top:1rem; font-size:.875rem; }
.admin-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; max-width:100%; }
.admin-table         { width:100%; border-collapse:collapse; font-size:.875rem; }
.admin-table th      { text-align:left; padding:.75rem .5rem; border-bottom:2px solid var(--brown-100); font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--color-text-muted); }
.admin-table td      { padding:.65rem .5rem; border-bottom:1px solid var(--brown-100); vertical-align:middle; }
.admin-table tr:last-child td { border-bottom:none; }
.admin-table__thumb  { width:48px; height:48px; object-fit:cover; border-radius:var(--radius); }
.admin-table__no-img { width:48px; height:48px; border-radius:var(--radius); background:var(--brown-100); display:flex; align-items:center; justify-content:center; font-size:.65rem; color:var(--color-text-muted); }
.admin-table__actions{ display:flex; gap:.5rem; align-items:center; }
.admin-link          { font-size:.85rem; color:var(--teal-700); font-weight:600; text-decoration:none; background:none; border:none; cursor:pointer; padding:0; }
.admin-link:hover    { color:var(--teal-500); }
.admin-link--danger  { color:#dc2626; }
.admin-link--danger:hover { color:#991b1b; }

/* Alerts, badges, empty */
.admin-alert           { padding:.75rem 1rem; border-radius:var(--radius); margin-bottom:1.25rem; font-size:.9rem; }
.admin-alert--success  { background:#f0fdf4; color:#166534; border:1px solid #bbf7d0; }
.admin-alert--error    { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.admin-alert ul        { margin:0; padding-left:1.25rem; }
.admin-empty           { text-align:center; padding:3rem; color:var(--color-text-muted); }
.admin-empty p         { margin-bottom:1rem; }
.badge                 { display:inline-flex; align-items:center; padding:.2rem .6rem; border-radius:var(--radius-full); font-size:.72rem; font-weight:700; letter-spacing:.03em; }
.badge--green          { background:#dcfce7; color:#166534; }
.badge--grey           { background:var(--brown-100); color:var(--color-text-muted); }
.badge--teal           { background:#d0f0f8; color:#0d5f6e; }
.badge--red            { background:#fee2e2; color:#991b1b; }
.badge--orange         { background:#fff3e0; color:#b45309; }

/* Admin form */
.admin-form              { background:var(--white); border-radius:var(--radius-lg); padding:1.75rem; box-shadow:var(--shadow-sm); }
.admin-form__grid        { display:grid; grid-template-columns:1fr 1fr; gap:2rem; margin-bottom:1.5rem; }
.admin-form__col         { display:flex; flex-direction:column; gap:1.1rem; }
.admin-form__actions     { display:flex; gap:1rem; padding-top:1rem; border-top:1px solid var(--brown-100); }
.admin-img-preview       { margin-bottom:.75rem; }
.admin-img-preview img   { max-width:200px; border-radius:var(--radius); border:1px solid var(--brown-100); }
.admin-img-preview__note { display:block; font-size:.78rem; color:var(--color-text-muted); margin-top:.25rem; }

/* ── Mobile admin sidebar: icon rail + expandable drawer ── */

/* Hamburger toggle button — inside sidebar header */
.admin-sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
}
.admin-sidebar-toggle:hover { background: rgba(255,255,255,.1); }
.admin-sidebar-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* Backdrop */
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.admin-sidebar-backdrop--open { display: block; }

/* Label spans — visible on desktop, hidden on mobile icon rail */
.admin-sidebar__label { flex: 1; }

@media (max-width:768px) {
  .admin-sidebar-toggle { display: flex; }
  /* Icon rail — always visible, narrow, sticky so footer shows on scroll */
  .admin-sidebar {
    position: sticky;
    top: var(--nav-safe-h);
    left: 0;
    width: 52px;
    height: calc(100vh - var(--nav-safe-h));
    z-index: 200;
    overflow: hidden;
    transition: width .25s ease;
    flex-shrink: 0;
    align-self: flex-start;
  }
  /* Expanded drawer state — fixed so it overlays admin-main */
  .admin-sidebar--expanded {
    position: fixed;
    top: var(--nav-safe-h);
    left: 0;
    width: 220px;
    height: calc(100vh - var(--nav-safe-h));
    overflow-y: auto;
    overflow-x: hidden;
  }
  /* Hide text labels in icon rail, show in expanded */
  .admin-sidebar__label             { display: none; }
  .admin-sidebar--expanded .admin-sidebar__label { display: block; }
  /* Hide logo text and img in icon rail, show in expanded */
  .admin-sidebar__logo-text         { display: none; }
  .admin-sidebar--expanded .admin-sidebar__logo-text { display: block; }
  .admin-sidebar__logo-img          { display: none; }
  .admin-sidebar--expanded .admin-sidebar__logo-img  { display: block; }
  /* Center icons in rail */
  .admin-sidebar__link {
    justify-content: center;
    padding: .65rem 0;
  }
  .admin-sidebar--expanded .admin-sidebar__link {
    justify-content: flex-start;
    padding: .65rem 1rem;
  }
  /* Logo area in rail — center hamburger */
  .admin-sidebar__logo {
    justify-content: center;
    padding: .75rem 0;
  }
  .admin-sidebar--expanded .admin-sidebar__logo {
    justify-content: flex-start;
    padding: 1.25rem 1rem;
  }
  /* Hide hamburger toggle when expanded — backdrop/link-tap closes it */
  .admin-sidebar--expanded .admin-sidebar-toggle { display: none; }
  /* admin-main offset by icon rail width */
  .admin-main { padding: 1.5rem 1rem; }
  .admin-form__grid { grid-template-columns: 1fr; }
}

@media (max-width:1024px) and (orientation:landscape) {
  .admin-sidebar { padding-left: env(safe-area-inset-left, 0px); }
  .admin-main    { padding-right: env(safe-area-inset-right, 0px); }
}

/* -------------------------------------------------------------
   Product catalog
   ------------------------------------------------------------- */
.cat-tabs     { display:flex; gap:.5rem; flex-wrap:wrap; margin-bottom:2rem; padding-bottom:1rem; border-bottom:1px solid var(--brown-100); }
.cat-tab      { padding:.4rem 1rem; border-radius:var(--radius-full); font-size:.85rem; font-weight:600; color:var(--color-text-muted); border:1.5px solid var(--brown-100); text-decoration:none; transition:all .15s; }
.cat-tab:hover       { border-color:var(--brown-300); color:var(--color-text); }
.cat-tab--active     { background:var(--brown-700); border-color:var(--brown-700); color:var(--white); }

.products-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:1.5rem; }
.products-grid--home { grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); }

.product-card { background:var(--white); border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow-sm); transition:box-shadow .2s,transform .2s; display:flex; flex-direction:column; }
.product-card:hover  { box-shadow:var(--shadow-md); transform:translateY(-3px); }
.product-card__img-link { position:relative; display:block; }
.product-card__img   { width:100%; height:220px; object-fit:cover; display:block; }
.product-card__img--placeholder { height:220px; background:var(--brown-100); display:flex; align-items:center; justify-content:center; font-size:3rem; }
.product-card__badge { position:absolute; top:.75rem; left:.75rem; background:var(--teal-500); color:#fff; font-size:.7rem; font-weight:700; padding:.2rem .6rem; border-radius:var(--radius-full); }
.product-card__badge--sold { background:var(--brown-500); }
.product-card__body  { padding:1.1rem; flex:1; display:flex; flex-direction:column; gap:.4rem; }
.product-card__cat   { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--teal-700); }
.product-card__name  { font-family:var(--font-display); font-size:1.05rem; margin:0; }
.product-card__name a{ color:var(--color-primary); text-decoration:none; }
.product-card__name a:hover { color:var(--teal-700); }
.product-card__footer{ display:flex; align-items:center; justify-content:space-between; margin-top:auto; padding-top:.75rem; }
.product-card__price { font-family:var(--font-display); font-size:1.15rem; font-weight:700; color:var(--brown-700); }
.product-card__sold  { font-size:.8rem; color:var(--color-text-muted); }
.products-empty      { text-align:center; padding:4rem 1rem; color:var(--color-text-muted); }

/* Product detail */
.product-detail          { padding-top:1.5rem; padding-bottom:4rem; }
.breadcrumb              { display:flex; align-items:center; gap:.5rem; font-size:.85rem; color:var(--color-text-muted); margin-bottom:2rem; flex-wrap:wrap; }
.breadcrumb a            { color:var(--teal-700); text-decoration:none; }
.breadcrumb a:hover      { color:var(--teal-500); }
.product-detail__grid    { display:grid; grid-template-columns:1fr 1fr; gap:3rem; }
.product-detail__img-wrap{ border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow-md); }
.product-detail__img     { width:100%; height:auto; display:block; }
.product-detail__img--placeholder { height:320px; background:var(--brown-100); display:flex; align-items:center; justify-content:center; }
.product-detail__cat     { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--teal-700); text-decoration:none; }
.product-detail__name    { font-size:clamp(1.5rem,3vw,2.2rem); margin:.4rem 0 .75rem; }
.product-detail__price   { font-family:var(--font-display); font-size:1.75rem; font-weight:700; color:var(--brown-700); margin-bottom:1.25rem; }
.product-detail__desc    { color:var(--color-text-muted); line-height:1.75; margin-bottom:1.5rem; max-width:52ch; }
.product-detail__actions { display:flex; align-items:flex-end; gap:1rem; margin-bottom:1.5rem; flex-wrap:wrap; }
.qty-wrap                { display:flex; flex-direction:column; gap:.3rem; }
.qty-input               { text-align:center; }
.product-detail__sold    { color:var(--color-text-muted); font-size:.9rem; margin-bottom:1.5rem; }
.product-detail__details { margin-bottom:.75rem; border:1px solid var(--brown-100); border-radius:var(--radius); overflow:hidden; }
.product-detail__details summary { padding:.75rem 1rem; cursor:pointer; font-weight:600; font-size:.9rem; background:var(--brown-100); }
.product-detail__details p { padding:.75rem 1rem; font-size:.875rem; color:var(--color-text-muted); margin:0; max-width:none; }
.product-detail__badges  { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:1.25rem; }
.product-badge           { font-size:.78rem; padding:.3rem .75rem; border-radius:var(--radius-full); background:var(--brown-100); color:var(--brown-700); font-weight:600; }

@media (max-width:768px) {
  .product-detail__grid { grid-template-columns:1fr; gap:1.5rem; }
}

/* -------------------------------------------------------------
   Navbar account link
   ------------------------------------------------------------- */
.navbar__account {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .6rem;
  color: rgba(253,247,240,.8);
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  text-decoration: none;
}
.navbar__account:hover { color: var(--cream); background: rgba(255,255,255,.08); }
.navbar__account-name {
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
}

.navbar__mobile-greeting {
  display: block;
  padding: .5rem clamp(1rem, 5vw, 2rem) .25rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--teal-300);
}

/* Hide account text label on narrower desktop widths, icon only */
@media (max-width: 900px) and (min-width: 769px) {
  .navbar__account-name { display: none; }
}

/* Mobile: hide desktop account link entirely, it's in the hamburger menu */
@media (max-width: 768px) {
  .navbar__account { display: none; }
}

/* =============================================================
   Stage 6 — Cart, checkout, order confirmation
   ============================================================= */

.admin-alert--info { background:#eff6ff; color:#1e40af; border:1px solid #bfdbfe; }

/* -------------------------------------------------------------
   Cart page
   ------------------------------------------------------------- */
.cart-page          { padding-top:2rem; padding-bottom:4rem; }
.cart-page__title   { margin-bottom:1.5rem; }

.cart-empty          { text-align:center; padding:4rem 1rem; color:var(--color-text-muted); }
.cart-empty__icon    { font-size:3rem; display:block; margin-bottom:1rem; }
.cart-empty p        { margin-bottom:1.5rem; font-size:1.05rem; }

.cart-table-wrap     { overflow-x:auto; background:var(--white); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); margin-bottom:1.5rem; }
.cart-table          { width:100%; border-collapse:collapse; font-size:.9rem; min-width:560px; }
.cart-table th       { text-align:left; padding:.85rem 1rem; border-bottom:2px solid var(--brown-100); font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--color-text-muted); }
.cart-table td       { padding:.85rem 1rem; border-bottom:1px solid var(--brown-100); vertical-align:middle; }
.cart-table tr:last-child td { border-bottom:none; }
.cart-table__img-col { width:64px; }
.cart-table__thumb   { width:56px; height:56px; object-fit:cover; border-radius:var(--radius); }
.cart-table__thumb--placeholder { display:flex; align-items:center; justify-content:center; background:var(--brown-100); font-size:1.5rem; }
.cart-table__name    { font-weight:600; color:var(--color-primary); text-decoration:none; }
.cart-table__name:hover { color:var(--teal-700); }
.cart-table__sold    { display:block; font-size:.75rem; color:#dc2626; font-weight:600; margin-top:.2rem; }
.cart-table__total   { font-weight:700; color:var(--brown-700); white-space:nowrap; }
.cart-row--unavailable { opacity:.55; }
.cart-qty-form        { display:flex; align-items:center; gap:.4rem; }
.cart-qty-input        { width:60px; padding:.35rem .5rem; text-align:center; }

.cart-summary               { background:var(--white); border-radius:var(--radius-lg); padding:1.5rem; box-shadow:var(--shadow-sm); margin-top:1.5rem; }
.cart-summary-wrap          { display:flex; justify-content:flex-end; margin-top:1.5rem; }
.cart-update-row            { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.75rem; padding:.75rem 0; }
.cart-layout                { display:grid; grid-template-columns:1fr 320px; gap:1.5rem; align-items:start; }
.cart-layout__table         { min-width:0; overflow:hidden; }
.cart-layout__summary       { min-width:0; }
.cart-summary__row          { display:flex; justify-content:space-between; align-items:center; padding:.4rem 0; font-size:.95rem; }
.cart-summary__row--total   { font-size:1.2rem; font-weight:700; color:var(--brown-700); font-family:var(--font-display); border-top:1px solid var(--brown-100); margin-top:.5rem; padding-top:.85rem; }
.cart-summary__note         { font-size:.78rem; color:var(--color-text-muted); margin-bottom:1.25rem; }
.cart-summary__actions      { display:flex; flex-direction:column; gap:.75rem; }
.cart-summary__actions .btn { width: 100%; text-align: center; box-sizing: border-box; }

/* -------------------------------------------------------------
   Checkout
   ------------------------------------------------------------- */
.checkout-page    { padding-top:2rem; padding-bottom:4rem; }
.checkout-grid    { display:grid; grid-template-columns:1fr 1.1fr; gap:2rem; align-items:start; }
.checkout-summary { background:var(--white); border-radius:var(--radius-lg); padding:1.5rem; box-shadow:var(--shadow-sm); }
.checkout-summary__title { font-size:1.1rem; margin-bottom:1rem; }
.checkout-items   { display:flex; flex-direction:column; gap:.6rem; margin-bottom:.5rem; }
.checkout-items__row  { display:flex; justify-content:space-between; font-size:.9rem; gap:1rem; }
.checkout-items__name { color:var(--color-text); }
.checkout-items__qty  { color:var(--color-text-muted); font-size:.85rem; }
.checkout-form-col    { background:var(--white); border-radius:var(--radius-lg); padding:1.5rem; box-shadow:var(--shadow-sm); }

@media (max-width:768px) {
  .checkout-grid { grid-template-columns:1fr; }
}

/* -------------------------------------------------------------
   Order confirmation
   ------------------------------------------------------------- */
.order-confirm           { max-width:600px; margin-inline:auto; padding-top:2.5rem; padding-bottom:4rem; }
.order-confirm__header   { text-align:center; margin-bottom:1.5rem; }
.order-confirm__check    { display:inline-flex; align-items:center; justify-content:center; width:56px; height:56px; border-radius:50%; background:#dcfce7; color:#166534; font-size:1.75rem; font-weight:700; margin-bottom:1rem; }
.order-confirm__sub      { color:var(--color-text-muted); font-size:.9rem; }
.order-confirm__card     { margin-bottom:0; }
.order-confirm__status-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:1rem; font-size:.9rem; font-weight:600; }
.order-confirm__notes    { margin-top:1.25rem; padding-top:1rem; border-top:1px solid var(--brown-100); font-size:.875rem; }
.order-confirm__notes p  { color:var(--color-text-muted); margin-top:.4rem; }
.order-confirm__actions  { display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }

/* -------------------------------------------------------------
   Navbar — desktop sign out link
   ------------------------------------------------------------- */
.navbar__signout {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(253,247,240,.55);
  padding: .4rem .5rem;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.navbar__signout:hover { color: var(--cream); background: rgba(255,255,255,.08); }

/* Hidden on mobile — Sign Out already lives in the hamburger menu there */
@media (max-width: 768px) {
  .navbar__signout { display: none; }
}

/* -------------------------------------------------------------
   Registration honeypot — invisible to real users, catches bots
   ------------------------------------------------------------- */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =============================================================
   Category public description
   ============================================================= */
.cat-description {
  color: var(--color-text-muted);
  font-size: .95rem;
  max-width: 65ch;
  margin: -1rem 0 2rem;
}

/* =============================================================
   Admin — draggable category reorder list
   (Pointer Events pattern proven in Pass The Cork's lobby reorder)
   ============================================================= */
.cat-reorder-hint  { margin-bottom: 1rem; }
.cat-reorder-list  { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .65rem; }

.cat-reorder-card {

  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: .9rem 1.1rem;
  box-shadow: var(--shadow-sm);
  touch-action: none; /* required so the browser doesn't scroll while we handle the drag */
  position: relative;
}

.cat-reorder-card--new {
  border: 2px solid var(--teal-500);
  box-shadow: 0 0 0 3px rgba(36,175,195,.15);
}
.cat-reorder-card--new .cat-reorder-card__name { font-weight: 800; }

.cat-reorder-card--dragging {
  opacity: .85;
  box-shadow: var(--shadow-md);
  z-index: 10;
  cursor: grabbing;
}

/* Drop position indicator line */
.cat-reorder-card--drop-before::before,
.cat-reorder-card--drop-after::after {
  content: '';
  position: absolute;
  left: .5rem;
  right: .5rem;
  height: 3px;
  background: var(--teal-500);
  border-radius: 2px;
}
.cat-reorder-card--drop-before::before { top: -.4rem; }
.cat-reorder-card--drop-after::after   { bottom: -.4rem; }

.cat-reorder-card__handle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: grab;
  border-radius: var(--radius);
  touch-action: none;
}
.cat-reorder-card__handle:hover { background: var(--brown-100); }
.cat-reorder-card__handle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--color-text-muted);
  border-radius: 1px;
}

.cat-reorder-card__body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.cat-reorder-card__main  { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cat-reorder-card__name  { font-weight: 600; font-size: .98rem; }
.cat-reorder-card__meta  { display: flex; gap: 1rem; flex-wrap: wrap; }
.cat-reorder-card__actions { flex-shrink: 0; display: flex; gap: .75rem; align-items: center; }

/* =============================================================
   Admin — Site Theme settings page
   ============================================================= */
.theme-settings           { display: flex; flex-direction: column; gap: 2rem; max-width: 640px; }
.theme-settings__section  { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 2px solid var(--brown-300); }
.theme-settings__title    { font-size: 1.05rem; margin-bottom: 1rem; }
.theme-settings__pills    { display: flex; flex-wrap: wrap; gap: .6rem; }
.theme-settings__swatches { display: flex; flex-wrap: wrap; gap: .75rem; }
.theme-settings__section--preview { max-width: 100%; }

.theme-preview {
  width: 700px;
  max-width: 100%;
  height: 750px; /* estimated crop point — capturing more height so the donkey isn't cut off */
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--brown-100);
  position: relative;
}
.theme-preview__frame {
  width: 1400px;
  height: 1500px;
  border: 0;
  transform-origin: top left;
  transform: scale(0.5); /* 700 / 1400 — zoomed out further than before */
  pointer-events: none; /* preview only — use "Open full site" to interact */
}

.theme-settings__status { font-size: .85rem; font-weight: 600; color: var(--teal-700); min-height: 1.2em; }

.theme-pill {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .5rem 1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--brown-100);
  background: var(--white);
  color: var(--color-text);
  cursor: pointer;
  transition: all .15s;
}
.theme-pill:hover     { border-color: var(--brown-300); }
.theme-pill--active   { background: var(--brown-700); border-color: var(--brown-700); color: var(--white); }

.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--brown-100);
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.theme-swatch:hover   { transform: scale(1.08); }
.theme-swatch--active { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(36,175,195,.2); }

/* =============================================================
   Stage 7 — Payment UI
   ============================================================= */
.payment-block {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
.payment-block__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.stripe-element-wrap {
  border: 1.5px solid var(--brown-100);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  background: var(--white);
}
.payment-error {
  color: var(--color-error, #c0392b);
  font-size: .875rem;
  min-height: 1.25rem;
  margin-bottom: .5rem;
}
.payment-separator {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0;
  color: var(--brown-700);
  font-size: .95rem;
  font-weight: 700;
}
.payment-separator::before,
.payment-separator::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--brown-100);
}

/* Admin payments page */
.payment-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--brown-300);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.payment-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--brown-50, #f5ede0);
  background: var(--brown-50, #fdf7f0);
}
.payment-section__title {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.payment-section__icon { font-size: 1.3rem; }
.payment-section__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.payment-section__mode { display: flex; flex-direction: column; gap: .5rem; }
.radio-group  { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.radio-label  { display: flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }

/* Toggle switch */
.toggle { display: flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track {
  width: 44px; height: 24px;
  background: var(--brown-200, #c4875a);
  border-radius: 12px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle__track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: var(--white);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform .2s;
}
.toggle input:checked ~ .toggle__track { background: var(--teal-500, #24afc3); }
.toggle input:checked ~ .toggle__track::after { transform: translateX(20px); }
.toggle__label { font-size: .85rem; font-weight: 600; color: var(--color-text-muted); }
.payment-section__subtitle { font-size: .8rem; font-weight: 400; color: var(--color-text-muted); margin-left: .25rem; }
.cart-update-btn {
  width: 100%;
  margin-bottom: .75rem;
}
.cart-update-hint { font-size: .8rem; color: var(--color-text-muted); margin-bottom: .5rem; }
.cart-update-hint--flash { animation: cart-hint-flash 2s ease-in-out; }
@keyframes cart-hint-flash {
  0%   { color: var(--color-text-muted); transform: scale(1); }
  20%  { color: var(--teal-500); font-weight: 700; transform: scale(1.06); }
  50%  { color: #e07020; font-weight: 700; transform: scale(1.06); }
  80%  { color: var(--teal-500); font-weight: 700; transform: scale(1.06); }
  100% { color: var(--color-text-muted); transform: scale(1); }
}


/* Payment method toggle (collapsible Stripe/PayPal blocks) */
.payment-method-toggle {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--brown-100);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: left;
}
.payment-method-toggle:hover { border-color: var(--brown-300); background: var(--brown-50, #fdf7f0); }
.payment-method-toggle[aria-expanded="true"] { border-color: var(--teal-500); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.payment-method-toggle__icon { font-size: 1.2rem; }
.payment-method-toggle__chevron { margin-left: auto; font-size: 1.2rem; transition: transform .2s; }
.payment-method-body {
  border: 2px solid var(--teal-500);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 1.25rem;
  background: var(--white);
}
/* Stack multiple payment blocks */
.payment-block + .payment-block { margin-top: .75rem; }

/* Also add mobile stack for cart layout */
@media (max-width: 640px) {
  .cart-layout { grid-template-columns: 1fr; }
}

/* Credit card brand icons in toggle */
.payment-method-toggle__cards { display:flex; gap:.35rem; align-items:center; margin-left:.25rem; }
.card-icon { width:38px; height:24px; border-radius:4px; box-shadow:0 1px 3px rgba(0,0,0,.2); flex-shrink:0; }

/* =============================================================
   Stage 8 — Users CRUD
   ============================================================= */
.user-edit-grid      { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; align-items:start; max-width:900px; }
@media (max-width:700px) { .user-edit-grid { grid-template-columns:1fr; } }

.user-meta           { display:flex; flex-direction:column; gap:.6rem; margin-bottom:1.25rem; }
.user-meta__row      { display:flex; justify-content:space-between; align-items:center; font-size:.9rem; padding:.3rem 0; border-bottom:1px solid var(--brown-50, #fdf7f0); }
.user-meta__label    { color:var(--color-text-muted); font-weight:500; }
.user-actions        { display:flex; flex-direction:column; gap:.75rem; }

.btn--danger {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.btn--danger:hover { background:#a93226; border-color:#a93226; }

.admin-table__row--muted td { opacity: .55; }
.admin-table__muted { color: var(--color-text-muted); font-size: .85rem; }

/* Confirmation modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay--hidden { display: none; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.modal-box__title   { font-size: 1.2rem; margin-bottom: 1rem; }
.modal-box__list    { margin: .75rem 0 .75rem 1.25rem; display:flex; flex-direction:column; gap:.35rem; font-size:.9rem; }
.modal-box__warning { color: #c0392b; font-size: .875rem; font-weight: 600; margin: 1rem 0; }
.modal-box__actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* =============================================================
   Contact page
   ============================================================= */
.contact-page         { padding-top:2.5rem; padding-bottom:4rem; }
.contact-header       { text-align:center; margin-bottom:2.5rem; }
.contact-header__sub  { color:var(--color-text-muted); margin-top:.5rem; }

.contact-layout {
  display:grid;
  grid-template-columns: 1fr 1.4fr;
  gap:2rem;
  align-items:start;
  max-width:900px;
  margin-inline:auto;
}

.contact-photo {
  /* Start at 80% of the column width, shrink fluidly on smaller screens */
  width: clamp(120px, 80%, 100%);
  height: auto;
  border-radius: var(--radius-lg);
  display: block;
  margin-bottom: 1.25rem;
}

.contact-info-card      { max-width:none; }
.contact-info-card h2   { font-size:1.1rem; margin-bottom:1rem; }
.contact-info-card__note { color:var(--color-text-muted); font-size:.9rem; margin-top:.5rem; }

@media (max-width:640px) {
  .contact-layout { grid-template-columns:1fr; }
  .contact-photo  { width: clamp(100px, 60%, 75%); margin-inline: auto; }
}

/* =============================================================
   Stage 8 — Order Management
   ============================================================= */
.order-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.order-stats__card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 110px;
  flex: 1;
}
.order-stats__num   { font-size: 1.6rem; font-weight: 800; font-family: var(--font-display); }
.order-stats__label { font-size: .75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.order-stats__card--pending  { border-top: 3px solid #f59e0b; }
.order-stats__card--paid     { border-top: 3px solid #10b981; }
.order-stats__card--ready    { border-top: 3px solid #24afc3; }
.order-stats__card--revenue  { border-top: 3px solid var(--brown-700); }

.order-filters       { background:var(--white); border-radius:var(--radius-lg); padding:1.25rem; box-shadow:var(--shadow-sm); margin-bottom:1.5rem; }
.order-filters__row  { display:flex; gap:1rem; align-items:flex-end; flex-wrap:wrap; }

.admin-table--clickable tbody tr:hover { background: var(--brown-50, #fdf7f0); }

.order-detail-grid         { display:grid; grid-template-columns:1fr 320px; gap:1.5rem; align-items:start; }
.order-detail__items       {  }
.order-detail__sidebar     { display:flex; flex-direction:column; gap:1.25rem; }
@media (max-width:768px) {
  .order-detail-grid { grid-template-columns:1fr; }
  .order-stats__card { min-width:80px; }
}

/* =============================================================
   Customer account page
   ============================================================= */
.account-orders          { display:flex; flex-direction:column; gap:.5rem; }
.account-order-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:.75rem 1rem;
  background:var(--brown-50,#fdf7f0);
  border-radius:var(--radius);
  text-decoration:none;
  color:var(--color-text);
  transition:background .15s;
}
.account-order-row:hover { background:var(--brown-100); }
.account-order-row__id   { font-weight:700; margin-right:.75rem; }
.account-order-row__date { color:var(--color-text-muted); font-size:.875rem; }
