/**
 * Mobile-First Responsive Design
 * Breakpoints: 320px (mobile), 768px (tablet), 1024px (desktop)
 */

/* ============================================
   MOBILE (320px - 767px)
   ============================================ */

/* Tipografía móvil */
@media (max-width: 767px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4, h5, h6 {
    font-size: 1rem;
  }

  /* Header móvil */
  .site-header-inner {
    padding: var(--spacing-md);
  }

  .site-logo img {
    height: 40px;
  }

  .site-navigation {
    display: none; /* Mostrar con hamburger menu */
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    padding: var(--spacing-sm);
  }

  /* Content */
  .site-content {
    padding: var(--spacing-lg) var(--spacing-sm);
  }

  /* Hero */
  .hero {
    padding: var(--spacing-2xl) var(--spacing-md);
    min-height: 300px;
  }

  .hero h1 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-md);
  }

  .hero p {
    font-size: 1rem;
  }

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

  /* Buttons */
  .btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
  }

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

  .card img {
    height: 150px;
  }

  /* Footer */
  .site-footer {
    padding: var(--spacing-2xl) var(--spacing-md);
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  /* WooCommerce */
  .products {
    grid-template-columns: 1fr;
  }

  .product-item {
    margin-bottom: var(--spacing-lg);
  }

  /* Forms */
  form {
    display: flex;
    flex-direction: column;
  }

  input,
  textarea,
  select,
  .form-row {
    width: 100%;
    margin-bottom: var(--spacing-md);
  }

  .form-row-inline {
    flex-direction: column;
  }

  .form-row-inline .form-col {
    width: 100%;
  }

  /* Touch-friendly elements */
  a, button, input[type="submit"], input[type="button"] {
    min-height: 48px;
    min-width: 48px;
    padding: var(--spacing-md);
  }

  /* Spacing móvil */
  .section {
    padding: var(--spacing-2xl) var(--spacing-sm);
  }

  .container {
    padding: 0 var(--spacing-sm);
  }
}

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

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

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

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

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

  /* Navigation tablet */
  .site-navigation {
    display: flex;
  }

  .mobile-menu-toggle {
    display: none;
  }

  /* WooCommerce tablet */
  .products {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Forms tablet */
  .form-row-inline {
    flex-direction: row;
  }

  .form-row-inline .form-col {
    flex: 1;
    margin-right: var(--spacing-md);
  }

  .form-row-inline .form-col:last-child {
    margin-right: 0;
  }

  /* Content */
  .site-content {
    padding: var(--spacing-2xl) var(--spacing-lg);
  }

  .hero {
    padding: var(--spacing-3xl) var(--spacing-lg);
  }
}

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

@media (min-width: 1024px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

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

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

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

  /* Hero desktop */
  .hero {
    padding: var(--spacing-3xl) var(--spacing-xl);
    min-height: 600px;
  }

  .hero-content {
    max-width: 900px;
  }

  /* WooCommerce desktop */
  .products {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Content */
  .site-content {
    padding: var(--spacing-3xl) var(--spacing-xl);
  }

  .container {
    padding: 0 var(--spacing-xl);
  }

  .section {
    padding: var(--spacing-3xl) var(--spacing-xl);
  }
}

/* ============================================
   LARGE DESKTOP (1400px+)
   ============================================ */

@media (min-width: 1400px) {
  .container,
  .site-content,
  .site-header-inner,
  .site-footer-inner {
    max-width: 1400px;
    padding-left: auto;
    padding-right: auto;
  }
}

/* ============================================
   LANDSCAPE MOBILE (max-height: 500px)
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 300px;
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .site-header {
    position: relative;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: subpixel-antialiased;
  }
}

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

@media print {
  body {
    background: white;
    color: black;
  }

  a, a visited {
    text-decoration: underline;
  }

  img {
    max-width: 100%;
  }

  .site-header,
  .site-footer,
  .no-print {
    display: none;
  }
}

/* ============================================
   ACCESSIBILITY: Reduced Motion
   ============================================ */

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

/* ============================================
   DARK MODE PREFERENCE
   ============================================ */

@media (prefers-color-scheme: light) {
  /* Fallback si el navegador fuerza light mode */
  body {
    background-color: var(--color-primary-dark);
    color: var(--color-text-primary);
  }
}
