/* ============================================================
   i-Open Group — Responsive Styles
   1100px / 768px / 480px
   ============================================================ */

/* ---- Large Tablet (≤ 1100px) ---- */
@media (max-width: 1100px) {
  :root { --section-v: 80px; }

  .nav-links { gap: 26px; margin-left: 32px; }

  .services-grid { grid-template-columns: repeat(2, 1fr); }

  .cards-grid  { gap: 18px; }

  .cta-inner  { gap: 44px; }
  .cta-img    { height: 300px; }

  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }

  /* products-grid is now a flex accordion — no grid override needed at 1100px */
}

/* ---- Tablet (≤ 768px) ---- */
@media (max-width: 768px) {
  :root { --section-v: 68px; --nav-h: 64px; }

  /* Navbar */
  .nav-links {
    display: none;
    position: fixed;
    left: 0;
    transform: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0; bottom: 0;
    margin: 0;
    background: rgba(4, 10, 22, 0.82);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    padding: 48px 36px 56px;
    gap: 0;
    z-index: 998;
    overflow-y: auto;
    animation: mobileMenuIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes mobileMenuIn {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .nav-links.open .nav-link {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.38);
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s ease, padding-left 0.2s ease;
  }
  /* Repurpose ::after as a chevron indicator */
  .nav-links.open .nav-link::after {
    content: '›';
    display: block;
    position: static;
    width: auto;
    height: auto;
    font-size: 30px;
    line-height: 1;
    background: none;
    border-radius: 0;
    opacity: 0.15;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
  }
  /* Active page link: bright white + orange chevron */
  .nav-links.open .nav-link.active {
    color: #fff;
    padding-left: 6px;
  }
  .nav-links.open .nav-link.active::after {
    opacity: 1;
    color: var(--orange);
    width: auto;
    transform: translateX(4px);
  }
  .hamburger { display: flex; margin-left: auto; }
  /* Hide top-bar CTA on mobile — it lives inside the menu instead */
  .nav-cta { display: none; }
  /* Mobile CTA: pinned to the bottom of the open menu */
  .nav-links.open .nav-cta-mobile {
    display: block;
    margin-top: auto;
    padding-top: 36px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-links.open .nav-cta-mobile a {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    font-size: 14px;
    letter-spacing: 1px;
  }

  /* Services */
  .services-grid { grid-template-columns: 1fr 1fr; }
  .service-col { padding: 30px 20px; }

  /* Professional Services */
  .cards-grid { grid-template-columns: 1fr; }
  .service-card { padding: 28px 24px; }

  /* CTA */
  .cta-inner { grid-template-columns: 1fr; gap: 32px; }
  .cta-img { display: none; }

  /* Video overlays: hide duration + label on mobile — thumbnail + play button is sufficient */
  .video-duration,
  .video-label { display: none; }

  /* Industry tabs */
  .tab-btn { padding: 9px 18px; font-size: 13px; }

  /* News */
  .news-grid { grid-template-columns: 1fr; }

  /* Contact form */
  .form-grid { grid-template-columns: 1fr; }
  .form-wrap { padding: 28px 20px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 6px; }

  /* Company hero — let content dictate height on mobile instead of forcing 100vh */
  .company-hero       { height: auto; min-height: 100svh; }
  .company-hero-inner { padding-bottom: 72px; }

  /* Company hero eyebrow: hide decorative line on mobile so text wraps without the dash orphaning */
  .company-hero-eyebrow { display: block; }
  .company-hero-eyebrow::before { display: none; }

  /* Hero CTAs — one button on mobile: hide ghost, stretch primary edge to edge */
  .company-hero-ctas .btn-ghost   { display: none; }
  .company-hero-ctas .btn-primary { width: 100%; justify-content: center; }

  /* Page hero */
  .page-hero { padding: 60px 28px 52px; }

  /* Full-screen block: release all fixed heights on mobile */
  .hero-products-block { height: auto; }
  .hero-products-block .page-hero { height: auto; padding: calc(var(--nav-h) + 20px) 28px 32px; align-items: flex-start; }
  /* Reset flex-basis (70%) and overflow so the section grows with its content */
  .hero-products-block .products-section { flex: none; overflow: visible; }
  /* Reset the 520px cap and flex:1 that clip the grid on mobile */
  .hero-products-block .products-grid { flex: none; max-height: none; }

  /* Products — vertical accordion on mobile */
  .products-grid {
    flex-direction: column;
    height: auto;
    gap: 8px;
  }

  /* All cards: vertical stack, full width, accordion enabled */
  /* scroll-margin-top clears the fixed navbar when scrollIntoView fires */
  .product-card,
  .product-card.active {
    scroll-margin-top: calc(var(--nav-h) + 12px);
    flex: none;
    width: 100%;
    flex-direction: column;
    cursor: pointer;
    border-radius: 12px;
  }
  .product-card.active { cursor: default; }

  /* Collapsed: header strip showing image + name */
  .product-card-img { flex: 0 0 76px; width: 100%; }
  .product-card.active .product-card-img { flex: 0 0 180px; }

  /* Collapsed label: horizontal, full width, with tap chevron */
  .product-card-collapsed-label {
    display: flex;
    writing-mode: horizontal-tb;
    transform: none;
    justify-content: flex-start;
    align-items: center;
    padding: 0 20px;
    font-size: 13px;
    letter-spacing: 2px;
    width: 100%;
  }
  /* Right-side chevron signals "tap to expand" */
  .product-card:not(.active) .product-card-collapsed-label::after {
    content: '›';
    margin-left: auto;
    font-size: 22px;
    opacity: 0.55;
    line-height: 1;
  }
  .product-card.active .product-card-collapsed-label { opacity: 0; }

  /* Icon: visible when expanded */
  .product-card-icon { opacity: 0; transform: scale(0.85); }
  .product-card.active .product-card-icon { opacity: 1; transform: scale(1); }

  /* Body: accordion expand/collapse */
  .product-card-body {
    max-height: 0;
    opacity: 0;
    padding: 0 24px;
    min-width: 0;
    transition: max-height 0.45s ease, opacity 0.3s ease, padding 0.35s ease;
  }
  .product-card.active .product-card-body {
    max-height: 640px;
    opacity: 1;
    padding: 24px;
    transition: max-height 0.45s ease 0.1s, opacity 0.3s ease 0.18s, padding 0.35s ease 0.08s;
  }

  /* Top bar accent */
  .product-card::before,
  .product-card.active::before { transition: transform 0.4s ease 0.2s; }

  .products-section { padding: 56px 24px; }

  /* Modal */
  .modal-card { padding: 32px 24px; }
  .products-checklist { grid-template-columns: 1fr; }
}


/* ---- Mobile (≤ 480px) ---- */
@media (max-width: 480px) {
  :root { --section-v: 56px; }

  .container { padding: 0 20px; }

  .services-grid { grid-template-columns: 1fr; gap: 1px; }

  .promo-btns { flex-direction: column; align-items: center; }
  .promo-btns .btn { width: 220px; justify-content: center; }

  .client-logos { gap: 16px; }
  .client-logo { width: 140px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand-col { grid-column: auto; }

  .nav-container { padding: 0 20px; }
  .nav-logo { font-size: 17px; }

  .page-hero h1 { letter-spacing: -1px; }

  /* Stats row: wrap on very narrow phones so labels don't overflow */
  .company-stats { flex-wrap: wrap; row-gap: 24px; }

  /* Modal form: single column */
  .modal-form .form-grid { grid-template-columns: 1fr; }
}
