/* ================================================================
   PEVLO — Mobile-First CSS  (mobile.css)
   Loads AFTER main.css — all mobile-only overrides here
   ================================================================ */

/* ── Bengali font guarantee ──────────────────────────────────── */
html[lang="bn"],
html[lang="bn"] body,
html[lang="bn"] .mobile-bottom-item span,
html[lang="bn"] .mob-float-nav__item,
html[lang="bn"] .top-notif-bar,
html[lang="bn"] .mob-search-bar input {
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', 'Anek Bangla', sans-serif;
}

/* ── Desktop search bar — modern pill style ──────────────────── */
.search-bar form {
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  border: 2px solid var(--primary);
  background: var(--bg-card);
  transition: box-shadow .2s, border-color .2s;
  box-shadow: 0 2px 8px rgba(11, 97, 64, .08);
}

.search-bar form:focus-within {
  box-shadow: 0 4px 20px rgba(11, 97, 64, .18);
  border-color: var(--primary-light, #13a06a);
}

.search-input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  border-radius: 0 !important;
  padding: 10px 16px !important;
  font-size: .92rem !important;
  flex: 1;
}

.search-btn {
  background: var(--primary) !important;
  border: none !important;
  color: #fff !important;
  padding: 0 22px !important;
  cursor: pointer;
  font-size: .95rem;
  transition: background .2s;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}

.search-btn:hover {
  background: var(--primary-dark, #0a5038) !important;
}

/* ================================================================
   MOBILE-ONLY — all rules below apply at ≤900px
   ================================================================ */

/* ── Hide desktop elements on mobile ─────────────────────────── */
@media (max-width: 900px) {
  .topbar {
    display: none !important;
  }

  .navbar {
    display: none !important;
  }

  /* Hide the desktop search bar in the main header */
  .header .search-bar {
    display: none !important;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  }

  /* Reduce body bottom padding — just enough for bottom nav */
  body {
    padding-bottom: 70px !important;
  }
}

/* ── Mobile Search Bar — below header ─────────────────── */
.mob-search-bar {
  display: none;
  /* hidden on desktop */
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  position: static;
}

.mob-search-bar form {
  display: flex;
  align-items: center;
  border-radius: 50px;
  overflow: hidden;
  border: 1.5px solid var(--primary);
  background: var(--bg-body);
  height: 42px;
}

.mob-scan-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  padding: 0 13px;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.mob-scan-btn:active {
  color: var(--primary);
}

.mob-search-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  padding: 0 12px !important;
  font-size: .92rem !important;
  height: 100%;
}

.mob-search-submit {
  background: var(--primary) !important;
  border: none !important;
  color: #fff !important;
  padding: 0 16px !important;
  cursor: pointer;
  font-size: .9rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0 50px 50px 0 !important;
  transition: background .2s;
}

.mob-search-submit:hover {
  background: var(--primary-dark, #0a5038) !important;
}

@media (max-width: 900px) {
  .mob-search-bar {
    display: block;
  }
}

/* ================================================================
   BOTTOM NAVIGATION — Full width, Icons + Labels
   ================================================================ */
.mobile-bottom-bar {
  display: none;
}

@media (max-width: 900px) {
  .mobile-bottom-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 95;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
    padding: 0 0 max(0px, env(safe-area-inset-bottom));
    align-items: stretch;
    justify-content: stretch;
  }
}

/* Each nav item */
.mobile-bottom-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s, transform .15s;
  position: relative;
  gap: 4px;
  letter-spacing: .01em;
  border: none;
  background: transparent;
}

.mobile-bottom-item i,
.mobile-bottom-item svg {
  font-size: 1.5rem;
  width: 26px;
  height: 26px;
  line-height: 1;
  transition: transform .15s;
  color: var(--primary);
}

html[data-theme="dark"] .mobile-bottom-item i,
html[data-theme="dark"] .mobile-bottom-item svg {
  color: var(--primary);
}

.mobile-bottom-item span {
  font-size: .6rem;
  line-height: 1;
  white-space: nowrap;
}

.mobile-bottom-item:hover,
.mobile-bottom-item.active {
  color: var(--primary);
}

.mobile-bottom-item:hover i,
.mobile-bottom-item:hover svg {
  transform: translateY(-1px);
}

/* ── Center Home button — raised green circle ─────────────────── */
.mobile-bottom-item--home {
  flex: 0 0 70px;
}

.mobile-bottom-item--home i,
.mobile-bottom-item--home svg {
  background: var(--primary);
  color: #fff !important;
  border: 5px solid var(--bg-card);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  padding: 12px;
  font-size: 1.45rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -32px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  transition: all .25s ease;
}

.mobile-bottom-item--home:hover i,
.mobile-bottom-item--home:hover svg,
.mobile-bottom-item--home.active i,
.mobile-bottom-item--home.active svg {
  background: var(--primary-dark);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.1);
}

/* Don't apply the general active color to home (icon handles it) */
.mobile-bottom-item--home {
  color: var(--text-muted);
}

.mobile-bottom-item--home.active {
  color: var(--primary);
}

/* Cart badge */
.mbb-badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 22px);
  background: var(--secondary);
  color: #fff;
  font-size: .52rem;
  font-weight: 900;
  min-width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  font-style: normal;
  border: 1.5px solid var(--bg-card);
  line-height: 1;
}

/* ================================================================
   FLOATING QUICK NAV (mobile)
   ================================================================ */
.mob-float-nav {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 12px;
  z-index: 89;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.mob-float-nav__toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  border: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(253, 151, 42, .4);
  cursor: pointer;
  transition: transform .2s, background .2s;
}

.mob-float-nav__toggle:hover {
  transform: rotate(15deg) scale(1.08);
}

.mob-float-nav__items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .22s, transform .22s;
}

.mob-float-nav.is-open .mob-float-nav__items {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mob-float-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 7px 14px 7px 10px;
  color: var(--text-main);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
  white-space: nowrap;
  transition: background .15s, transform .15s;
}

.mob-float-nav__item:hover {
  background: var(--bg-body);
  transform: translateX(-3px);
}

.mob-float-nav__item i {
  color: var(--primary);
  width: 16px;
  text-align: center;
}

@media (max-width: 900px) {
  .mob-float-nav {
    display: flex;
  }
}

/* ================================================================
   PRODUCT GRIDS — 2 column on mobile
   ================================================================ */
.product-grid-5col {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .product-grid-5col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .product-grid-5col.limit-mobile>*:nth-child(n+7) {
    display: none !important;
  }

  .infinite-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

@media (max-width: 480px) {

  .product-grid-5col,
  .infinite-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}

/* ================================================================
   GENERAL MOBILE POLISH
   ================================================================ */
@media (max-width: 900px) {
  .section {
    padding: 20px 0 !important;
  }

  .section-compact {
    padding: 16px 0 !important;
  }

  .section-head {
    margin-bottom: 14px !important;
  }

  .section-title {
    font-size: 1.25rem !important;
  }

  /* Chat/back-to-top position fixes for mobile */
  .floating-chat-container {
    bottom: 80px !important;
    right: 12px !important;
  }

  /* Prevent floating nav toggle overlap with chat */
  .mob-float-nav {
    bottom: 80px;
  }
}

/* ── Search box border: theme blue (old green shadow removed), soft ring on focus ── */
.search-bar form{
  border:1.5px solid color-mix(in srgb, var(--primary) 55%, var(--border)) !important;
  box-shadow:0 1px 2px rgba(15,23,42,.05) !important;
  transition:border-color .2s ease, box-shadow .2s ease !important;
}
.search-bar form:hover{border-color:color-mix(in srgb, var(--primary) 80%, var(--border)) !important}
.search-bar form:focus-within{
  border-color:var(--primary-light) !important;
  box-shadow:0 0 0 4px color-mix(in srgb, var(--primary-light) 16%, transparent) !important;
}
html[data-theme="dark"] .search-bar form{
  border-color:color-mix(in srgb, var(--primary) 45%, transparent) !important;
  background:color-mix(in srgb, var(--bg-card) 85%, #000) !important;
  box-shadow:none !important;
}
html[data-theme="dark"] .search-bar form:focus-within{
  border-color:var(--primary-light) !important;
  box-shadow:0 0 0 4px color-mix(in srgb, var(--primary-light) 14%, transparent) !important;
}
.mob-search-bar form{border-color:color-mix(in srgb, var(--primary) 55%, var(--border)) !important;transition:border-color .2s, box-shadow .2s}
.mob-search-bar form:focus-within{border-color:var(--primary-light) !important;box-shadow:0 0 0 3px color-mix(in srgb, var(--primary-light) 16%, transparent)}
.search-bar.pvs-open form{border-bottom-left-radius:22px;border-bottom-right-radius:22px}

/* ── Live suggestions dropdown ── */
.pvs-host{position:relative}
.pvs{
  position:absolute;left:0;right:0;top:calc(100% + 8px);z-index:400;
  background:var(--bg-card);color:var(--text-main);
  border:1px solid var(--border);border-radius:16px;
  box-shadow:0 18px 50px -12px rgba(15,23,42,.28);
  max-height:min(70vh,480px);overflow:auto;overscroll-behavior:contain;padding:6px;
  animation:pvsIn .14s ease-out;
}
.pvs[hidden]{display:none}
@keyframes pvsIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.pvs.is-loading{opacity:.6;transition:opacity .15s}
.pvs-label{padding:8px 10px 4px;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-muted)}
.pvs-cats{display:flex;flex-wrap:wrap;gap:6px;padding:6px 6px 4px}
.pvs-chip{padding:5px 12px;border-radius:999px;font-size:.8rem;font-weight:600;text-decoration:none;color:var(--primary);background:color-mix(in srgb, var(--primary) 9%, transparent);border:1px solid color-mix(in srgb, var(--primary) 20%, transparent)}
.pvs-chip:hover,.pvs-chip.is-active{background:color-mix(in srgb, var(--primary) 16%, transparent)}
.pvs-prod{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:12px;text-decoration:none;color:inherit}
.pvs-prod:hover,.pvs-prod.is-active{background:color-mix(in srgb, var(--primary) 8%, transparent)}
.pvs-prod img{width:44px;height:44px;flex:none;object-fit:cover;border-radius:10px;background:var(--bg-body);border:1px solid var(--border)}
.pvs-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.pvs-name{font-weight:600;font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pvs-name mark,.pvs-chip mark{background:none;color:var(--primary-light);font-weight:800}
.pvs-meta{font-size:.74rem;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pvs-out{font-style:normal;color:#dc2626}
.pvs-price{display:flex;flex-direction:column;align-items:flex-end;flex:none;font-size:.86rem}
.pvs-price b{color:var(--secondary, var(--primary))}
.pvs-price s{font-size:.72rem;color:var(--text-muted)}
.pvs-all{display:block;margin-top:4px;padding:10px;border-radius:12px;text-align:center;font-size:.84rem;font-weight:700;color:var(--primary-light);text-decoration:none;border-top:1px solid var(--border)}
.pvs-all:hover,.pvs-all.is-active{background:color-mix(in srgb, var(--primary) 8%, transparent)}
.pvs-empty{padding:18px 12px;text-align:center;font-size:.86rem;color:var(--text-muted)}
.pvs-skel{display:flex;flex-direction:column;gap:8px;padding:8px}
.pvs-skel i{display:block;height:44px;border-radius:10px;background:linear-gradient(90deg,var(--bg-body) 25%,color-mix(in srgb,var(--border) 60%,var(--bg-body)) 50%,var(--bg-body) 75%);background-size:200% 100%;animation:pvsSk 1s linear infinite}
@keyframes pvsSk{to{background-position:-200% 0}}
#mobSearchBar .pvs{top:calc(100% + 4px);left:8px;right:8px}
@media (prefers-reduced-motion:reduce){.pvs,.pvs-skel i{animation:none}}

/* ── Page changes without reload (site-nav.js) ── */
.pv-nprog{position:fixed;top:0;left:0;right:0;height:3px;z-index:6000;pointer-events:none;opacity:0;transform:scaleX(0);transform-origin:0 50%;
  background:linear-gradient(90deg,#06acfa,#3b6cff,#8b5cf6);box-shadow:0 0 8px rgba(59,108,255,.6)}
#pvPage.pv-page-in{animation:pvPageIn .14s cubic-bezier(.2,.8,.2,1) both}
@keyframes pvPageIn{from{opacity:.65}to{opacity:1}}
@media (prefers-reduced-motion:reduce){#pvPage.pv-page-in{animation:none}}

/* ── Search box v2: one clean border; hover/focus = brighter border + soft glow (no second ring) ── */
.search-bar form{transition:border-color .25s ease, box-shadow .3s ease !important}
.search-bar form:hover{border-color:color-mix(in srgb, var(--primary-light) 70%, var(--border)) !important;
  box-shadow:0 4px 18px -10px color-mix(in srgb, var(--primary-light) 60%, transparent) !important}
.search-bar form:focus-within,
html[data-theme="dark"] .search-bar form:focus-within{border-color:var(--primary-light) !important;
  box-shadow:0 6px 24px -10px color-mix(in srgb, var(--primary-light) 75%, transparent) !important}
html[data-theme="dark"] .search-bar form:hover{border-color:color-mix(in srgb, var(--primary-light) 60%, transparent) !important}
.search-bar .search-btn{border-radius:0 999px 999px 0 !important;margin:0 !important;align-self:stretch}
.search-bar .search-input:focus,.search-bar .search-input:focus-visible{outline:none !important;box-shadow:none !important}
.mob-search-bar form:focus-within{box-shadow:0 6px 22px -10px color-mix(in srgb, var(--primary-light) 70%, transparent) !important}
