/* Reset default margins so header touches the very top */
html, body{ margin:0; padding-top:0; }

/* Desktop layout guards to avoid overlap */
@media (min-width: 992px){
  .ss-topbar .row{ flex-wrap: wrap; }
  .ss-topbar .col-lg-6{ flex:0 0 50%; max-width:50%; }
  .ss-topbar .col-lg-3{ flex:0 0 25%; max-width:25%; }
  .ss-searchbar{ padding-right:8px; }
  .ss-actions{ margin-left:8px; flex-wrap: wrap; }
}

/* At medium desktop widths, put search on its own line to avoid overlap */
@media (min-width: 992px) and (max-width: 1199.98px){
  .ss-topbar .col-lg-3{ flex:0 0 50%; max-width:50%; }
  .ss-topbar .col-lg-6{ flex:0 0 100%; max-width:100%; }
  .ss-actions{ justify-content:flex-end; gap:12px; }
  /* Keep main menu tidy on tablet: no ugly wrapping */
  .ss-menu .container-fluid{ padding-right:0; }
  .ss-menu .navbar-nav{ flex-wrap: nowrap; overflow-x:auto; overflow-y:visible; gap:0; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
  .ss-menu .nav-item{ flex:0 0 auto; }
  .ss-menu .nav-link{ white-space:nowrap; }
}

/* Small desktop (1200–1399px): keep a single-line menu with horizontal scroll */
@media (min-width: 1200px) and (max-width: 1399.98px){
  .ss-menu .container-fluid{ padding-right:0; }
  .ss-menu .navbar-nav{ flex-wrap: nowrap; overflow-x:auto; overflow-y:visible; gap:0; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
  .ss-menu .nav-item{ flex:0 0 auto; }
  .ss-menu .nav-link{ white-space:nowrap; }
  /* Rebalance topbar columns to avoid crowding */
  .ss-topbar .col-lg-3{ flex:0 0 20%; max-width:20%; }
  .ss-topbar .col-lg-6{ flex:0 0 60%; max-width:60%; }
}
/* Header styles extracted from includes/header.php for cleaner markup */

/* Sticky footer layout */
html, body { height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
footer.footer { margin-top: auto; }

/* Overall header theme */
header.site-header { background:#0f172a !important; color:#fff; }
.ss-topbar { background:#0f172a; color:#cbd5e1; font-size:12px; padding-top:2px; padding-bottom:2px; line-height:1; }
.ss-topbar .container-fluid{ padding-top:0; padding-bottom:0; }
.ss-topbar .row{ margin-top:0; margin-bottom:0; --bs-gutter-y:0; align-items:center; }
.ss-topbar .row{ gap:0; }
.ss-topbar .logo { display:flex; align-items:center; gap:5px; color:#fff; font-weight:800; letter-spacing:.2px; }
.ss-topbar .logo i { color:#ef4444; font-size:22px; line-height:1; }
.ss-topbar .logo span { font-size:18px; line-height:1; }
.ss-topbar .gst { white-space:nowrap; }
.ss-topbar .gst-badge { margin-left:8px; }
.ss-searchbar { background:#0f172a; padding:0; }
.ss-search-wrap { display:flex; gap:10px; align-items:center; min-width:0; flex:1 1 auto; }
.ss-actions { flex:0 0 auto; }
.ss-cat { min-width:90px; max-width:110px; border-radius:6px 0 0 6px; border:1px solid #1f2937; background:#0b1220; color:#e5e7eb; height:36px; padding:0 10px; }
.ss-input { flex:1; height:36px; border:1px solid #1f2937; background:#0b1220; color:#e5e7eb; border-left:none; border-right:none; }
.ss-input::placeholder { color:#94a3b8; }
.ss-btn { height:36px; border:none; background:#f59e0b; color:#111827; border-radius:0 6px 6px 0; padding:0 12px; display:inline-flex; align-items:center; justify-content:center; }
.ss-pill { height:38px; display:inline-flex; align-items:center; gap:8px; background:#0b1220; border:1px solid #1f2937; color:#e5e7eb; border-radius:999px; padding:0 14px; white-space:nowrap; font-weight:600; }
.ss-actions { display:flex; align-items:center; gap:16px; flex-wrap:nowrap; }
.ss-actions a, .ss-actions span { color:#e5e7eb; font-size:14px; text-decoration:none; }
.ss-actions .inquiry { background:#0b1220; border:1px solid #1f2937; border-radius:8px; padding:8px 12px; color:#e5e7eb; font-weight:600; }
.ss-actions .account { line-height:1.15; font-size:14px; }
.ss-actions .account small { display:block; color:#94a3b8; font-size:12.5px; }

/* Second row menu (fully tight) */
.ss-menu { background:#0b1220; border-top:0; padding-top:0; padding-bottom:0; margin-bottom:0; line-height:1; }
.ss-menu .navbar { min-height:0; margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; display:flex; align-items:center; line-height:1; }
.ss-menu .container-fluid { padding-top:0; padding-bottom:0; }
.ss-menu .navbar-collapse { padding-top:0; padding-bottom:0; }
.ss-menu .navbar-nav { margin-top:0 !important; margin-bottom:0 !important; align-items:center; line-height:1 !important; }
.ss-menu .nav-item { padding-top:0 !important; padding-bottom:0 !important; margin-top:0 !important; margin-bottom:0 !important; line-height:1 !important; display:flex; align-items:center; }
.ss-menu .nav-link { color:#cbd5e1 !important; padding:0 10px !important; font-size:15px; display:flex; align-items:center; line-height:1 !important; }
.ss-menu .nav-link:hover { color:#fff !important; }
.ss-menu .dropdown-menu { background:#0b1220; border:1px solid #1f2937; border-radius:8px; }
.ss-menu .dropdown-item { color:#e5e7eb; font-size:13px; }
.ss-menu .dropdown-item:hover { background:#111827; color:#fff; }

/* Ensure Account dropdown (in topbar actions) is readable on dark bg */
.ss-actions .dropdown-menu { 
  background:#0b1220; 
  border:1px solid #1f2937; 
  border-radius:8px; 
  min-width: 180px;
  z-index: 1055; /* above header */
}
.ss-actions .dropdown-item { 
  color:#e5e7eb !important; 
  font-size:13px; 
}
.ss-actions .dropdown-item:hover, 
.ss-actions .dropdown-item:focus { 
  background:#111827; 
  color:#ffffff !important; 
}

/* Home icon tight fit */
.ss-menu .nav-link .bi-house-door { font-size:20px; line-height:1; display:inline-block; margin:0 6px 0 0; position:relative; top:-1px; }

/* Mobile adjustments */
@media (max-width: 991.98px){
  /* Mobile app-like top bar */
  .ss-mobilebar{ background:#0f172a; border-bottom:1px solid #1f2937; }
  .ss-mobilebar .logo{ color:#fff; font-weight:800; letter-spacing:.2px; }
  .ss-mobilebar .btn{ line-height:1; }
  .ss-mobilebar .btn:focus{ box-shadow:none; }

  /* Mobile main menu (collapsed by default) */
  .ss-menu{ border-top:1px solid #1f2937; }
  .ss-menu .navbar{ padding:0; }
  .ss-menu .navbar-collapse{ background:#0b1220; border-top:1px solid #1f2937; }
  .ss-menu .navbar-collapse.collapse{ display:none !important; }
  .ss-menu .navbar-collapse.collapse.show{ display:block !important; }
  .ss-menu .navbar-nav{ flex-direction:column; align-items:stretch; padding:6px 8px; gap:4px; }
  .ss-menu .nav-item{ width:100%; }
  .ss-menu .nav-link{ display:block; text-align:left; padding:12px 12px !important; border-radius:8px; line-height:1.3 !important; font-size:15px; }
  .ss-menu .nav-link:hover{ background:#111827; }
  .ss-menu .dropdown-menu{ position:static !important; float:none; background:transparent; border:none; padding:0 0 8px 14px; margin-top:0; }
  .ss-menu .dropdown-item{ padding:8px 10px; border-radius:6px; line-height:1.25; }
  .ss-menu .dropdown-toggle::after{ margin-left:6px; }

  .ss-topbar .row>div{ margin-bottom:8px; }
  .ss-actions{ justify-content:flex-start; gap:10px; }
  .ss-search-wrap{ flex-wrap:wrap; }
  .ss-cat{ border-radius:6px; }
  .ss-input{ flex:1 1 100%; border-radius:6px; border-left:1px solid #1f2937; margin-top:6px; }
  .ss-btn{ border-radius:6px; margin-top:6px; }

  /* Make collapsed mobile search breathe */
  #ssMobileSearch .ss-search-wrap{ gap:8px; }
  #ssMobileSearch .ss-cat{ min-width:110px; }
}

/* GST badge and descriptor (near search bar) */
.gst-badge{
  background:#ecfdf5 !important;
  color:#065f46 !important;
  border:1px solid #34d399 !important;
  font-size:13px !important;
  padding:4px 10px !important;
  font-weight:700;
  box-shadow: 0 2px 6px rgba(16,185,129,.15);
}
.pro-desc{ color:#94a3b8 !important; font-size:14px; }

@media (min-width: 992px){
  /* Desktop: fix the entire header to the very top */
  header.site-header{ position: fixed; top:0 !important; left:0; right:0; z-index:1035; margin-top:0 !important; border-top:0 !important; }
  /* Menu lives inside fixed header; no additional sticky to avoid gaps */
  .ss-menu{ position: static; box-shadow:none; }
  /* Class hook remains harmless if present */
  header.site-header.hdr-fixed{ position: fixed; top:0; left:0; right:0; z-index:1035; }
}

/* Body padding helper when header is fixed (JS will override exact value). */
body.has-fixed-header{ padding-top: 88px; }
  .ss-actions a, .ss-actions span{ font-size:15px; }
  .ss-actions .account small{ font-size:13px; }
  .ss-pill{ height:40px; padding:0 16px; }
  .ss-actions{ gap:18px; }
