/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:   #1a9e7b;
  --green-d: #147a5e;
  --sand:    #f4f1eb;
  --ink:     #1c1c1c;
  --muted:   #666;
  --border:  #ddd;
  --radius:  8px;
  --shadow:  0 2px 8px rgba(0,0,0,.08);
  --max-w:   1100px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Layout ──────────────────────────────────────────────────────────────────*/
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* ── Header / Nav ────────────────────────────────────────────────────────────*/
header {
  background: var(--green);
  color: #fff;
  padding: .85rem 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { font-size: 1.4rem; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.logo:hover { text-decoration: none; }
nav { display: flex; gap: 1.5rem; align-items: center; }
nav a { color: rgba(255,255,255,.88); font-weight: 500; }
nav a:hover { color: #fff; text-decoration: none; }
.cart-icon { position: relative; }
.cart-badge {
  position: absolute; top: -7px; right: -10px;
  background: #f90; color: #fff; font-size: .65rem;
  font-weight: 700; border-radius: 9999px;
  padding: 1px 5px; min-width: 18px; text-align: center;
  display: none;
}

/* ── Hero banner ─────────────────────────────────────────────────────────────*/
.hero {
  background: var(--sand);
  padding: 3.5rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.2rem; margin-bottom: .5rem; }
.hero p  { color: var(--muted); font-size: 1.1rem; }

/* ── Product grid ────────────────────────────────────────────────────────────*/
.section-title { font-size: 1.4rem; margin-bottom: 1.25rem; padding-top: 2.5rem; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  padding-bottom: 3rem;
}
.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  background: #fff;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.product-card img { width: 100%; height: 180px; object-fit: cover; }
.product-card .product-image { line-height: 0; } /* no gap below img */
.product-card .card-body { padding: .9rem 1rem 1.1rem; }
.product-card .name   { font-weight: 600; margin-bottom: .25rem; }
.product-card .cat    { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.product-card .price  { font-size: 1.15rem; font-weight: 700; color: var(--green); margin-bottom: .75rem; }

/* ── Buttons ─────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-block;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
}
.btn-primary   { background: var(--green);  color: #fff; }
.btn-primary:hover { background: var(--green-d); text-decoration: none; }
.btn-outline   { background: transparent; border: 2px solid var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; text-decoration: none; }
.btn-danger    { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-block     { display: block; width: 100%; text-align: center; padding: .75rem; }

/* ── Product detail page ─────────────────────────────────────────────────────*/
.product-detail { display: flex; gap: 2.5rem; padding: 2.5rem 0 3rem; flex-wrap: wrap; }
.product-detail img { border-radius: var(--radius); flex: 1 1 340px; max-width: 480px; }
.product-info { flex: 1 1 260px; }
.product-info h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.product-info .badge { display: inline-block; background: var(--sand); color: var(--muted); font-size: .75rem; padding: .2rem .6rem; border-radius: 4px; margin-bottom: .75rem; }
.product-info .big-price { font-size: 2rem; font-weight: 700; color: var(--green); margin-bottom: 1rem; }
.product-info .desc { color: var(--muted); margin-bottom: 1.5rem; }
.qty-row { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.qty-row label { font-weight: 600; }
.qty-input { width: 64px; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; text-align: center; }

/* ── Cart page ───────────────────────────────────────────────────────────────*/
.cart-page { padding: 2rem 0 3rem; }
.cart-page h1 { margin-bottom: 1.5rem; }
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.cart-table th { text-align: left; border-bottom: 2px solid var(--border); padding: .6rem .5rem; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cart-table td { padding: .75rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-table img { width: 60px; height: 44px; object-fit: cover; border-radius: 4px; }
.cart-total { text-align: right; font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.cart-total span { color: var(--green); }
.cart-actions { display: flex; justify-content: space-between; align-items: center; }
.empty-cart { text-align: center; padding: 4rem 0; color: var(--muted); }
.empty-cart p { font-size: 1.1rem; margin-bottom: 1rem; }

/* ── Checkout form ───────────────────────────────────────────────────────────*/
.checkout-page { padding: 2rem 0 3rem; max-width: 600px; }
.checkout-page h1 { margin-bottom: 1.5rem; }
.form-section { margin-bottom: 2rem; }
.form-section h2 { font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
.form-row { display: flex; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; flex: 1; }
.form-group label { font-size: .9rem; font-weight: 600; }
.form-group input, .form-group select {
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  width: 100%;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,158,123,.15);
}
.order-summary { background: var(--sand); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.order-summary h2 { font-size: 1rem; margin-bottom: .75rem; }
.order-summary .line { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .3rem; }
.order-summary .total-line { display: flex; justify-content: space-between; font-weight: 700; padding-top: .5rem; border-top: 1px solid var(--border); margin-top: .5rem; }
.order-summary .total-line span:last-child { color: var(--green); }

/* ── Confirmation ────────────────────────────────────────────────────────────*/
.confirm-page { text-align: center; padding: 4rem 0; }
.check-icon { font-size: 4rem; margin-bottom: 1rem; }
.confirm-page h1 { font-size: 2rem; margin-bottom: .5rem; }
.confirm-page .order-num { font-size: 1.2rem; color: var(--muted); margin-bottom: 1.5rem; }
.confirm-page .order-num strong { color: var(--ink); }

/* ── Footer ──────────────────────────────────────────────────────────────────*/
footer {
  background: var(--ink); color: rgba(255,255,255,.55);
  text-align: center; font-size: .85rem;
  padding: 1.5rem;
  margin-top: 2rem;
}
footer a { color: rgba(255,255,255,.7); }

/* ── Variant badge ───────────────────────────────────────────────────────────*/
.variant-badge {
  font-size: .7rem;
  font-weight: 700;
  background: rgba(255,255,255,.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 9999px;
  padding: .15rem .6rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Alerts ──────────────────────────────────────────────────────────────────*/
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #d1fae5; color: #065f46; }

/* ── Related products (product page) ────────────────────────────────────────*/
.related { padding-bottom: 3rem; }
.related h2 { font-size: 1.2rem; margin-bottom: 1rem; }
