@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

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

:root {
  --bg:        #F7F6F3;
  --header-bg: #FEF6EE;
  --hero:      #B4CCAD;
  --teal:      #8CC0CE;
  --text:      #212427;
  --muted:     #6b7280;
  --border:    #e5e7eb;
  --white:     #ffffff;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
}

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .2s, transform .15s;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-outline { background: transparent; border: 2px solid var(--text); color: var(--text); }
.btn-dark    { background: var(--text); color: var(--white); }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-full { width: 100%; text-align: center; }

/* ── Header ── */
header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}
.logo span { color: var(--teal); }

nav ul {
  display: flex;
  gap: 32px;
}
nav a {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  transition: color .2s;
}
nav a:hover, nav a.active { color: var(--teal); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--text);
  display: flex;
  align-items: center;
}
.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--teal);
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-count.hidden { display: none; }

/* ── Hero ── */
.hero {
  background: var(--hero);
  padding: 80px 24px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--text);
  max-width: 640px;
  margin: 0 auto 20px;
  line-height: 1.15;
}
.hero p {
  font-size: 20px;
  color: var(--text);
  opacity: .8;
  max-width: 480px;
  margin: 0 auto 36px;
}

/* ── Section ── */
section { padding: 72px 24px; }
.section-title {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
}
.section-title span { color: var(--teal); }

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.product-img {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f0ede8;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: opacity .3s;
}
.product-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.product-price { font-size: 18px; font-weight: 700; color: var(--teal); }
.product-desc  { font-size: 14px; color: var(--muted); flex: 1; }
.product-card .btn { margin-top: 12px; }

/* ── About ── */
.about-section {
  background: var(--white);
}
.about-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.about-inner p { font-size: 18px; color: var(--muted); line-height: 1.8; }
.about-inner p + p { margin-top: 16px; }

/* ── Reviews ── */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.review-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.stars { color: #f4c400; font-size: 18px; margin-bottom: 10px; }
.review-text { font-size: 15px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.review-author { font-weight: 600; font-size: 14px; }

/* ── Delivery Banner ── */
.delivery-banner {
  background: var(--hero);
  text-align: center;
}
.delivery-banner h2 { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.delivery-steps {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.delivery-step { text-align: center; }
.delivery-step .step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.delivery-step p { font-size: 15px; font-weight: 500; max-width: 120px; }

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
}
.contact-info h3 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.contact-info p  { color: var(--muted); margin-bottom: 12px; display: flex; align-items: flex-start; gap: 10px; }
.contact-info a  { color: var(--teal); }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  background: var(--white);
  color: var(--text);
  transition: border-color .2s;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--teal); }
.contact-form textarea { resize: vertical; min-height: 120px; }

/* ── Cart Page ── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}
.cart-items { display: flex; flex-direction: column; gap: 16px; }
.cart-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: #f0ede8;
  border-radius: 8px;
  padding: 6px;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name  { font-weight: 600; font-size: 16px; }
.cart-item-price { color: var(--teal); font-weight: 600; font-size: 15px; }
.qty-control { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qty-num { font-weight: 600; min-width: 20px; text-align: center; }
.remove-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 20px; margin-left: auto; }

.cart-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}
.cart-summary h3 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 16px; }
.summary-row.total { font-weight: 700; font-size: 20px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.summary-row.discount { color: #16a34a; }
.discount-row { margin: 16px 0; }
.discount-input-wrap { display: flex; gap: 8px; }
.discount-input-wrap input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  text-transform: uppercase;
}
.discount-input-wrap input:focus { outline: none; border-color: var(--teal); }
.discount-msg { font-size: 13px; margin-top: 6px; }
.discount-msg.ok    { color: #16a34a; }
.discount-msg.error { color: #dc2626; }
.empty-cart { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty-cart p { font-size: 20px; margin-bottom: 24px; }

/* ── Delivery Page ── */
.delivery-page { max-width: 760px; margin: 0 auto; }
.delivery-page h1 { font-size: 36px; font-weight: 700; margin-bottom: 32px; }
.delivery-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.delivery-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--teal); }
.delivery-card p, .delivery-card li { color: var(--muted); line-height: 1.8; }
.delivery-card ul { padding-left: 20px; list-style: disc; }

/* ── Success / Cancel ── */
.result-page { text-align: center; padding: 100px 24px; }
.result-page .icon { font-size: 64px; margin-bottom: 24px; }
.result-page h1 { font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.result-page p { font-size: 18px; color: var(--muted); margin-bottom: 32px; }

/* ── Admin ── */
.admin-header {
  background: var(--text);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h1 { font-size: 20px; }
.admin-body { padding: 32px 24px; max-width: 1100px; margin: 0 auto; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-toolbar h2 { font-size: 24px; font-weight: 700; }
.product-editor { display: grid; gap: 20px; }
.editor-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.editor-card-head {
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.editor-card-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
}
.editor-img-wrap { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.editor-img-wrap img { width: 100px; height: 100px; object-fit: contain; border-radius: 8px; background: #f0ede8; padding: 8px; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-fields .full { grid-column: 1 / -1; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-group label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.field-group input,
.field-group textarea,
.field-group select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s;
}
.field-group input:focus,
.field-group textarea:focus { outline: none; border-color: var(--teal); }
.field-group textarea { resize: vertical; min-height: 80px; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(10px);
  transition: all .3s;
  pointer-events: none;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok  { background: #16a34a; }
.toast.err { background: #dc2626; }

/* ── Footer ── */
footer {
  background: var(--text);
  color: #9ca3af;
  padding: 40px 24px;
  text-align: center;
  font-size: 15px;
}
footer .footer-inner { max-width: 600px; margin: 0 auto; }
.social-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.social-links a { color: #9ca3af; font-size: 22px; transition: color .2s; }
.social-links a:hover { color: var(--white); }
footer p + p { margin-top: 6px; }
footer a { color: #9ca3af; }
footer a:hover { color: var(--white); }

/* ── Page header ── */
.page-hero {
  background: var(--hero);
  padding: 48px 24px;
  text-align: center;
}
.page-hero h1 { font-size: 38px; font-weight: 700; }
.page-hero p  { color: var(--text); opacity: .75; margin-top: 8px; font-size: 18px; }

/* ── Breadcrumb ── */
.breadcrumb-bar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb-bar a { color: var(--muted); transition: color .2s; }
.breadcrumb-bar a:hover { color: var(--teal); }
.breadcrumb-bar span { margin: 0 6px; }

/* ── Product Page ── */
.product-page-section { padding: 48px 24px 72px; }

.product-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

/* Gallery */
.gallery { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 90px; }
.gallery-main-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f0ede8;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
  transition: opacity .25s;
}
.gallery-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ede8;
  cursor: pointer;
  padding: 0;
  transition: border-color .2s;
  flex-shrink: 0;
}
.gallery-thumb:hover { border-color: var(--muted); }
.gallery-thumb.active { border-color: var(--teal); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

/* Product info panel */
.product-page-info { display: flex; flex-direction: column; gap: 18px; }
.product-page-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red   { background: #fee2e2; color: #dc2626; }
.badge-gray  { background: #f3f4f6; color: var(--muted); }

.product-page-name  { font-size: clamp(22px, 3vw, 32px); font-weight: 700; line-height: 1.2; }
.product-page-price { font-size: 30px; font-weight: 700; color: var(--teal); }
.product-page-short { font-size: 16px; color: var(--muted); line-height: 1.7; }

.features-list { display: flex; flex-direction: column; gap: 8px; padding: 0; list-style: none; }
.features-list li { font-size: 15px; color: var(--text); display: flex; gap: 8px; }
.features-list li::before { content: none; }

.free-from-wrap { border-top: 1px solid var(--border); padding-top: 16px; }
.ff-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ff-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ff-tag {
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.atc-row {
  display: flex;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.atc-btn { flex: 1; padding: 14px 20px; font-size: 16px; }

.certs-wrap { border-top: 1px solid var(--border); padding-top: 16px; }
.certs-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cert-badge {
  font-size: 12px;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab-pane {
  display: none;
  padding: 28px 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 720px;
}
.tab-pane.active { display: block; }
.ingredients-text { font-size: 14px; line-height: 2; }

/* Product card — updated to include detail link */
.product-card-link { display: block; text-decoration: none; color: inherit; }
.product-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.product-card-actions .btn { flex: 1; font-size: 13px; padding: 9px 10px; }

/* ── Admin image management ── */
.images-manager { margin-top: 16px; }
.images-manager-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.images-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.img-thumb-wrap {
  position: relative;
  width: 80px;
  flex-shrink: 0;
}
.img-thumb-wrap img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: #f0ede8;
  border-radius: 8px;
  padding: 6px;
  border: 2px solid transparent;
  display: block;
}
.img-thumb-wrap.is-main img { border-color: var(--teal); }
.img-thumb-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.img-thumb-actions button {
  background: #f3f4f6;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  color: var(--muted);
  transition: background .2s;
}
.img-thumb-actions button:hover { background: var(--border); }
.img-thumb-actions .del-btn:hover { background: #fee2e2; color: #dc2626; }
.img-thumb-actions .main-btn.active { background: #dcfce7; color: #16a34a; }
.upload-thumb-btn {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: border-color .2s;
  position: relative;
  overflow: hidden;
}
.upload-thumb-btn:hover { border-color: var(--teal); color: var(--teal); }
.upload-thumb-btn input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-thumb-btn .upload-icon { font-size: 22px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  nav ul { display: none; }
  .cart-layout { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .editor-card-body { grid-template-columns: 1fr; }
  .editor-fields { grid-template-columns: 1fr; }
  .delivery-steps { gap: 24px; }
  .product-page-grid { grid-template-columns: 1fr; gap: 32px; }
  .gallery { position: static; }
  .atc-row { flex-wrap: wrap; }
  .atc-btn { width: 100%; }
}
