/* =========================================================
   Mahi Green World — Base styles, tokens, resets, utilities
   ========================================================= */

:root {
  /* Brand palette */
  --color-primary: #2E7D32;
  --color-primary-dark: #1B5E20;
  --color-primary-light: #E8F5E9;
  --color-cream: #FDFBF5;
  --color-gold: #C99A2E;
  --color-gold-dark: #8A5A00;
  --color-red: #C0392B;

  --color-text: #23291F;
  --color-text-muted: #5B6459;
  --color-border: #E1E5DC;
  --color-white: #FFFFFF;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1280px;
  --gutter: 24px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 2px 10px rgba(27, 94, 32, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(27, 94, 32, 0.14);

  --header-height: 132px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--color-primary-dark);
  line-height: 1.15;
}

p {
  margin: 0;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Section rhythm */
.section {
  padding: 56px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.section-head h2 {
  font-size: 1.65rem;
}

.section-head .view-all {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  white-space: nowrap;
}

.section-head .view-all:hover {
  color: var(--color-primary-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary-dark);
  color: var(--color-primary-dark);
}

.btn-outline:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

/* Placeholder art tiles (stand in for real photography) */
.leaf-art {
  background: radial-gradient(circle at 30% 30%, var(--color-primary-light), transparent 60%),
    linear-gradient(135deg, #EFF6EA, #E1EFDA);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.leaf-art svg {
  width: 42%;
  height: 42%;
  opacity: 0.55;
}

/* Phase 8: a real product photo, when one exists, layers over the
   .leaf-art placeholder background rather than replacing the markup —
   if the image is missing/fails to load, productCard.js hides it and
   the existing placeholder art shows through exactly as before. */
.product-media img.product-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* Product name as a link (product cards, cart line items) — Phase 4 */
.product-name-link {
  color: inherit;
}

.product-name-link:hover {
  color: var(--color-primary);
}
