/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS — Paz Soldán Abogados
   Proyecto: Paz Soldán Abogados
   Dispositivos: Android, iPhone (iOS Safari), Tablets y Desktop
   Última actualización: 2026-09-28
   ========================================================================== */

/* Reglas Globales Móviles Anti-Jank & Prevención Zoom iOS */
input, select, textarea {
  font-size: 16px !important; /* Previene auto-zoom molesto en iOS Safari al enfocar */
}

a, button {
  -webkit-tap-highlight-color: rgba(197, 160, 89, 0.2);
  touch-action: manipulation;
}

/* ==========================================================================
   1. Breakpoint: Desktop Medio / Laptops (< 1100px)
   ========================================================================== */
@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual-card {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-trust-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .authority-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .authority-image-box {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
  }

  .authority-floating-badge {
    position: static;
    margin-top: 1.25rem;
    width: 100%;
    right: auto;
    bottom: auto;
  }

  .cases-banner-grid {
    grid-template-columns: 1fr;
  }

  .cases-banner-img {
    max-height: 300px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

/* ==========================================================================
   2. Breakpoint: Tablets (< 900px)
   ========================================================================== */
@media (max-width: 900px) {
  /* Solución al bug crítico de iOS Safari con background-attachment: fixed */
  .hero-section {
    background-attachment: scroll !important;
  }

  /* Evitar desborde horizontal del badge flotante del hero */
  .hero-floating-stat {
    right: 0.5rem;
    top: 0.75rem;
    padding: 0.65rem 1rem;
  }

  /* Drawer de Navegación Móvil */
  .nav-menu {
    position: fixed;
    top: 75px;
    left: 0;
    width: 100%;
    max-height: calc(100dvh - 75px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #FFFFFF;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.25rem;
    border-bottom: 2px solid var(--color-gold);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transform: translateY(-150%);
    transition: transform 0.35s ease;
    z-index: 999;
  }

  .nav-menu.open {
    transform: translateY(0);
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(10, 37, 64, 0.06);
    width: 100%;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
  }

  .nav-cta-group .btn {
    display: none;
  }

  .audience-panel.active {
    grid-template-columns: 1fr;
  }

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

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

  /* Slider TikTok Móvil / Rotador Automático */
  .tiktok-slider-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 1.5rem auto 0 auto;
    padding: 0.5rem 0;
  }

  .tiktok-track {
    display: flex !important;
    gap: 0 !important;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    width: 100%;
  }

  .tiktok-phone-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
  }

  .tiktok-slider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.5rem;
  }

  .tiktok-nav-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(230, 179, 37, 0.4);
    color: var(--color-gold);
    font-size: 1.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
  }

  .tiktok-nav-arrow:hover, .tiktok-nav-arrow:active {
    background: var(--color-gold);
    color: var(--color-obsidian);
  }

  .tiktok-slider-dots {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }

  .tiktok-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
  }

  .tiktok-dot.active {
    background: var(--color-gold);
    width: 26px;
    border-radius: var(--radius-full);
    box-shadow: 0 0 10px rgba(230, 179, 37, 0.6);
  }

  .triage-options-grid {
    grid-template-columns: 1fr;
  }

  .authority-points {
    grid-template-columns: 1fr;
  }

  .triage-wrapper {
    padding: 2rem 1.25rem;
  }
}

/* ==========================================================================
   3. Breakpoint: Smartphones Android & iPhone (< 600px)
   ========================================================================== */
@media (max-width: 600px) {
  /* Contenedor adaptado a pantallas estrechas (360px) */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section-padding {
    padding-top: 3.25rem;
    padding-bottom: 3.25rem;
  }

  /* Cintillo de Emergencia Superior */
  .top-emergency-bar {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
  }

  .emergency-container {
    gap: 0.35rem;
    line-height: 1.4;
  }

  .emergency-pill {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
  }

  .emergency-link {
    font-size: 0.78rem;
  }

  /* Header y Logo */
  .navbar {
    height: 70px;
  }

  .nav-logo {
    height: 44px;
    width: 44px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-subtitle {
    font-size: 0.65rem;
  }

  /* Hero */
  .hero-section {
    padding: 3rem 0 4rem 0;
    min-height: auto;
  }

  .hero-badge-top {
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
  }

  .hero-title {
    font-size: clamp(1.85rem, 6.8vw, 2.25rem);
    line-height: 1.2;
    text-align: left;
  }

  .hero-lead {
    font-size: 0.96rem;
    line-height: 1.55;
    text-align: left;
  }

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

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.96rem;
    padding: 0.85rem 1.25rem;
    justify-content: center;
  }

  .hero-guarantee {
    font-size: 0.82rem;
    text-align: left;
  }

  .hero-floating-stat {
    display: none; /* Simplificación para maximizar espacio de foto en móvil */
  }

  .hero-lawyer-frame {
    max-height: 380px;
  }

  .hero-trust-bar {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
  }

  /* Selector de Audiencia */
  .audience-switcher {
    flex-direction: column;
    width: 100%;
    gap: 0.6rem;
  }

  .audience-tab-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    min-height: 46px;
  }

  .audience-card {
    padding: 1.5rem 1.25rem;
  }

  /* Triage Legal Express */
  .triage-wrapper {
    padding: 1.75rem 1rem;
    border-radius: var(--radius-md);
  }

  .triage-header {
    margin-bottom: 1.75rem;
  }

  .triage-step-progress {
    gap: 0.35rem;
    margin-bottom: 1.75rem;
  }

  .progress-step {
    font-size: 0.74rem;
    gap: 0.25rem;
  }

  .step-num {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .step-divider {
    width: 14px;
  }

  .triage-question-title {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    line-height: 1.35;
  }

  .triage-option-card {
    padding: 0.85rem 1rem;
    min-height: 52px;
    gap: 0.75rem;
  }

  .option-main-text {
    font-size: 0.92rem;
  }

  .option-sub-text {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .triage-result-card {
    padding: 1.5rem 1rem;
  }

  .triage-result-title {
    font-size: 1.35rem;
  }

  /* Casos Ganados & Testimonios */
  .case-amount {
    font-size: 1.75rem;
  }

  /* TikTok Grid */
  .tiktok-stat-pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  /* Botón Flotante de WhatsApp con Safe-Area (iPhone Notch / Home Bar) */
  .floating-whatsapp {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    right: calc(1rem + env(safe-area-inset-right, 0px));
  }

  .floating-wa-bubble {
    display: none;
  }

  .floating-wa-btn {
    width: 56px;
    height: 56px;
  }

  /* Banner de Cookies Responsivo */
  .cookie-banner {
    left: 0.75rem !important;
    right: 0.75rem !important;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    max-width: none !important;
    width: auto !important;
    padding: 1rem 1.15rem !important;
    gap: 0.75rem !important;
  }

  .cookie-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Modales Legales en Móvil */
  .legal-modal-overlay {
    padding: 0.5rem;
  }

  .legal-modal-card {
    max-height: 92dvh;
    border-radius: var(--radius-md);
  }

  .legal-modal-header {
    padding: 1rem 1.25rem;
  }

  .legal-modal-title {
    font-size: 1.1rem;
  }

  .legal-modal-body {
    padding: 1.25rem 1rem;
    font-size: 0.88rem;
    -webkit-overflow-scrolling: touch;
  }

  .legal-modal-footer {
    padding: 1rem 1.25rem;
  }
}
