@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --ink: #1B2420;
  --ink-soft: #2E3A32;
  --porcelain: #F5F2E8;
  --porcelain-line: #E4DFCF;
  --sencha: #5C7A5E;
  --sencha-dark: #45604A;
  --oolong: #B4703A;
  --oolong-dark: #96592C;
  --clay: #2E2A24;
  --clay-soft: #6B6355;
  --white: #FFFDF8;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 10px rgba(27, 36, 32, 0.08);
  --shadow-sheet: 0 -8px 30px rgba(27, 36, 32, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--porcelain);
  color: var(--clay);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: 92px;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.price, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Header ---------- */

.app-header {
  background: var(--ink);
  color: var(--white);
  padding: 22px 18px 20px;
  border-radius: 0 0 24px 24px;
  position: relative;
  overflow: hidden;
}

.app-header::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 112, 58, 0.35), transparent 70%);
}

.app-header .wordmark {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.3px;
  color: var(--white);
  margin: 0;
}

.app-header .tagline {
  font-size: 13px;
  color: rgba(245, 242, 232, 0.65);
  margin-top: 4px;
}

/* ---------- Category chips ---------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--porcelain-line);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--clay-soft);
  transition: all 0.18s ease;
}

.chip.active {
  background: var(--sencha);
  border-color: var(--sencha);
  color: var(--white);
}

/* ---------- Product grid ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px 20px;
}

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  animation: fade-in 0.35s ease both;
}

.card .stripe {
  height: 3px;
  background: var(--sencha);
}

.card .photo-wrap {
  aspect-ratio: 1 / 1;
  background: var(--porcelain-line);
  overflow: hidden;
  position: relative;
}

.card .photo-wrap img { width: 100%; height: 100%; object-fit: cover; }

.card .photo-wrap.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clay-soft);
  font-size: 28px;
}

.stamp {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--oolong);
  color: var(--white);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  line-height: 1.05;
  box-shadow: 0 3px 8px rgba(180, 112, 58, 0.4);
  border: 2px solid rgba(255, 253, 248, 0.55);
}
.stamp .amount { font-size: 12px; }
.stamp .currency { font-size: 8px; opacity: 0.85; }

.card .body { padding: 10px 12px 12px; }
.card .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta {
  font-size: 11.5px;
  color: var(--clay-soft);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Bottom sheet ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 36, 32, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  background: var(--porcelain);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-sheet);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
  overflow-y: auto;
  padding-bottom: 24px;
}
.sheet.open { transform: translateY(0); }

.sheet .handle {
  width: 40px;
  height: 4px;
  background: var(--porcelain-line);
  border-radius: 4px;
  margin: 10px auto 4px;
}

.sheet .close-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(27, 36, 32, 0.06);
  color: var(--ink);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet .hero-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--porcelain-line);
}

.sheet .content { padding: 18px 20px 0; }

.sheet .title { font-size: 21px; margin-bottom: 4px; }

.rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--clay-soft);
  margin-bottom: 12px;
}
.rating-row .stars { color: var(--oolong); letter-spacing: 1px; }

.description { font-size: 14px; line-height: 1.55; color: var(--ink-soft); margin-bottom: 18px; }

.pkg-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pkg-pill {
  padding: 9px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--porcelain-line);
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--clay);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 78px;
}
.pkg-pill .p-price { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--oolong-dark); font-size: 13px; }
.pkg-pill.active { border-color: var(--sencha); background: rgba(92, 122, 94, 0.08); }

.btn-primary {
  width: 100%;
  background: var(--sencha);
  color: var(--white);
  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.2s ease;
}
.btn-primary:active { transform: scale(0.98); background: var(--sencha-dark); }
.btn-primary:disabled { opacity: 0.5; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 22px 0 10px;
  font-family: 'Playfair Display', serif;
}

.review {
  border-top: 1px solid var(--porcelain-line);
  padding: 12px 0;
}
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.review-author { font-size: 13px; font-weight: 600; color: var(--ink); }
.review-date { font-size: 11px; color: var(--clay-soft); }
.review-stars { color: var(--oolong); font-size: 12px; margin-bottom: 4px; }
.review-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

.review-form {
  background: var(--white);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
  border: 1px solid var(--porcelain-line);
}
.star-picker { display: flex; gap: 6px; font-size: 24px; margin-bottom: 10px; color: var(--porcelain-line); }
.star-picker span.active { color: var(--oolong); }
.review-form textarea {
  width: 100%;
  border: 1px solid var(--porcelain-line);
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
  font-size: 13.5px;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 10px;
  background: var(--porcelain);
}

/* ---------- Floating cart bar ---------- */

.cart-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: var(--ink);
  color: var(--white);
  border-radius: 999px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(27, 36, 32, 0.3);
  z-index: 30;
  transform: translateY(120%);
  transition: transform 0.3s ease;
}
.cart-bar.visible { transform: translateY(0); }
.cart-bar.pulse { animation: pulse 0.35s ease; }
.cart-bar .cb-count { font-size: 13.5px; font-weight: 500; }
.cart-bar .cb-total { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; }

@keyframes pulse {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--porcelain-line);
}
.cart-line .cl-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.cart-line .cl-meta { font-size: 12px; color: var(--clay-soft); }
.cart-line .cl-price { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--oolong-dark); font-size: 13.5px; }
.cart-line .cl-remove {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(27, 36, 32, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 6px;
  font-weight: 700;
  color: var(--ink);
}
.cart-total-row .price { font-size: 18px; color: var(--oolong-dark); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--clay-soft);
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -20px);
  background: var(--ink);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 60;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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