:root {
  --primary: #2d5a27;
  --primary-light: #4a9e42;
  --primary-dark: #1f4019;
  --bg: #f5f7f2;
  --text: #2d2d2d;
  --sale: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── ANNOUNCEMENT BAR ── */
.announcement-bar {
  background: var(--primary-dark);
  color: #d9ead6;
  text-align: center;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

/* ── HEADER ── */
header {
  background: var(--primary);
  color: white;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
}
.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { color: white; text-decoration: none; font-size: 1.3rem; font-weight: 700; }
.nav-link { color: white; text-decoration: none; font-size: 0.9rem; font-weight: 600; opacity: 0.9; }
.nav-link:hover { opacity: 1; text-decoration: underline; }
.cart-btn {
  background: var(--primary-light);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.cart-btn:hover { background: #3d8836; }
#cart-count {
  background: white;
  color: var(--primary);
  border-radius: 50%;
  padding: 0 6px;
  font-size: 0.8rem;
  margin-left: 4px;
}

/* ── MAIN / FOOTER ── */
main { flex: 1; max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; width: 100%; }
footer { background: var(--primary); color: #b8d4b5; text-align: center; padding: 1rem; font-size: 0.85rem; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  background-size: cover;
  background-position: center;
  color: white;
  border-radius: 14px;
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  text-align: center;
}
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.05rem; opacity: 0.92; margin-bottom: 1.25rem; }
.hero .btn-checkout { background: white; color: var(--primary); }
.hero .btn-checkout:hover { background: #eef5ea; }
/* Gutenberg's Button block ships no styling of its own (WP's own
   block-library CSS isn't loaded -- this site is headless), so give it the
   same look as .btn-checkout directly rather than relying on inheritance. */
.hero .wp-block-button__link {
  display: inline-block;
  background: white;
  color: var(--primary);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 600;
}
.hero .wp-block-button__link:hover { background: #eef5ea; }

/* ── FEATURED SHELF ── */
.featured-shelf { margin-bottom: 2rem; }
.featured-shelf h2 { font-size: 1.1rem; margin-bottom: 0.85rem; }
.featured-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

/* ── SHOP LAYOUT ── */
.shop-layout { display: flex; gap: 2rem; align-items: flex-start; }

/* ── SIDEBAR ── */
.sidebar { width: 200px; flex-shrink: 0; }
.sidebar h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: #666; margin-bottom: 0.75rem; }
.sidebar ul { list-style: none; }
.sidebar ul li a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.sidebar ul li a:hover { background: #e2eddf; }
.sidebar ul li a.active { background: var(--primary); color: white; font-weight: 600; }

/* ── PRODUCT GRID ── */
.product-grid-wrap { flex: 1; }
.category-description { color: #555; font-size: 0.95rem; margin-bottom: 1.25rem; line-height: 1.5; }
.category-description p { margin: 0; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.product-card {
  background: white;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  position: relative;
}
.product-icon,
.product-placeholder {
  font-size: 2.5rem;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf2e6, #dcebd5);
}
.product-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.product-card h3 { font-size: 1rem; font-weight: 600; }
.product-desc { font-size: 0.82rem; color: #666; flex: 1; line-height: 1.4; }
.product-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.price-was { font-size: 0.85rem; color: #999; text-decoration: line-through; margin-right: 0.4rem; }
.btn-add {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.btn-add:hover { background: #3d7a33; }

/* ── SALE BADGE ── */
.sale-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--sale);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}
.promo-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sale);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── CART ── */
.cart-layout { max-width: 760px; margin: 0 auto; }
.cart-layout h2 { margin-bottom: 1.5rem; }

.cart-table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.cart-table th, .cart-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid #eee; }
.cart-table th { background: #f0f4ef; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: #555; }
.cart-table tfoot td { border-top: 2px solid #ddd; border-bottom: none; }

.qty-input { width: 60px; padding: 0.3rem; border: 1px solid #ddd; border-radius: 4px; text-align: center; }
.btn-remove { background: none; border: none; color: #c0392b; cursor: pointer; font-size: 1rem; }

.checkout-form {
  margin-top: 2rem;
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.checkout-form h3 { margin-bottom: 1rem; }
.checkout-form label { display: block; margin-bottom: 1rem; font-size: 0.9rem; font-weight: 600; color: #444; }
.checkout-form input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}
.btn-checkout {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.5rem;
}
.btn-checkout:hover { background: #3d7a33; }

/* ── CONFIRMATION ── */
.confirmation { display: flex; justify-content: center; padding: 2rem 0; }
.confirmation-box { background: white; border-radius: 12px; padding: 2.5rem; max-width: 600px; width: 100%; box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-align: center; }
.check { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }
.confirmation-box h2 { margin-bottom: 0.5rem; }
.confirmation-box p { color: #555; margin-bottom: 0.5rem; }
.order-ref { margin-bottom: 1.5rem; }
.confirmation-box .cart-table { text-align: left; margin-bottom: 1.5rem; }

.empty { color: #888; font-size: 0.95rem; }

/* ── BLOG ── */
.blog-layout { max-width: 960px; margin: 0 auto; }
.blog-layout h2 { margin-bottom: 1.5rem; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.blog-card {
  background: white; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07); text-decoration: none; color: var(--text);
  display: flex; flex-direction: column;
}
.blog-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.blog-card .product-icon { height: 150px; border-radius: 0; font-size: 3rem; }
.blog-card h3 { padding: 0.85rem 1rem 0.25rem; font-size: 1rem; }
.blog-date { padding: 0 1rem 0.85rem; font-size: 0.8rem; color: #888; display: block; }
.blog-detail { max-width: 720px; margin: 0 auto; }
.blog-back { color: var(--primary); text-decoration: none; font-size: 0.9rem; font-weight: 600; display: inline-block; margin-bottom: 1rem; }
.blog-detail-cover { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin-bottom: 1.5rem; }
.blog-detail h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.blog-body { margin-top: 1.5rem; line-height: 1.7; color: #333; }

/* ── CUSTOM PAGES / BLOCK EDITOR ── */
.custom-page { display: flex; flex-direction: column; gap: 2rem; max-width: 960px; margin: 0 auto; }
.block-text { max-width: 720px; margin: 0 auto; }
.block-text h2 { margin-bottom: 0.75rem; }
.block-text-body { line-height: 1.7; color: #333; }
.block-image { text-align: center; }
.block-image img { max-width: 100%; border-radius: 10px; }
.block-image figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: #888; }
.block-quote {
  max-width: 640px; margin: 0 auto; text-align: center; padding: 1.5rem;
  border-left: 4px solid var(--primary); background: white; border-radius: 0 10px 10px 0;
}
.block-quote p { font-size: 1.2rem; font-style: italic; color: #333; margin-bottom: 0.5rem; }
.block-quote cite { font-size: 0.9rem; color: #888; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header { padding: 0 1rem; }
  main { padding: 0 1rem; margin: 1.25rem auto; }
  .hero { padding: 2rem 1.25rem; }
  .hero h1 { font-size: 1.5rem; }

  .shop-layout { flex-direction: column; gap: 1rem; }
  .sidebar { width: 100%; }
  .sidebar ul { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
  .sidebar ul li a { white-space: nowrap; margin-bottom: 0; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
}

/* ── EDIT MODE (staff Page Builder only -- never loaded for real visitors) ── */
.eb-block { display: contents; } /* invisible wrapper, doesn't disturb flex/grid layout */
body.eb-edit-mode .eb-block { outline: 1px dashed transparent; }
body.eb-edit-mode .eb-block:hover { outline-color: rgba(45,90,39,0.35); cursor: pointer; }
body.eb-edit-mode .eb-block.eb-selected { outline: 2px solid var(--primary); outline-offset: -2px; }
body.eb-edit-mode [contenteditable="true"]:focus { outline: 2px dashed var(--primary-light); outline-offset: 2px; }
