/* ==========================================================================
   RESPONSIVE & MOBILE-FIRST RULES - CEVICHERÍA PUNTA DEL NORTE
   ========================================================================== */

/* --- TABLETS & PANTALLAS MEDIANAS (Max-width: 1024px) --- */
@media (max-width: 1024px) {
  .story-grid {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .story-media-wrap {
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
  }

  .locations-layout {
    grid-template-columns: 1fr;
  }

  .map-card-wrapper {
    min-height: 400px;
  }

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

/* --- DISPOSITIVOS MÓVILES (Max-width: 768px) --- */
@media (max-width: 768px) {
  :root {
    --header-height: 74px;
  }

  .header {
    height: var(--header-height);
  }

  .logo-brand-img {
    height: 56px;
    max-width: 210px;
  }

  /* Ocultar menú de escritorio y mostrar botón hamburguesa */
  .nav-menu {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .header-actions .btn-header-cta {
    display: none; /* Se visualiza dentro del Drawer móvil y el Hero */
  }

  /* Hero Mobile */
  .hero {
    min-height: 480px;
    padding-top: calc(var(--header-height) + var(--space-6));
    padding-bottom: var(--space-8);
    text-align: center;
  }

  /* Split hero móvil: mantener 2 columnas lado a lado (NO apilar) */
  .hero-split-bg {
    flex-direction: row !important;
  }

  .hero-split-left,
  .hero-split-right {
    width: 50% !important;
    height: 100% !important;
  }

  /* Ocultar pines de sede para no tapar botones CTA */
  .hero-split-label {
    display: none !important;
  }

  /* Ocultar las 4 tarjetas de indicadores (Pesca del Día, 4.8, 2 Sedes, Delivery) */
  .hero-stats {
    display: none !important;
  }

  /* Hero Content centrado */
  .hero-content {
    margin: 0 auto;
  }

  .hero-pill-badge {
    margin-left: auto;
    margin-right: auto;
    font-size: var(--font-size-xs);
    padding: 6px 14px;
    margin-bottom: var(--space-4);
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-5);
  }

  .hero-actions {
    justify-content: center;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 50px;
  }

  /* Historia / Por Qué Elegirnos */
  .story-image-frame img {
    height: 320px;
  }

  .story-floating-badge {
    position: static;
    margin-top: var(--space-4);
    max-width: 100%;
    justify-content: center;
  }

  /* Platos Favoritos */
  .dishes-tabs {
    gap: var(--space-2);
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
    width: 100%;
    scrollbar-width: none;
  }

  .dishes-tabs::-webkit-scrollbar {
    display: none;
  }

  .dish-tab-btn {
    white-space: nowrap;
    padding: 8px 16px;
  }

  .dishes-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .dish-media {
    height: 240px;
  }

  /* Reseñas Google */
  .google-rating-banner {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: var(--space-6);
  }

  .google-brand-wrap {
    flex-direction: column;
  }

  .reviews-track {
    grid-template-columns: 1fr;
  }

  /* Sedes y Ubicaciones */
  .location-card {
    padding: var(--space-6);
  }

  .location-actions {
    flex-direction: column;
  }

  .location-actions .btn {
    width: 100%;
  }

  /* Modal Mobile */
  .modal-card {
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: var(--space-4) var(--space-6);
  }

  .modal-body {
    padding: var(--space-6);
  }

  .booking-form {
    grid-template-columns: 1fr;
  }

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

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

  /* Botones Flotantes y Carrito Mobile */
  .floating-actions-container {
    bottom: 16px;
    right: 16px;
    gap: 10px;
  }

  .whatsapp-floating-widget {
    bottom: 16px;
    right: 16px;
  }

  .whatsapp-branches-menu {
    width: min(280px, calc(100vw - 32px));
  }

  .cart-floating-fab {
    padding: 10px 16px;
    font-size: 14px;
  }

  .cart-drawer {
    max-width: 100%;
  }

  .catalog-filters-bar {
    padding: 12px 16px 8px;
  }

  .catalog-search-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .catalog-results-badge {
    text-align: center;
  }

  .catalog-modal-body {
    padding: 16px;
  }

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

  .dish-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .dish-detail-media {
    height: 200px;
  }

  .cart-toast {
    left: 16px;
    right: 16px;
    bottom: 84px;
    justify-content: space-between;
  }
}

/* --- PANTALLAS PEQUEÑAS (Max-width: 400px) --- */
@media (max-width: 400px) {
  .hero {
    min-height: 420px;
    padding-top: calc(var(--header-height) + var(--space-4));
    padding-bottom: var(--space-6);
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .section {
    min-height: auto;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

/* --- SAFE AREAS DE DISPOSITIVOS MÓVILES (Notches & Dynamic Islands) --- */
@supports (padding: env(safe-area-inset-bottom)) {
  .floating-actions-container {
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: calc(16px + env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
  }
}


/* --- MODAL CARTA COMPLETA: OPTIMIZACIÓN MÓVIL --- */
@media (max-width: 768px) {
  /* Reducir margen exterior del modal en móvil */
  #carta-modal {
    padding: 8px !important;
  }

  /* Modal ocupa casi toda la pantalla */
  .carta-modal-wrapper {
    width: 100% !important;
    height: 96vh !important;
    max-height: 96vh !important;
    border-radius: 14px !important;
  }

  /* Header del modal: más compacto en móvil */
  .carta-modal-header {
    padding: 10px 14px !important;
  }

  /* Botones del header más compactos */
  .carta-modal-header button {
    padding: 5px 10px !important;
    font-size: 11.5px !important;
  }
}

/* Pantallas muy pequeñas: header ultra-compacto */
@media (max-width: 400px) {
  .carta-modal-header {
    padding: 8px 12px !important;
  }

  .carta-modal-header h3 {
    font-size: 1rem !important;
  }
}
