/* ============================================================
   AERTSEN LIVING — responsive.css  v2
   Master responsive file — loaded on EVERY page
   Breakpoints: 1200 · 1024 · 900 · 768 · 600 · 480
   Load LAST in <head>, after all other CSS files
============================================================ */

/* ── BASE SAFETY ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; display: block; }

/* ── VIEWPORT 1200px — large tablet ──────────────────────── */
@media (max-width: 1200px) {
  .header-container { padding: 0 28px; }
  .container        { padding: 0 28px !important; }
  .hero-text        { padding-left: 48px; }
  .testimonial-card { min-width: 360px; }
}

/* ── VIEWPORT 1024px — tablet ─────────────────────────────── */
@media (max-width: 1024px) {
  /* Layout */
  .container        { padding: 0 24px !important; }
  .section-pad      { padding: 80px 0; }
  .section-pad-sm   { padding: 56px 0; }

  /* Hero */
  .hero-text        { padding-left: 36px; padding-right: 36px; max-width: 100%; }
  .hero-stats       { display: none; }
  .hero-scroll      { display: none; }
  .hero-title       { font-size: clamp(2.4rem, 5vw, 4.5rem); }

  /* Grids → 2 col */
  .grid-3           { grid-template-columns: repeat(2,1fr) !important; }
  .grid-4           { grid-template-columns: repeat(2,1fr) !important; }
  .why-grid         { grid-template-columns: repeat(2,1fr) !important; }
  .counter-grid     { grid-template-columns: repeat(2,1fr) !important; }
  .process-steps    { grid-template-columns: repeat(2,1fr) !important; gap: 40px; }
  .process-steps::before { display: none; }
  .services-grid    { grid-template-columns: repeat(2,1fr) !important; }
  .footer-grid      { grid-template-columns: 1fr 1fr !important; gap: 40px; }

  /* Masonry */
  .projects-masonry { columns: 2 !important; }

  /* Factory */
  .factory-inner    { gap: 48px; }
  .factory-img-wrap { height: 380px; }

  /* AI teaser */
  .ai-inner         { gap: 40px; }
  .ai-visual        { height: 400px; }

  /* Service pages */
  .service-intro-grid  { grid-template-columns: 1fr !important; }
  .options-grid        { grid-template-columns: repeat(2,1fr) !important; }
  .benefits-grid       { grid-template-columns: repeat(2,1fr) !important; }
  .materials-grid      { grid-template-columns: repeat(2,1fr) !important; }
  .related-grid        { grid-template-columns: repeat(2,1fr) !important; }
  .consult-inner       { grid-template-columns: 1fr !important; }
  .service-hero-right  { display: none; }

  /* Content pages */
  .posts-grid          { grid-template-columns: repeat(2,1fr) !important; }
  .featured-post-card  { grid-template-columns: 1fr !important; }
  .post-layout         { grid-template-columns: 1fr !important; }
  .post-sidebar        { position: static !important; }

  /* Section header flex */
  .section-title-area  { flex-direction: column; align-items: flex-start; gap: 20px; }
}

/* ── VIEWPORT 900px — between tablet/mobile ───────────────── */
@media (max-width: 900px) {
  /* Homepage inline grids */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* About page grids */
  .about-grid        { grid-template-columns: 1fr !important; }
  .about-stats-row   { grid-template-columns: repeat(2,1fr) !important; }

  /* Contact */
  .contact-grid      { grid-template-columns: 1fr !important; gap: 28px !important; }

  /* Careers */
  .spontaneous-card  { flex-direction: column !important; }
  .newsletter-card   { flex-direction: column !important; }
  .nlc-form          { width: 100% !important; flex-direction: column !important; }
  .nlc-form input    { width: 100% !important; }
  .post-layout       { grid-template-columns: 1fr !important; }
}

/* ── VIEWPORT 768px — mobile ──────────────────────────────── */
@media (max-width: 768px) {
  /* Safety */
  body              { overflow-x: hidden; }

  /* Container */
  .container        { padding: 0 18px !important; }
  .section-pad      { padding: 60px 0; }
  .section-pad-sm   { padding: 44px 0; }

  /* Hero */
  .hero-section     { height: 100svh; min-height: 560px; }
  .hero-content     { padding-bottom: 80px; }
  .hero-text        { padding: 0 18px; max-width: 100%; }
  .hero-title       { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-sub         { font-size: .88rem; max-width: 100%; }
  .hero-nav         { left: 18px; bottom: 24px; }
  .hero-actions     { gap: 10px; flex-wrap: wrap; }
  .btn-hero-primary,
  .btn-hero-outline { padding: 12px 22px; font-size: .76rem; }

  /* All multi-col grids → 1 col */
  .grid-2           { grid-template-columns: 1fr !important; gap: 32px !important; }
  .grid-3           { grid-template-columns: 1fr !important; }
  .grid-4           { grid-template-columns: repeat(2,1fr) !important; }
  .why-grid         { grid-template-columns: 1fr !important; }
  .why-card         { padding: 32px 22px; }
  .process-steps    { grid-template-columns: 1fr !important; gap: 24px; }
  .services-grid    { grid-template-columns: 1fr !important; }
  .service-card     { padding: 28px 22px; }

  /* Masonry → single col */
  .projects-masonry { columns: 1 !important; }

  /* Counters */
  .counter-grid     { grid-template-columns: repeat(2,1fr) !important; }
  .counter-item     { padding: 32px 14px; border-right: none !important; border-bottom: 1px solid rgba(255,255,255,.07); }

  /* Testimonials — scroll-snap on mobile */
  .testimonials-slider { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .testimonial-card  { min-width: min(85vw, 300px); max-width: 85vw; padding: 26px; scroll-snap-align: start; }
  .testimonial-text  { font-size: .92rem; }
  .testimonials-track { transform: none !important; } /* disable JS transform on mobile — use native scroll */

  /* Factory */
  .factory-inner     { grid-template-columns: 1fr !important; gap: 28px; }
  .factory-img-wrap  { height: 260px; }
  .factory-features  { grid-template-columns: 1fr !important; gap: 14px; }

  /* AI teaser */
  .ai-inner          { grid-template-columns: 1fr !important; gap: 28px; }
  .ai-visual         { height: 280px; }
  .ai-chip           { padding: 12px 16px; }
  .ai-chip-val       { font-size: 1.1rem; }

  /* Footer */
  .footer-grid         { grid-template-columns: 1fr !important; gap: 28px; }
  .footer-cta-inner    { flex-direction: column !important; align-items: flex-start; gap: 20px; }
  .footer-cta-strip    { padding: 44px 0; }
  .footer-main         { padding: 44px 18px 0; }
  .footer-bottom       { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-legal        { flex-wrap: wrap; gap: 12px; }
  .footer-cta-text h3  { font-size: 1.5rem; }
  .btn-call            { display: none; }

  /* Modal */
  .modal-content       { grid-template-columns: 1fr !important; }
  .modal-left          { display: none !important; }
  .modal-right         { padding: 28px 22px; }
  .modal-box           { margin: 12px; border-radius: 20px; }

  /* Service pages */
  .service-hero        { height: 68vh; min-height: 440px; }
  .service-intro-img   { height: 260px !important; }
  .options-grid        { grid-template-columns: 1fr !important; }
  .benefits-grid       { grid-template-columns: 1fr !important; }
  .materials-grid      { grid-template-columns: repeat(2,1fr) !important; }
  .related-grid        { grid-template-columns: 1fr !important; }
  .form-row            { grid-template-columns: 1fr !important; }
  .consult-form        { padding: 26px 18px !important; }
  .service-hero-content h1 { font-size: clamp(1.8rem, 6vw, 3rem); }

  /* Content pages — blog / projects / careers */
  .content-hero        { padding: 100px 0 56px; }
  .ch-title            { font-size: clamp(26px, 7vw, 44px); }
  .ch-sub              { font-size: .88rem; max-width: 100%; }
  .fp-image            { min-height: 220px; }
  .fp-body             { padding: 24px 22px; }
  .fp-title            { font-size: 20px; }
  .posts-grid          { grid-template-columns: 1fr !important; }
  .post-hero           { min-height: 320px; padding-top: 76px; padding-bottom: 32px; }
  .post-title          { font-size: clamp(22px, 5vw, 36px); }
  .post-sidebar        { position: static !important; }

  /* About page inline grid override */
  .about-section-grid,
  [class*="grid-2"] { grid-template-columns: 1fr !important; }
  .about-stats-row   { grid-template-columns: repeat(2,1fr) !important; }
  .about-process-grid { grid-template-columns: repeat(2,1fr) !important; }

  /* Services page */
  .services-card-grid  { grid-template-columns: repeat(2,1fr) !important; }

  /* Contact */
  .contact-grid        { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Careers */
  .jc-header           { flex-wrap: wrap; gap: 10px; }
  .spontaneous-card,
  .newsletter-card     { flex-direction: column !important; padding: 28px 22px !important; }
  .nlc-form            { width: 100% !important; flex-direction: column !important; }

  /* Final CTA */
  .final-cta           { padding: 72px 0; }
  .final-cta h2        { font-size: clamp(1.8rem, 5vw, 2.8rem); }
  .final-cta-btns      { flex-direction: column; align-items: center; gap: 12px; }
  .final-cta-btns a,
  .final-cta-btns button { width: 100%; max-width: 300px; text-align: center; justify-content: center; }

  /* Misc */
  .section-header      { margin-bottom: 32px; }
  .label-tag           { font-size: .68rem; }

  /* Overflow */
  .marquee-strip,
  .testimonials-slider,
  .testimonials-track  { overflow: hidden; }

  /* Table safety */
  table                { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── VIEWPORT 600px — small mobile ───────────────────────── */
@media (max-width: 600px) {
  .container           { padding: 0 14px !important; }

  /* Hero */
  .hero-title          { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  .hero-sub            { font-size: .82rem; }

  /* Grid-4 → 1 col */
  .grid-4              { grid-template-columns: 1fr !important; }

  /* Counters — keep 2 col */
  .counter-grid        { grid-template-columns: 1fr 1fr !important; }
  .counter-item        { padding: 26px 12px; }
  .counter-num         { font-size: clamp(2rem, 8vw, 3rem); }

  /* Services card grid → 1 col */
  .services-card-grid  { grid-template-columns: 1fr !important; }

  /* About process → 1 col */
  .about-process-grid  { grid-template-columns: 1fr !important; }

  /* Service pages */
  .service-hero        { height: 62vh; min-height: 380px; }
  .materials-grid      { grid-template-columns: 1fr !important; }

  /* Modal slides up from bottom */
  .modal-overlay       { padding: 0; align-items: flex-end; }
  .modal-box           { margin: 0; border-radius: 24px 24px 0 0; max-height: 92svh; overflow-y: auto; }

  /* Content pages */
  .content-hero        { padding: 86px 0 44px; }
  .ch-title            { font-size: clamp(22px, 8vw, 34px); }
  .hero-stats          { flex-direction: column; gap: 10px; padding: 18px 22px; border-radius: 14px; }
  .hs-div              { width: 56px; height: 1px; }

  /* Blog */
  .post-article .post-lead { font-size: 15px; }
  .post-body           { font-size: 14px; }

  /* Careers */
  .jc-tags             { gap: 4px; }
  .jc-tag              { font-size: 10px; padding: 2px 8px; }
  .jc-apply            { flex-direction: column; }
  .btn-apply           { width: 100%; text-align: center; }

  /* Footer */
  .footer-cta-text h3  { font-size: 1.3rem; }
  .footer-cta-strip    { padding: 36px 0; }

  /* Buttons */
  .btn-primary-dark    { padding: 13px 22px; }
  .btn-consult         { padding: 9px 14px; font-size: .72rem; }

  /* Form inputs — prevent iOS zoom */
  input, select, textarea { font-size: 16px !important; }

  /* Filter bar — horizontal scroll */
  .filter-bar          { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .fcat                { flex-shrink: 0; font-size: 12px; padding: 6px 14px; }

  /* Pagination */
  .pagination-bar      { gap: 5px; margin-top: 28px; }
  .pag-btn             { width: 32px; height: 32px; font-size: 12px; }

  /* WhatsApp float — smaller */
  .whatsapp-float      { width: 52px; height: 52px; bottom: 18px; right: 18px; }
}

/* ── VIEWPORT 480px — very small phones ──────────────────── */
@media (max-width: 480px) {
  .container           { padding: 0 12px !important; }

  /* Hero — stack everything */
  .hero-content        { padding-bottom: 72px; align-items: flex-end; }
  .hero-text           { padding: 0 12px; }
  .hero-title          { font-size: clamp(1.7rem, 10vw, 2.4rem); }
  .hero-sub            { display: none; }
  .hero-actions        { flex-direction: column; gap: 8px; }
  .btn-hero-primary,
  .btn-hero-outline    { width: 100%; text-align: center; justify-content: center; padding: 13px 18px; }

  /* Header — tighten */
  .header-container    { padding: 0 14px; gap: 12px; }
  .header-cta a:first-child { display: none; } /* hide phone number, keep button */

  /* Why grid force 1 col */
  .why-grid            { grid-template-columns: 1fr !important; }

  /* Service hero */
  .service-hero        { height: 58vh; }
  .service-hero-content h1 { font-size: clamp(1.5rem, 8vw, 2.4rem); }

  /* Post */
  .post-title          { font-size: clamp(20px, 6vw, 28px); }
  .post-hero           { min-height: 280px; padding-top: 72px; }

  /* Testimonials */
  .testimonial-card    { min-width: 240px; padding: 20px; }
  .testimonial-text    { font-size: .86rem; }

  /* Footer */
  .footer-socials a    { width: 30px; height: 30px; }

  /* Careers job cards */
  .job-card            { border-radius: 10px; }
  .jc-header           { padding: 14px; }
  .jc-title            { font-size: 14px; }

  /* Contact info cards */
  .contact-info-card   { padding: 12px; }
}

/* ── LANDSCAPE MOBILE ─────────────────────────────────────── */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 520px) {
  .hero-section        { height: 100svh; min-height: 340px; }
  .hero-content        { padding: 90px 0 50px; align-items: center; }
  .hero-title          { font-size: clamp(1.5rem, 5vw, 2.2rem); }
}

/* ── INLINE STYLE OVERRIDES ───────────────────────────────── */
/* Catch any remaining inline style="grid-template-columns:..." that break on mobile */
@media (max-width: 768px) {
  /* about.php hero grid */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* about stats — keep 2col */
  [style*="grid-template-columns:1fr 1fr"][style*="gap:16px"],
  [style*="grid-template-columns: 1fr 1fr"][style*="gap: 16px"] {
    grid-template-columns: 1fr 1fr !important;
  }
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2,1fr) !important;
  }
  /* Contact form inner row */
  [style*="grid-template-columns:1fr 1fr"][style*="gap:12px"] {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* Keep 2-col stats grid */
  [style*="gap:16px"][style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── PRINT ────────────────────────────────────────────────── */
@media print {
  #site-header, .whatsapp-float, #consultModal,
  .mobile-menu, .mobile-overlay, .hero-nav,
  .hero-scroll, .footer-cta-strip { display: none !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
}