/* ==========================================================================
   Fun & Flexy — Modern Festive Storefront Styles
   Palette: Warm Cream, Deep Pine Green, Berry Red, Soft Gold
   ========================================================================== */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-warm: #f4efe6;
  --text: #1c2420;
  --text-muted: #55635c;
  --border: #e6dfd3;

  --pine: #1f4e3d;
  --pine-dark: #15372b;
  --pine-soft: #e9f2ee;

  --berry: #c43e3e;
  --berry-dark: #9f2f2f;
  --berry-soft: #fceeee;

  --gold: #d4a359;
  --gold-soft: #fbf4e6;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(28, 36, 32, 0.05);
  --shadow-md: 0 10px 30px rgba(28, 36, 32, 0.08);
  --shadow-lg: 0 20px 50px rgba(28, 36, 32, 0.12);

  --font-heading: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.6rem;
  color: var(--text);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--pine);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--pine);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* Snow Canvas Overlay */
#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* ==========================================================================
   Header / Sticky Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--pine);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pine), #2c6e56);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-links a:hover {
  background: var(--pine-soft);
  color: var(--pine);
}

@media (max-width: 680px) {
  .nav-links a:not(.nav-keep) {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-inner {
    gap: 8px;
  }
  .brand {
    font-size: 1.15rem;
    gap: 8px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }
  .nav-links a {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--pine);
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 78, 61, 0.22);
}

.btn-primary:hover {
  background: var(--pine-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--pine);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--pine);
  background: var(--pine-soft);
}

.btn-berry {
  background: var(--berry);
  color: #fff;
  box-shadow: 0 6px 18px rgba(196, 62, 62, 0.22);
}

.btn-berry:hover {
  background: var(--berry-dark);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.9rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 44px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
}

@media (max-width: 860px) {
  .hero {
    padding: 28px 0 40px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.stall-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--berry-soft);
  color: var(--berry-dark);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 16px;
  border: 1px solid rgba(196, 62, 62, 0.18);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.hero h1 span {
  color: var(--pine);
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-media {
  position: relative;
}

.hero-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 34px;
  background: radial-gradient(circle at 50% 60%, rgba(212, 163, 89, 0.28), transparent 70%);
  z-index: -1;
}

.hero-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 62%;
  border-radius: var(--radius-md);
  background: #f2f1ee;
}

.hero-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px 2px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-caption strong {
  color: var(--text);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: 56px 0;
}

.section-warm {
  background: var(--surface-warm);
  border-block: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-header.centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--berry);
  margin-bottom: 6px;
}

.section-header h2 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 58ch;
  margin-bottom: 0;
}

/* ==========================================================================
   Product Filter Pills & Grid
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn:hover {
  border-color: var(--pine);
}

.filter-btn[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3f1ed;
  overflow: hidden;
}

.product-media-btn {
  all: unset;
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-media img {
  transform: scale(1.03);
}

.product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(145deg, #f4efe6, #e9f2ee);
  color: var(--pine);
  padding: 20px;
  text-align: center;
}

.product-placeholder span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
}

.status-in-stock {
  background: var(--pine);
  color: #fff;
}

.status-low-stock {
  background: var(--berry);
  color: #fff;
}

.status-made-to-order {
  background: var(--gold-soft);
  color: #7d5616;
  border: 1px solid rgba(212, 163, 89, 0.45);
}

.status-sold-out {
  background: #4b5563;
  color: #fff;
}

.led-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(28, 36, 32, 0.82);
  color: #ffefc2;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.product-top h3 {
  font-size: 1.15rem;
  margin: 0;
}

.product-price {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--pine);
  white-space: nowrap;
}

.product-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.swatches {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(28, 36, 32, 0.2);
  display: inline-block;
}

.product-actions {
  display: flex;
  gap: 8px;
}

.product-actions .btn {
  flex: 1;
}

/* ==========================================================================
   Order & Feedback Forms
   ========================================================================== */
.two-col-forms {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 880px) {
  .two-col-forms {
    grid-template-columns: 1fr;
  }
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 520px) {
  .card-panel {
    padding: 20px;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem; /* 16px prevents iOS Safari auto-zoom on focus */
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--pine);
  background: #fff;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--pine);
}

/* Order Items Builder */
.order-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.order-line {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 72px 38px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  border: 1px solid var(--border);
}

@media (max-width: 720px) {
  .order-line {
    grid-template-columns: 1fr 1fr;
  }
  .order-line select:first-child {
    grid-column: 1 / -1;
  }
}

.order-line select,
.order-line input {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-family: var(--font-body);
  font-size: 1rem; /* 16px prevents iOS Safari auto-zoom */
  width: 100%;
}

.remove-line-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--berry);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.remove-line-btn:hover {
  background: var(--berry-soft);
  border-color: var(--berry);
}

.order-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--pine-soft);
  color: var(--pine-dark);
  margin-bottom: 16px;
  font-weight: 600;
}

.order-total {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.info-note {
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--gold-soft);
  border: 1px solid rgba(212, 163, 89, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

/* Star Rating */
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
  margin-top: 2px;
}

.star-rating input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.star-rating label {
  font-size: 1.85rem;
  line-height: 1;
  color: #d6cfc3;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #e6a825;
}

.star-rating label:hover {
  transform: scale(1.1);
}

/* Form Result Banner */
.form-status {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  background: var(--pine-soft);
  border: 1px solid var(--pine);
  color: var(--pine-dark);
}

.form-status.is-error {
  background: var(--berry-soft);
  border: 1px solid var(--berry);
  color: var(--berry-dark);
}

.form-status .mailto-fallback {
  display: inline-flex;
  margin-top: 10px;
}

/* ==========================================================================
   Meet the Maker / Steps & Safety Cards
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

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

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--pine-soft);
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

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

.safety-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--berry);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.safety-card.is-care {
  border-left-color: var(--pine);
}

.safety-card.is-age {
  border-left-color: var(--gold);
}

.safety-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.safety-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   Native <dialog> Lightbox
   ========================================================================== */
.lightbox-dialog {
  width: min(92vw, 680px);
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.lightbox-dialog::backdrop {
  background: rgba(17, 24, 20, 0.72);
  backdrop-filter: blur(4px);
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.lightbox-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-close:hover {
  background: var(--pine-soft);
}

.lightbox-body {
  padding: 18px 20px 22px;
}

.lightbox-main-img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #f3f1ed;
  margin-bottom: 12px;
}

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.lightbox-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  background: #f3f1ed;
}

.lightbox-thumb.is-active {
  border-color: var(--pine);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--pine-dark);
  color: #e4ede8;
  padding: 40px 0 56px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer a {
  color: #ffefc2;
}

.footer-meta {
  font-size: 0.85rem;
  color: #b7cbc0;
  margin-top: 6px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 239, 194, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #ffefc2;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.back-to-top-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffefc2;
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .footer-right {
    align-items: flex-start;
    text-align: left;
  }
}

/* Highlight animation when "Order This" scrolls to form */
@keyframes pulseHighlight {
  0% { box-shadow: 0 0 0 0 rgba(31, 78, 61, 0.35); }
  70% { box-shadow: 0 0 0 12px rgba(31, 78, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 78, 61, 0); }
}

.is-highlighted {
  animation: pulseHighlight 0.9s ease-out;
}
