/**
 * GBC AI Solutions & DistilX - Master Responsive Stylesheet
 * File: css/responsive.css
 * Provides fluid, comprehensive responsiveness across all device sizes:
 * - 4K & Ultra-wide displays (> 1600px)
 * - Desktops & Laptops (1025px - 1440px)
 * - Tablets in landscape (769px - 1024px)
 * - Tablets in portrait (641px - 768px)
 * - Large mobiles (481px - 640px)
 * - Standard mobiles (361px - 480px)
 * - Compact mobiles (<= 360px)
 */

/* ==========================================================================
   1. GLOBAL RESPONSIVE FOUNDATIONS
   ========================================================================== */

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* Prevent iOS Safari automatic font-size zoom on input focus */
@media screen and (max-width: 768px) {

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Tables inside chat / copilot demo must scroll horizontally if needed */
.chat-log table,
.decision-layer table,
.chat-box table,
.hero-card table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   2. DESKTOP & LAPTOP REFINEMENTS (max-width: 1200px)
   ========================================================================== */

@media (max-width: 1200px) {
  .wrap {
    padding-left: 28px;
    padding-right: 28px;
  }

  .hero .grid {
    gap: 40px;
  }

  .sol-grid {
    gap: 20px;
  }

  .mod-grid {
    gap: 20px;
  }

  .demo-grid,
  .copilot-grid {
    gap: 36px;
  }
}

/* ==========================================================================
   3. TABLETS LANDSCAPE & SMALL LAPTOPS (max-width: 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  section {
    padding: 80px 0;
  }

  .hero {
    padding: 60px 0 72px;
  }

  body.distilx-page .hero {
    padding: 52px 0 64px;
  }

  /* Main Site Navigation */
  nav.main a {
    font-size: 14.5px;
  }

  /* Solutions 3-column to 2-column */
  .sol-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Industries 4-column to 2-column */
  .ind-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  /* Trust 3-column to 2-column */
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  /* DistilX Modules */
  .mod-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer 4-col to 2-col */
  footer .cols {
    grid-template-columns: 1.5fr 1fr;
    gap: 36px;
  }
}

/* ==========================================================================
   4. MEDIUM SCREENS / NAVBAR BREAKPOINT (max-width: 980px)
   ========================================================================== */

@media (max-width: 980px) {

  /* Main Site Header Hamburger */
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  nav.main {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(11, 12, 69, 0.12);
    padding: 20px 24px 28px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    z-index: 99;
  }

  nav.main.open {
    display: flex;
  }

  nav.main a {
    font-size: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(225, 229, 238, 0.6);
  }

  nav.main a.nav-cta {
    margin-left: 0;
    margin-top: 8px;
    text-align: center;
    justify-content: center;
    padding: 12px 20px;
    background: var(--navy);
    color: #fff;
    border-radius: 8px;
  }

  /* Hero Grids stack to 1 column */
  .hero .grid,
  body.distilx-page .hero .grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero .sub {
    max-width: 100%;
  }

  /* Decision layer scheme */
  #schem {
    margin-top: 8px;
  }

  /* Proof Section */
  .proof-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* DistilX Grids */
  .copilot-grid,
  .demo-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* DistilX Header Navigation */
  .distilx-nav {
    display: none;
  }

  .back-mobile {
    display: inline-flex;
  }
}

/* ==========================================================================
   5. TABLETS PORTRAIT (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
  section {
    padding: 64px 0;
  }

  .site {
    padding: 0px;
  }

  h1 {
    font-size: clamp(32px, 7vw, 48px);
    line-height: 1.08;
  }

  h2 {
    font-size: clamp(24px, 5.5vw, 34px);
    line-height: 1.15;
    max-width: 100%;
  }

  .lede {
    font-size: 17.5px;
    line-height: 1.5;
  }

  /* Hero adjustments */
  .hero .sub {
    font-size: 18px;
    line-height: 1.5;
    margin-top: 14px;
  }

  .hero .proofline {
    font-size: 15px;
    gap: 8px;
    margin-top: 18px;
  }

  /* Copilot Demo in index.php */
  .copilot-card .card-head {
    padding: 12px 16px;
  }

  .copilot-card .card-body {
    padding: 18px 16px;
  }

  /* Forms */
  .form-row,
  .map .two {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-card,
  form.map {
    padding: 24px 20px;
    border-radius: 12px;
  }

  /* Floating WhatsApp button */
  .wa {
    bottom: 20px;
    right: 20px;
    font-size: 14.5px;
    padding: 11px 18px;
    border-radius: 28px;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.35);
  }

  /* Footer */
  footer {
    padding: 48px 0 36px;
  }

  footer .cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ==========================================================================
   6. LARGE MOBILES / PHABLETS (max-width: 640px)
   ========================================================================== */

@media (max-width: 640px) {
  .wrap {
    padding-left: 18px;
    padding-right: 18px;
  }

  .bar {
    height: 64px;
  }

  nav.main {
    top: 64px;
    padding: 16px 18px 24px;
  }

  /* Buttons */
  .btn {
    padding: 11px 20px;
    font-size: 15px;
  }

  .btn.sm {
    padding: 8px 14px;
    font-size: 13.5px;
  }

  .hero .ctas,
  .hero-ctas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .hero .ctas .btn,
  .hero-ctas .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Fixed Bottom WhatsApp Floating Button Responsive */
  .btn-wa-circle {
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
  }

  .btn-wa-circle svg {
    width: 26px;
    height: 26px;
  }

  /* Grids to single column */
  .sol-grid,
  .ind-grid,
  .trust-grid,
  .mod-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sol-card,
  .ind-card,
  .trust-card,
  .mod-card {
    padding: 22px 18px;
  }

  /* States Compliance Bar */
  .states-bar {
    padding: 16px 0;
  }

  .states-wrap {
    gap: 8px;
  }

  .states-wrap b {
    width: 100%;
    display: block;
    margin-bottom: 4px;
  }

  .state-tag {
    font-size: 12px;
    padding: 3px 8px;
  }

  /* Chat mockups */
  .chat-box,
  .copilot-card {
    border-radius: 12px;
  }

  .chat-head {
    padding: 11px 14px;
    font-size: 13.5px;
  }

  .chat-body,
  #chat-log {
    padding: 14px 12px;
    gap: 10px;
  }

  .msg,
  .chat-body .msg {
    padding: 10px 12px;
    font-size: 13.5px;
  }

  /* Prompt Buttons */
  #prompts {
    gap: 8px;
    margin-top: 12px;
  }

  #prompts button {
    font-size: 13px;
    padding: 8px 12px;
    width: 100%;
    text-align: left;
  }

  /* DistilX Brand Logo */
  .brand-logo {
    height: 38px;
    max-width: 165px;
  }

  /* Hide call button in distilx nav to avoid header crunch */
  .nav-actions .btn.line {
    display: none;
  }
}

/* ==========================================================================
   7. STANDARD MOBILES (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
  section {
    padding: 48px 0;
  }

  .hero {
    padding: 38px 0 48px;
  }

  body.distilx-page .hero {
    padding: 36px 0 44px;
  }

  h1 {
    font-size: clamp(27px, 8.2vw, 36px);
  }

  h2 {
    font-size: clamp(22px, 6.5vw, 28px);
  }

  h3 {
    font-size: 18.5px;
  }

  /* Pill tags */
  .pill-proof {
    font-size: 12px;
    padding: 4px 10px;
  }

  /* Decision Layer Animation Container */
  .decision-layer {
    padding: 16px 14px;
    border-radius: 12px;
  }

  .stream-tag {
    font-size: 11.5px;
    padding: 3px 8px;
  }

  /* Hero Card checklist */
  .hero-card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .hero-card h3 {
    font-size: 18px;
  }

  .hero-card li {
    font-size: 13.5px;
    gap: 8px;
  }

  /* Contact Items */
  .contact-methods {
    gap: 10px;
    margin-top: 20px;
  }

  .c-item {
    font-size: 14px;
    gap: 10px;
  }

  /* Form padding */
  .form-card,
  form.map {
    padding: 20px 14px;
  }

  .form-group label,
  .field label {
    font-size: 13px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea,
  .field input,
  .field textarea {
    padding: 10px 12px;
    border-radius: 7px;
  }

  /* Floating WhatsApp Button */
  .wa {
    bottom: 16px;
    right: 14px;
    font-size: 13.5px;
    padding: 9px 15px;
  }

  /* Brand and mobile back button */
  .back-mobile {
    padding: 5px 9px;
    font-size: 12px;
  }

  .brand b {
    font-size: 20px;
  }

  .brand span {
    font-size: 9.5px;
  }
}

/* ==========================================================================
   8. COMPACT & SMALL MOBILES (max-width: 360px)
   ========================================================================== */

@media (max-width: 360px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-logo {
    height: 32px;
    max-width: 140px;
  }

  .btn.wa.sm {
    padding: 7px 10px;
    font-size: 12px;
  }

  .back-mobile {
    display: none;
    /* Hide back link on extreme small screens to prevent overlap */
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 20px;
  }

  .hero-card,
  .form-card,
  form.map {
    padding: 16px 12px;
  }
}

/* ==========================================================================
   9. ULTRA-WIDE & 4K DISPLAYS (min-width: 1600px)
   ========================================================================== */

@media (min-width: 1600px) {
  .wrap {
    max-width: 1280px;
  }

  h1 {
    font-size: 64px;
  }

  h2 {
    font-size: 42px;
  }

  .sub,
  .lede {
    font-size: 21px;
  }

  section {
    padding: 112px 0;
  }
}

/* ==========================================================================
   10. PRINT STYLESHEET
   ========================================================================== */

@media print {

  header.site,
  .wa,
  .btn-wa-circle,
  .menu-btn,
  #prompts,
  .hero-ctas,
  .nav-actions {
    display: none !important;
  }

  body {
    color: #000 !important;
    background: #fff !important;
    font-size: 12pt;
  }

  .wrap {
    max-width: 100% !important;
    padding: 0 !important;
  }

  section {
    padding: 24pt 0 !important;
    break-inside: avoid;
  }

  a {
    text-decoration: underline !important;
    color: #000 !important;
  }
}