* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

a { color: var(--color-primary); }

h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0 0 10px; }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); }
.brand img { height: 40px; }
.brand .name { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--color-primary); }
.brand .tagline { font-size: 0.75rem; color: #888; display: block; }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; background: var(--color-primary); color: #fff; padding: 9px 16px; border-radius: 30px; text-decoration: none; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.cart-link .count { background: rgba(255,255,255,0.25); border-radius: 50%; padding: 1px 7px; font-size: 0.78rem; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.whatsapp-btn { font-size: 0.85rem; font-weight: 600; text-decoration: none; color: #128C7E; background: #e9fbf5; padding: 8px 14px; border-radius: 20px; white-space: nowrap; }
.account-link { font-size: 0.88rem; font-weight: 600; text-decoration: none; color: var(--color-text); white-space: nowrap; }

/* Announcement bar */
.announcement-bar { background: var(--color-primary); color: #fff; text-align: center; font-size: 0.8rem; font-weight: 600; padding: 8px 16px; }

/* Hero */
.hero { padding: 40px 0 30px; text-align: center; }
.hero h1 { font-size: 2rem; color: var(--color-primary); }
.hero p { color: #666; max-width: 480px; margin: 0 auto; }
.hero-with-image { display: flex; align-items: center; gap: 40px; text-align: left; padding: 40px 0; }
.hero-with-image .hero-text { flex: 1; }
.hero-with-image .hero-text h1 { font-size: 2.1rem; }
.hero-with-image .hero-text p { max-width: none; margin: 0; }
.hero-with-image .hero-image { flex: 1; }
.hero-with-image .hero-image img { border-radius: 16px; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.product-badge { display: inline-block; background: var(--color-accent); color: #fff; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 20px; }
.product-card .product-badge { position: absolute; top: 10px; left: 10px; }

/* Category nav */
.category-nav { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0 20px; }
.category-nav a { flex: 0 0 auto; padding: 8px 16px; border-radius: 20px; background: #fff; border: 1px solid rgba(0,0,0,0.08); text-decoration: none; color: var(--color-text); font-size: 0.88rem; }
.category-nav a:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Product grid */
.section-title { font-size: 1.3rem; color: var(--color-primary); margin: 30px 0 14px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.product-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid rgba(0,0,0,0.06); text-decoration: none; color: var(--color-text); display: flex; flex-direction: column; transition: transform 0.15s ease; }
.product-card:hover { transform: translateY(-3px); }
.product-card .img-wrap { position: relative; aspect-ratio: 1/1; background: #f1e9e3; overflow: hidden; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .info { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.product-card .info h3 { font-size: 1rem; margin-bottom: 4px; }
.product-card .price { color: var(--color-primary); font-weight: 700; margin-top: auto; }

/* Product detail */
.product-detail { display: flex; gap: 32px; flex-wrap: wrap; padding: 30px 0; }
.product-detail .media { position: relative; flex: 1 1 320px; }
.product-detail .media .product-badge { position: absolute; top: 14px; left: 14px; }
.product-detail .media img { border-radius: 14px; width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #f1e9e3; }
.product-detail .info { flex: 1 1 340px; }
.product-detail .desc { color: #555; margin-bottom: 18px; }
.variant-options, .addon-options { margin-bottom: 18px; }
.variant-options .opt, .addon-options .opt { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.variant-options label, .addon-options label { flex: 1; cursor: pointer; }
.price-tag { font-size: 1.4rem; font-weight: 700; color: var(--color-primary); margin: 14px 0; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 30px; overflow: hidden; }
.qty-control button { border: none; background: #fff; width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; }
.qty-control input { width: 44px; border: none; text-align: center; font-size: 1rem; }
.btn { display: inline-block; background: var(--color-primary); color: #fff; border: none; padding: 12px 22px; border-radius: 30px; font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { opacity: 0.92; }
.btn-outline { background: transparent; border: 1.5px solid var(--color-primary); color: var(--color-primary); }
.btn-block { display: block; width: 100%; }

/* Cart page */
.cart-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.07); flex-wrap: wrap; }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #f1e9e3; }
.cart-item .details { flex: 1; }
.cart-item .addons-list { font-size: 0.8rem; color: #888; }
.cart-qty-form { display: flex; align-items: center; gap: 8px; }
.cart-qty-input { width: 60px; padding: 6px; border: 1px solid #ccc; border-radius: 6px; }
.cart-item-total { min-width: 80px; text-align: right; font-weight: 700; }
.cart-summary { background: #fff; border: 1px solid rgba(0,0,0,0.07); border-radius: 12px; padding: 20px; margin-top: 20px; }
.cart-summary .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.92rem; }
.cart-summary .total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid rgba(0,0,0,0.08); margin-top: 8px; padding-top: 10px; }
.empty-state { text-align: center; padding: 60px 20px; color: #888; }

/* Checkout */
.checkout-grid { display: flex; gap: 30px; flex-wrap: wrap; padding: 20px 0 60px; }
.checkout-form { flex: 2 1 380px; }
.checkout-summary { flex: 1 1 280px; }
fieldset { border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; margin-bottom: 20px; padding: 4px 18px 18px; background: #fff; }
legend { font-weight: 700; color: var(--color-primary); padding: 0 6px; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=tel], input[type=date], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 0.95rem; font-family: inherit;
}
.fulfillment-toggle { display: flex; gap: 10px; margin: 8px 0 4px; }
.fulfillment-toggle label { flex: 1; text-align: center; padding: 12px; border: 1.5px solid #ddd; border-radius: 8px; cursor: pointer; font-weight: 600; margin: 0; }
.fulfillment-toggle input { display: none; }
.fulfillment-toggle input:checked + span { color: var(--color-primary); }
.fulfillment-toggle label:has(input:checked) { border-color: var(--color-primary); background: rgba(0,0,0,0.02); }
.field-error { color: #c62828; font-size: 0.8rem; margin-top: 4px; }
.form-errors { background: #fdecea; border: 1px solid #f5c2c0; color: #611a15; padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }

/* Confirmation */
.confirmation { text-align: center; padding: 60px 20px; max-width: 520px; margin: 0 auto; }
.confirmation .order-number { font-size: 1.6rem; font-weight: 700; color: var(--color-primary); margin: 14px 0; }

/* Footer */
.site-footer { background: #fff; border-top: 1px solid rgba(0,0,0,0.06); margin-top: 50px; padding: 30px 0; text-align: center; color: #888; font-size: 0.85rem; }

/* ---------- Mobile (phones, <=640px) ---------- */
@media (max-width: 640px) {
  .container { padding: 0 12px; }

  /* Header: let brand + actions wrap onto their own row rather than overflow or
     hide the account link's text (an icon alone can't tell "log in" from "my
     account" apart, so it stays as real text, just smaller). */
  .site-header .bar { padding: 10px 0; gap: 8px 10px; flex-wrap: wrap; }
  .brand { gap: 6px; min-width: 0; }
  .brand img { height: 32px; }
  .brand .name { font-size: 1rem; }
  .brand .tagline { display: none; }
  .header-actions { gap: 6px; flex-wrap: wrap; }
  .whatsapp-btn .btn-label, .cart-link .btn-label { display: none; }
  .whatsapp-btn { padding: 8px 10px; }
  .cart-link { padding: 8px 12px; }
  .account-link { font-size: 0.8rem; }

  .announcement-bar { font-size: 0.72rem; padding: 6px 10px; line-height: 1.4; }

  /* Hero: stack image under text, tighten spacing */
  .hero { padding: 24px 0 20px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-with-image { flex-direction: column; align-items: stretch; gap: 18px; text-align: center; padding: 20px 0; }
  .hero-with-image .hero-text h1 { font-size: 1.5rem; }
  .hero-with-image .hero-text p { margin: 0 auto; max-width: 420px; }
  .hero-with-image .hero-image img { aspect-ratio: 16/10; }

  .section-title { font-size: 1.1rem; margin: 22px 0 12px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .product-card .info { padding: 10px 12px 12px; }
  .product-card .info h3 { font-size: 0.88rem; }
  .product-card .price { font-size: 0.85rem; }

  .product-detail { gap: 20px; padding: 16px 0; }
  .product-detail .info h1 { font-size: 1.4rem; }

  /* Cart rows: image+details on top, qty/remove/total wrap to a full-width row below */
  .cart-item { gap: 10px; padding: 12px 0; }
  .cart-item img { width: 52px; height: 52px; }
  .cart-item-total { order: 1; width: 100%; text-align: left; margin-top: -6px; }

  .checkout-grid { gap: 20px; padding: 14px 0 40px; }
  fieldset { padding: 4px 12px 14px; }
  .fulfillment-toggle { gap: 8px; }
  .fulfillment-toggle label { padding: 10px 6px; font-size: 0.85rem; }

  .confirmation { padding: 30px 14px; }
  .confirmation .order-number { font-size: 1.3rem; }
}

/* ---------- Extra-small phones (<=380px) ---------- */
@media (max-width: 380px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .fulfillment-toggle { flex-direction: column; }
}
