/* public/assets/css/style.css
   Brand palette taken directly from the reference site screenshots:
   dark green header/footer (#0d2818), gold accent (#d4af37), Bangla font. */

:root {
  --gh-primary: #0d2818;
  --gh-accent: #d4af37;
}

body {
  /* No external font CDN - these are all pre-installed system fonts that
     already render Bangla well (Nirmala UI on Windows, Noto Sans Bengali
     on most Linux/Android, system-ui elsewhere), so the design never
     depends on a third-party font host being reachable. */
  font-family: "Nirmala UI", "Noto Sans Bengali", "Segoe UI", system-ui, sans-serif;
  background: #f7f7f5;
  color: #222;
}

/* ---- Navbar ---- */
.gh-navbar {
  background: var(--gh-primary);
  padding: .6rem 0;
}
.gh-logo {
  color: var(--gh-accent) !important;
  font-size: 1.6rem;
  letter-spacing: 1px;
}
.gh-cat-btn, .gh-cat-btn-mobile {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  white-space: nowrap;
}
.gh-cat-btn-mobile {
  background: var(--gh-primary);
  border-radius: 0;
  color: #fff;
  border: none;
  padding: .6rem;
}
.gh-search .form-control {
  border-radius: 6px 0 0 6px;
}
.gh-search-btn {
  background: var(--gh-accent);
  color: #222;
  border-radius: 0 6px 6px 0;
}
.gh-cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  font-size: .65rem;
}

/* ---- Product cards ---- */
.gh-product-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .15s ease;
  height: 100%;
}
.gh-product-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.gh-product-thumb {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  display: block;
}
.gh-product-price {
  color: var(--gh-primary);
  font-weight: 700;
}
.gh-order-btn {
  background: var(--gh-accent);
  color: #1a1a1a;
  border: none;
  font-weight: 600;
}
.gh-order-btn:hover { background: #c49b2e; color: #1a1a1a; }

/* ---- Cart icon dropdown (header + mobile header) ---- */
.gh-cart-dropdown-menu {
  min-width: 300px;
  max-width: min(340px, 90vw);
}
.gh-cart-dropdown-item:hover { background: #f8f9fa; }

/* ---- Category grid (homepage categories + a category page's subcategory
   row) - a real grid, not a horizontal-scroll strip, so it shows a fixed
   number of columns and wraps to more rows instead of needing a swipe.
   6 columns on desktop; the mobile media query below overrides to 4. ---- */
.gh-cat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}
.gh-cat-grid .gh-cat-pill {
  width: auto;
  min-width: 0;
}
.gh-cat-pill {
  text-align: center;
  text-decoration: none;
  color: #333;
}
/* Category/subcategory name label under the icon (homepage category strip,
   and the subcategory strip on a category page - both reuse this class). */
.gh-cat-pill > .small {
  font-weight: 700;
}
.gh-cat-pill img, .gh-cat-pill .gh-cat-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .4rem;
  font-weight: 700;
  color: var(--gh-primary);
  border: 2px solid var(--gh-accent);
}

/* ---- Section titles ---- */
.gh-section-title {
  text-align: center;
  font-weight: 700;
  margin: 2rem 0 1.2rem;
}

/* ---- Hero slider ---- */
.gh-hero {
  background: var(--gh-primary);
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
}

/* ---- Footer ---- */
.gh-footer {
  background: var(--gh-primary);
  color: #eaeaea;
}
.gh-footer-brand { color: var(--gh-accent); }
.footer-link { color: #cfcfcf; text-decoration: none; }
.footer-link:hover { color: var(--gh-accent); }

/* ---- Checkout / cart ---- */
.gh-checkout-box {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 1.2rem;
}

/* ---- Order tracking progress stepper (Ordered -> Packed -> In Transit -> Delivered) ---- */
.order-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 1.5rem 0;
}
.order-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.order-step-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .5rem;
  font-size: 1.4rem;
  background: #d9d9d9;
  color: #fff;
  position: relative;
  z-index: 2;
}
.order-step.done .order-step-icon,
.order-step.current .order-step-icon {
  background: #e0393e; /* matches the reference tracker's red */
}
.order-step-line {
  position: absolute;
  top: 28px;
  left: 50%;
  width: 100%;
  height: 3px;
  background: #d9d9d9;
  z-index: 1;
}
.order-step.done .order-step-line { background: #e0393e; }
.order-step:last-child .order-step-line { display: none; }
.order-step-label {
  font-size: .8rem;
  font-weight: 600;
  color: #555;
}
.order-step.done .order-step-label,
.order-step.current .order-step-label { color: #e0393e; }
.order-cancelled-badge {
  background: #f8d7da;
  color: #842029;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  font-weight: 600;
}

/* =====================================================================
   MOBILE / ANDROID WEBVIEW SUPPORT
   The Android app wraps this site in a WebView, so these rules matter
   even more than on a regular mobile browser: WebView has no browser
   chrome to fall back on, so anything that doesn't fit/scroll/tap
   correctly here is what the app "is" for the user.
   ===================================================================== */

/* Prevent the whole page from scrolling sideways if any one element is
   slightly too wide - a single overflowing element shouldn't be able to
   drag the entire viewport. Nested horizontal-scroll areas (category
   pills, tables) keep their own overflow-x further down. */
html {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  max-width: 100%;
  /* Deliberately NOT overflow-x: hidden here - having it on BOTH html
     and body breaks position:sticky for any descendant (a well-known
     CSS gotcha: overflow set to anything but visible on an ancestor
     turns it into a scroll container, which sticky positioning then
     anchors to instead of the real viewport). html alone still fully
     prevents the page from scrolling sideways. */
}

/* WebView/Chrome-mobile shows a gray flash on every tap by default -
   remove it and use our own :active states instead, which feels far
   more like a native app. */
* {
  -webkit-tap-highlight-color: transparent;
}
a, button, .btn, [role="button"] {
  touch-action: manipulation; /* removes the ~300ms tap delay */
}

/* Minimum comfortable touch target size (44px is the standard
   accessibility/Android guideline) for anything meant to be tapped. */
.gh-icons a, .gh-icons button, .navbar-toggler {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dropdown-item, .form-check-input, .btn-close {
  min-height: 30px; /* dropdown rows/checkboxes: smaller but still easy to hit */
}

/* ---- Responsive navbar: on narrow screens the search bar moves to its
   own row below the logo/icons instead of squeezing into one line ---- */
@media (max-width: 575.98px) {
  .gh-navbar .container-fluid {
    flex-wrap: wrap;
  }
  .gh-search {
    order: 3;
    flex-basis: 100%;
    margin: .5rem 0 0 !important;
  }
  .gh-logo { font-size: 1.3rem; }
  .gh-hero h1 { font-size: 1.6rem; }
  .gh-hero .fs-5 { font-size: 1rem !important; }
}

/* ---- Responsive admin sidebar: a fixed 230px column eats too much of a
   360-400px phone screen, so it becomes a horizontal scrollable top bar
   below ~992px instead of a permanent side column. ---- */
/* Safety net: admin page headers ("Title" + action buttons on the same
   row) can overflow a narrow phone if a button label is long - force them
   to wrap onto their own line instead of pushing the page wider. */
@media (max-width: 575.98px) {
  .admin-layout .d-flex.justify-content-between {
    flex-wrap: wrap;
    row-gap: .5rem;
  }
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    min-height: auto !important;
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: .5rem !important;
  }
  .admin-sidebar h5 { display: none; } /* saves space on the scrollable bar */
  .admin-sidebar a { display: inline-block; margin-right: .25rem; }
  .admin-sidebar form { display: inline-block; width: auto !important; margin-left: .5rem; }
  .admin-layout { flex-direction: column; }
}

/* Momentum scrolling for horizontal-scroll containers inside a WebView */
.d-flex.overflow-auto {
  -webkit-overflow-scrolling: touch;
}

/* Tables inside cards can overflow a narrow phone screen - scroll the
   table itself rather than breaking the page layout. Apply this class
   to the wrapping <div> around any admin <table>. */
.table-responsive-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Bootstrap modals/offcanvas already handle mobile width via their own
   framework CSS (now self-hosted - see "Design assets" note in
   README.md), so no extra overrides are needed there. */

/* Product page action buttons: side-by-side normally, stacked on very
   narrow phones so Bangla button labels don't get cramped/wrapped. */
@media (max-width: 400px) {
  .gh-product-actions {
    flex-direction: column;
  }
}

/* ---- Admin panel ---- */
.admin-sidebar {
  background: var(--gh-primary);
  min-height: 100vh;
}
.admin-sidebar a {
  color: #eaeaea;
  text-decoration: none;
  display: block;
  padding: .6rem 1rem;
  border-radius: 6px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(212,175,55,.18);
  color: var(--gh-accent);
}

@media (max-width: 991px) {
  .gh-cat-btn { display: none; }
}

/* ============================================================
   Mobile-only redesign: centered logo header, sticky bottom nav,
   category grid. Everything here is scoped under max-width: 991.98px
   (Bootstrap's lg breakpoint) so desktop/laptop is completely
   untouched - this only ever applies on mobile.
   ============================================================ */
@media (max-width: 991.98px) {
  /* Mobile header row: logo on the left, search/cart/menu icons grouped
     on the right - plain flex order (justify-content-between in the
     markup), no absolute positioning needed. */
  .gh-mobile-header {
    padding: .25rem 0;
  }
  .gh-mobile-header .gh-logo {
    margin: 0;
  }
  /* Logo height is admin-configurable (Settings > Logo Size) and is set by
     the ".gh-logo img" rule in header.php's settings-driven <style> block.
     Deliberately no height rule here anymore - a fixed px value in this
     file would always beat that rule (higher selector specificity: two
     classes vs. one) and silently ignore the admin's setting on mobile. */
  /* Icon "chips": a soft rounded background per icon instead of bare
     glyphs floating on the dark navbar - reads as distinct tappable
     buttons and gives the header a more finished, app-like feel. */
  /* Compact icons per request - plain icon + small badge, no surrounding
     "chip" background box (that was taking up too much header space
     compared to the reference). Kept at a comfortable tap size (28px)
     without the visible circle. */
  .gh-mobile-header .gh-icons {
    margin-left: auto;
    gap: .6rem;
  }
  /* The three icons are different element types (a / dropdown button /
     plain button), which by default align to text baseline rather than
     their own centers - that's what was making them look unevenly
     spaced and off-center as a row. Forcing each one (and the dropdown's
     wrapper div) to the same inline-flex centering fixes that. */
  .gh-mobile-header .gh-icons > a,
  .gh-mobile-header .gh-icons > .gh-cart-dropdown-wrapper,
  .gh-mobile-header .gh-icons > .gh-cart-dropdown-wrapper > button,
  .gh-mobile-header .gh-icons > #gh-mobile-search-toggle,
  .gh-mobile-header .gh-icons > .gh-mobile-menu-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    transition: background .15s ease;
  }
  .gh-mobile-header .gh-icons > a:active,
  .gh-mobile-header .gh-icons > .gh-cart-dropdown-wrapper > button:active,
  .gh-mobile-header .gh-icons > #gh-mobile-search-toggle:active,
  .gh-mobile-header .gh-icons > #gh-mobile-search-toggle[aria-expanded="true"],
  .gh-mobile-header .gh-icons > .gh-mobile-menu-btn:active {
    background: rgba(255, 255, 255, .12);
  }
  .gh-mobile-header .gh-icons .gh-cart-badge {
    font-size: .6rem;
    padding: .2em .4em;
    top: -6px;
    right: -8px;
  }
  .gh-mobile-menu-btn {
    font-size: 1.3rem;
    line-height: 1;
  }

  /* Category grid on mobile: 4 columns (was 5 - felt cramped), icons a
     little bigger to fill the extra room, wraps to as many rows as needed. */
  .gh-cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem .5rem;
  }
  .gh-cat-grid .gh-cat-pill img,
  .gh-cat-grid .gh-cat-pill .gh-cat-circle {
    width: 62px;
    height: 62px;
  }
  .gh-cat-grid .small {
    font-size: .7rem;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* Sticky bottom nav - fixed to the bottom of the viewport, so page
     content needs bottom padding to avoid being hidden behind it. */
  body { padding-bottom: 60px; }
}

.gh-mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: var(--gh-primary);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); /* clears phone home-bar/gesture area */
  box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}
.gh-mobile-bottom-nav a {
  color: #cfd8d3;
  text-decoration: none;
  text-align: center;
  font-size: .65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  flex: 1;
}
.gh-mobile-bottom-nav a i {
  font-size: 1.25rem;
}
.gh-mobile-bottom-nav a.active,
.gh-mobile-bottom-nav a:hover {
  color: var(--gh-accent);
}
