/* Jerry Decorations Shop — design system
   Direction: warm editorial premium-minimal. Ivory ground, charcoal ink,
   clay accent, serif display + humanist body, sharp corners, generous air. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe9;
  --border: #e5dfd5;
  --border-strong: #cfc6b8;

  --text: #221e19;
  --muted: #675f53;
  --faint: #8d8474;

  --accent: #96603f;
  --accent-hover: #7c4e32;
  --accent-soft: #f0e5dc;

  --success: #3d6b4f;
  --danger: #a0392f;
  --sale: #a0392f;

  --font-display: "Playfair Display", "Georgia", serif;
  --font-body: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --radius-sm: 2px;
  --radius-md: 4px;

  --shadow-sm: 0 1px 2px rgba(34, 30, 25, 0.06);
  --shadow-md: 0 4px 16px rgba(34, 30, 25, 0.08);
  --shadow-lg: 0 12px 40px rgba(34, 30, 25, 0.14);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 150ms;
  --med: 220ms;

  --maxw: 1240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

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

button { font: inherit; cursor: pointer; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s5); }

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

::selection { background: var(--accent-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- announcement bar ---------- */
.announce-bar {
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 9px var(--s4);
}
.announce-bar a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  height: 72px;
}
.brand {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand em { font-style: italic; color: var(--accent); }
.main-nav { display: flex; gap: var(--s5); }
.main-nav a {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--s2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.main-nav a:hover, .main-nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: var(--s4); }
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  padding: var(--s2) var(--s3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.cart-link:hover { background: var(--surface-2); border-color: var(--text); }
.cart-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-count.empty { display: none; }
.menu-toggle { display: none; }

/* mobile nav */
@media (max-width: 860px) {
  .header-inner { height: 60px; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: var(--s3) var(--s5) var(--s5);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: var(--s3) 0; border-bottom: 1px solid var(--border); font-size: 15px; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: none;
    border: none;
    color: var(--text);
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--surface-2);
}
.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(20, 16, 12, 0.55) 0%, rgba(20, 16, 12, 0.15) 60%, transparent 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 560px;
  padding: var(--s8) 0;
}
.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: var(--s4);
}
.hero h1 { font-size: 48px; margin-bottom: var(--s4); }
.hero p { font-size: 17px; opacity: 0.9; margin-bottom: var(--s6); max-width: 46ch; }
@media (max-width: 640px) {
  .hero { min-height: 440px; }
  .hero h1 { font-size: 32px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-light { background: #fff; color: var(--text); }
.btn-light:hover { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--text); background: var(--surface-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- sections ---------- */
.section { padding: var(--s9) 0; }
.section-tight { padding: var(--s7) 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s6);
}
.section-head h2 { font-size: 32px; }
.section-head .link-more {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.section-head .link-more:hover { color: var(--accent-hover); }

/* ---------- category tiles ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}
.cat-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.cat-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.cat-tile:hover img { transform: scale(1.045); }
.cat-tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(20, 16, 12, 0.62) 100%);
}
.cat-label {
  position: absolute;
  left: var(--s5); bottom: var(--s4); right: var(--s5);
  z-index: 1;
  color: #fff;
  font-family: var(--font-display);
  font-size: 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}
.cat-label span { font-family: var(--font-body); font-size: 13px; letter-spacing: 0.06em; opacity: 0.85; }
@media (max-width: 860px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } .cat-tile { aspect-ratio: 16 / 9; } }

/* ---------- product cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s5) var(--s4);
}
@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .product-grid { grid-template-columns: 1fr; } }

.product-card { display: block; }
.card-media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--border);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 350ms var(--ease), transform 600ms var(--ease);
}
.card-media .img-hover {
  position: absolute; inset: 0;
  opacity: 0;
}
.product-card:hover .img-hover { opacity: 1; }
.product-card:hover .card-media img.img-main { transform: scale(1.03); }
.sale-badge {
  position: absolute;
  top: var(--s3); left: var(--s3);
  z-index: 1;
  background: var(--sale);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.card-info { padding: var(--s3) var(--s1) 0; }
.card-vendor { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.card-title {
  font-size: 15px;
  font-weight: 500;
  margin: 2px 0 4px;
  transition: color var(--fast) var(--ease);
}
.product-card:hover .card-title { color: var(--accent); }
.card-price { font-size: 15px; display: flex; gap: var(--s2); align-items: baseline; }
.price-was { color: var(--faint); text-decoration: line-through; font-size: 13px; }
.price-now.on-sale { color: var(--sale); font-weight: 600; }

/* ---------- catalog toolbar ---------- */
.page-title { padding: var(--s7) 0 var(--s5); }
.page-title h1 { font-size: 40px; margin-bottom: var(--s2); }
.page-title p { color: var(--muted); max-width: 65ch; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s6);
}
.chip {
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: all var(--fast) var(--ease);
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.select, .input {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.select:focus, .input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.result-count { font-size: 13px; color: var(--faint); }
@media (max-width: 640px) { .toolbar-right { margin-left: 0; width: 100%; } }

.pagination { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s7); }
.page-btn {
  min-width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  color: var(--muted);
  transition: all var(--fast) var(--ease);
}
.page-btn:hover { border-color: var(--text); color: var(--text); }
.page-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.page-btn[disabled] { opacity: 0.4; cursor: default; }

/* ---------- product detail ---------- */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s8);
  padding: var(--s7) 0 var(--s9);
}
@media (max-width: 900px) { .pdp { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s5); } }

.breadcrumbs { font-size: 13px; color: var(--faint); padding-top: var(--s5); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 6px; }

.gallery-main {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  margin-bottom: var(--s3);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); }
.gallery-thumbs button {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  padding: 0;
  transition: border-color var(--fast) var(--ease);
}
.gallery-thumbs button:hover { border-color: var(--border-strong); }
.gallery-thumbs button.active { border-color: var(--text); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pdp-vendor { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--s2); }
.pdp h1 { font-size: 34px; margin-bottom: var(--s3); }
.pdp-price { font-size: 22px; display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s5); }
.pdp-price .price-was { font-size: 16px; }
.pdp-price .save-note { font-size: 13px; color: var(--sale); font-weight: 600; letter-spacing: 0.04em; }

.opt-group { margin-bottom: var(--s5); }
.opt-label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--s2); display: block; }
.opt-label .opt-value { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.opt-values { display: flex; flex-wrap: wrap; gap: var(--s2); }
.opt-btn {
  padding: 9px 16px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: all var(--fast) var(--ease);
}
.opt-btn:hover { border-color: var(--text); }
.opt-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.opt-btn.unavailable { opacity: 0.4; text-decoration: line-through; }

.qty-row { display: flex; gap: var(--s3); align-items: stretch; margin: var(--s5) 0 var(--s3); }
.qty-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.qty-box button {
  width: 44px; height: 100%;
  min-height: 48px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
}
.qty-box button:hover { color: var(--text); }
.qty-box input {
  width: 44px;
  text-align: center;
  border: none;
  font: inherit;
  background: transparent;
  -moz-appearance: textfield;
}
.qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-row .btn { flex: 1; }

.stock-note { font-size: 13px; color: var(--muted); margin-bottom: var(--s5); }
.stock-note.low { color: var(--sale); font-weight: 600; }
.stock-note.out { color: var(--danger); font-weight: 600; }

.pdp-desc { color: var(--muted); font-size: 15px; line-height: 1.7; border-top: 1px solid var(--border); padding-top: var(--s5); white-space: pre-line; max-width: 65ch; }
.pdp-meta { margin-top: var(--s5); font-size: 13px; color: var(--faint); display: grid; gap: 4px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: var(--s5);
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--text);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
  z-index: 200;
  display: flex;
  gap: var(--s4);
  align-items: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #f5c9a8; font-weight: 600; }
.toast.error { background: var(--danger); }

/* ---------- cart & checkout ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--s7);
  padding-bottom: var(--s9);
  align-items: start;
}
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: var(--s4);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item img {
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
}
.cart-item-title { font-weight: 500; font-size: 15px; }
.cart-item-title:hover { color: var(--accent); }
.cart-item-variant { font-size: 13px; color: var(--faint); margin: 2px 0 var(--s2); }
.cart-item-right { text-align: right; display: grid; gap: var(--s2); justify-items: end; }
.cart-item-price { font-weight: 600; }
.link-remove {
  background: none; border: none;
  font-size: 13px;
  color: var(--faint);
  text-decoration: underline;
  padding: var(--s1);
}
.link-remove:hover { color: var(--danger); }
.cart-item .qty-box button { min-height: 36px; width: 34px; }
.cart-item .qty-box input { width: 34px; font-size: 14px; }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--s5);
  position: sticky;
  top: 96px;
}
.summary-card h2 { font-size: 22px; margin-bottom: var(--s4); }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: var(--s1) 0; }
.summary-total {
  display: flex; justify-content: space-between;
  font-size: 18px; font-weight: 600; color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: var(--s3);
  padding-top: var(--s3);
  margin-bottom: var(--s4);
}

.form-grid { display: grid; gap: var(--s3); }
.form-grid label { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; display: grid; gap: 6px; }
.form-grid .input, .form-grid textarea { width: 100%; }
textarea.input { resize: vertical; min-height: 72px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }

.empty-state { text-align: center; padding: var(--s9) var(--s5); }
.empty-state h2 { font-size: 28px; margin-bottom: var(--s3); }
.empty-state p { color: var(--muted); margin-bottom: var(--s5); }

.order-done { max-width: 560px; margin: 0 auto; text-align: center; padding: var(--s9) var(--s5); }
.order-done .check {
  width: 64px; height: 64px;
  margin: 0 auto var(--s5);
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.order-done h1 { font-size: 34px; margin-bottom: var(--s3); }
.order-done p { color: var(--muted); margin-bottom: var(--s3); }
.order-number { font-weight: 700; color: var(--text); letter-spacing: 0.04em; }

/* ---------- value props ---------- */
.props-band { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.props {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
  padding: var(--s6) 0;
}
.prop { text-align: center; padding: 0 var(--s4); }
.prop h3 { font-size: 18px; margin-bottom: var(--s1); }
.prop p { font-size: 14px; color: var(--muted); }
@media (max-width: 720px) { .props { grid-template-columns: 1fr; gap: var(--s4); } }

/* ---------- skeleton ---------- */
@keyframes shimmer { 0% { opacity: 0.55; } 50% { opacity: 1; } 100% { opacity: 0.55; } }
.skeleton .card-media, .skeleton-line { animation: shimmer 1.4s ease-in-out infinite; background: var(--surface-2); border-color: transparent; }
.skeleton-line { height: 14px; border-radius: var(--radius-sm); margin-top: var(--s2); }

/* ---------- footer ---------- */
.site-footer {
  background: #211d18;
  color: #cfc6b8;
  margin-top: var(--s8);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s7);
  padding: var(--s8) 0 var(--s6);
}
.footer-brand .brand { color: #fff; font-size: 26px; }
.footer-brand p { font-size: 14px; margin-top: var(--s3); max-width: 40ch; color: #a89e8d; }
.site-footer h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--s4);
}
.footer-links { list-style: none; display: grid; gap: var(--s2); }
.footer-links a, .footer-contact a { font-size: 14px; color: #cfc6b8; transition: color var(--fast) var(--ease); }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-contact { list-style: none; display: grid; gap: var(--s3); font-size: 14px; }
.footer-contact .label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #8d8474; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: var(--s4) 0;
  font-size: 13px;
  color: #8d8474;
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}
@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr; gap: var(--s6); }
}
