:root {
  --bg: #f2f0e9;
  --card: #fffdf7;
  --card-2: #f8f3ea;
  --text: #1f1a13;
  --muted: #6f6556;
  --brand: #1f7a42;
  --brand-dark: #14552d;
  --accent: #d58a24;
  --line: #e6dcc9;
  --danger: #a33131;
  --shadow: 0 16px 40px rgba(59, 42, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 6% 8%, #faf6ed 0%, var(--bg) 38%, #ede6d6 100%);
  min-height: 100vh;
  padding: 16px 12px calc(92px + env(safe-area-inset-bottom));
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.16;
  z-index: -3;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(6px);
  z-index: -2;
}

.bg-shape-1 {
  width: 260px;
  height: 260px;
  background: rgba(31, 122, 66, 0.17);
  top: -60px;
  right: -80px;
}

.bg-shape-2 {
  width: 210px;
  height: 210px;
  background: rgba(213, 138, 36, 0.2);
  bottom: -20px;
  left: -60px;
}

.topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.brand-spotlight {
  flex: 1;
  border: 1px solid #1f7a42;
  border-radius: 18px;
  background: linear-gradient(140deg, #1f7a42 0%, #2f8f53 45%, #176034 100%);
  padding: 15px 15px 13px;
  box-shadow: 0 18px 34px rgba(25, 84, 50, 0.25);
}

.brand-kicker {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 4px 0 0;
  font-family: 'Fraunces', serif;
  line-height: 1.06;
  font-size: 2rem;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(5, 37, 20, 0.28);
}

.tagline {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  max-width: 38ch;
  font-weight: 500;
  line-height: 1.45;
}

.brand-glow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.brand-glow-strip span {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
}

.hero-card {
  margin-top: 14px;
  border: 1px solid #ddceb3;
  border-radius: 18px;
  background: linear-gradient(140deg, #fffaf1, #f5ead6 58%, #f3e3c9);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
  animation: reveal 0.6s ease both;
}

.hero-label {
  margin: 0;
  color: #7a5f2f;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  font-weight: 800;
}

.hero-card h2 {
  margin: 6px 0;
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
}

.hero-card p {
  margin: 0;
  color: #5f543f;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.hero-btn {
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 0.87rem;
}

.hero-btn:hover {
  background: var(--brand-dark);
}

.hero-cod {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #e0d3bc;
  font-size: 0.82rem;
  color: #5d4b30;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hero-highlights article {
  border-radius: 12px;
  border: 1px solid #ead9bc;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px 8px;
  text-align: center;
}

.hero-highlights strong {
  display: block;
  font-size: 1rem;
}

.hero-highlights span {
  font-size: 0.78rem;
  color: #736650;
}

.cart-pill {
  align-self: flex-start;
  border: none;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.cart-pill span {
  background: #fff;
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 4px;
}

.cod-banner {
  margin: 14px 0;
  background: linear-gradient(130deg, #ffedcd, #fce2b5);
  border: 1px solid #efc985;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.cod-banner p {
  margin: 0;
  font-size: 0.92rem;
}

.quick-chips {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.quick-chips::-webkit-scrollbar {
  height: 6px;
}

.quick-chips::-webkit-scrollbar-thumb {
  background: #d8cdb9;
  border-radius: 999px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: start;
}

.chip.active,
.chip:hover {
  border-color: #b9d8c3;
  background: #e8f5ec;
  color: #155a31;
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title-row h3 {
  margin: 0;
  font-size: 1.06rem;
}

.section-title-row p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
}

.layout {
  display: grid;
  gap: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.product {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  animation: liftIn 0.5s ease both;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(58, 44, 24, 0.18);
}

.product img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
}

.product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product h3 {
  margin: 0;
  font-size: 1rem;
}

.tag {
  background: #ecf8ef;
  color: #14552d;
  border: 1px solid #c3e7ce;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.meta {
  margin: 5px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-row strong {
  color: var(--brand-dark);
}

.add-btn,
.primary-btn,
.qty-btn {
  border: none;
  cursor: pointer;
}

.add-btn,
.primary-btn {
  background: var(--brand);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.add-btn:hover,
.primary-btn:hover {
  background: var(--brand-dark);
}

.cart-panel {
  background: linear-gradient(180deg, #fffef8, #f6f1e6);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
  position: fixed;
  right: 10px;
  left: 10px;
  bottom: 76px;
  max-height: min(72vh, 560px);
  overflow: auto;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s ease, opacity 0.24s ease;
  z-index: 30;
}

.cart-panel.open {
  transform: translateY(0%);
  opacity: 1;
  pointer-events: auto;
}

.cart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-panel h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.pill-muted {
  border: 1px solid #d9ceb8;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.74rem;
  color: #5e533f;
  font-weight: 700;
}

.cart-item {
  border-bottom: 1px dashed var(--line);
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-item-image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e6dcc9;
  flex-shrink: 0;
}

.cart-item-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
}

.cart-item-price {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #efe6d8;
}

.remove-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin: 12px 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 17, 10, 0.52);
  display: grid;
  place-items: center;
  padding: 12px;
  z-index: 60;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 16, 10, 0.45);
  z-index: 20;
}

.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 14px;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-content h3 {
  margin: 0;
}

.icon-btn {
  border: none;
  background: #efe6d8;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.close-cart-btn {
  width: 28px;
  height: 28px;
  font-size: 0.78rem;
}

.bottom-cart-btn {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  border: none;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  font-weight: 800;
  font-size: 0.95rem;
  min-height: 48px;
  box-shadow: var(--shadow);
  z-index: 35;
}

.bottom-cart-btn:hover {
  background: var(--brand-dark);
}

#checkoutForm {
  display: grid;
  gap: 8px;
}

#checkoutForm label {
  display: grid;
  gap: 5px;
  font-size: 0.9rem;
}

.cod-note {
  margin: 2px 0;
  color: var(--brand-dark);
}

footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.85rem;
}

footer a {
  color: var(--brand-dark);
  font-weight: 700;
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  body {
    padding-top: 12px;
  }

  .topbar {
    flex-direction: column;
    gap: 10px;
  }

  .brand-spotlight {
    border-radius: 16px;
  }

  h1 {
    font-size: 2.05rem;
  }

  .tagline {
    font-size: 0.96rem;
  }

  .cart-pill {
    align-self: stretch;
    width: 100%;
    border-radius: 12px;
    padding: 11px 14px;
    text-align: center;
  }

  .hero-card {
    padding: 14px;
    border-radius: 16px;
  }

  .hero-card h2 {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .hero-cta-row {
    flex-wrap: wrap;
  }

  .hero-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls {
    gap: 10px;
  }

  .product {
    grid-template-columns: 80px 1fr;
    border-radius: 14px;
  }

  .product img {
    width: 80px;
    height: 80px;
  }

  .product h3 {
    font-size: 0.97rem;
  }

  .meta {
    font-size: 0.8rem;
  }

  .cart-panel {
    right: 8px;
    left: 8px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    border-radius: 14px;
    padding: 10px;
    max-height: min(76vh, 620px);
  }

  .qty-btn {
    width: 28px;
    height: 28px;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 900px) {
  body {
    padding: 20px 26px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .hero-card {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
  }

  .controls {
    grid-template-columns: 1fr 210px;
  }

  .layout {
    grid-template-columns: 2.3fr 1fr;
    align-items: start;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .cart-panel {
    position: sticky;
    top: 14px;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    max-height: calc(100vh - 44px);
    bottom: auto;
    z-index: auto;
  }

  .cart-pill {
    display: none;
  }

  .close-cart-btn,
  .bottom-cart-btn,
  .cart-overlay {
    display: none;
  }
}
