/* ============================================================
   RESPONSIVE CSS — ALIWEN MUNDO RÚSTICO
   Global Responsive Gutters System & Viewport Adaptation
   Breakpoints: 360 / 375 / 390 / 393 / 414 / 430 / 768 / 820 / 834 / 1024 / 1440 / 1920
   ============================================================ */

/* ============================================================
   1920px+ — Extra Wide Screens
   ============================================================ */
@media (min-width: 1920px) {
  :root {
    --header-height: 130px;
    --page-gutter: 48px;
  }

  .container {
    max-width: 1600px;
  }

  .hero-title {
    /* En pantallas muy grandes el héroe puede ir un poco mayor */
    font-size: 7rem;
  }

  .logo-img {
    width: 185px;
    max-width: 185px;
  }

  .header-inner {
    min-height: 96px;
  }
}

/* ============================================================
   1440px – 1919px — Large Desktop
   ============================================================ */
@media (min-width: 1440px) and (max-width: 1919px) {
  :root {
    --header-height: 125px;
    --page-gutter: 40px;
  }

  .logo-img {
    width: 178px;
    max-width: 178px;
  }

  .header-inner {
    min-height: 90px;
  }

  .galeria-grid {
    grid-auto-rows: 65px;
  }
}

/* ============================================================
   1025px – 1439px — Desktop Standard
   ============================================================ */
@media (min-width: 1025px) and (max-width: 1439px) {
  :root {
    --page-gutter: 32px;
  }
}

/* ============================================================
   MAX 1280px — Small Desktop / Landscape Tablets
   ============================================================ */
@media (max-width: 1280px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }

  .tipos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   768px – 1024px — TABLETS (Portrait & Landscape)
   (Includes iPad 768px, 820px, 834px, 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --header-height: 105px;
    --page-gutter: 40px;
    --space-32: 6rem;
    --space-24: 4.5rem;
  }

  .logo-img {
    width: 158px;
    max-width: 158px;
  }

  .header-inner {
    min-height: 80px;
  }

  /* Header nav switches to mobile drawer button */
  .site-nav {
    display: none;
  }

  .hamburger {
    display: flex;
    align-self: center;
  }

  /* Hero Tablet */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .hero-left {
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(3rem, 7vw, 5rem);
    line-height: 1.02;
    margin-bottom: var(--space-4);
  }

  .hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
    padding-bottom: var(--space-2);
  }

  .hero-secondary-text {
    max-width: 100%;
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  /* Declaración */
  .declaracion-inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .declaracion-image {
    height: 420px;
  }

  .declaracion-body p {
    max-width: 55ch;
  }

  /* Trayectoria */
  .trayectoria-inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  /* Proceso */
  .proceso-step {
    grid-template-columns: auto 1fr;
  }

  .step-image {
    display: none;
  }

  /* Arquitectura y paisaje */
  .ap-inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .ap-image {
    height: 420px;
  }

  /* Tipos de proyecto */
  .tipos-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Prensa */
  .prensa-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Formulario & Sidebar */
  .formulario-inner {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  /* Galería */
  .galeria-item {
    height: 280px;
  }

  /* Lightbox */
  .lightbox-inner {
    width: 92%;
  }
}

/* ============================================================
   431px – 767px — PHABLETS & LARGE PHONES
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --header-height: 96px;
    --page-gutter: 28px;
    --space-40: 6rem;
    --space-48: 7rem;
    --space-32: 4.5rem;
    --space-24: 3.5rem;
  }

  .logo-img {
    width: 145px;
    max-width: 145px;
  }

  .header-inner {
    min-height: 72px;
  }

  .hero-title {
    font-size: clamp(2.4rem, 11vw, 3.8rem);
    line-height: 1.05;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary,
  .btn-ghost,
  .btn-submit {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Form grid 1 column */
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Footer 1 column */
  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  /* Galería */
  .galeria-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }

  .galeria-item {
    height: 250px;
  }
}

/* ============================================================
   375px – 430px — STANDARD MOBILE (iPhone 15 Pro Max, 14, Pixel)
   (CRÍTICO: Gutter de 24px real para evitar bordes pegados)
   ============================================================ */
@media (max-width: 430px) {
  :root {
    --header-height: 92px;
    --page-gutter: 24px;
    --space-32: 4rem;
    --space-24: 3rem;
    --space-20: 2.75rem;
    --space-16: 2.25rem;
  }

  .logo-img {
    width: 138px;
    max-width: 138px;
  }

  .header-inner {
    min-height: 68px;
  }

  /* Hero Mobile Title & Text */
  .hero-left {
    width: 100%;
  }

  .hero-title {
    font-size: clamp(2.2rem, 9.5vw, 3.2rem);
    line-height: 1.05;
    word-break: break-word;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
  }

  .hero-secondary-text {
    font-size: var(--text-base);
    line-height: 1.7;
    max-width: 38ch;
  }

  .hero-actions {
    width: 100%;
    gap: var(--space-3);
  }

  .btn-primary,
  .btn-ghost,
  .btn-submit {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: var(--space-4) var(--space-6);
  }

  .btn-header-cta {
    display: none;
  }

  /* Secciones de Texto Editorial (Nuestra Diferencia, Trayectoria, etc.) */
  .declaracion-body p,
  .trayectoria-body p,
  .ap-body p,
  .experiencia-body p,
  .cta-text,
  .formulario-sidebar-text {
    font-size: var(--text-base);
    line-height: 1.75;
    max-width: 38ch;
    word-break: break-word;
  }

  .declaracion-image,
  .ap-image {
    height: 300px;
  }

  /* Directorio de atención */
  .direct-contact-box {
    width: 100%;
    box-sizing: border-box;
    padding-top: var(--space-6);
  }

  .direct-contact-link {
    font-size: var(--text-sm);
    word-break: break-word;
  }

  /* Form Inputs (16px font-size prevents iOS Safari zoom) */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
    padding: var(--space-3.5, 0.875rem);
    width: 100%;
    box-sizing: border-box;
  }

  .form-label {
    font-size: var(--text-xs);
  }

  .checkbox-label {
    font-size: var(--text-xs);
    line-height: 1.5;
  }

  /* Galería */
  .galeria-item {
    height: 220px;
  }

  /* Mobile Overlay Nav */
  .mobile-nav-link {
    font-size: var(--text-2xl);
  }

  /* Quotes */
  .marca-hacha-quote {
    font-size: var(--text-xl);
    padding-left: var(--space-4);
  }

  /* WhatsApp FAB más compacto en mobile */
  .whatsapp-fab {
    width: 56px;
    height: 56px;
    bottom: max(1.5rem, calc(0.75rem + env(safe-area-inset-bottom)));
    right: max(1.25rem, calc(0.5rem + env(safe-area-inset-right)));
  }

  .whatsapp-fab svg {
    width: 26px;
    height: 26px;
  }
}

/* ============================================================
   <= 374px — SMALL MOBILE (iPhone SE, Galaxy Fold 360px)
   ============================================================ */
@media (max-width: 374px) {
  :root {
    --header-height: 86px;
    --page-gutter: 20px;
  }

  .logo-img {
    width: 124px;
    max-width: 124px;
  }

  .header-inner {
    min-height: 64px;
  }

  .hero-title {
    font-size: 2.15rem;
    line-height: 1.05;
  }

  /* WhatsApp FAB mínimo para 360px */
  .whatsapp-fab {
    width: 52px;
    height: 52px;
  }

  .whatsapp-fab svg {
    width: 24px;
    height: 24px;
  }

  .stat-number {
    font-size: 4.5rem;
  }

  .form-grid {
    gap: var(--space-4);
  }

  .galeria-item {
    height: 195px;
  }
}

/* ============================================================
   PRINT MEDIA
   ============================================================ */
@media print {
  .site-header,
  .whatsapp-fab,
  .scroll-indicator,
  .hamburger,
  .mobile-nav {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}
