/**
 * Sistema de diseño responsive para vIAjes
 * Adapta la interfaz a móvil, tablet y escritorio
 */

/* =====================================================
   VARIABLES CSS - Sistema de diseño
   ===================================================== */

:root {
  /* Breakpoints */
  --breakpoint-mobile: 640px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;
  --breakpoint-wide: 1280px;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Container widths */
  --container-mobile: 100%;
  --container-tablet: 720px;
  --container-desktop: 960px;
  --container-wide: 1140px;
}

/* =====================================================
   CONTENEDOR PRINCIPAL RESPONSIVE
   ===================================================== */

.app-container {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  background: white;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Móvil: ancho completo */
@media (max-width: 639px) {
  .app-container {
    max-width: 100%;
    box-shadow: none;
  }
}

/* Tablet: contenedor de 720px */
@media (min-width: 640px) and (max-width: 1023px) {
  .app-container {
    max-width: var(--container-tablet);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 0;
  }
}

/* Desktop: contenedor de 960px */
@media (min-width: 1024px) and (max-width: 1279px) {
  .app-container {
    max-width: var(--container-desktop);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
}

/* Wide: contenedor de 1140px */
@media (min-width: 1280px) {
  .app-container {
    max-width: var(--container-wide);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
}

/* =====================================================
   PADDING RESPONSIVE
   ===================================================== */

.responsive-padding {
  padding: var(--spacing-md);
}

@media (min-width: 640px) {
  .responsive-padding {
    padding: var(--spacing-lg);
  }
}

@media (min-width: 1024px) {
  .responsive-padding {
    padding: var(--spacing-xl);
  }
}

/* =====================================================
   TIPOGRAFÍA RESPONSIVE
   ===================================================== */

/* Móvil */
.text-responsive-xs { font-size: 0.75rem; }
.text-responsive-sm { font-size: 0.875rem; }
.text-responsive-base { font-size: 1rem; }
.text-responsive-lg { font-size: 1.125rem; }
.text-responsive-xl { font-size: 1.25rem; }
.text-responsive-2xl { font-size: 1.5rem; }
.text-responsive-3xl { font-size: 1.875rem; }
.text-responsive-4xl { font-size: 2.25rem; }

/* Tablet y superior: escalar ligeramente */
@media (min-width: 640px) {
  .text-responsive-xs { font-size: 0.8125rem; }
  .text-responsive-sm { font-size: 0.9375rem; }
  .text-responsive-base { font-size: 1.0625rem; }
  .text-responsive-lg { font-size: 1.1875rem; }
  .text-responsive-xl { font-size: 1.375rem; }
  .text-responsive-2xl { font-size: 1.75rem; }
  .text-responsive-3xl { font-size: 2.125rem; }
  .text-responsive-4xl { font-size: 2.625rem; }
}

/* Desktop: tamaños completos */
@media (min-width: 1024px) {
  .text-responsive-xs { font-size: 0.875rem; }
  .text-responsive-sm { font-size: 1rem; }
  .text-responsive-base { font-size: 1.125rem; }
  .text-responsive-lg { font-size: 1.25rem; }
  .text-responsive-xl { font-size: 1.5rem; }
  .text-responsive-2xl { font-size: 2rem; }
  .text-responsive-3xl { font-size: 2.5rem; }
  .text-responsive-4xl { font-size: 3rem; }
}

/* =====================================================
   GRID RESPONSIVE
   ===================================================== */

.grid-responsive {
  display: grid;
  gap: var(--spacing-md);
}

/* Móvil: 1 columna */
@media (max-width: 639px) {
  .grid-responsive {
    grid-template-columns: 1fr;
  }
  
  .grid-responsive-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet: 2-3 columnas */
@media (min-width: 640px) and (max-width: 1023px) {
  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }
  
  .grid-responsive-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop: 3-4 columnas */
@media (min-width: 1024px) {
  .grid-responsive {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
  }
  
  .grid-responsive-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =====================================================
   NAVEGACIÓN RESPONSIVE
   ===================================================== */

/* Móvil: Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
}

/* Tablet: Bottom Nav centrado */
@media (min-width: 640px) and (max-width: 1023px) {
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    max-width: var(--container-tablet);
    border-radius: 16px 16px 0 0;
  }
}

/* Desktop: Sidebar opcional (o mantener bottom nav) */
@media (min-width: 1024px) {
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    max-width: var(--container-desktop);
    border-radius: 0 0 12px 12px;
  }
}

/* =====================================================
   BOTONES RESPONSIVE
   ===================================================== */

.btn-responsive {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  min-height: 44px; /* WCAG touch target */
}

@media (min-width: 640px) {
  .btn-responsive {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
    min-height: 48px;
  }
}

@media (min-width: 1024px) {
  .btn-responsive {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    min-height: 52px;
  }
}

/* =====================================================
   INPUTS RESPONSIVE
   ===================================================== */

.input-responsive {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  min-height: 48px;
}

@media (min-width: 640px) {
  .input-responsive {
    padding: 1rem 1.25rem;
    font-size: 1.0625rem;
    min-height: 52px;
  }
}

@media (min-width: 1024px) {
  .input-responsive {
    padding: 1.125rem 1.5rem;
    font-size: 1.125rem;
    min-height: 56px;
  }
}

/* =====================================================
   CARDS RESPONSIVE
   ===================================================== */

.card-responsive {
  padding: var(--spacing-md);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
  .card-responsive {
    padding: var(--spacing-lg);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

@media (min-width: 1024px) {
  .card-responsive {
    padding: var(--spacing-xl);
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  }
}

/* =====================================================
   UTILIDADES DE VISIBILIDAD
   ===================================================== */

/* Ocultar en móvil */
@media (max-width: 639px) {
  .hidden-mobile {
    display: none !important;
  }
}

/* Ocultar en tablet */
@media (min-width: 640px) and (max-width: 1023px) {
  .hidden-tablet {
    display: none !important;
  }
}

/* Ocultar en desktop */
@media (min-width: 1024px) {
  .hidden-desktop {
    display: none !important;
  }
}

/* Mostrar solo en móvil */
.show-mobile {
  display: block;
}

@media (min-width: 640px) {
  .show-mobile {
    display: none !important;
  }
}

/* Mostrar solo en tablet */
.show-tablet {
  display: none;
}

@media (min-width: 640px) and (max-width: 1023px) {
  .show-tablet {
    display: block !important;
  }
}

/* Mostrar solo en desktop */
.show-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .show-desktop {
    display: block !important;
  }
}

/* =====================================================
   ORIENTACIÓN
   ===================================================== */

/* Landscape en móvil */
@media (max-width: 639px) and (orientation: landscape) {
  .app-container {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  
  .bottom-nav {
    height: 60px; /* Más compacto en landscape */
  }
}

/* =====================================================
   SAFE AREA (para móviles con notch)
   ===================================================== */

.safe-area-top {
  padding-top: env(safe-area-inset-top, 0);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.safe-area-left {
  padding-left: env(safe-area-inset-left, 0);
}

.safe-area-right {
  padding-right: env(safe-area-inset-right, 0);
}

/* =====================================================
   HOVER STATES (solo en dispositivos con cursor)
   ===================================================== */

@media (hover: hover) and (pointer: fine) {
  .hover-scale:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
  }
  
  .hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
  }
}

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

@media print {
  .no-print {
    display: none !important;
  }
  
  .app-container {
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
  }
  
  .bottom-nav {
    display: none !important;
  }
}
