/* Responsive — Mobile first — Excavaciones BCN */
/* Breakpoints: 375px | 480px | 768px | 1024px | 1280px | 1920px */

/* ── 1920px+ ── */
@media (min-width: 1920px) {
  .container { max-width: 1600px; }
  html { font-size: 18px; }
}

/* ── 1280px+ ── */
@media (min-width: 1280px) {
  .container { padding-inline: var(--space-12); }
}

/* ── 1024px+ (desktop nav) ── */
@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .nav-cta    { display: flex; }
}

/* ═══════════════════════════════════════════════════
   < 1280px — Tablet grande / pantallas medias
═══════════════════════════════════════════════════ */
@media (max-width: 1279px) {
  /* Hero: columna única, stats visibles horizontalmente */
  .hero-inner           { grid-template-columns: 1fr; gap: var(--space-10); }
  .hero-right           { display: block; }
  .hero-right .hero-badge { display: none; }
  .hero-stats-card      { grid-template-columns: repeat(4, 1fr); gap: var(--space-5); padding: var(--space-6); }

  /* Blog: 2 col */
  .blog-grid            { grid-template-columns: 1fr 1fr; }
  .blog-card-featured   { grid-column: span 2; }

  /* Footer: 2 col */
  .footer-top           { grid-template-columns: 1fr 1fr; gap: var(--space-10); }
  .footer-brand         { grid-column: span 2; }

  /* Stats: 2 col */
  .stats-grid           { grid-template-columns: repeat(2, 1fr); }
  .stats-grid .stat-item:nth-child(2) { border-right: none; }
}

/* ═══════════════════════════════════════════════════
   < 1024px — Tablet
═══════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  :root { --navbar-height: 64px; }

  /* Nav */
  .nav-links                          { display: none; }
  .nav-cta .btn:not(.nav-cta-primary) { display: none; }
  .nav-toggle                         { display: flex; }

  /* Two-col → one col */
  .two-col,
  .two-col-60-40,
  .two-col-40-60 { grid-template-columns: 1fr; gap: var(--space-10); }
  .two-col-reverse > *:first-child { order: unset; }

  /* Grids */
  .grid-2           { grid-template-columns: 1fr; }
  .grid-4           { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid   { grid-template-columns: repeat(2, 1fr); }
  .portfolio-item:nth-child(1) { grid-column: span 2; }
  .process-grid     { grid-template-columns: repeat(2, 1fr); }
  .process-grid::before { display: none; }

  /* About visual: landscape ratio cuando está apilada */
  .about-visual { aspect-ratio: 16/9; }

  /* Sidebar sticky → static (service pages) */
  [style*="position:sticky"]  { position: static !important; top: auto !important; }
  [style*="position: sticky"] { position: static !important; top: auto !important; }

  /* Service hero background image lateral — ocultarlo en tablet */
  [style*="width:45%"][style*="background-image"] { display: none !important; }
}

/* ═══════════════════════════════════════════════════
   < 768px — Móvil
═══════════════════════════════════════════════════ */
@media (max-width: 767px) {
  html { font-size: 15px; }
  .container    { padding-inline: var(--space-5); }
  .section      { padding-block: var(--space-16); }
  .section-sm   { padding-block: var(--space-12); }
  .section-lg   { padding-block: var(--space-16); }

  /* Tipografía */
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }

  .hero-title { font-size: clamp(2.4rem, 10vw, 3.5rem); }

  .section-header h2,
  .section-header-center h2 { font-size: var(--text-3xl); }
  .section-header-center p  { font-size: var(--text-base); }

  /* ─── Hero stats: 2×2 ─── */
  .hero-stats-card { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); padding: var(--space-4); }
  .hero-stats-card .stat-number { font-size: var(--text-3xl); }
  .hero-stats-card .stat-label  { font-size: var(--text-xs); letter-spacing: 0.04em; }

  /* ─── Social proof: no cramped ─── */
  .hero-social-proof { flex-wrap: wrap; gap: var(--space-3); }
  .hero-proof-text   { font-size: var(--text-xs); }

  /* ─── About visual: cuadrado ─── */
  .about-visual { aspect-ratio: 4/3; }
  .about-badge-overlay { padding: var(--space-3) var(--space-4); gap: var(--space-2); }
  .about-badge-overlay .stat-number { font-size: var(--text-2xl); }

  /* ─── Stats section ─── */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-number { font-size: var(--text-4xl); }
  .stats-grid .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-5);
  }
  .stats-grid .stat-item:nth-last-child(-n+2) { border-bottom: none; }

  /* ─── Grids ─── */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr; }

  /* ─── Blog ─── */
  .blog-grid          { grid-template-columns: 1fr; }
  .blog-card-featured { grid-column: auto; }

  /* ─── Portfolio ─── */
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-item:nth-child(1) { grid-column: span 1; aspect-ratio: 4/3; }

  /* ─── Footer ─── */
  .footer-top    { grid-template-columns: 1fr; }
  .footer-brand  { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-legal  { flex-wrap: wrap; gap: var(--space-3); }

  /* ─── CTA section ─── */
  .cta-section { padding: var(--space-10) var(--space-5); }
  .cta-section h2 { font-size: var(--text-3xl); }
  .cta-section p  { font-size: var(--text-base); margin-bottom: var(--space-8); }
  .cta-section .btn-group { flex-direction: column; }
  .cta-section .btn-group .btn { width: 100%; justify-content: center; }

  /* ─── Botones hero ─── */
  .hero-ctas     { flex-direction: column; }
  .hero-ctas .btn { width: 100%; justify-content: center; }

  /* ─── Testimonios ─── */
  .testimonials-grid { grid-template-columns: 1fr; }
  .testimonial { padding: var(--space-6); }
  .testimonial__quote { font-size: var(--text-base); }

  /* ─── Marquee ─── */
  .marquee-wrapper::before,
  .marquee-wrapper::after { width: 40px; }
  .marquee-item { font-size: var(--text-base); }

  /* ─── Service/blog pages: imágenes destacadas ─── */
  img[style*="height:500px"],
  img[style*="height: 500px"],
  img[style*="height:520px"],
  img[style*="height: 520px"] { height: 240px !important; }

  /* ─── Service page hero bg image ─── */
  [style*="width:45%"][style*="background-image"]  { display: none !important; }
  [style*="width: 45%"][style*="background-image"] { display: none !important; }

  /* ─── Page hero ─── */
  .page-hero { padding-top: calc(var(--navbar-height) + var(--space-12)); padding-bottom: var(--space-12); }

  /* ─── Hero: espacio para el scroll indicator ─── */
  #hero { padding-bottom: 110px; }

  /* ─── Accordion ─── */
  .accordion-trigger { font-size: var(--text-lg); }

  /* ─── Card service ─── */
  .card-service { padding: var(--space-6); }
}

/* ═══════════════════════════════════════════════════
   < 480px — Móvil pequeño
═══════════════════════════════════════════════════ */
@media (max-width: 479px) {
  .hero-stats-card { grid-template-columns: repeat(2, 1fr); }
  .hero-stats-card .stat-number { font-size: var(--text-2xl); }

  .grid-4 { grid-template-columns: 1fr; }

  /* CTA btns: apilados */
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; justify-content: center; }

  /* About badge overlay: más compacto */
  .about-badge-overlay { font-size: 0.8em; }
}

/* ═══════════════════════════════════════════════════
   < 375px — Móvil muy pequeño
═══════════════════════════════════════════════════ */
@media (max-width: 374px) {
  .container { padding-inline: var(--space-4); }
  .btn        { padding: 12px 18px; }
  .btn-lg     { padding: 14px 22px; }
  .hero-title { font-size: 2.2rem; }
}

/* ═══════════════════════════════════════════════════
   Landscape + móvil
═══════════════════════════════════════════════════ */
@media (max-width: 768px) and (orientation: landscape) {
  #hero {
    min-height: auto;
    padding-top: calc(var(--navbar-height) + var(--space-6));
    padding-bottom: var(--space-6);
  }
  .hero-title { font-size: clamp(1.8rem, 6vw, 2.5rem); }
}
