/* ============================================
   RESPONSIVE DESIGN - MESÓN DEL ALMA
   Media queries para mobile, tablet y desktop
   ============================================ */

/* ==================== MOBILE FIRST BASE (< 768px) ==================== */

/* Ya definidos en los archivos base como estilos por defecto */

/* ==================== TABLET (768px - 1024px) ==================== */

@media (min-width: 768px) {
  /* Contenedor */
  .container {
    max-width: 720px;
    padding: 0 var(--spacing-lg);
  }

  /* Tipografía */
  .section-title {
    font-size: var(--text-5xl);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  /* Grid system */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== DESKTOP (> 1024px) ==================== */

@media (min-width: 1024px) {
  /* Contenedor */
  .container {
    max-width: 1200px;
  }

  /* Tipografía */
  .hero-title {
    font-size: var(--text-5xl);
  }

  /* Grid system */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== MOBILE (< 768px) ==================== */

@media (max-width: 767px) {
  /* Navegación móvil */
  .nav-menu {
    position: fixed;
    top: var(--navbar-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    background: rgba(44, 24, 16, 0.98);
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--spacing-2xl) 0;
    gap: var(--spacing-md);
    transition: left var(--transition-base);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    font-size: var(--text-lg);
    width: 100%;
    text-align: center;
    padding: var(--spacing-md) 0;
  }

  /* Mostrar botón hamburguesa */
  .hamburger {
    display: flex;
  }

  /* Tipografía móvil */
  .section-title {
    font-size: var(--text-3xl);
  }

  .section-subtitle {
    font-size: var(--text-base);
  }

  .hero-title {
    font-size: var(--text-2xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  /* Cards */
  .card {
    padding: var(--spacing-md);
  }

  .card-title {
    font-size: var(--text-lg);
  }

  /* Botones */
  .btn {
    width: 100%;
    padding: 14px 24px;
  }

  .btn-group {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  /* Grid a 1 columna */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Tablas responsive */
  .table {
    font-size: var(--text-sm);
  }

  .table thead {
    display: none;
  }

  .table tr {
    display: block;
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .table td {
    display: block;
    text-align: right;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-gray-light);
  }

  .table td::before {
    content: attr(data-label);
    float: left;
    font-weight: var(--font-semibold);
    color: var(--color-primary);
  }

  .table td:last-child {
    border-bottom: none;
  }

  /* Modal/Lightbox */
  .modal-content {
    max-width: 95%;
  }

  .modal-close {
    top: -35px;
    font-size: var(--text-2xl);
  }

  /* Formularios */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Evita zoom en iOS */
  }

  /* Stats cards */
  .stats-number {
    font-size: var(--text-4xl);
  }
}

/* ==================== TABLET LANDSCAPE (768px - 1023px) ==================== */

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-title {
    font-size: var(--text-4xl);
  }

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

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

/* ==================== EXTRA SMALL DEVICES (< 480px) ==================== */

@media (max-width: 479px) {
  .hero-title {
    font-size: var(--text-xl);
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .btn {
    padding: 12px 20px;
    font-size: var(--text-sm);
  }

  .card-image {
    height: 150px;
  }
}

/* ==================== LARGE SCREENS (> 1400px) ==================== */

@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* ==================== LANDSCAPE ORIENTATION ==================== */

@media (orientation: landscape) and (max-height: 600px) {
  .hero {
    min-height: 100vh;
  }

  .nav-menu {
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
  }
}

/* ==================== PRINT STYLES ==================== */

@media print {
  .navbar,
  .footer,
  .btn,
  .hamburger {
    display: none;
  }

  body {
    background-color: white;
    color: black;
  }

  .container {
    max-width: 100%;
  }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
