/* ============================================================
   components.css — the reusable pieces
   ------------------------------------------------------------
   WHAT THIS DOES
   Buttons, badges, product cards, prices and form fields.
   Every page is assembled from these. If a page needs something
   that isn't here, design it here first.

   WHAT BREAKS HERE
   - Buttons and inputs share a 48px min-height on purpose.
     Changing one and not the other makes forms look ragged.
   - .card__media uses aspect-ratio: 4/5. Real photos must be
     cropped to 4:5 or the grid goes uneven.
   - Adding a variant means adding a modifier (.btn--x), never
     a new base class.

   TRY CHANGING
   The gap in .row, then look at the button row on mobile.
   ============================================================ */

/* --- Section header (used on every page) --- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-8);
}
.section-head h2 { font-size: var(--text-2xl); }
.section-head .note {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--leaf { background: var(--leaf); color: #fff; }
.btn--leaf:hover { background: var(--leaf-dark); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn--link {
  min-height: auto;
  padding: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.badge--accent  { background: var(--accent-tint); color: var(--accent-dark); }
.badge--leaf    { background: var(--leaf-tint); color: var(--leaf); }
.badge--sun     { background: var(--sun); color: var(--ink); }
.badge--outline { background: var(--paper); border: 1px solid var(--line); color: var(--ink-muted); }

/* --- Product card --- */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 340px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease;
}
.card:hover { border-color: var(--ink); }

.card__media {
  position: relative;
  flex: none;
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, var(--photo-1), var(--photo-2));
  display: grid;
  place-items: center;
}
.card__media span {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--photo-ink);
}
.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-4);
}
/* Prices sit on the same line across a row, even when a title wraps. */
.card .price { margin-top: auto; }
.card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.card__meta {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
}

/* --- Price: always show XCD, with USD underneath --- */
.price { display: flex; align-items: baseline; gap: var(--space-2); }
.price__xcd { font-weight: 600; }
.price__usd { font-size: var(--text-sm); color: var(--ink-muted); }

/* --- Form fields --- */
.field { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.field label { font-size: var(--text-sm); font-weight: 500; }
.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

/* --- Inline links inside body copy --- */
.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
