/* BIMA WALI - mobile-first overrides (loaded after style.css) */

/* Never create a second scroll container; just clip sideways overflow */
html, body { max-width: 100%; overflow-x: clip !important; }
img, svg, video { max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }

/* Tables scroll inside their own box instead of breaking the page */
.table-scroll, .comp-matrix, .compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { max-width: 100%; }

@media (max-width: 768px) {
  /* ---------- Top notice bar: one tidy line ---------- */
  .top-notice-bar { padding: 6px 0; }
  .top-notice-content { flex-direction: row !important; justify-content: space-between !important; gap: 8px !important; padding: 0 12px; flex-wrap: nowrap; }
  .top-notice-left { display: none !important; }
  .top-notice-right { width: 100%; display: flex !important; justify-content: space-between; gap: 8px; font-size: 0.72rem; }
  .top-notice-link { white-space: nowrap; font-size: 0.72rem; }
  .top-notice-link svg { display: none; }

  /* ---------- Header ---------- */
  .header-inner { gap: 8px; }
  .logo-container { min-width: 0; flex: 1 1 auto; gap: 8px; }
  .logo-sub-tag { display: none; }
  .site-main-logo { height: 38px; max-width: 70px; }
  .logo-main-text { white-space: nowrap; font-size: 1.1rem; }
  .btn-header-login { white-space: nowrap; padding: 8px 12px; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 6px; }
  .btn-header-login svg { width: 14px; height: 14px; }
  .header-search-wrap { display: none; }
  .header-actions { flex: 0 0 auto; }

  /* Mobile menu panel */
  .nav-links { max-height: calc(100vh - 110px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .nav-links .nav-link, .nav-links a { min-height: 44px; display: flex; align-items: center; }

  /* ---------- Hero search ---------- */
  .smart-search-box { flex-direction: column !important; align-items: stretch !important; border-radius: 18px !important; padding: 10px !important; gap: 8px; height: auto !important; }
  .smart-search-box .smart-search-icon { display: none; }
  .smart-search-input { width: 100% !important; font-size: 16px !important; padding: 12px 14px !important; border: 1px solid #e2e8f0 !important; border-radius: 12px !important; background: #fff; text-overflow: ellipsis; }
  .smart-search-btn { width: 100% !important; justify-content: center; padding: 13px 16px !important; border-radius: 12px !important; }

  /* ---------- Forms: every inline multi-column grid becomes one column ---------- */
  form[style*="grid-template-columns"],
  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns:repeat(4"] { grid-template-columns: 1fr !important; }
  form[style*="grid-template-columns"] > * { min-width: 0; }
  .quick-quote-box { padding: 16px !important; }
  input:not([type=range]):not([type=checkbox]):not([type=radio]), select, textarea, .form-control { font-size: 16px !important; min-height: 46px; } /* stops iOS zoom-on-focus */
  input[type=range] { min-height: 0 !important; height: auto; padding: 0; }
  input[type=checkbox], input[type=radio] { min-height: 0; width: 20px; height: 20px; }
  textarea.form-control { min-height: 90px; }
  button, .btn-get-quotes, .btn-buy-plan, .btn-header-call { min-height: 44px; }
  .btn-get-quotes { width: 100%; justify-content: center; }

  /* ---------- Cards and grids ---------- */
  .quote-card { grid-template-columns: 1fr !important; gap: 14px; }
  .company-card, .facility-card, .agent-card { min-width: 0; }
  .facility-action-group, .agent-contact-btns { flex-wrap: wrap; }
  .facility-action-group > *, .agent-contact-btns > * { flex: 1 1 140px; justify-content: center; }
  [class*="-grid"] { min-width: 0; }
  .emi-calc-grid, .cibil-checker-grid { grid-template-columns: 1fr !important; }
  .emi-loan-types { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  .emi-type-btn { white-space: normal; }

  /* Horizontal chip/tab rows swipe sideways */
  .quote-tabs, .cat-pill-row, .category-pills, .quote-tabs-nav { display: flex; overflow-x: auto; flex-wrap: nowrap; gap: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .quote-tabs::-webkit-scrollbar { display: none; }
  .quote-tab-btn, .cat-pill-btn { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }

  /* ---------- Tables ---------- */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .comp-matrix { overflow-x: auto; }

  /* ---------- Modal ---------- */
  .modal-backdrop { align-items: flex-end !important; padding: 0 !important; }
  .modal-content, .modal-box { width: 100% !important; max-width: 100% !important; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0 !important; }

  /* ---------- Sticky bottom bar ---------- */
  .sticky-mobile-bar { display: flex !important; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); height: auto !important; }
  .sticky-mobile-bar a, .sticky-mobile-bar button { flex: 1 1 0; min-width: 0; height: 44px !important; padding: 0 6px !important; font-size: 0.78rem !important; white-space: nowrap; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
  body { padding-bottom: 72px; }

  /* ---------- Misc spacing / type ---------- */
  .container { padding-left: 14px; padding-right: 14px; }
  h1, .hero-title { word-break: break-word; }
  .section-title { font-size: 1.45rem; }

  /* Credit + EMI cards: tighter padding, readable status strip */
  .cibil-checker-section, .emi-calculator-section { padding: 18px 12px !important; }
  .cibil-meter-card { padding: 14px !important; }
  .cibil-form-card > div { padding: 18px !important; }
  .cibil-status-strip { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cibil-status-box { min-width: 0; }

  /* Admin: tables scroll, controls wrap */
  .admin-table-wrap, .table-responsive { overflow-x: auto; }
  .admin-tab-btn { white-space: nowrap; }
}

@media (max-width: 380px) {
  .logo-main-text { font-size: 1rem; }
  .btn-header-login span { display: none; }
  .top-notice-link strong { font-size: 0.72rem; }
}

@media (max-width: 768px) {
  /* The bottom bar already has a Direct Quote button */
  .floating-direct-quote { display: none !important; }
}

@media (max-width: 768px) {
  /* Any inline multi-column grid stacks (auto-fit grids already adapt on their own) */
  [style*="grid-template-columns"]:not([style*="auto-fit"]) { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns"] { gap: 14px !important; }
  /* Small pairs of buttons (company cards) stay side by side */
  .company-card [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  /* Admin filter bar */
  .admin-filters, .filter-bar { grid-template-columns: 1fr 1fr !important; }
  .admin-navbar, .admin-header { flex-wrap: wrap; gap: 8px; }
}

[id] { scroll-margin-top: 90px; }

/* ---------- Trusted partners strip ---------- */
.trusted-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 980px; margin: 0 auto; }
.trusted-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; text-decoration: none; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05); transition: transform .15s ease, box-shadow .15s ease; min-height: 118px; text-align: center; }
.trusted-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12); }
.trusted-mark { font-size: 1.35rem; font-weight: 900; letter-spacing: -0.3px; line-height: 1.15; padding: 6px 12px; border: 2px solid; border-radius: 10px; }
.trusted-tag { font-size: 0.85rem; font-weight: 600; color: #475569; }
@media (max-width: 768px) {
  .trusted-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .trusted-card { padding: 16px 8px; min-height: 104px; }
  .trusted-mark { font-size: 1.05rem; padding: 5px 8px; }
  .trusted-tag { font-size: 0.74rem; }
}

.facility-filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
@media (max-width: 768px) { .facility-filter-bar { grid-template-columns: 1fr !important; } }

/* ---------- Logo: crisp circular emblem ---------- */
.site-main-logo { height: 48px; width: 48px; max-width: none; border-radius: 50%; background: #fff; filter: none !important; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(11, 36, 109, 0.18); object-fit: contain; image-rendering: auto; }
.footer-main-logo { height: 84px; width: 84px; max-width: none; border-radius: 50%; background: #fff; padding: 2px; filter: none !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.thankyou-logo { width: 96px; height: 96px; border-radius: 50%; background: #fff; }
.agent-avatar-img { object-fit: contain; background: #fff; border-radius: 50%; }
@media (max-width: 768px) {
  .site-main-logo { height: 42px !important; width: 42px !important; max-width: none !important; }
  .logo-sub-tag { display: none !important; }
}

/* Tablet / small laptop: keep the header on one clean line */
@media (min-width: 769px) and (max-width: 1240px) {
  .header-search-wrap { display: none !important; }
  .nav-links { gap: 2px !important; flex-wrap: nowrap; }
  .nav-link, .nav-links > li > a { white-space: nowrap; font-size: 0.84rem !important; padding: 8px 9px !important; }
  .logo-sub-tag { display: none; }
  .btn-header-login { white-space: nowrap; font-size: 0.82rem; padding: 8px 12px; }
}

/* Homepage: banners first, headline + search below */
.hero-section { padding-top: 24px; }
.hero-header-below { margin-top: 44px; padding-top: 8px; text-align: center; }
.hero-header-below .hero-title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
@media (max-width: 768px) { .hero-header-below { margin-top: 28px; } .hero-header-below .hero-title { font-size: 1.55rem; } }

/* ---------- BIMA WALI logo: round emblem + wordmark + round ".in" badge + slanted tagline ---------- */
.bw-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1; flex-shrink: 0; }
.bw-emblem { display: inline-block; width: 52px; height: 52px; flex-shrink: 0; }
.bw-emblem img { width: 52px; height: 52px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(11, 36, 109, 0.2); display: block; }
.bw-text { display: flex; flex-direction: column; align-items: flex-start; }
.bw-row { display: flex; align-items: center; gap: 5px; }
.bw-word { font-weight: 900; font-size: 1.6rem; line-height: 1; letter-spacing: -0.5px; color: #0b2546; white-space: nowrap; }
.bw-word b { color: #0b5cff; font-weight: 900; }
.bw-in { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50%; background: #f97316; color: #fff; font-weight: 800; font-size: 0.66rem; letter-spacing: -0.3px; transform: rotate(-12deg) translateY(-3px); box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4); }
.bw-strip { margin-top: 5px; background: #0b2546; color: #fff; font-style: italic; font-weight: 800; font-size: 0.5rem; letter-spacing: 0.1em; padding: 3px 9px; white-space: nowrap; transform: skewX(-14deg); }
.bw-logo.on-dark { margin-bottom: 14px; }
.bw-logo.on-dark .bw-word { color: #fff; }
.bw-logo.on-dark .bw-word b { color: #38bdf8; }
.bw-logo.on-dark .bw-strip { background: #38bdf8; color: #0b2546; }
@media (max-width: 768px) {
  .bw-logo { gap: 8px; }
  .bw-emblem, .bw-emblem img { width: 42px; height: 42px; }
  .bw-in { width: 20px; height: 20px; font-size: 0.52rem; }
  .bw-word { font-size: 1.2rem; }
  .bw-strip { font-size: 0.4rem; padding: 2px 6px; margin-top: 4px; }
}
@media (max-width: 380px) { .bw-strip { display: none; } }


/* ---------- Final logo: supplied BIMA WALI.in emblem as a single image ---------- */
.bw-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.bw-logo img { height: 58px; width: auto; display: block; border-radius: 50%; }
.bw-logo.on-dark { margin-bottom: 14px; }
.bw-logo.on-dark img { height: 110px; background: #fff; }
.thankyou-logo, .agent-avatar-img, .admin-logo { border-radius: 50%; }
@media (max-width: 768px) { .bw-logo img { height: 46px; } }


/* ---------- Slogan strip next to / below the logo ---------- */
.bw-logo { flex-direction: column; align-items: flex-start; gap: 3px; }
.bw-slogan { display: inline-block; background: linear-gradient(90deg, #0b2546, #0b5cff); color: #fff; font-style: italic; font-weight: 800; font-size: 0.56rem; letter-spacing: 0.11em; padding: 3px 12px 3px 9px; transform: skewX(-14deg); white-space: nowrap; border-radius: 1px; box-shadow: 0 2px 6px rgba(11, 92, 255, 0.25); }
.bw-logo.on-dark { align-items: flex-start; }
.bw-logo.on-dark .bw-slogan { background: linear-gradient(90deg, #f97316, #fb923c); color: #fff; }
@media (max-width: 768px) { .bw-slogan { font-size: 0.42rem; padding: 2px 8px 2px 6px; letter-spacing: 0.08em; } .bw-logo img { height: 40px; } }

/* 7th trusted partner card sits centred on its own row */
.trusted-card:last-child:nth-child(3n+1) { grid-column: 2; }
@media (max-width: 768px) { .trusted-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); } }


/* ---------- Final logo: square BIMA WALI.in badge with its own tagline ---------- */
.bw-logo { flex-direction: row; align-items: center; gap: 0; }
.bw-logo img { height: 68px; width: 68px; border-radius: 13px; background: transparent; box-shadow: 0 2px 8px rgba(0, 114, 255, 0.25); }
.bw-logo.on-dark img { height: 120px; width: 120px; border-radius: 16px; background: transparent; }
.thankyou-logo, .admin-logo, .login-box .logo { border-radius: 14px !important; border: 0 !important; }
.bw-slogan { display: none !important; }
@media (max-width: 768px) { .bw-logo img { height: 52px; width: 52px; border-radius: 11px; } }


/* ---------- Final logo (rectangular BIMA WALI.in, "A trusting advisor") ---------- */
.bw-logo img { height: 62px; width: auto; border-radius: 6px; box-shadow: none; background: #fff; }
.bw-logo.on-dark img { height: 96px; width: auto; border-radius: 8px; background: #fff; padding: 0; }
.thankyou-logo { width: auto !important; height: 84px !important; border-radius: 8px !important; }
.admin-logo { width: auto !important; height: 40px !important; border-radius: 6px !important; }
.login-box .logo { width: auto !important; height: 64px !important; border-radius: 8px !important; border: 0 !important; }
@media (max-width: 768px) { .bw-logo img { height: 46px; } }
