/* ============================================================
   HBIC Solutions — Mobile-First Responsive CSS
   Modern SaaS + Corporate + App Feel
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --mob-header-h: 64px;
  --mob-bottom-nav-h: 68px;
  --wa-bottom-mobile: 90px;
  --wa-bottom-desktop: 28px;
  --wa-right: 22px;
}

/* ============================================================
   DESKTOP NAVBAR — clean white 3-column layout
   ============================================================ */
.navbar-main {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  height: 74px;
  display: flex;
  align-items: center;
  transition: box-shadow 0.3s;
}
.navbar-main.scrolled { box-shadow: 0 4px 28px rgba(0,0,0,0.13); }

.navbar-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  align-items: center;
  height: 74px;
}

/* Logo */
.navbar-logo {
  display: flex; align-items: center;
  text-decoration: none; flex-shrink: 0;
}
.navbar-logo img {
  height: 66px; width: 190px;
  object-fit: contain; object-position: left center;
}
.navbar-logo-label { display: none; }

/* Centre links */
.navbar-center {
  display: flex; align-items: center;
  justify-content: center; gap: 4px;
}
.navbar-center a {
  display: inline-block;
  padding: 8px 17px;
  font-size: 0.95rem; font-weight: 600;
  color: var(--text); border-radius: 8px;
  text-decoration: none; white-space: nowrap;
  transition: all 0.2s;
}
.navbar-center a:hover { color: var(--primary); background: rgba(26,35,126,0.07); }
.navbar-center a.active { color: var(--accent-orange); background: rgba(255,111,0,0.09); }

/* Right auth */
.navbar-right {
  display: flex; align-items: center;
  justify-content: flex-end; gap: 10px;
}
.nav-btn-login-new {
  padding: 9px 22px; border: 2px solid var(--primary);
  border-radius: 50px; color: var(--primary);
  font-size: 0.88rem; font-weight: 700;
  text-decoration: none; transition: all 0.22s;
}
.nav-btn-login-new:hover { background: var(--primary); color: #fff; }

.nav-btn-started {
  padding: 9px 22px; background: var(--accent-orange);
  border-radius: 50px; color: #fff;
  font-size: 0.88rem; font-weight: 700;
  text-decoration: none; border: 2px solid var(--accent-orange);
  transition: all 0.22s;
}
.nav-btn-started:hover {
  background: #e65c00; border-color: #e65c00;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255,111,0,0.35);
}

.nav-user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 6px;
  background: var(--light-bg); border: 1.5px solid var(--gray-200);
  border-radius: 50px; text-decoration: none; transition: all 0.22s;
}
.nav-user-chip:hover { border-color: var(--primary); background: #eef0ff; }

.nav-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.85rem;
  overflow: hidden; flex-shrink: 0;
}
.nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.nav-user-name {
  font-size: 0.86rem; font-weight: 700; color: var(--text);
  max-width: 90px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.nav-logout-btn {
  padding: 9px 18px; border: 2px solid #EF5350;
  border-radius: 50px; color: #EF5350;
  font-size: 0.86rem; font-weight: 700;
  text-decoration: none; transition: all 0.22s;
}
.nav-logout-btn:hover { background: #EF5350; color: #fff; }

/* Profile dropdown — desktop hover */
.nav-profile-wrap { position: relative; }
.nav-profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px); right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  min-width: 200px;
  padding: 8px 0;
  z-index: 2000;
  animation: dropFade 0.2s ease;
}
@keyframes dropFade {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: translateY(0); }
}
.nav-profile-wrap:hover .nav-profile-dropdown { display: block; }
.nav-profile-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--text); text-decoration: none;
  transition: background 0.15s;
}
.nav-profile-dropdown a:hover { background: var(--light-bg); }
.nav-profile-dropdown a i { width: 18px; color: var(--primary); font-size: 0.9rem; }
.nav-profile-dropdown .drop-logout { color: #EF5350; }
.nav-profile-dropdown .drop-logout i { color: #EF5350; }
.nav-profile-dropdown hr { margin: 6px 0; border-color: var(--gray-200); }

/* Hide hamburger always */
.nav-hamburger { display: none !important; }

/* Desktop body padding */
@media (min-width: 901px) {
  body { padding-top: 74px; }
  .mob-header-right  { display: none !important; }
  .mob-bottom-nav    { display: none !important; }
  .mob-dropdown      { display: none !important; }
  #mobOverlay        { display: none !important; }
}

/* ============================================================
   MOBILE HEADER  (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .navbar-main { height: var(--mob-header-h); }
  .navbar-inner {
    grid-template-columns: 1fr auto;
    padding: 0 16px;
    height: var(--mob-header-h);
  }
  .navbar-center { display: none !important; }
  .navbar-right  { display: none !important; }

  .navbar-logo img { height: 50px; width: auto; }

  body {
    padding-top: var(--mob-header-h) !important;
    padding-bottom: var(--mob-bottom-nav-h) !important;
    overflow-x: hidden;
  }

  /* Mobile right: avatar button */
  .mob-header-right {
    display: flex; align-items: center; gap: 10px;
  }
  .mob-avatar-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 0.9rem;
    border: 2.5px solid rgba(26,35,126,0.2);
    overflow: hidden; cursor: pointer; flex-shrink: 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

  /* Mobile dropdown panel */
  .mob-dropdown {
    display: none;
    position: fixed;
    top: var(--mob-header-h); right: 12px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    min-width: 230px;
    padding: 10px 0;
    z-index: 3000;
  }
  .mob-dropdown.open {
    display: block;
    animation: dropFade 0.2s ease;
  }
  .mob-dropdown-header {
    padding: 12px 18px 10px;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 4px;
  }
  .mob-dropdown-name  { font-size: 0.92rem; font-weight: 800; color: var(--text); display: block; }
  .mob-dropdown-email { font-size: 0.75rem; color: var(--text-muted); display: block; margin-top: 2px; }
  .mob-dropdown a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px;
    font-size: 0.9rem; font-weight: 600;
    color: var(--text); text-decoration: none;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-dropdown a:hover,
  .mob-dropdown a:active { background: var(--light-bg); }
  .mob-dropdown a i { width: 20px; color: var(--primary); font-size: 1rem; }
  .mob-dropdown .drop-logout       { color: #EF5350; }
  .mob-dropdown .drop-logout i     { color: #EF5350; }
  .mob-dropdown hr { margin: 6px 0; border-color: var(--gray-100); }
}

/* ============================================================
   BOTTOM NAVIGATION BAR  (mobile only)
   ============================================================ */
.mob-bottom-nav { display: none; }

@media (max-width: 900px) {
  .mob-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--mob-bottom-nav-h);
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
    z-index: 2000;
    align-items: stretch;
    justify-content: space-around;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mob-nav-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex: 1; gap: 3px;
    text-decoration: none;
    color: #9095A0;
    font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.2px;
    transition: all 0.2s;
    padding: 6px 2px;
    border-radius: 10px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
  }
  .mob-nav-item i {
    font-size: 1.2rem;
    transition: all 0.2s;
    display: block;
  }
  .mob-nav-item span {
    display: block; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; text-align: center;
  }
  .mob-nav-item.active { color: var(--primary); }
  .mob-nav-item.active i { transform: translateY(-2px); }
  .mob-nav-item.active::before {
    content: '';
    position: absolute; top: 0;
    left: 20%; right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
  }
  .mob-nav-item:hover { color: var(--primary); }
}

/* ============================================================
   WHATSAPP FLOAT BUTTON
   ============================================================ */
.whatsapp-float {
  position: fixed;
  bottom: var(--wa-bottom-desktop);
  right: var(--wa-right);
  z-index: 1500;
  width: 56px; height: 56px;
  background: #25D366; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
  box-shadow: 0 6px 24px rgba(37,211,102,0.45);
  transition: all 0.3s; text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 14px 36px rgba(37,211,102,0.55);
  color: #fff;
}
.whatsapp-float::before {
  content: ''; position: absolute; inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(37,211,102,0.35);
  animation: wa-pulse 2s ease-in-out infinite;
}
@keyframes wa-pulse {
  0%,100% { transform:scale(1); opacity:0.8; }
  50%      { transform:scale(1.2); opacity:0; }
}
@media (max-width: 900px) {
  .whatsapp-float {
    bottom: var(--wa-bottom-mobile);
    right: var(--wa-right);
    width: 50px; height: 50px;
    font-size: 1.35rem;
  }
}

/* ============================================================
   HERO SECTION — mobile optimized
   ============================================================ */
@media (max-width: 900px) {
  .hero { min-height: 100svh; align-items: flex-start; padding-top: 16px; }
  .hero-content {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 28px 20px 56px !important;
    text-align: center;
  }
  .hero-visual { display: none !important; }
  .hero-title {
    font-size: clamp(1.9rem, 7.5vw, 2.8rem) !important;
    letter-spacing: -0.5px !important;
  }
  .hero-subtitle {
    font-size: 0.95rem !important;
    margin-bottom: 20px !important;
  }
  .hero-actions { justify-content: center; gap: 12px; }
  .hero-trust   { justify-content: center; }
  .hero-badge   { font-size: 0.72rem; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions a { width: 100%; max-width: 280px; justify-content: center; }
}

/* Hero tech pills — mobile only */
.hero-tech-pills { display: none; }
@media (max-width: 900px) {
  .hero-tech-pills {
    display: flex; flex-wrap: wrap;
    gap: 8px; justify-content: center;
    margin-bottom: 22px;
  }
  .hero-tech-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 50px;
    color: rgba(255,255,255,0.92);
    font-size: 0.76rem; font-weight: 600;
  }
  .hero-tech-pill i { font-size: 0.78rem; }
}

/* ============================================================
   STATS BAR — mobile
   ============================================================ */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2,1fr) !important; gap: 20px; }
  .stat-value  { font-size: 1.8rem; }
  .stat-label  { font-size: 0.72rem; }
}

/* ============================================================
   SECTION — tighter spacing on mobile
   ============================================================ */
@media (max-width: 768px) {
  .section     { padding: 52px 0; }
  .section-title { font-size: clamp(1.45rem, 5vw, 2rem); }
  .container   { padding: 0 16px; }
  .section-header { flex-direction: column; align-items: flex-start; margin-bottom: 28px; }
}

/* ============================================================
   SERVICES — 2-column grid on mobile
   ============================================================ */
.swipe-hint { display: none !important; }

@media (max-width: 768px) {
  .services-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    overflow-x: unset !important;
  }
  .service-card {
    min-width: unset !important;
    padding: 18px 14px !important;
  }
  .service-card h3 { font-size: 0.88rem !important; }
  .service-card p  { font-size: 0.78rem !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .service-icon-wrap { width: 44px !important; height: 44px !important; font-size: 1.2rem !important; margin-bottom: 12px !important; }
}
@media (max-width: 380px) {
  .services-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   PRODUCTS — 2-column grid on mobile
   ============================================================ */
@media (max-width: 768px) {
  .products-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    overflow-x: unset !important;
  }
  .product-card {
    min-width: unset !important;
  }
  .product-img { height: 130px !important; font-size: 2.4rem !important; }
  .product-body { padding: 12px !important; }
  .product-body h3 { font-size: 0.84rem !important; }
  .product-body p  { font-size: 0.75rem !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .product-actions { flex-direction: column !important; gap: 6px !important; }
  .product-actions .btn-sm { text-align: center; font-size: 0.75rem !important; padding: 7px 8px !important; }
}
@media (max-width: 380px) {
  .products-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   WHY GRID — mobile stack
   ============================================================ */
@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .why-visual { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   TESTIMONIALS — 2-column grid on mobile
   ============================================================ */
@media (max-width: 768px) {
  .testimonials-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    overflow-x: unset !important;
  }
  .testimonial-card {
    min-width: unset !important;
    padding: 16px 14px !important;
  }
  .testimonial-text {
    font-size: 0.8rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .author-name { font-size: 0.84rem !important; }
  .author-role { font-size: 0.72rem !important; }
  .author-avatar { width: 36px !important; height: 36px !important; font-size: 0.85rem !important; }
}
@media (max-width: 400px) {
  .testimonials-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   CONTACT — quick actions bar (mobile only)
   ============================================================ */
.contact-quick-actions { display: none; }
@media (max-width: 768px) {
  .contact-quick-actions {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px; margin-bottom: 28px;
  }
  .cqa-btn {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 18px 12px;
    border-radius: 16px; text-decoration: none;
    font-size: 0.8rem; font-weight: 700;
    transition: all 0.2s; border: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .cqa-btn i { font-size: 1.5rem; }
  .cqa-call  { background: #E3F2FD; color: #1565C0; }
  .cqa-wa    { background: #E8F5E9; color: #2E7D32; }
  .cqa-email { background: #FFF3E0; color: #E65100; }
  .cqa-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
  .contact-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* ============================================================
   CTA SECTION — mobile
   ============================================================ */
@media (max-width: 768px) {
  .cta-section { padding: 52px 0; }
  .cta-inner h2 { font-size: clamp(1.45rem, 5vw, 2rem); }
  .cta-actions { flex-direction: column; align-items: center; gap: 12px; }
  .cta-actions a { width: 100%; max-width: 280px; justify-content: center; }
}

/* ============================================================
   FOOTER — mobile
   ============================================================ */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 28px; }
  .footer-top  { padding: 44px 0 28px; }
  .footer-bottom { padding-bottom: calc(20px + var(--mob-bottom-nav-h)); }
}

/* ============================================================
   PAGE HERO (inner pages) — mobile
   ============================================================ */
@media (max-width: 768px) {
  .page-hero { padding: 36px 0 28px; }
  .page-hero h1 { font-size: clamp(1.65rem, 6vw, 2.2rem); }
  .page-hero p  { font-size: 0.92rem; }
  .page-hero::after { height: 36px; }
}

/* ============================================================
   AUTH PAGES — mobile
   ============================================================ */
@media (max-width: 600px) {
  .auth-box  { padding: 30px 20px; border-radius: 20px; }
  .form-row  { grid-template-columns: 1fr !important; }
  .auth-logo img { height: 48px; }
}

/* ============================================================
   DASHBOARD — mobile
   ============================================================ */
@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr !important; }
  .sidebar       { display: none !important; }
  .main-content  { margin-left: 0 !important; }
  .main-topbar   { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .main-topbar > div:last-child { font-size: 0.78rem !important; }
  .topbar-title  { font-size: 1rem !important; }
  .main-body     { padding: 16px 12px; }
  .stat-mini-num { font-size: 1.3rem; }
  /* Stat cards: 3-col on tablet */
  [style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
  /* Quick actions + Recent Requests: stack to 1 col */
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* data table horizontal scroll */
  .data-table { display: block; overflow-x: auto; white-space: nowrap; font-size: 0.8rem !important; }
  .table-card { border-radius: 14px !important; }
  /* Profile header card: stack on mobile */
  .profile-header-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 20px 16px !important;
    gap: 14px !important;
  }
  .profile-badges { justify-content: center; }
}
@media (max-width: 480px) {
  /* Stat cards: 2-col on small phones */
  [style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .stat-mini-card { padding: 12px 10px !important; }
  .stat-mini-icon { width: 34px !important; height: 34px !important; margin-bottom: 8px !important; }
  .stat-mini-num  { font-size: 1.2rem !important; }
  .stat-mini-label { font-size: 0.68rem !important; }
}

/* ============================================================
   PROFILE — mobile
   ============================================================ */
@media (max-width: 768px) {
  .hbic-tab-switcher {
    flex-direction: column !important;
    border-radius: 16px !important;
    width: 100% !important;
  }
  .hbic-tab-btn {
    border-radius: 12px !important;
    justify-content: flex-start !important;
  }
  .profile-header-card {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: center !important;
    text-align: center !important;
    padding: 20px 16px !important;
  }
  .profile-info h2 { font-size: 1.15rem !important; }
  .profile-badges  { justify-content: center; }
  /* Form rows in profile: 1 col */
  .form-row { grid-template-columns: 1fr !important; gap: 14px !important; }
  /* Form cards: comfortable padding */
  .form-card { padding: 18px 14px !important; border-radius: 16px !important; }
  /* Full-width submit button */
  .btn-submit { width: 100% !important; justify-content: center; }
}

/* ============================================================
   TOUCH TARGETS
   ============================================================ */
@media (max-width: 900px) {
  .btn-primary, .btn-outline-white, .btn-outline,
  .btn-submit, .nav-btn-started, .nav-btn-login-new { min-height: 44px; }
  .form-control {
    font-size: 16px !important;
    min-height: 48px;
  }
  select.form-control { min-height: 48px; }
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
html { scroll-behavior: smooth; }

.fade-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

.fade-in-mob {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.fade-in-mob.visible { opacity: 1; }

/* Stagger delays */
.stagger-mob > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-mob > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-mob > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-mob > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-mob > *:nth-child(5) { transition-delay: 0.33s; }

/* ============================================================
   UTILITIES
   ============================================================ */
/* View All button: hidden on desktop (header already has it), visible on mobile */
.mob-view-all-btn { display: none; }
@media (max-width: 768px) {
  .mob-view-all-btn { display: block; }
  body { overflow-x: hidden; }
  img  { max-width: 100%; height: auto; }
  .data-table { font-size: 0.82rem; }
  .form-card  { padding: 22px 16px; border-radius: 16px; }
  .table-card { border-radius: 16px; }
  .alert      { font-size: 0.84rem; padding: 12px 14px; }
}

@media (max-width: 375px) {
  .section-title { font-size: 1.4rem; }
  .hero-title    { font-size: 1.85rem !important; }
  .stat-value    { font-size: 1.65rem; }
}