:root {
  --green: #006a4e;
  --orange: #f26a00;
  --cream: #fffcf7;
  --dark: #2a2829;
  --grey: #555;
  --line: #999;
  --header-h: 66px;
  --tabbar-h: 70px;
  --max-w: 480px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }

body {
  background: #ece8e0;               /* visible only on desktop, beside the phone-width app */
  font-family: 'Inter', system-ui, sans-serif;
}

/* App shell: phone width, centered on large screens */
.app {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--cream);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 12px 0 5px;
  background: #fefefe;
  border-bottom: 1px solid var(--line);
}
.brand { flex: 1; display: flex; align-items: center; gap: 8px; color: #111; text-decoration: none; min-width: 0; }
.brand__logo {
  flex: none;
  width: 62px;                                     /* fills the 66px header */
  height: 62px;
  object-fit: contain;
  display: block;
}
.brand__name {
  font-family: 'Montserrat', 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 340px) { .brand__name { font-size: 18px; } }

.search { width: 40px; height: 40px; display: grid; place-items: center; margin-right: 18px; color: var(--orange); }
.search svg { width: 30px; height: 30px; }

/* Language toggle */
.lang {
  position: relative;
  flex: none;
  width: 106px;
  height: 35px;
  display: flex;
  align-items: center;
  border: 1.5px solid #333;
  border-radius: 20px;
  background: #fff;
}
.lang__pill {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 46px;
  height: 25px;
  border-radius: 14px;
  background: var(--orange);
  transition: transform 0.25s ease;
}
.lang__opt { position: relative; z-index: 1; flex: 1; text-align: center; font-size: 16px; font-weight: 600; color: #333; transition: color 0.25s; }
.lang__opt--en { color: #fff; letter-spacing: 0.3px; }
.lang__opt--bn { font-family: 'Hind Siliguri', sans-serif; }
.lang.is-bn .lang__pill { transform: translateX(51px); }
.lang.is-bn .lang__opt--en { color: #333; }
.lang.is-bn .lang__opt--bn { color: #fff; }

/* Content */
.main { padding: 12px 3px calc(var(--tabbar-h) + 16px); }
.banner { aspect-ratio: 1080 / 285; overflow: hidden; }       /* banner size: 1080 x 285 px (about 3.8 : 1) */
.banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner--empty { background: var(--dark); }                    /* placeholder until banner.jpg is added */

/* Bottom tab bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 100%;
  max-width: var(--max-w);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: #fefefe;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(242, 106, 0, 0.06);
}
.tab {
  position: relative;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--grey);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  min-width: 0;
}
.tab span { white-space: nowrap; }                 /* keep every tab label on one line */
#accountBtn { flex: 1.3; }                        /* a little extra room for "My Account" */
@media (max-width: 360px) { .tab { font-size: 12px; } }
.tab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--orange); font-weight: 600; }
.tab.is-active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 38px;
  height: 3px;
  margin-left: -19px;
  border-radius: 0 0 3px 3px;
  background: var(--orange);
}

/* More menu (bottom sheet that slides up from behind the tab bar) */
.more {
  --ease: cubic-bezier(0.32, 0.72, 0, 1);        /* smooth, iOS-like deceleration */
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;                                   /* below .tabbar (30): footer stays in front */
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: background 0.35s ease, visibility 0s linear 0.35s;
}
.more.is-open {
  background: rgba(0, 0, 0, 0.35);
  visibility: visible;
  pointer-events: auto;
  transition: background 0.35s ease, visibility 0s;
}
.more.is-dragging { transition: none; }

.more__panel {
  width: 100%;
  padding: 8px 16px calc(18px + var(--tabbar-h) + env(safe-area-inset-bottom));
  background: #fefefe;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  touch-action: none;                            /* we handle the swipe-down ourselves */
  transform: translateY(100%);
  transition: transform 0.38s var(--ease);
  will-change: transform;
}
.more.is-open .more__panel { transform: translateY(0); }
.more.is-dragging .more__panel { transition: none; }
.more__handle { width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 2px; background: #ddd; }
.more__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.more__title { font-size: 18px; font-weight: 600; color: #111; margin: 0 0 0 4px; }
.more__close { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f3f0ea; color: #333; }
.more__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.more__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid #eee;
  border-radius: 14px;
  background: var(--cream);
  color: #222;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.more__item svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--orange); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.more__item:active { background: #fff1e6; border-color: var(--orange); }

/* Bengali text reads better in a Bengali font */
html[lang="bn"] body { font-family: 'Hind Siliguri', 'Inter', system-ui, sans-serif; }

/* language toggle while the AI is translating */
.lang.is-loading .lang__pill { animation: lang-pulse 0.9s ease-in-out infinite; }
@keyframes lang-pulse { 50% { opacity: 0.45; } }

/* small message at the bottom */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #2a2829;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* Product list on the home page */
.products { padding: 18px 9px 0; }
.products__title { margin: 0 0 12px 3px; font-size: 18px; font-weight: 600; color: #111; }
.products__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #f0e9dc;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.card:active { border-color: var(--orange); }
.card__img {
  position: relative;
  aspect-ratio: 2 / 3;                             /* same tall picture box on every card */
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff;                                /* white, so a white photo background blends in (no visible gap) */
}
/* the WHOLE picture is shown (no cropping); absolute so a tall photo can never stretch its card */
.card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.card__ph { display: grid; place-items: center; color: #e2b48a; }
.card__ph svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.card__body { flex: 1; display: flex; flex-direction: column; padding: 10px 10px 12px; }
.card__name {
  margin: 0 0 6px;
  min-height: 2.6em;                               /* room for two lines, keeps cards even */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: #222;
}
.card__price { margin-top: auto; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.card__price b { font-size: 15px; font-weight: 600; color: var(--orange); }
.card__price s { font-size: 12px; color: #999; }

/* loading placeholders and messages */
.card--skeleton { pointer-events: none; }
.card--skeleton .card__img { background: #f3ede3; }
.sk { height: 12px; margin-bottom: 8px; border-radius: 6px; background: #f3ede3; }
.sk--short { width: 55%; }
.card--skeleton .card__img, .sk { animation: sk-pulse 1.2s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: 0.5; } }

.products__msg { grid-column: 1 / -1; padding: 28px 12px; text-align: center; color: var(--grey); font-size: 14px; }
.products__retry { margin-top: 12px; padding: 10px 20px; border-radius: 10px; background: var(--orange); color: #fff; font-weight: 600; font-size: 14px; }


/* theme.css - light / dark toggle button for Bongo Shi
   Load it AFTER style.css:  <link rel="stylesheet" href="theme.css"> */

.theme {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.theme:active { background: rgba(127, 127, 127, .15); }
.theme:focus-visible { outline: 2px solid #ff6a00; outline-offset: 2px; }

/* the two icons sit on top of each other and swap with a small spin */
.theme__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  transition: transform .35s ease, opacity .25s ease;
}
.theme__icon--moon { opacity: 1; transform: rotate(0) scale(1); }
.theme__icon--sun  { opacity: 0; transform: rotate(-90deg) scale(.5); }

.theme.is-dark .theme__icon--moon { opacity: 0; transform: rotate(90deg) scale(.5); }
.theme.is-dark .theme__icon--sun  { opacity: 1; transform: rotate(0) scale(1); }

/* ---------- Dark mode ----------
   theme.js sets data-theme="dark" on <html>. These rules recolour the page. */
.theme { color: #333; }
html[data-theme="dark"] body { background: #0e0d0d; color: #f2f2f2; }
html[data-theme="dark"] .app { background: #1b1a19; }
html[data-theme="dark"] .header { background: #161514; border-bottom-color: #3a3836; }
html[data-theme="dark"] .brand { color: #f5f5f5; }
html[data-theme="dark"] .theme { color: #f2f2f2; }
html[data-theme="dark"] .products__title,
html[data-theme="dark"] .more__title { color: #f5f5f5; }
html[data-theme="dark"] .products__msg { color: #b9b4ad; }
html[data-theme="dark"] .card { background: #242220; border-color: #3a3836; }
html[data-theme="dark"] .card__name { color: #eee; }
html[data-theme="dark"] .card__price s { color: #8d8882; }
html[data-theme="dark"] .card__img { background: #fff; }
html[data-theme="dark"] .card--skeleton .card__img,
html[data-theme="dark"] .sk { background: #2e2a26; }
html[data-theme="dark"] .tabbar { background: #161514; border-top-color: #3a3836; box-shadow: none; }
html[data-theme="dark"] .tab { color: #b9b4ad; }
html[data-theme="dark"] .tab.is-active { color: var(--orange); }
html[data-theme="dark"] .more__panel { background: #1f1e1c; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .more__handle { background: #4a4743; }
html[data-theme="dark"] .more__close { background: #2e2c2a; color: #eee; }
html[data-theme="dark"] .more__item { background: #262422; border-color: #3a3836; color: #eee; }
html[data-theme="dark"] .more__item:active { background: #3a2a1d; border-color: var(--orange); }
html[data-theme="dark"] .toast { background: #f2f2f2; color: #111; }
