/* =============================================
   CBC – Mobile-First Responsive CSS
   Full overhaul for clean phone display
   Breakpoints: 1024px (tablet), 768px (phone), 480px (small phone)
   ============================================= */

/* =============================================
   0. BASE CLASSES (replaces inline styles)
   ============================================= */

/* Two-column service section layout */
.svc-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* Hero grid (home) */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 60px;
  align-items: center;
}

/* Process / How We Work */
.process-grid {
  display: grid;
  grid-template-columns: 1fr 60px 1fr 60px 1fr;
  align-items: start;
  gap: 0;
}

/* Why CBC grid */
.why-cbc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* Brand strip (home) */
.brand-strip-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-strip-card {
  max-width: 700px;
  width: 100%;
  background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
  border-radius: 8px;
  padding: 28px 36px;
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid #ddd;
}
.brand-strip-logo { height: 64px; width: auto; flex-shrink: 0; }
.brand-strip-title { font-size: 1.7rem; font-weight: 800; color: #2d2d2d; line-height: 1.1; }
.brand-strip-sub { font-size: 0.9rem; color: #777; margin-top: 6px; }
.brand-strip-btn { margin-left: auto; flex-shrink: 0; white-space: nowrap; }

/* Startup banner */
.startup-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.startup-banner-content {
  padding: 44px 48px;
}
.startup-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.startup-price-panel {
  background: rgba(0,0,0,0.2);
  padding: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 220px;
  border-left: 1px solid rgba(255,255,255,0.12);
}

/* Google Calendar booking card */
.gcal-booking-card {
  border-radius: 12px;
  border: 1px solid var(--gray-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  background: #fff;
  text-align: center;
  padding: 32px 24px;
}
.gcal-icon-wrap {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--crimson-dark), var(--crimson));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.gcal-book-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 4px 16px rgba(139,26,43,0.3);
}
.gcal-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.gcal-badge {
  font-size: 0.78rem;
  color: var(--gray-light);
  display: flex;
  align-items: center;
  gap: 5px;
}
.gcal-badge i { color: var(--crimson); }

/* =============================================
   1. GLOBAL RESETS FOR PHONE
   ============================================= */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow-x: hidden;
}

/* Minimum tap target size */
a, button, .btn, .filter-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.accordion-header { display: flex; min-height: 44px; }

/* =============================================
   2. TABLET – 1024px
   ============================================= */
@media (max-width: 1024px) {

  /* All two-column grids → stack */
  .svc-two-col,
  .hero-grid,
  .why-cbc-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Process: stack vertically */
  .process-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Hero cards: 2-col on tablet */
  .hero-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Expertise 2-col */
  .expertise-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; }

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

  /* Pricing 2-col */
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-card.featured { transform: none; }

  /* Resources / Contact */
  .resources-layout { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .contact-layout { grid-template-columns: 1fr; gap: 32px; }

  /* Article layout */
  .article-layout { grid-template-columns: 1fr; gap: 32px; }
}

/* =============================================
   3. PHONE – 768px  (MAIN MOBILE BREAKPOINT)
   ============================================= */
@media (max-width: 768px) {

  /* --- Container --- */
  .container { padding: 0 16px; }

  /* --- Sections --- */
  .section    { padding: 44px 0; }
  .section-sm { padding: 32px 0; }
  .section-lg { padding: 56px 0; }
  .section-header { margin-bottom: 28px; }
  .section-header p { font-size: 0.9rem; }

  /* --- Typography --- */
  h1 { font-size: clamp(1.8rem, 7vw, 2.4rem) !important; }
  h2 { font-size: clamp(1.35rem, 5.5vw, 1.8rem) !important; }
  h3 { font-size: clamp(1.05rem, 4.5vw, 1.25rem) !important; }
  p  { font-size: 0.9rem; }

  /* --- Navbar --- */
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-container { padding: 0 16px; height: 64px; }
  .nav-logo img { height: 40px; }
  .nav-logo-text .brand-name { font-size: 0.85rem; }
  .nav-logo-text .brand-sub  { font-size: 0.68rem; }
  .page-offset { padding-top: 64px; }
  .mobile-menu { top: 64px; padding: 12px 16px 20px; }
  .mobile-menu a {
    font-size: 1rem;
    padding: 13px 16px;
    border-radius: 8px;
    min-height: 48px;
  }
  .mobile-menu .btn {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }

  /* --- Page Hero (inner pages) --- */
  .page-hero { padding: 70px 0 36px; }
  .page-hero h1 { margin-bottom: 8px; }
  .page-hero p  { font-size: 0.9rem; }
  .page-hero .breadcrumb { font-size: 0.75rem; margin-bottom: 12px; }

  /* --- ALL multi-column grids → single column --- */
  .svc-two-col,
  .hero-grid,
  .why-cbc-grid,
  .process-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .expertise-grid,
  .pricing-grid,
  .blog-grid,
  .resources-layout,
  .contact-layout,
  .article-layout,
  .sidebar,
  .approach-flow {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* --- Home Hero --- */
  .home-hero {
    padding: 36px 0 28px;
    min-height: auto;
  }
  .hero-title { font-size: clamp(1.9rem, 7.5vw, 2.4rem) !important; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-btns {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
  }
  .hero-btns .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  .hero-stats {
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 16px;
  }
  .hero-stat-num { font-size: 1.4rem; }
  /* Hero cards: single column on phone */
  .hero-cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .hero-card-item { padding: 14px 16px; }

  /* Hide hero cards entirely on very small screens to keep hero clean */
  /* (keep them visible – just stacked) */

  /* --- Brand Strip --- */
  .brand-strip-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 16px;
  }
  .brand-strip-logo { height: 48px; }
  .brand-strip-title { font-size: 1.2rem; }
  .brand-strip-sub  { font-size: 0.82rem; }
  .brand-strip-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  /* --- Cards --- */
  .card          { padding: 20px 16px; }
  .service-card  { padding: 20px 16px; }
  .card-icon     { width: 48px; height: 48px; font-size: 1.2rem; margin-bottom: 14px; }
  .testimonial-card { padding: 20px 16px; }
  .value-card    { padding: 20px 16px; }

  /* --- Process Steps --- */
  .process-step { padding: 18px 14px; text-align: center; }
  .process-arrow {
    transform: rotate(90deg);
    padding: 2px 0;
    margin: 0 auto;
    width: auto !important;
  }

  /* --- Why CBC right panel – hide decorative box, keep text --- */
  .why-cbc-grid > div:last-child { display: none; }

  /* --- CTA Banner --- */
  .cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 28px 16px;
    gap: 20px;
    border-radius: 12px;
  }
  .cta-banner > div:last-child {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  .cta-banner .btn {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
  }

  /* --- Services Page --- */
  /* Service hero hero buttons */
  .service-detail-card {
    grid-template-columns: 1fr !important;
    padding: 20px 16px;
    gap: 14px;
  }
  .service-detail-card .sd-icon { width: 48px; height: 48px; font-size: 1.2rem; }

  /* Startup banner – full stack */
  .startup-banner-inner {
    display: flex !important;
    flex-direction: column !important;
  }
  .startup-banner-content {
    padding: 24px 20px !important;
  }
  .startup-features-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
  }
  .startup-price-panel {
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.15) !important;
    padding: 24px 20px !important;
    min-width: unset !important;
    text-align: center !important;
  }
  .startup-price-panel .btn {
    width: 100%;
    justify-content: center;
  }

  /* Pricing cards */
  .pricing-grid {
    gap: 14px !important;
  }
  .pricing-card { padding: 24px 16px; }
  .pricing-card.featured { transform: none; order: -1; }
  .pricing-price { font-size: 2rem; }

  /* Service tab nav – horizontal scroll, compact */
  .service-tab-link { padding: 14px 14px !important; font-size: 0.78rem !important; }

  /* Inline service hero buttons */
  div[style*="display:flex; gap:12px"] a.btn,
  div[style*="display:flex; gap:12px; flex-wrap"] a.btn {
    padding: 11px 18px;
    font-size: 0.85rem;
  }

  /* --- Expertise Page --- */
  .expertise-grid { gap: 14px !important; }
  .expertise-card-img { height: 120px; }
  .expertise-card-body { padding: 16px; }
  .approach-step {
    width: 100%;
    min-width: unset;
    padding: 18px 14px;
  }
  .approach-arrow {
    transform: rotate(90deg);
    padding: 2px 0;
  }

  /* --- Resources Page --- */
  .resources-layout { gap: 20px !important; }
  .sidebar { gap: 14px !important; }
  .blog-featured {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  .blog-featured-img { min-height: 140px; }
  .blog-featured-body { padding: 18px; }
  .blog-featured-body h2 { font-size: 1.05rem; }
  .blog-grid { gap: 14px !important; }
  .blog-card-body { padding: 14px; }
  .blog-card-body h3 { font-size: 0.9rem; }
  .filter-tabs { gap: 6px; margin-bottom: 16px; }
  .filter-tab { padding: 7px 12px; font-size: 0.78rem; }
  .newsletter-form { flex-direction: column; gap: 8px; }
  .newsletter-form input, .newsletter-form button { width: 100%; }
  .sidebar-widget { padding: 18px; margin-bottom: 14px; }

  /* --- Contact Page --- */
  .contact-info-cards { margin-top: 16px; gap: 10px; }
  .contact-info-card  { padding: 14px; gap: 12px; }
  .gcal-booking-card  { padding: 22px 16px; }
  .gcal-book-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 13px 20px !important;
  }
  .gcal-badges {
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
  }
  .gcal-badge { font-size: 0.75rem; }

  /* --- CATCH-ALL: Any remaining inline two-column grids --- */
  /* These selectors catch inline style="display:grid;grid-template-columns:1fr 1fr..." */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr auto"],
  div[style*="grid-template-columns: 1fr auto"],
  div[style*="grid-template-columns:repeat(2"],
  div[style*="grid-template-columns: repeat(2"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
  }

  /* Exceptions: keep horizontal flex for social/icon rows */
  .footer-social,
  .footer-bottom,
  .article-share,
  .gcal-badges,
  .hero-stats,
  .blog-meta,
  .article-meta-bar,
  .filter-tabs,
  .tag-cloud,
  .hero-btns div[style],
  .breadcrumb {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: inherit !important;
    width: auto !important;
  }

  /* --- Article body – inline grids inside content --- */
  .article-body div[style*="grid-template-columns"],
  .article-body div[style*="grid-template"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  /* Also catch any article callout or featured box grids */
  .article-callout div[style*="grid"],
  .article-pullquote div[style*="grid"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* --- Article Pages --- */
  .article-hero-img {
    height: 200px;
    border-radius: 10px;
    margin-bottom: 20px;
  }
  .article-hero-img i { font-size: 3.5rem; }
  .article-meta-bar {
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }
  .article-body h2 { font-size: 1.2rem; margin: 24px 0 10px; }
  .article-body h3 { font-size: 1rem; margin: 18px 0 8px; }
  .article-body p  { font-size: 0.88rem; line-height: 1.75; }
  .article-pullquote { padding: 14px 16px; margin: 16px 0; }
  .article-pullquote p { font-size: 0.9rem !important; }
  .article-author-box {
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    margin-top: 28px;
  }
  .article-share { gap: 8px; padding: 16px 0; margin: 24px 0; }
  .share-btn { font-size: 0.75rem; padding: 7px 12px; }
  .article-callout { padding: 16px; margin: 20px 0; }
  .article-layout .sidebar-widget { margin-bottom: 12px; }

  /* --- Footer --- */
  .footer { padding: 36px 0 0; }
  .footer-grid { gap: 24px; padding-bottom: 28px; }
  .footer-col ul { gap: 8px; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 14px 0;
  }
  .footer-links-row { flex-wrap: wrap; justify-content: center; gap: 10px 16px; }

  /* --- FAQ / Accordion --- */
  .accordion-header { padding: 14px 16px; font-size: 0.88rem; }
  .accordion-body   { padding: 0 16px 14px; font-size: 0.85rem; }

  /* --- Tables --- */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.8rem;
  }
  table th, table td { padding: 8px 10px !important; min-width: 90px; }

  /* --- Utility overrides --- */
  img, video, iframe, embed, object { max-width: 100%; }
  pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* =============================================
   4. SMALL PHONE – 480px
   ============================================= */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .section    { padding: 36px 0; }
  .section-header { margin-bottom: 22px; }

  h1 { font-size: clamp(1.6rem, 6.5vw, 1.95rem) !important; }
  h2 { font-size: clamp(1.2rem, 5vw, 1.55rem) !important; }
  h3 { font-size: clamp(1rem, 4vw, 1.15rem) !important; }

  .btn    { padding: 11px 18px; font-size: 0.85rem; }
  .btn-lg { padding: 13px 22px; font-size: 0.9rem; }

  .hero-title { font-size: clamp(1.6rem, 7vw, 2rem) !important; }

  /* Hide the hero service cards on very small phones to keep hero tight */
  .hero-cards { display: none !important; }

  /* Hero stats: 2-column grid */
  .hero-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    flex-wrap: unset !important;
  }

  /* Pricing card compact */
  .pricing-card { padding: 20px 14px; }
  .pricing-price { font-size: 1.8rem; }
  .pricing-feature { font-size: 0.8rem; padding: 6px 0; }

  /* Brand strip: ultra compact */
  .brand-strip-card { padding: 14px; gap: 10px; }
  .brand-strip-logo { height: 40px; }
  .brand-strip-title { font-size: 1.05rem; }

  /* Article */
  .article-hero-img { height: 160px; }
  .article-hero-img i { font-size: 3rem; }

  /* CTA banner */
  .cta-banner { padding: 22px 14px; }

  /* Filter tabs wrap cleanly */
  .filter-tabs { gap: 5px; }
  .filter-tab { padding: 6px 10px; font-size: 0.75rem; }

  /* Footer */
  .footer-grid { gap: 20px; }
  .footer-bottom p { font-size: 0.72rem; }
}

/* =============================================
   5. TOUCH DEVICE – Disable hover transforms
   ============================================= */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .service-card:hover,
  .hero-card-item:hover,
  .expertise-card:hover,
  .blog-card:hover,
  .industry-item:hover,
  .value-card:hover,
  .pricing-card:not(.featured):hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  .btn:active { transform: scale(0.97); }
}

/* =============================================
   6. PRINT (download pages)
   ============================================= */
@media print {
  .navbar, .mobile-menu, .doc-actionbar,
  .footer, .nav-toggle {
    display: none !important;
  }
  body { font-size: 11pt; color: #000; background: #fff; }
  .page-offset { padding-top: 0; }
  a { color: #000; text-decoration: none; }
  h2, h3 { page-break-after: avoid; }
  table { page-break-inside: avoid; }
}
