@import url('https://fonts.googleapis.com/css2?family=Baloo+Da+2:wght@500;600;700;800&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  --cream: #FBF3E6;
  --white: #FFFDF9;
  --tea: #C9863B;
  --tea-dark: #7A4A1E;
  --tea-deep: #4A2E14;
  --amber: #F0C68B;
  --amber-soft: #FBE3BE;
  --leaf: #5B7C4B;
  --leaf-dark: #435E37;
  --ink: #3B2A1A;
  --danger: #B4472C;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(74, 46, 20, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Hind Siliguri', sans-serif;
  line-height: 1.55;
}
h1, h2, h3, .display {
  font-family: 'Baloo Da 2', 'Hind Siliguri', sans-serif;
  color: var(--tea-deep);
  margin: 0 0 .4em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--amber);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 18px; max-width: 1180px; margin: 0 auto;
  flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Baloo Da 2', sans-serif;
  font-size: 1.5rem; font-weight: 700; color: var(--tea-dark);
  flex-shrink: 0;
}
.brand .cup-wrap { position: relative; width: 40px; height: 40px; }
.brand .cup-wrap svg { width: 40px; height: 40px; }
.steam { position: absolute; top: -14px; left: 10px; width: 20px; height: 20px; opacity: .75; }
.steam span {
  position: absolute; bottom: 0; width: 3px; height: 10px; border-radius: 3px;
  background: var(--tea); animation: rise 2.2s ease-in-out infinite;
}
.steam span:nth-child(1) { left: 2px; animation-delay: 0s; }
.steam span:nth-child(2) { left: 9px; animation-delay: .5s; }
.steam span:nth-child(3) { left: 16px; animation-delay: 1s; }
@keyframes rise {
  0% { transform: translateY(0) scaleY(1); opacity: 0; }
  30% { opacity: .8; }
  100% { transform: translateY(-16px) scaleY(1.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .steam span { animation: none; opacity: .5; } }

.search-box {
  flex: 1 1 260px; display: flex; align-items: center;
  background: var(--cream); border: 2px solid var(--amber);
  border-radius: 999px; padding: 6px 8px 6px 16px;
}
.search-box input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 0.98rem; color: var(--ink);
}
.search-box button {
  background: var(--tea); color: #fff; border: none; border-radius: 999px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.fb-icon {
  width: 38px; height: 38px; border-radius: 50%; background: #1877F2;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fb-icon svg { width: 20px; height: 20px; fill: #fff; }

.nav-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-buttons a {
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  border: 2px solid var(--tea); color: var(--tea-dark); position: relative;
  transition: all .15s ease;
}
.nav-buttons a:hover { background: var(--tea); color: #fff; }
.nav-buttons a.active { background: var(--tea); color: #fff; }
.cart-count {
  position: absolute; top: -8px; right: -8px; background: var(--danger); color: #fff;
  font-size: .68rem; min-width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ---------- Offer ticker ---------- */
.ticker-wrap {
  background: var(--tea-dark); color: var(--amber-soft); overflow: hidden;
  white-space: nowrap; position: relative;
}
.ticker-track {
  display: inline-block; padding-left: 100%;
  animation: ticker 28s linear infinite;
  font-weight: 600; font-size: .92rem; padding-top: 8px; padding-bottom: 8px;
}
.ticker-track span { margin-right: 60px; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }

/* ---------- Banner ---------- */
.banner-wrap { max-width: 1180px; margin: 16px auto; padding: 0 18px; }
.banner-scroll {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: var(--radius); scrollbar-width: thin;
}
.banner-scroll img {
  scroll-snap-align: start; border-radius: var(--radius); width: 100%;
  flex: 0 0 100%; height: 220px; object-fit: cover; box-shadow: var(--shadow);
}
@media (max-width: 600px) { .banner-scroll img { height: 150px; } }

/* ---------- Layout: sidebar + grid ---------- */
.shop-layout { display: flex; gap: 24px; align-items: flex-start; margin: 20px auto 60px; }
.filter-sidebar {
  flex: 0 0 220px; background: var(--white); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: sticky; top: 90px;
}
.filter-sidebar h3 { font-size: 1.05rem; margin-bottom: 12px; }
.filter-sidebar label {
  display: flex; align-items: center; gap: 8px; padding: 7px 0; cursor: pointer;
  font-size: .92rem;
}
.filter-sidebar select, .filter-sidebar input[type=text] {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--amber);
  margin-bottom: 10px; background: var(--cream);
}
.category-chip {
  display: inline-block; margin: 3px 4px 3px 0; padding: 5px 12px; border-radius: 999px;
  background: var(--cream); border: 1.5px solid var(--amber); font-size: .82rem; cursor: pointer;
}
.category-chip.active { background: var(--tea); color: #fff; border-color: var(--tea); }

.product-main { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px;
}
.product-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .15s ease;
}
.product-card:hover { transform: translateY(-3px); }
.product-card .thumb { aspect-ratio: 1/1; overflow: hidden; background: var(--amber-soft); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.product-card .info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .cat { font-size: .74rem; color: var(--tea); font-weight: 600; }
.product-card .name { font-size: .98rem; font-weight: 600; color: var(--tea-deep); min-height: 2.6em; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-now { font-weight: 700; color: var(--leaf-dark); font-size: 1.05rem; }
.price-old { text-decoration: line-through; color: #a89685; font-size: .85rem; }
.btn-row { display: flex; gap: 8px; margin-top: auto; }
.btn {
  flex: 1; text-align: center; padding: 9px 6px; border-radius: 9px; font-weight: 600;
  font-size: .85rem; border: none; cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn-outline { background: transparent; border: 2px solid var(--tea); color: var(--tea-dark); }
.btn-fill { background: var(--leaf); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Product detail / image modal ---------- */
.img-modal {
  position: fixed; inset: 0; background: rgba(58,38,20,.82); display: none;
  align-items: center; justify-content: center; z-index: 200; padding: 24px;
}
.img-modal.open { display: flex; }
.img-modal img {
  max-width: min(90vw, 520px); max-height: 82vh; object-fit: contain;
  border-radius: var(--radius); background: #fff;
}
.img-modal .close-x {
  position: absolute; top: 22px; right: 26px; color: #fff; font-size: 2rem; cursor: pointer;
}

/* ---------- Cart / Checkout ---------- */
.page-title { padding: 22px 0 8px; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-table th, .cart-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--amber-soft); font-size: .92rem; }
.cart-table th { background: var(--amber-soft); color: var(--tea-deep); }
.qty-input { width: 56px; padding: 5px; border-radius: 6px; border: 1.5px solid var(--amber); text-align: center; }
.summary-box { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; max-width: 380px; margin-left: auto; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95rem; }
.summary-row.total { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--amber); margin-top: 8px; padding-top: 10px; color: var(--leaf-dark); }

.form-box { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; color: var(--tea-deep); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1.5px solid var(--amber);
  background: var(--cream); font-size: .95rem;
}
.pay-info {
  background: var(--amber-soft); border-radius: 10px; padding: 14px 16px; font-size: .9rem; margin-bottom: 14px;
  border-left: 4px solid var(--tea);
}
.pay-info b { color: var(--tea-deep); }
.courier-note { background: var(--cream); border: 1px dashed var(--tea); border-radius: 10px; padding: 12px 14px; font-size: .87rem; margin-bottom: 14px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--tea-deep); color: var(--amber-soft); margin-top: 40px; padding: 30px 0 18px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer h4 { color: #fff; margin-bottom: 8px; font-size: 1rem; }
.site-footer .bottom { text-align: center; font-size: .8rem; opacity: .75; margin-top: 20px; }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--tea-dark); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge-pending { background: #FBE3BE; color: #7A4A1E; }
.badge-shipped { background: #D9E7CE; color: #435E37; }
.badge-delivered { background: #C7E4C0; color: #2E4B22; }
.badge-cancelled { background: #F3C9BE; color: #8C3A24; }
.alert-success { background: #DCEED1; color: #2E4B22; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; }
.alert-error { background: #F5D3C6; color: #8C3A24; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; }

@media (max-width: 860px) {
  .shop-layout { flex-direction: column; }
  .filter-sidebar { flex: 1 1 auto; width: 100%; position: static; }
  .header-inner { justify-content: center; }
}
