/* ============================================
   Bloom & Charm Boutique — Design Tokens
   ============================================ */
:root {
  --linen: #F6F1E7;
  --linen-card: #FFFDF8;
  --ink: #2B2620;
  --ink-soft: #5A5245;
  --sage: #5C6B4F;
  --sage-dark: #48543E;
  --brass: #B8935B;
  --brass-light: #D9BD8C;
  --terracotta: #A65D42;
  --line: rgba(43, 38, 32, 0.12);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, sans-serif;

  --radius: 3px;
  --shadow-soft: 0 2px 12px rgba(43, 38, 32, 0.06);
  --shadow-lift: 0 8px 24px rgba(43, 38, 32, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

/* ============================================
   Nav Bar
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: rgba(246, 241, 231, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.brand em {
  font-style: italic;
  color: var(--sage);
  font-weight: 500;
}

.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.nav-cart:hover { background: rgba(43, 38, 32, 0.06); }

.nav-cart svg { width: 20px; height: 20px; stroke: var(--ink); }

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--terracotta);
  color: var(--linen-card);
  font-size: 0.68rem;
  font-weight: 600;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.cart-count.visible { transform: scale(1); }

/* ============================================
   Hero
   ============================================ */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--terracotta);
}

.hero p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ============================================
   Product Grid — with charm-chain motif
   ============================================ */
.shop {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
  position: relative;
}

.shop-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.shop-heading h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
}

.shop-heading .thread {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--brass) 0, var(--brass) 4px,
    transparent 4px, transparent 10px
  );
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.25rem 1.75rem;
  position: relative;
}

/* the charm-link connectors between cards, desktop only */
.grid::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle 3px at 33.33% 50%, var(--brass) 98%, transparent),
    radial-gradient(circle 3px at 66.66% 50%, var(--brass) 98%, transparent);
  opacity: 0.35;
  display: none;
}

@media (min-width: 640px) {
  .grid::before { display: block; }
}

.card {
  background: var(--linen-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.card-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: linear-gradient(135deg, var(--brass-light), var(--sage));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.card-image .placeholder-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.04em;
}

.card-body {
  padding: 1.1rem 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
}

.card-body .price {
  color: var(--terracotta);
  font-weight: 600;
  font-size: 0.95rem;
}

.card-body .desc {
  color: var(--ink-soft);
  font-size: 0.85rem;
  flex: 1;
}

.add-btn {
  margin-top: 0.4rem;
  padding: 0.65rem 1rem;
  background: var(--sage);
  color: var(--linen-card);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  transition: background 0.2s ease;
}

.add-btn:hover { background: var(--sage-dark); }

.add-btn.added { background: var(--terracotta); }

/* ============================================
   Cart Drawer
   ============================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 32, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 50;
}

.overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 92vw);
  background: var(--linen);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,0.15);
}

.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.drawer-close svg { width: 22px; height: 22px; stroke: var(--ink); }

.drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-empty {
  color: var(--ink-soft);
  text-align: center;
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

.drawer-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.drawer-item .thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brass-light), var(--sage));
  flex-shrink: 0;
}

.drawer-item .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

.drawer-item .info { flex: 1; min-width: 0; }

.drawer-item .info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-item .info .price { color: var(--ink-soft); font-size: 0.82rem; }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.2rem 0.4rem;
}

.qty-controls button {
  width: 20px; height: 20px;
  font-size: 1rem;
  color: var(--sage);
}

.remove-btn {
  color: var(--terracotta);
  font-size: 0.75rem;
  text-decoration: underline;
  margin-left: 0.5rem;
}

.drawer-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
}

.drawer-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.checkout-btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--ink);
  color: var(--linen-card);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background 0.2s ease;
}

.checkout-btn:hover:not(:disabled) { background: var(--sage-dark); }
.checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.checkout-error {
  color: var(--terracotta);
  font-size: 0.82rem;
  margin-top: 0.7rem;
  text-align: center;
  display: none;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1.1rem; }
}

@media (max-width: 420px) {
  .nav { padding: 1rem 1.25rem; }
  .hero { padding: 3.5rem 1.25rem 2.5rem; }
}

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