/* ============================================================
   layout.css — Navigation · Footer · Trust Bar · Responsive
   N Gram Technologies
   ============================================================ */

/* ─── NAV ─── */
nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

/* Single row: logo | menu | actions */
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; padding: 0; gap: 8px;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(13px, 1.4vw, 18px);
  color: var(--navy); flex-shrink: 0; line-height: 1.2;
  white-space: nowrap;
}
.logo-mark {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--emerald) 100%);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.logo-sub {
  font-size: 10px; font-weight: 400; color: var(--slate);
  display: block; line-height: 1; margin-top: 2px;
}
.logo-img {
  height: 44px; width: auto; display: block;
}
/* Logo artwork ships on a solid white background, so give it a white
   card treatment wherever it sits on a dark surface (e.g. the footer). */
.footer-brand .logo,
.mobile-drawer-header .logo {
  background: #fff; border-radius: 8px; padding: 4px 10px; display: inline-flex;
}
.footer-brand .logo-img { height: 38px; }

/* Desktop menu — middle, takes remaining space */
.nav-menu { display: flex; align-items: center; gap: 0; flex: 1 1 auto; overflow: visible; position: relative; z-index: 1000; }
.nav-item  { position: relative; overflow: visible; }
.nav-link  {
  display: flex; align-items: center; gap: 3px;
  padding: 8px 11px;
  font-size: 14px; font-weight: 500; color: var(--text-sub);
  border-radius: var(--radius-sm); transition: all .15s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active, .nav-link:focus-visible {
  color: var(--blue); background: var(--blue-light); outline: none;
}

/* Desktop: show full menu, hide mobile-only menu */
.nav-menu-desktop { display: flex; }
.nav-menu-mobile  { display: none; }

/* Login: visible on desktop, hidden on mobile */
.nav-login-btn { display: inline-flex; }

/* Actions */
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-actions .btn { white-space: nowrap; }

/* Dropdown chevron */
.chevron {
  display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; margin-left: 2px; vertical-align: middle;
  transition: transform .2s;
}
.nav-item:hover .chevron,
.nav-item:focus-within .chevron,
.nav-item.dropdown-open .chevron { transform: rotate(180deg); }

/* Dropdown panel */
.dropdown {
  position: absolute; top: 100%; left: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  min-width: 230px; padding: 8px; margin-top: 6px;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 99999;
}
.dropdown::before {
  content: ''; position: absolute; top: -12px; left: 0; right: 0;
  height: 12px; background: transparent;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown,
.nav-item.dropdown-open .dropdown { opacity: 1; pointer-events: all; transform: translateY(0); }

/* Mobile dropdown — narrower */
.mob-dropdown { min-width: 170px; }

/* Dropdown items */
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text-sub); transition: all .15s;
}
.dropdown-item:hover { background: var(--blue-light); color: var(--blue); }
.dropdown-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px;
}
.di-blue  { background: var(--blue-light); }
.di-green { background: var(--emerald-light); }
.di-amber { background: #FEF3C7; }

/* Coming Soon */
.dropdown-item.coming-soon { opacity: 0.65; cursor: not-allowed; pointer-events: none; }
.coming-soon-badge {
  margin-left: auto; padding: 3px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  background: linear-gradient(135deg,#DBEAFE,#E0E7FF); color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

/* ─── TRUST BAR ─── */
.trust-bar {
  padding: 20px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); background: var(--slate-light);
}
.trust-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px 24px; flex-wrap: wrap;
}
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-sub); }
.trust-item-icon { font-size: 18px; }

/* ─── FOOTER ─── */
footer { background: var(--navy); color: rgba(255,255,255,.7); }
.footer-top {
  padding: 60px 0 40px; border-bottom: 1px solid rgba(255,255,255,.1);
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr);
  gap: 40px;
}
.footer-brand .logo  { color: #fff; margin-bottom: 14px; }
.footer-brand p      { font-size: 14px; line-height: 1.7; color: rgba(255,255,255,.6); max-width: 260px; margin-bottom: 20px; }
.social-icons        { display: flex; gap: 10px; }
.social-icon         { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 16px; transition: background .2s; }
.social-icon:hover   { background: rgba(255,255,255,.18); }
.footer-col h4       { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col ul li    { margin-bottom: 10px; }
.footer-col ul li a  { font-size: 14px; color: rgba(255,255,255,.6); transition: color .15s; }
.footer-col ul li a:hover { color: #fff; }
.contact-item        { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 12px; }
.contact-icon        { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.footer-bottom       { padding: 20px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom p     { font-size: 13px; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a       { font-size: 13px; color: rgba(255,255,255,.5); }
.footer-bottom-links a:hover { color: #fff; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .hero-grid, .mf-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { display: flex; justify-content: center; width: 100%; max-width: 520px; margin: 0 auto; }
  .mf-visual   { display: none; }
  .footer-top  { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .why-grid    { grid-template-columns: repeat(2, 1fr); }
  .nav-link    { padding: 8px 9px; font-size: 13px; }
}

/* ── Mobile: swap to compact inline menu matching screenshot ── */
@media (max-width: 768px) {
  .hero-visual { max-width: 100% !important; }
  .nav-inner       { min-height: 54px; gap: 4px; }
  /* Visual order: logo(1) | mobile-menu(2, takes flex space) | hamburger(3) */
  .logo            { order: 1; flex-shrink: 0; }
  .nav-menu-mobile { order: 2; }
  .hamburger       { order: 3; margin-left: auto; flex-shrink: 0; }
  .logo-sub        { display: none; }
  .logo-mark       { width: 32px; height: 32px; font-size: 14px; }
  .logo-img        { height: 36px; }

  /* Hide full desktop menu, show 2-item mobile quick-links */
  .nav-menu-desktop { display: none; }
  .nav-menu-mobile  {
    display: flex; align-items: center; gap: 0;
    /* Sit between hamburger and right edge — order puts it after hamburger in DOM */
    flex: 1 1 auto;
    overflow: visible; position: relative; z-index: 1000;
    justify-content: flex-start;
    padding-left: 4px;
  }

  /* Hide Login button and nav actions on mobile (both live in the drawer) */
  .nav-login-btn { display: none; }
  .nav-actions { display: none; }

  /* Mobile nav links: plain, compact */
  .nav-menu-mobile .nav-link {
    font-size: 13px; font-weight: 500; padding: 6px 8px; color: var(--text-main);
    white-space: nowrap;
  }
  .nav-menu-mobile .nav-link:hover { color: var(--brand-primary, #00b386); }
  /* Mobile dropdowns: open below, left-aligned */
  .nav-menu-mobile .dropdown { min-width: 180px; }
  .nav-menu-mobile .mob-dropdown { left: 0; right: auto; }
}

@media (max-width: 480px) {
  .nav-inner   { gap: 4px; }
  .nav-menu-mobile .nav-link { font-size: 12px; padding: 5px 5px; }
  .nav-actions .btn { padding: 8px 12px; font-size: 12px; }
  .logo        { font-size: 13px; gap: 7px; }
  .logo-mark   { width: 30px; height: 30px; font-size: 13px; }
  .logo-img    { height: 32px; }
}

/* ── Very narrow screens: logo + hamburger no longer leave room for
   "Mutual Funds" + "Recharge & Bills" on the same line — instead of
   clipping, drop the quick-links menu to a second row underneath. ── */
@media (max-width: 400px) {
  .nav-inner {
    flex-wrap: wrap;
    min-height: auto;
    padding-top: 8px;
    padding-bottom: 6px;
  }
  .logo      { order: 1; }
  .hamburger { order: 2; margin-left: auto; }
  .nav-menu-mobile {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    gap: 2px;
    padding-left: 0;
    margin-top: 4px;
  }
  .nav-menu-mobile .nav-link {
    padding: 5px 8px;
    white-space: nowrap;
  }
  .nav-menu-mobile .mob-dropdown { left: 0; right: auto; }
}

@media (max-width: 640px) {
  .section       { padding: 56px 0; }
  .section-sm    { padding: 40px 0; }
  .hero          { padding: 56px 0 40px; }
  .hero-title    { font-size: clamp(28px, 8vw, 42px); }
  .hero-cta      { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-stats    { flex-direction: column; gap: 14px; }
  .hero-stat-divider { display: none; }
  .hero-badge    { font-size: 11px; padding: 6px 12px; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .why-grid      { grid-template-columns: 1fr; }
  .mf-features   { grid-template-columns: 1fr; }
  .footer-top    { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 14px; }
  .footer-bottom-links { justify-content: center; flex-wrap: wrap; gap: 12px; }
  .cta-btns      { flex-direction: column; align-items: stretch; }
  .cta-btns .btn { text-align: center; justify-content: center; }
  .trust-inner   { justify-content: center; gap: 16px; }
  .trust-item    { font-size: 12px; }
}

@media (max-width: 380px) {
  .container  { padding: 0 12px; }
  .hero-title { font-size: 26px; }
  .why-card   { padding: 18px 16px; }
  .nav-menu-mobile .nav-link { font-size: 11px; padding: 5px 4px; }
}

/* ══════════════════════════════════════════════
   HAMBURGER BUTTON  (mobile only — hidden on desktop)
   ══════════════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger:hover { background: var(--surface-raised, rgba(0,0,0,0.06)); }

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary, #1a1a2e);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}
/* Animated X when open */
.hamburger.is-active .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active .hamburger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-active .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════
   MOBILE DRAWER OVERLAY
   ══════════════════════════════════════════════ */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1199;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-drawer-overlay.drawer-open {
  display: block;
  opacity: 1;
}

/* ══════════════════════════════════════════════
   MOBILE DRAWER PANEL
   ══════════════════════════════════════════════ */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100dvh;
  background: var(--bg-primary, #fff);
  z-index: 1200;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  flex-direction: column;
}
.mobile-drawer.drawer-open {
  display: flex;
  transform: translateX(0);
}

/* Drawer header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light, #e8e8e8);
  flex-shrink: 0;
}
.mobile-drawer-header .logo-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.mobile-drawer-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-sub, #666);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.mobile-drawer-close:hover {
  background: var(--surface-raised, #f5f5f5);
  color: var(--text-primary, #1a1a2e);
}

/* Drawer menu list */
.mobile-drawer-menu {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  flex: 1;
}
.mobile-drawer-menu li { margin: 0; }

.mobile-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary, #1a1a2e);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  gap: 8px;
}
.mobile-drawer-link:hover,
.mobile-drawer-toggle:hover {
  background: var(--surface-raised, #f6f6f6);
  color: var(--brand-primary, #00b386);
}
.drawer-chevron {
  font-size: 12px;
  transition: transform 0.25s;
  flex-shrink: 0;
  color: var(--text-sub, #888);
}
.drawer-item-open > .mobile-drawer-toggle .drawer-chevron {
  transform: rotate(180deg);
}

/* Sub-menu accordion */
.mobile-drawer-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  background: var(--surface-subtle, #fafafa);
  border-top: 1px solid transparent;
  transition: max-height 0.3s ease, border-color 0.3s;
}
.drawer-item-open > .mobile-drawer-sub {
  max-height: 400px;
  border-top-color: var(--border-light, #eee);
}
.mobile-drawer-sublink {
  display: flex;
  align-items: center;
  padding: 11px 20px 11px 32px;
  font-size: 14px;
  color: var(--text-sub, #555);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  gap: 6px;
}
.mobile-drawer-sublink:hover {
  background: var(--surface-raised, #f0f0f0);
  color: var(--brand-primary, #00b386);
}
.coming-soon-item {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}
.coming-soon-badge {
  font-size: 10px;
  background: var(--amber, #f59e0b);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: auto;
}

/* Drawer bottom actions */
.mobile-drawer-actions {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-light, #e8e8e8);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   SHOW HAMBURGER on mobile; keep desktop unchanged
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  /* nav-actions is fully hidden on mobile via the rule above */
}
