/* ==========================================================================
   PINNACLE GLOBAL ACADEMY - RESPONSIVE ARCHITECTURE & ZERO-OVERFLOW ENGINE
   Viewports:
     Mobile:  < 640px
     Tablet:  640px – 1023px
     Desktop: >= 1024px (1024px – 1279px compact, 1280px+ large)
   ========================================================================== */

/* Universal Zero-Overflow & Layout Integrity Guards */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

img, svg, picture, video, iframe {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   DESKTOP (>= 1024px)
   Scaled High-Res Logo, Center Nav (7 links), Right Dual CTAs
   ========================================================================== */
@media (min-width: 1024px) {
  :root {
    --header-height: 84px;
  }

  .site-header .container,
  .top-bar .container {
    max-width: 1320px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Top Announcement Bar */
  .top-bar {
    min-height: 38px;
    padding: 0.375rem 1rem;
    display: flex;
    align-items: center;
  }

  .top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 38px;
    width: 100%;
  }

  .top-bar-info {
    display: flex !important;
    align-items: center;
  }

  .top-bar-cta {
    display: flex !important;
    align-items: center;
  }

  /* Header Layout */
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: var(--header-height);
  }

  /* Left: Scaled High-Res Logo */
  .site-logo,
  .brand-logo-link {
    flex-shrink: 0;
  }

  .site-logo img,
  .brand-logo-img {
    height: 56px !important;
    max-height: 58px !important;
    width: auto;
    object-fit: contain;
  }

  /* Center: Nav Menu */
  .main-nav {
    display: flex !important;
    align-items: center;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .nav-link {
    padding: 6px 8px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  /* Right: Dual CTA Buttons */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .header-actions .btn-accent {
    display: inline-flex !important;
    padding: 7px 11px;
    font-size: 0.80rem;
    white-space: nowrap;
  }

  .header-actions .btn-primary {
    display: inline-flex !important;
    padding: 7px 12px;
    font-size: 0.80rem;
    white-space: nowrap;
  }

  .mobile-menu-btn {
    display: none !important;
  }
}

/* Compact Adjustments for Small Desktops (1024px to 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --header-height: 78px;
  }

  .header-inner {
    gap: 0.75rem;
  }

  .site-logo img,
  .brand-logo-img {
    height: 56px !important;
    max-height: 56px !important;
  }

  .nav-link {
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .btn-accent {
    padding: 7px 11px;
    font-size: 0.80rem;
  }

  .header-actions .btn-primary {
    padding: 7px 13px;
    font-size: 0.80rem;
  }
}

/* ==========================================================================
   MOBILE & TABLET (< 1024px)
   Single clean row: [Logo] ------------------ [Touch-friendly Hamburger (44x44)]
   All CTAs moved into the slide-out drawer
   ========================================================================== */
@media (max-width: 1023px) {
  :root {
    --header-height: 72px;
  }

  .site-header {
    width: 100%;
    overflow: hidden;
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    height: var(--header-height);
    box-sizing: border-box;
  }

  .site-logo,
  .brand-logo-link {
    flex-shrink: 0;
    max-width: calc(100% - 60px);
  }

  /* Nav Menu and Header Buttons hidden from sticky row */
  .main-nav {
    display: none !important;
  }

  .site-header .header-actions .btn,
  .site-header .header-actions a,
  .header-actions .btn,
  .header-actions .btn-accent,
  .header-actions .btn-primary {
    display: none !important;
  }

  /* Touch-friendly 44x44px Hamburger button */
  .mobile-menu-btn {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  .mobile-menu-btn svg {
    width: 24px;
    height: 24px;
  }

  /* Grids */
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero-visual {
    max-width: 520px;
    margin: 0 auto;
  }

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .promo-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .floating-badge {
    position: static !important;
    margin-top: var(--space-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Tablet Specific (640px to 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .site-logo img,
  .brand-logo-img {
    height: 54px !important;
    max-height: 54px !important;
    width: auto;
    object-fit: contain;
  }

  .top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .top-bar-info {
    font-size: 0.78rem;
  }

  .top-bar-cta-link {
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   MOBILE (< 768px & < 640px)
   Clean single promo top bar, sharp 46px logo, zero lateral drift
   ========================================================================== */
@media (max-width: 767px) {
  /* Top Announcement Bar: Option B (Single, Clean, High-Conversion Promo) */
  .top-bar {
    padding: 6px 12px;
    min-height: 36px;
  }

  .top-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    width: 100%;
    text-align: center;
  }

  .top-bar-info {
    display: none !important;
  }

  .top-bar-cta {
    display: flex !important;
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .top-bar-cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
  }

  /* Hero & Buttons */
  .hero-section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }

  /* Grids collapse */
  .grid-2,
  .grid-3,
  .grid-4,
  .process-grid,
  .promo-grid,
  .promo-features,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .promo-banner {
    padding: var(--space-xl) var(--space-md);
  }

  .promo-banner::after {
    font-size: 5rem;
    right: -10px;
    bottom: -20px;
  }

  .sub-footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .sub-footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .floating-whatsapp {
    bottom: 16px;
    right: 16px;
  }

  .whatsapp-btn {
    width: 50px;
    height: 50px;
  }

  .whatsapp-tooltip {
    display: none !important;
  }

  .mobile-nav-panel {
    width: 88%;
    max-width: 320px;
    padding: var(--space-lg);
  }
}

/* Mobile (< 640px) */
@media (max-width: 639px) {
  :root {
    --header-height: 64px;
    --space-lg: 14px;
  }

  .header-inner {
    padding: 0.5rem 0.85rem;
    height: var(--header-height);
  }

  .site-logo img,
  .brand-logo-img {
    height: 46px !important;
    max-height: 48px !important;
    width: auto;
    object-fit: contain;
  }

  .mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
  }
}

/* Small Mobile (< 480px down to 320px) */
@media (max-width: 479px) {
  :root {
    --header-height: 60px;
    --space-lg: 12px;
  }

  .container,
  .container-narrow {
    padding-left: 12px;
    padding-right: 12px;
  }

  .site-logo img,
  .brand-logo-img {
    height: 44px !important;
    max-height: 46px !important;
    max-width: 220px;
  }

  h1 {
    font-size: 1.65rem !important;
  }

  h2 {
    font-size: 1.4rem !important;
  }

  h3 {
    font-size: 1.18rem !important;
  }

  .lead-form-card,
  .service-card,
  .card,
  .contact-info-card,
  .map-card {
    padding: 16px !important;
  }

  .exam-pill-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .exam-stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
