/* ==========================================================================
   3) LAYOUT — header, mobile bottom bar, category sheet, footer, containers
   Mobile order (as requested):
     header  : লোগো → সার্চ বার → কার্ট বাটন
     bottom  : ক্যাটাগরি → শপ → কার্ট → হোম → ব্যাক
   ========================================================================== */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 860px; }
.page-pad { padding-top: 18px; padding-bottom: 36px; }
main { display: block; min-height: 60vh; }
body { padding-bottom: calc(var(--bn-h) + var(--safe-b)); }

/* ---------- top strip (desktop only) ---------- */
.topstrip { display: none; background: var(--navy); color: var(--on-navy); font-size: 13px; }
.topstrip .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 16px; }
.topstrip a { color: inherit; opacity: .9; display: inline-flex; align-items: center; gap: 6px; }
.topstrip a:hover { opacity: 1; text-decoration: none; }
.ts-left { display: flex; gap: 18px; }
.ts-right { opacity: .85; }
.s-hide { visibility: hidden; }
html.s-data .s-hide { visibility: visible; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.hdr { display: flex; align-items: center; gap: 10px; min-height: var(--hdr-h); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { display: block; height: 30px; width: auto; max-width: 118px; object-fit: contain; }
.hdr-search { flex: 1; min-width: 0; position: relative; display: flex; }
.hdr-search input {
  width: 100%; height: 40px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--bg);
  padding: 0 44px 0 16px; font-size: 14.5px; outline: none; transition: border-color .15s, background .15s; -webkit-appearance: none; appearance: none;
}
.hdr-search input:focus { border-color: var(--brand); background: #fff; }
.hdr-search input::placeholder { color: #8795a9; }
.hdr-search button {
  position: absolute; right: 3px; top: 3px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); display: grid; place-items: center;
}
.hdr-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.hdr-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 42px; height: 42px; padding: 0 8px; border-radius: 12px; color: var(--text); background: transparent; border: 0;
}
.hdr-btn:hover { background: var(--bg); text-decoration: none; }
.hdr-account { display: none; }              /* mobile header = logo · search · cart only */
.hdr-btn .lbl { display: none; font-size: 14px; font-weight: 600; }
.badge-n {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.badge-n:empty { display: none; }
.nav-desktop { display: none; }

@media (min-width: 900px) {
  .topstrip { display: block; }
  .brand img { height: 42px; max-width: 190px; }
  .hdr { gap: 22px; }
  .hdr-search { max-width: 520px; margin: 0 auto 0 8px; }
  .hdr-search input { height: 46px; }
  .hdr-search button { width: 40px; height: 40px; top: 3px; }
  .nav-desktop { display: flex; align-items: center; gap: 4px; order: 2; }
  .hdr-search { order: 3; } .hdr-actions { order: 4; }
  .nav-desktop > a, .dd-btn {
    padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 15px; background: none; border: 0; display: inline-flex; align-items: center; gap: 4px;
  }
  .nav-desktop > a:hover, .dd-btn:hover, .nav-desktop > a.active { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
  .hdr-btn .lbl { display: inline; }
  .hdr-account { display: inline-flex; }
  .dd { position: relative; }
  .dd-panel {
    position: absolute; top: 100%; left: 0; min-width: 250px; max-height: 70vh; overflow: auto; padding: 8px; background: #fff;
    border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); display: none;
  }
  .dd:hover .dd-panel, .dd:focus-within .dd-panel { display: block; }
  .dd-panel a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14.5px; }
  .dd-panel a:hover { background: var(--bg); text-decoration: none; }
  .dd-panel small { color: var(--muted); }
}

/* ---------- mobile bottom bar: ক্যাটাগরি · শপ · কার্ট · হোম · ব্যাক ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); box-shadow: 0 -4px 18px rgba(15, 27, 45, .07);
}
.bottom-nav a, .bottom-nav button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--bn-h); color: var(--muted); background: none; border: 0; font-size: 11.5px; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.bottom-nav .ic { width: 23px; height: 23px; }
.bottom-nav .active { color: var(--brand-dark); }
.bottom-nav .active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.bottom-nav .badge-n { top: 6px; right: calc(50% - 22px); }
@media (min-width: 900px) { .bottom-nav { display: none; } body { padding-bottom: 0; } }

/* ---------- category sheet (opened from the bottom bar) ---------- */
.sheet-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(8, 18, 34, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; max-height: 82vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 22px 22px 0 0; transform: translateY(102%); transition: transform .25s ease; padding-bottom: var(--safe-b);
}
.sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.sheet-body { overflow: auto; padding: 4px 12px 16px; -webkit-overflow-scrolling: touch; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-cat {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; text-align: center; color: var(--text);
  background: var(--bg); border-radius: var(--r); font-size: 13px; font-weight: 600; line-height: 1.3;
}
.sheet-cat:hover { text-decoration: none; background: var(--brand-soft); }
.sheet-cat .cic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--brand); overflow: hidden; box-shadow: var(--shadow-sm); }
.sheet-cat .cic img { width: 100%; height: 100%; object-fit: cover; }
.sheet-cat small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.sheet-links { display: grid; gap: 2px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.sheet-links a { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 10px; color: var(--text); font-weight: 600; }
.sheet-links a:hover { background: var(--bg); text-decoration: none; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: var(--bg); color: var(--text); }
@media (min-width: 900px) { .sheet, .sheet-overlay { display: none; } }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #c9d4e6; margin-top: 30px; }
.site-footer a { color: #c9d4e6; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 26px; padding-top: 34px; padding-bottom: 26px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-logo { display: inline-block; background: #fff; border-radius: 12px; padding: 8px 14px; }
.footer-logo img { display: block; height: 34px; width: auto; }
.footer-brand p { margin: 14px 0; max-width: 420px; font-size: 14.5px; }
.contact-list { list-style: none; display: grid; gap: 8px; font-size: 14.5px; }
.contact-list li { display: flex; gap: 10px; align-items: flex-start; }
.contact-list .ic { margin-top: 3px; color: var(--accent); }
.socials { display: flex; gap: 8px; margin-top: 14px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.socials a:hover { background: var(--brand); }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-links { display: grid; gap: 8px; font-size: 14.5px; align-content: start; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 14px; padding-bottom: 14px; }
.pay-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-badges span { background: rgba(255, 255, 255, .1); border-radius: 6px; padding: 2px 9px; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 40px; padding-top: 48px; }
  .footer-brand { grid-column: auto; }
}
