/* The Festive Pet — shared design system.
   One stylesheet, every storefront page links it; page-specific <style>
   blocks (kept inline per page) now only hold layout tweaks, not the
   color/typography system itself. */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --pine:       #123a2c;
  --pine-dark:  #0b241b;
  --cranberry:  #b3382c;
  --cranberry-dark: #8f2a20;
  --gold:       #d8a34c;
  --cream:      #fbf5e9;
  --cream-2:    #f4ead6;
  --ink:        #241d16;
  --ink-soft:   #52483d;
  --line:       #e4d8c1;
  --white:      #ffffff;
  --shadow: 0 12px 30px -12px rgb(18 58 44 / 0.25);
  --shadow-sm: 0 4px 14px -6px rgb(18 58 44 / 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Fredoka', 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand-mark { font-family: var(--font-display); letter-spacing: 0.01em; }
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--pine);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 12px -4px rgb(0 0 0 / 0.25);
}
.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand-mark {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.brand-mark .paw { font-size: 1.5rem; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: #cfe0d6;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover, .site-nav a.active { color: var(--white); border-color: var(--gold); }

.cart-toggle {
  position: relative;
  background: var(--cranberry);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cart-toggle:hover { background: var(--cranberry-dark); transform: translateY(-1px); }
.cart-toggle .badge {
  background: var(--gold);
  color: var(--pine-dark);
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 4.5rem 1.5rem 3.5rem;
  background:
    radial-gradient(circle at 15% 20%, rgb(216 163 76 / 0.16) 0, transparent 45%),
    radial-gradient(circle at 85% 0%, rgb(179 56 44 / 0.12) 0, transparent 50%),
    var(--cream);
  overflow: hidden;
}
.hero::before {
  content: "🐾";
  position: absolute;
  font-size: 9rem;
  opacity: 0.05;
  top: -2rem;
  left: -1.5rem;
  transform: rotate(-18deg);
}
.hero::after {
  content: "🐾";
  position: absolute;
  font-size: 7rem;
  opacity: 0.05;
  bottom: -1.5rem;
  right: -1rem;
  transform: rotate(14deg);
}
.hero .eyebrow {
  display: inline-block;
  background: var(--pine);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  color: var(--pine);
  margin: 0 0 1rem;
  line-height: 1.15;
}
.hero p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---------- Product grid / cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.5s ease both;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img { position: relative; width: 100%; height: 230px; background: var(--cream-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-tag {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: var(--pine); color: var(--cream);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.3rem 0.6rem; border-radius: 999px;
}
.card-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--pine); }
.card-price { font-size: 1.15rem; color: var(--cranberry); font-weight: 700; margin-bottom: 0.85rem; }
.card-price .was { color: #a8a196; font-weight: 500; text-decoration: line-through; font-size: 0.95rem; margin-right: 0.4rem; }
.card-text { font-size: 0.95rem; margin-bottom: 1.4rem; line-height: 1.55; color: var(--ink-soft); flex-grow: 1; }

/* Qty stepper (cart-eligible products) */
.qty-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.qty-row .stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty-row .stepper button {
  width: 2rem; height: 2rem; border: none; background: var(--cream-2); color: var(--pine);
  font-size: 1.1rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.qty-row .stepper button:hover { background: var(--gold); color: var(--pine-dark); }
.qty-row .stepper span { width: 2rem; text-align: center; font-weight: 600; }
.qty-row .stock-note { font-size: 0.78rem; color: #8a8377; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--cranberry); color: var(--white);
  padding: 0.8rem 1.25rem; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-family: var(--font-body); font-size: 0.95rem;
  border: none; cursor: pointer; width: 100%;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--cranberry-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn.btn-outline { background: transparent; border: 2px solid var(--pine); color: var(--pine); }
.btn.btn-outline:hover { background: var(--pine); color: var(--cream); }
.btn.btn-ghost { background: var(--cream-2); color: var(--pine); }
.btn.btn-ghost:hover { background: var(--line); }

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--pine); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.65rem 0.75rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  box-sizing: border-box; font-family: inherit; font-size: 0.95rem; background: var(--white); color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--cranberry); box-shadow: 0 0 0 3px rgb(179 56 44 / 0.12);
}
.field-error { color: var(--cranberry-dark); font-size: 0.78rem; margin-top: 0.3rem; display: none; }
.form-group.invalid input, .form-group.invalid select { border-color: var(--cranberry); }
.form-group.invalid .field-error { display: block; }

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0; background: rgb(11 36 27 / 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 50;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100vw);
  background: var(--white); z-index: 51; box-shadow: -8px 0 30px -10px rgb(0 0 0 / 0.3);
  transform: translateX(100%); transition: transform 0.28s ease;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head {
  padding: 1.25rem 1.5rem; background: var(--pine); color: var(--cream);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-drawer-head h2 { margin: 0; font-size: 1.15rem; }
.cart-drawer-head button { background: none; border: none; color: var(--cream); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.cart-empty .paw { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.cart-line { display: flex; gap: 0.85rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-title { font-weight: 700; font-size: 0.92rem; color: var(--pine); margin-bottom: 0.15rem; }
.cart-line-price { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.5rem; }
.cart-line-controls { display: flex; align-items: center; gap: 0.6rem; }
.cart-line-controls .stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.cart-line-controls .stepper button { width: 1.6rem; height: 1.6rem; border: none; background: none; font-weight: 700; cursor: pointer; color: var(--pine); }
.cart-line-controls .remove { background: none; border: none; color: var(--cranberry); font-size: 0.78rem; font-weight: 600; cursor: pointer; text-decoration: underline; margin-left: auto; }
.cart-drawer-foot { padding: 1.25rem 1.5rem; border-top: 1px solid var(--line); background: var(--cream); }
.cart-subtotal { display: flex; justify-content: space-between; font-weight: 700; color: var(--pine); margin-bottom: 1rem; font-size: 1.05rem; }
.cart-note { font-size: 0.78rem; color: var(--ink-soft); text-align: center; margin-top: 0.6rem; }

/* ---------- Loading / error / empty micro-states ---------- */
.spinner {
  width: 1.1rem; height: 1.1rem; border: 2px solid rgb(255 255 255 / 0.4);
  border-top-color: var(--white); border-radius: 50%; animation: spin 0.7s linear infinite;
  display: inline-block;
}
.alert { border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.88rem; margin-top: 0.75rem; }
.alert-error { background: #fbe9e7; color: var(--cranberry-dark); border: 1px solid #f2c9c3; }
.alert-success { background: #e6f2ea; color: #1c6b45; border: 1px solid #bfe0cd; }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(1rem);
  background: var(--pine); color: var(--cream); padding: 0.7rem 1.25rem; border-radius: 999px;
  font-size: 0.88rem; font-weight: 600; box-shadow: var(--shadow); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .card, .cart-drawer, .cart-overlay, .toast { animation: none !important; transition: none !important; }
}

/* ---------- Shared content pages ---------- */
main.page { max-width: 760px; margin: 0 auto; padding: 3.5rem 1.5rem 4rem; line-height: 1.7; }
main.page h1 { color: var(--pine); font-size: 2rem; margin-bottom: 1.25rem; }
main.page h3 { color: var(--pine); margin-bottom: 0.35rem; font-family: var(--font-display); }
main.page .q { margin-bottom: 1.9rem; }
main.page a { color: var(--cranberry); font-weight: 600; text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--pine-dark); color: #b9c9bf; text-align: center; padding: 2.75rem 1.5rem; margin-top: 3rem; }
.site-footer .brand-mark { justify-content: center; margin-bottom: 0.75rem; color: var(--cream); }
.site-footer .legal { margin-top: 1rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.site-footer .legal a { color: #b9c9bf; text-decoration: none; font-size: 0.85rem; }
.site-footer .legal a:hover { color: var(--white); }
.site-footer .copyright { font-size: 0.85rem; color: #8ba296; margin-top: 0.5rem; }

@media (max-width: 640px) {
  .site-header-inner { justify-content: center; text-align: center; }
  .site-nav { justify-content: center; gap: 1.1rem; }
  .hero { padding: 3.5rem 1.25rem 2.5rem; }
  .grid { padding: 2.25rem 1.25rem 3rem; gap: 1.5rem; }
}
