/* =========================
   Havillah Marketplace — unified styles
   ========================= */

/* ===== Design tokens ===== */
:root {
  --green: #0f9d58;     /* brand accent */
  --green-600: #0b8a4b;
  --dark: #0b3d2e;      /* headings/nav text */
  --sky: #0ea5e9;       /* secondary accent */
  --muted: #e5e7eb;     /* borders */
  --bg: #e6f4ff;        /* site background */
  --card: #fff;         /* card background */
  --shadow: 0 8px 22px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: #0f172a;
  background-color: var(--bg);
}
img { max-width: 100%; display: block; }
 a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== Masthead (brand + nav) ===== */
.masthead {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--muted);
}
.brandbar { display:flex; align-items:center; gap:12px; padding:10px 0 4px; }
.brandbar img { width:52px; height:52px; border-radius:8px; flex:0 0 auto; margin-left:-6px; }
.brandbar .site-title { font-weight:900; letter-spacing:.2px; font-size:clamp(20px,4.5vw,34px); margin:0; }

.nav-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:8px 0 12px; }
.nav-links { display:flex; gap:18px; align-items:center; flex-wrap:wrap; }
.nav-links a { padding:8px 10px; border-radius:10px; font-weight:700; color:var(--dark); }
.nav-links a.active, .nav-links a:hover { background:#eef6f2; color:var(--green); }

.ebay-btn { background: var(--sky); color:#fff; padding:10px 14px; border-radius:12px; font-weight:800; box-shadow: 0 6px 16px rgba(14,165,233,.22); }

/* Cart link pill */
.cart-link, .btn-cart { font-size: 16px; padding: 8px 12px; background:#f2f2f2; border-radius:10px; display:inline-block; }
.cart-link:hover, .btn-cart:hover { background:#e5e7eb; }

/* ===== Mobile menu ===== */
.menu-toggle { display:none; background:#fff; border:1px solid #d1d5db; border-radius:10px; padding:8px 10px; }
.mobile-menu { display:none; border-top:1px solid var(--muted); background:#fff; }
.mobile-menu.open { display:block; }
.mobile-menu a { display:block; padding:12px 16px; border-bottom:1px solid #f1f5f9; font-weight:700; }
.mobile-menu .ebay-btn { display:block; margin:10px 16px; text-align:center; }

/* ===== Hero Section (home) ===== */
.hero { position:relative; color:#fff; isolation:isolate; overflow:hidden; background:#203a33; min-height:640px; }
.hero-bg { position:absolute; inset:0; }
/* bright, crisp image + cross-fade support */
.hero-bg img { width:100%; height:100%; object-fit:cover; opacity:1; filter:none; image-rendering:auto; transition:opacity .6s ease; }
.hero-bg img.fade { opacity:0; }
/* subtle overlay for legibility */
.hero-bg::after { content:""; position:absolute; inset:0; background: radial-gradient(120% 80% at 65% 10%, rgba(0,0,0,.06), rgba(0,0,0,.20)); pointer-events:none; }
.hero-inner { padding:64px 12px 72px; position:relative; z-index:1; }
.eyebrow { opacity:.85; text-transform:uppercase; letter-spacing:.08em; font-weight:800; font-size:.78rem; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.hero h1 { margin:.4rem 0 .7rem; font-weight:900; font-size:clamp(24px,4.8vw,42px); text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.hero p { max-width:750px; font-size:1.05rem; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cta-row { display:flex; gap:1rem; flex-wrap:wrap; margin-top:24px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; padding:.75rem 1.2rem; border-radius:12px; font-weight:800; }
.btn-primary { background:var(--green); color:#fff; }
.btn-primary:hover { background:var(--green-600); }
.btn-outline { background:#fff; color:#0b3d2e; border:1px solid #d1d5db; }

@media (max-width: 768px) { .hero { min-height:460px; } }

/* ===== Product grid (cards) ===== */
.wrap { max-width:1200px; margin:0 auto; padding:24px 16px 60px; }
.product-grid { display:grid; gap:20px; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); margin-top:18px; }

/* two markup variants unified: .card and .product-card */
.card, .product-card {
  background: var(--card); border:1px solid #e5e7eb; border-radius:14px; box-shadow:0 2px 10px rgba(0,0,0,.06);
  padding:14px; text-align:center; display:flex; flex-direction:column; justify-content:space-between; transition:transform .12s ease, box-shadow .12s ease;
}
.card:hover, .product-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }

/* image containers */
.imgbox, .product-card img { width:100%; height:220px; background:#fafafa; border-radius:10px; overflow:hidden; display:flex; align-items:center; justify-content:center; margin-bottom:10px; object-fit:cover; }
.imgbox img { width:100%; height:100%; object-fit:cover; }

/* text elements */
.name, .product-name { font-weight:800; margin:6px 0 4px; min-height:44px; }
.desc, .product-description { color:#444; font-size:.92rem; min-height:56px; }
.price, .product-price { color:#16a34a; font-weight:800; margin:10px 0 12px; }
.buy { display:inline-block; background:#0ea5e9; color:#fff; padding:10px 14px; border-radius:10px; font-weight:700; }

/* ===== Shared Qty styles (used by qty.js) ===== */
.price-qty-row { display:flex; justify-content:center; align-items:center; gap:10px; margin-top:8px; }
.qty-input { width:56px; padding:6px; text-align:center; font-size:14px; border-radius:8px; border:1px solid #cbd5e1; }

/* ===== Cart page ===== */
.cart-section { display:flex; justify-content:center; padding:40px 20px; }
.cart-card { background:#fff; padding:30px; border-radius:20px; box-shadow: var(--shadow); width:100%; max-width:700px; }
.cart-card h2 { text-align:center; margin-bottom:25px; font-size:24px; }
#cart-items { list-style:none; padding:0; margin:0; }
.cart-item { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; border-bottom:1px solid #eee; padding-bottom:15px; }
.cart-item img { width:60px; height:60px; object-fit:cover; border-radius:8px; margin-right:15px; }
.cart-item-details { flex-grow:1; }
.cart-item-details h3 { margin:0; font-size:16px; }
.cart-item-details p { margin:5px 0; font-size:14px; }
.qty-btn { padding:2px 8px; font-size:14px; margin:0 5px; border:1px solid #ccc; background:#f8f8f8; border-radius:4px; cursor:pointer; }
.remove-btn { background:none; border:none; font-size:20px; cursor:pointer; color:#555; }
.cart-total { text-align:right; margin-top:20px; font-weight:700; font-size:16px; }
.cart-actions { display:flex; justify-content:space-between; margin-top:30px; gap:10px; }
/* Cart-only buttons (don’t affect hero CTAs) */
.cart-actions .btn-primary { background-color:#2ea44f; color:#fff; padding:12px 20px; border:none; border-radius:10px; cursor:pointer; font-size:14px; flex:1; text-align:center; display:inline-block; transition:background-color .2s ease; }
.cart-actions .btn-primary:hover { background-color:#218838; }
.cart-actions .btn-secondary { background-color:#cccccc; color:#333; padding:12px 20px; border:none; border-radius:10px; text-decoration:none; font-size:14px; flex:1; text-align:center; transition:background-color .2s ease; }
.cart-actions .btn-secondary:hover { background-color:#b3b3b3; }

/* ===== Checkout page ===== */
.checkout-container { display:flex; flex-wrap:wrap; gap:30px; padding:40px; }
.checkout-left, .checkout-right { background:#fff; padding:30px; border-radius:10px; box-shadow:0 4px 10px rgba(0,0,0,.1); flex:1; min-width:300px; }
#checkout-form input, #checkout-form button { display:block; width:100%; margin-bottom:15px; padding:10px; font-size:16px; }
.name-fields, .postcode-fields { display:flex; gap:10px; }
.name-fields input, .postcode-fields input { flex:1; }
#card-element { padding:10px; border:1px solid #ccc; border-radius:5px; margin-bottom:15px; }
/* compact summary list */
.summary-item { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid #eef2f7; }
.summary-item img { width:64px; height:64px; object-fit:cover; border-radius:8px; flex:0 0 64px; }
.summary-item span:nth-child(2) { flex:1; }

/* ===== Footer spacing ===== */
footer .container { padding-top:12px; padding-bottom:12px; }

/* ===== Contact page (do NOT override .card globally) ===== */
/* If contact page needs a distinct card look, wrap its section with a parent class and scope like:
.contact-page .card { background:#fff; padding:24px; border-radius:12px; box-shadow: 0 6px 20px rgba(0,0,0,.04); margin:20px 0; }
*/

/* ===== Responsive tweaks ===== */
@media (max-width: 900px) { .cta-row { justify-content:center; } }
@media (max-width: 600px) {
  .brandbar { flex-direction:column; align-items:flex-start; padding:10px; }
  .menu-toggle { display:block; }
  .nav-links { display:none; }
}
