:root {
  --bg: #faf6ee;
  --card: #ffffff;
  --primary: #1f4d2c;
  --primary-dark: #143620;
  --accent: #d97706;
  --accent-dark: #b45f04;
  --text: #23291f;
  --muted: #6b7568;
  --border: #e7e0d1;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Inter', sans-serif;
  margin: 0 0 .5em;
  color: var(--primary-dark);
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 24px;
}
.header-inner .header-search { flex: 1; max-width: 520px; }
.logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.main-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  font-weight: 500;
  color: var(--text);
}
.main-nav a:hover { color: var(--primary); }
.cart-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
}
.cart-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: .7rem;
  padding: 1px 7px;
  position: absolute;
  top: -6px;
  right: -6px;
}

/* Flash messages */
.flash-wrap { padding-top: 16px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-weight: 500;
}
.flash-success { background: #e5f3e8; color: var(--primary-dark); }
.flash-error { background: #fbeaea; color: #9c2b2b; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: .95rem;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--primary-dark); border: 2px solid var(--primary-dark); padding: 12px 26px; }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-block { width: 100%; text-align: center; }
.btn-add {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
}
.btn-add:hover { background: var(--primary-dark); }
.btn-small {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}

/* Hero */
.hero { background: linear-gradient(180deg, #f1ead7 0%, var(--bg) 100%); padding: 60px 0 40px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 40px;
}
.eyebrow {
  color: var(--accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .85rem;
}
.hero-copy h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: .4em;
}
.hero-sub { font-size: 1.05rem; color: var(--muted); max-width: 460px; }
.hero-cta { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.hero-art { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-blob {
  width: 320px; height: 320px;
  background: radial-gradient(circle at 30% 30%, #cfe3cf, var(--primary) 90%);
  border-radius: 42% 58% 65% 35% / 45% 45% 55% 55%;
  opacity: .85;
}
.hero-emoji { position: absolute; font-size: 8rem; filter: drop-shadow(0 12px 18px rgba(0,0,0,.15)); }

/* Features */
.features { padding: 50px 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}
.feature-icon { font-size: 2.4rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--muted); font-size: .95rem; }

/* Product grid / cards */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 8px;
}
.link-more { color: var(--primary); font-weight: 600; }
.product-section { padding: 30px 0 60px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(31,77,44,.1); }
.product-thumb {
  background: #f1ead7;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
}
.thumb-emoji { font-size: 3.4rem; }
.thumb-emoji.large { font-size: 6rem; }
.product-body { padding: 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-weight: 600; font-size: 1.02rem; color: var(--text); }
.product-desc { color: var(--muted); font-size: .88rem; flex: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; }
.unit { color: var(--muted); font-size: .8rem; display: block; }

/* Promo strip */
.promo-strip { background: var(--primary); color: #fff; padding: 40px 0; }
.promo-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.promo-inner h2 { color: #fff; margin-bottom: .2em; }
.promo-inner p { color: #d9e6dc; margin: 0; }

/* Page header (shop/about/cart etc.) */
.page-header { padding: 46px 0 26px; background: #f1ead7; }
.page-header p { color: var(--muted); margin: 0; }

/* Shop layout */
.shop-section { padding: 34px 0 60px; }
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.shop-filters { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.filter-link { display: block; padding: 8px 0; color: var(--text); border-bottom: 1px solid var(--border); }
.filter-link:last-child { border-bottom: none; }
.filter-link.active, .filter-link:hover { color: var(--primary); font-weight: 600; }

/* Product detail */
.product-detail-section { padding: 40px 0 60px; }
.product-detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 50px; }
.product-detail-thumb { background: #f1ead7; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; min-height: 320px; }
.product-detail-price { font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); }
.add-to-cart-form { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.add-to-cart-form input { width: 70px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.trust-list { list-style: none; padding: 0; color: var(--muted); }
.trust-list li { margin-bottom: 6px; }

/* Cart */
.cart-section, .checkout-section, .order-success-section { padding: 34px 0 70px; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius-md); overflow: hidden; }
.cart-table th, .cart-table td { padding: 14px; border-bottom: 1px solid var(--border); text-align: left; }
.qty-form { display: flex; gap: 8px; }
.qty-form input { width: 60px; padding: 6px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.remove-link { color: #b23a3a; font-weight: 600; }
.cart-summary { max-width: 360px; margin-left: auto; margin-top: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.cart-summary-row, .summary-line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.checkout-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 26px; display: flex; flex-direction: column; }
.checkout-form label { font-weight: 600; margin: 12px 0 6px; font-size: .9rem; }
.checkout-form input, .checkout-form select, .checkout-form textarea {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-family: inherit; font-size: .95rem;
}
.checkout-summary { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; }

/* Order success */
.order-success-card { max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; text-align: center; }
.success-icon { font-size: 3rem; margin-bottom: 10px; }
.order-lines { text-align: left; margin: 20px 0; }

/* About */
.about-section { padding: 10px 0 60px; }
.about-content { max-width: 700px; }

/* Footer */
.site-footer { background: var(--primary-dark); color: #d9e6dc; padding: 50px 0 20px; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-col .logo { color: #fff; }
.footer-col h4 { color: #fff; }
.footer-col a { display: block; margin-bottom: 8px; color: #c3d3c5; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 18px; font-size: .85rem; text-align: center; color: #9fb4a2; }

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy h1 { font-size: 2.2rem; }
  .hero-sub { margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .hero-art { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-layout { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .promo-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 520px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------- */
/* Header: search bar, account menu, cart-with-total, sub-nav             */
/* ---------------------------------------------------------------------- */
.header-search {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.header-search select {
  border: none;
  border-right: 1px solid var(--border);
  background: #f7f3e9;
  padding: 0 12px;
  font-size: .85rem;
  color: var(--text);
  max-width: 140px;
}
.header-search input[type="text"] {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: .9rem;
  min-width: 0;
}
.header-search input[type="text"]:focus, .header-search select:focus { outline: none; }
.header-search button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-size: 1rem;
}

.header-actions { display: flex; align-items: center; gap: 20px; }
.account-menu { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.account-icon { font-size: 1.5rem; color: var(--primary); }
.account-text { display: flex; flex-direction: column; font-size: .82rem; line-height: 1.3; }
.muted-small { color: var(--muted); font-size: .78rem; }
.account-links a { color: var(--primary-dark); font-weight: 600; }
.account-links a:hover { text-decoration: underline; }

.cart-pill .cart-text { display: flex; flex-direction: column; line-height: 1.25; }
.cart-pill .cart-text strong { font-size: .95rem; }
.cart-pill .muted-small { color: #cfe0d1; }

.sub-nav { background: var(--primary-dark); }
.sub-nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 20px;
  color: #fff;
}
.sub-nav .main-nav { flex: 0 0 auto; gap: 22px; justify-content: flex-start; }
.sub-nav .main-nav a { color: #d9e6dc; }
.sub-nav .main-nav a:hover { color: #fff; }
.sub-nav-cta { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.phone-link { color: #d9e6dc; font-weight: 600; white-space: nowrap; }
.phone-link:hover { color: #fff; }
.btn-cta {
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  white-space: nowrap;
}
.btn-cta:hover { background: var(--accent-dark); }

.cat-dropdown { position: relative; }
.cat-dropdown-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cat-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 24px rgba(0,0,0,.15);
  min-width: 200px;
  z-index: 30;
  overflow: hidden;
}
.cat-dropdown:hover .cat-dropdown-menu,
.cat-dropdown:focus-within .cat-dropdown-menu { display: block; }
.cat-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.cat-dropdown-menu a:last-child { border-bottom: none; }
.cat-dropdown-menu a:hover { background: var(--bg); color: var(--primary); }

.product-thumb img, .product-detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb { overflow: hidden; }
.product-detail-thumb { overflow: hidden; }

@media (max-width: 980px) {
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; max-width: 100%; flex-basis: 100%; }
  .sub-nav-inner { flex-wrap: wrap; row-gap: 10px; }
  .sub-nav .main-nav { flex-wrap: wrap; }
  .sub-nav-cta { margin-left: 0; }
}
@media (max-width: 600px) {
  .account-text { display: none; }
  .cart-pill .cart-text { display: none; }
}

/* ---------------------------------------------------------------------- */
/* Auth pages (customer login/register, admin login)                      */
/* ---------------------------------------------------------------------- */
.auth-section { padding: 60px 0; }
.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.auth-card h1 { text-align: center; font-size: 1.5rem; }
.auth-form { display: flex; flex-direction: column; }
.auth-form label { font-weight: 600; margin: 12px 0 6px; font-size: .9rem; }
.auth-form input, .auth-form select, .auth-form textarea {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-family: inherit; font-size: .95rem;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; margin: 14px 0 !important; }
.checkbox-label input { width: auto; }

/* Account dashboard */
.account-section { padding: 34px 0 70px; }
.account-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.account-address-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eee; color: #555; }
.status-new { background: #fff3cd; color: #8a6d1f; }
.status-confirmed { background: #dbeafe; color: #1e50a2; }
.status-out_for_delivery { background: #fde3c4; color: #a15b0a; }
.status-delivered { background: #e5f3e8; color: var(--primary-dark); }
.status-cancelled { background: #fbeaea; color: #9c2b2b; }

@media (max-width: 860px) {
  .account-layout { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------- */
/* Admin panel                                                            */
/* ---------------------------------------------------------------------- */
.admin-body { background: #f4f1e8; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--primary-dark);
  color: #d9e6dc;
  padding: 24px 0;
  flex-shrink: 0;
}
.admin-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #fff;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-logo span { font-size: .75rem; font-weight: 500; color: #9fb4a2; text-transform: uppercase; letter-spacing: .06em; }
.admin-nav { display: flex; flex-direction: column; }
.admin-nav a {
  padding: 12px 20px;
  color: #d9e6dc;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.admin-main { flex: 1; padding: 32px 40px; max-width: 1100px; }
.admin-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-stats { display: flex; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 28px;
  min-width: 140px;
}
.stat-value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); font-family: 'Poppins', sans-serif; }
.stat-label { color: var(--muted); font-size: .85rem; }
.admin-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); }
.admin-thumb-lg { max-width: 220px; border-radius: var(--radius-sm); display: block; margin-bottom: 10px; }
.admin-row-actions { display: flex; gap: 12px; align-items: center; }
.admin-row-actions a { color: var(--primary); font-weight: 600; }
.link-btn-danger { background: none; border: none; color: #b23a3a; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; font-size: .95rem; }
.admin-order-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 24px 16px; }
  .admin-order-layout { grid-template-columns: 1fr; }
}
