/* ═══════════════════════════════════════════════════════════
   SEAHOME — MOBILE-FIRST OPTIMIZATION 2026
   Targets: 375px (iPhone SE) · 390px (iPhone 14) · 430px (iPhone 14 Pro Max)
   ═══════════════════════════════════════════════════════════ */

/* ── BASE MOBILE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 15px; -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  .container { padding: 0 1rem !important; max-width: 100%; }
  .section { padding: 3rem 0 !important; }
  .section-label { font-size: 0.7rem; letter-spacing: 0.15em; }
  .section-heading { font-size: clamp(1.6rem, 6vw, 2.2rem) !important; line-height: 1.25 !important; }
  .section-intro { margin-bottom: 1.5rem; }
  .section-intro p { font-size: 0.9rem; line-height: 1.7; }
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-container { padding: 0 1rem !important; height: 60px !important; }
  .brand-name { font-size: 1.1rem; }
  .nav-burger { display: flex !important; margin-left: auto; }
  .nav-cta { display: none !important; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: 60px 0 0 !important;
    background: rgba(4, 28, 44, 0.98);
    backdrop-filter: blur(16px);
    padding: 1.5rem 1.25rem !important;
    gap: 0 !important;
    z-index: 999;
    overflow-y: auto;
  }
  .nav-links.open .nav-item {
    font-size: 1.05rem !important;
    padding: 0.9rem 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.9);
  }
  .nav-links.open .nav-item:last-child { border-bottom: none; }
}

/* ── HERO ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { min-height: 100svh; }
  .hero-body { padding: 80px 1rem 1.5rem !important; }
  .hero-eyebrow { font-size: 0.65rem; margin-bottom: 0.75rem; }
  .eyebrow-line { width: 24px; }
  .hero-headline {
    font-size: clamp(2rem, 9vw, 2.8rem) !important;
    line-height: 1.15 !important;
    margin-bottom: 0.75rem;
    max-width: 100%;
  }
  .hero-sub {
    font-size: 0.875rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
    max-width: 100%;
  }
  .hero-actions {
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100%;
    margin-bottom: 1.5rem;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.9rem 1.25rem !important;
    font-size: 0.95rem !important;
    min-height: 48px;
    border-radius: 0.5rem;
  }
  /* Stats bar — 2x2 grid */
  .hero-metrics {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0 !important;
    padding: 0 !important;
    width: calc(100% - 2rem) !important;
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
  }
  .metric {
    padding: 0.875rem 0.5rem !important;
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
  }
  .metric:nth-child(2n) { border-right: none; }
  .metric:nth-child(3),
  .metric:nth-child(4) { border-bottom: none; }
  .metric-divider { display: none !important; }
  .metric-val { font-size: 1.5rem !important; }
  .metric-unit { font-size: 0.7rem; }
  .metric-label { font-size: 0.65rem; margin-top: 2px; }
  .hero-scroll { bottom: 0.75rem; }
}

@media (max-width: 390px) {
  .hero-headline { font-size: clamp(1.75rem, 8vw, 2.4rem) !important; }
  .metric-val { font-size: 1.3rem !important; }
  .hero-body { padding: 72px 0.875rem 1.25rem !important; }
}

/* ── ABOUT ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr !important; gap: 2rem; }
  .about-visual { order: -1; border-radius: 0.75rem; overflow: hidden; }
  .about-features { grid-template-columns: 1fr !important; gap: 0.75rem; }
  .feature-item {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 0.5rem;
  }
  .feature-icon { font-size: 1.5rem; flex-shrink: 0; }
  .feature-title { font-size: 0.95rem; margin-bottom: 0.25rem; }
  .feature-desc { font-size: 0.85rem; }
}

/* ── SERVICES ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .services-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .service-card { padding: 1.5rem 1.25rem; border-radius: 0.75rem; }
  .service-num { font-size: 2rem; }
  .service-title { font-size: 1.1rem; }
  .service-desc { font-size: 0.875rem; }
  .service-spec { font-size: 0.8rem; }
  .service-cta { padding: 0.7rem 1.25rem; font-size: 0.875rem; min-height: 44px; display: inline-flex; align-items: center; }
}

/* ── TECHNICAL / RAS ────────────────────────────────────────── */
@media (max-width: 768px) {
  .tech-block--wide { padding: 1.5rem 1rem !important; border-radius: 0.75rem; }
  /* RAS flow — vertical */
  .ras-flow {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
  .ras-flow-step {
    min-width: unset !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem;
    text-align: left !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .ras-flow-arrow { display: none !important; }
  /* Params grid — 2 cols */
  .params-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem; }
  .param-card { padding: 1rem; border-radius: 0.5rem; }
  .param-value { font-size: 1.3rem !important; }
  .param-label { font-size: 0.72rem; }
  /* Compare table — horizontal scroll */
  .compare-table-wrap,
  .tech-compare-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
    border-radius: 0;
  }
  .compare-table-wrap table,
  .tech-compare-wrapper table { min-width: 560px; font-size: 0.8rem; }
  .tech-note { font-size: 0.8rem; padding: 0.75rem 1rem; }
}

/* ── MATERIALS ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .materials-pioneer-banner {
    flex-direction: column !important;
    text-align: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border-radius: 0.75rem;
  }
  .pioneer-badge { font-size: 0.65rem; padding: 0.3rem 0.75rem; }
  .pioneer-text { font-size: 0.85rem; }
  /* RAS flow bar */
  .ras-flow-bar {
    flex-direction: column !important;
    gap: 0.25rem;
    padding: 1rem;
  }
  /* Cards — single column */
  .mat-cards-row,
  .mat-cards-row--3col { grid-template-columns: 1fr !important; gap: 1rem; }
  .mat-card { border-radius: 0.75rem; overflow: hidden; }
  .mat-card-img { height: 200px; object-fit: cover; width: 100%; display: block; }
  .mat-card-body { padding: 1rem; }
  .mat-card-title { font-size: 1rem; }
  .mat-card-desc { font-size: 0.85rem; }
  /* Stats bar — 2x2 */
  .materials-stats-bar {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
    padding: 1.25rem 1rem !important;
  }
  .mat-stat-divider { display: none !important; }
  .mat-stat-num { font-size: 1.5rem !important; }
  .mat-stat-label { font-size: 0.72rem; }
}

/* ── GALLERY / PROJECTS ─────────────────────────────────────── */
@media (max-width: 768px) {
  .projects-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .filter-btn { font-size: 0.8rem; padding: 0.45rem 0.9rem; border-radius: 2rem; white-space: nowrap; min-height: 36px; }
  .gallery-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .gallery-item--lg { grid-column: span 1 !important; }
  .gallery-item { border-radius: 0.75rem; overflow: hidden; }
  /* Always show overlay on mobile */
  .gallery-overlay {
    opacity: 1 !important;
    background: linear-gradient(to top, rgba(4,28,44,0.85) 0%, transparent 65%) !important;
  }
  .gallery-title { font-size: 0.95rem; }
  .gallery-meta { font-size: 0.8rem; }
  .gallery-tags { flex-wrap: wrap; gap: 0.35rem; }
  .gallery-tag { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
}

/* ── BLUEPRINTS ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Tab buttons */
  .bp-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.5rem;
  }
  .bp-tab-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
    border-radius: 2rem;
    white-space: nowrap;
    min-height: 40px;
  }
  /* Cards grid */
  .bp-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .bp-card--large { grid-column: span 1 !important; }
  .bp-card { border-radius: 0.75rem; overflow: hidden; }
  .bp-card-img { height: 200px; object-fit: cover; width: 100%; display: block; }
  .bp-card-body { padding: 1rem; }
  .bp-card-title { font-size: 0.95rem; }
  .bp-card-desc { font-size: 0.82rem; line-height: 1.55; }
  .bp-card-tags { gap: 0.35rem; flex-wrap: wrap; }
  .bp-card-tag { font-size: 0.72rem; padding: 0.25rem 0.6rem; }
  /* Visit grid */
  .visit-grid { grid-template-columns: 1fr !important; gap: 0.75rem; }
  .visit-card { padding: 1rem; border-radius: 0.75rem; }
  .visit-name { font-size: 0.95rem; }
  .visit-address { font-size: 0.82rem; }
  .visit-cta { font-size: 0.8rem; min-height: 36px; }
}

/* ── FAQ ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Stats */
  .faq-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem; }
  .faq-stat-card { padding: 1rem; border-radius: 0.75rem; }
  .faq-stat-num { font-size: 1.6rem !important; }
  .faq-stat-label { font-size: 0.72rem; }
  /* Compare */
  .faq-compare-row { grid-template-columns: 1fr !important; gap: 0.75rem; }
  .faq-compare-col { padding: 1rem; border-radius: 0.75rem; }
  .faq-compare-title { font-size: 0.9rem; }
  .faq-compare-list li { font-size: 0.82rem; }
  /* Table scroll */
  .faq-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
  }
  .faq-table { min-width: 500px; font-size: 0.8rem; }
  /* SLA grid */
  .faq-sla-grid { grid-template-columns: 1fr !important; gap: 0.75rem; }
  .faq-sla-item { padding: 0.875rem; border-radius: 0.5rem; }
  .faq-sla-time { font-size: 1.5rem !important; }
  /* CTA */
  .faq-cta { padding: 1.5rem 1rem; border-radius: 0.75rem; }
  .faq-cta .btn {
    display: block !important;
    width: 100% !important;
    text-align: center;
    margin: 0.4rem 0 !important;
    min-height: 48px;
    line-height: 48px;
    padding: 0 1rem !important;
  }
  /* Accordion */
  .faq-item { border-radius: 0.5rem; overflow: hidden; }
  .faq-question { font-size: 0.9rem; padding: 1rem !important; min-height: 44px; }
  .faq-answer { font-size: 0.85rem; padding: 0 1rem 1rem !important; line-height: 1.65; }
}

/* ── PRICING ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .pricing-card { padding: 1.5rem 1.25rem; border-radius: 0.75rem; }
  .pricing-card--featured { transform: none !important; border: 2px solid var(--accent); }
  .pricing-name { font-size: 1.1rem; }
  .pricing-price { font-size: 1.6rem !important; }
  .pricing-features li { font-size: 0.85rem; }
  .pricing-cta { padding: 0.8rem 1.25rem; font-size: 0.9rem; min-height: 48px; width: 100%; display: flex; align-items: center; justify-content: center; }
}

/* ── CONTACT ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr !important; gap: 2rem; }
  .contact-title { font-size: 1.4rem; }
  .contact-item { font-size: 0.875rem; }
  .form-group label { font-size: 0.875rem; }
  /* font-size 16px prevents iOS auto-zoom */
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
  }
  .form-row { grid-template-columns: 1fr !important; }
  .btn-submit {
    width: 100% !important;
    padding: 1rem !important;
    font-size: 1rem;
    border-radius: 0.5rem;
    min-height: 52px;
  }
}

/* ── FOOTER ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 2rem; }
  .footer-logo { font-size: 1.1rem; }
  .footer-tagline { font-size: 0.85rem; }
  .footer-col-title { font-size: 0.8rem; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
  .footer-links { gap: 0.5rem; }
  .footer-link { font-size: 0.875rem; min-height: 36px; display: flex; align-items: center; }
  .footer-bottom-inner { flex-direction: column !important; text-align: center; gap: 0.5rem; font-size: 0.8rem; }
  .footer-social { gap: 0.75rem; }
  .social-link { width: 36px; height: 36px; font-size: 0.8rem; min-height: 36px; }
}

/* ── FLOATING CTA ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .floating-cta { right: 0.75rem !important; bottom: 1rem !important; gap: 0.5rem !important; }
  .float-zalo { width: 44px !important; height: 44px !important; border-radius: 50% !important; font-size: 1rem; }
  .float-quote,
  .float-phone {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    font-size: 1rem;
  }
  .float-quote span,
  .float-phone span { display: none !important; }
}

/* ── PROCESS ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .process-step { grid-template-columns: 56px 1fr !important; gap: 0.75rem; padding-bottom: 1.5rem; }
  .step-num { width: 40px !important; height: 40px !important; font-size: 0.875rem; }
  .step-title { font-size: 1rem; }
  .step-desc { font-size: 0.85rem; }
}

/* ── TESTIMONIALS ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .testimonials-track { grid-template-columns: 1fr !important; gap: 1rem; }
  .testimonial-card { padding: 1.25rem; border-radius: 0.75rem; }
  .testimonial-text { font-size: 0.875rem; line-height: 1.65; }
  .testimonial-author { font-size: 0.875rem; }
}

/* ── TOUCH TARGETS (min 44px) ───────────────────────────────── */
@media (max-width: 768px) {
  a, button, [role="button"] { -webkit-tap-highlight-color: transparent; }
  .btn, .btn-primary, .btn-ghost, .btn-submit,
  .filter-btn, .bp-tab-btn, .faq-question,
  .service-cta, .pricing-cta { min-height: 44px; }
}

/* ── HOVER: Disable on touch ────────────────────────────────── */
@media (hover: none) and (max-width: 768px) {
  .service-card:hover { transform: none !important; box-shadow: var(--shadow-md) !important; }
  .bp-card:hover { transform: none !important; }
  .gallery-item:hover .gallery-overlay { opacity: 1 !important; }
  .btn-primary:hover { transform: none !important; }
  .pricing-card:hover { transform: none !important; }
}

/* ── SAFE AREA (iPhone notch / home bar) ────────────────────── */
@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    .nav-container {
      padding-left: max(1rem, env(safe-area-inset-left)) !important;
      padding-right: max(1rem, env(safe-area-inset-right)) !important;
    }
    .floating-cta {
      bottom: max(1rem, env(safe-area-inset-bottom)) !important;
      right: max(0.75rem, env(safe-area-inset-right)) !important;
    }
    footer { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
  }
}

/* ── 480px BREAKPOINT ───────────────────────────────────────── */
@media (max-width: 480px) {
  .section-heading { font-size: clamp(1.4rem, 5.5vw, 1.9rem) !important; }
  .section-intro p { font-size: 0.875rem; }
  .container { padding: 0 0.875rem !important; }
  .gallery-grid { grid-template-columns: 1fr !important; }
  .gallery-item--lg { grid-column: span 1 !important; }
}
