/**
 * Hermanos Marketing Website - Responsive Styles
 * Mobile-first responsive design
 */

/* ==========================================
   MOBILE (< 640px) - BASE STYLES IN main.css
   ========================================== */

/* ==========================================
   SMALL TABLETS (≥ 640px)
   ========================================== */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
  
  .hero-text h1 {
    font-size: var(--text-5xl);
  }
  
  .hero-text p {
    font-size: var(--text-xl);
  }
}

/* ==========================================
   TABLETS (≥ 768px)
   ========================================== */
@media (min-width: 768px) {
  /* Typography Scaling */
  h1 { font-size: var(--text-6xl); }
  h2 { font-size: var(--text-5xl); }
  h3 { font-size: var(--text-4xl); }
  
  /* Section Spacing */
  .section {
    padding: var(--spacing-3xl) 0;
  }
  
  /* Hero */
  .hero {
    min-height: 380px;
    display: flex;
    align-items: flex-start;
    padding-top: var(--spacing-lg);
  }
  
  .hero-actions {
    flex-wrap: nowrap;
  }
}

/* ==========================================
   MOBILE MENU (< 1024px)
   ========================================== */
@media (max-width: 1023px) {
  /* Compact mobile header */
  .nav {
    padding: 0.25rem 0;
    min-height: 44px;
  }
  
  .nav-logo img {
    height: 28px;
  }
  
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Make Sign In button icon-only on mobile */
  .nav-actions .btn {
    padding: 0.5rem;
    font-size: 0;
    width: 36px;
    height: 36px;
    position: relative;
  }
  
  .nav-actions .btn::before {
    content: "👤";
    font-size: 18px;
    display: block;
  }
  
  /* Hide desktop menu */
  .nav-menu {
    position: fixed;
    top: 46px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
  }
  
  .nav-menu.active {
    max-height: 500px;
    box-shadow: var(--shadow-lg);
  }
  
  .nav-menu li {
    width: 100%;
  }
  
  .nav-link {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
  }
  
  /* Mobile Hero */
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  /* Mobile Footer */
  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   DESKTOPS (≥ 1024px)
   ========================================== */
@media (min-width: 1024px) {
  /* Navigation */
  .nav-menu {
    position: static;
    flex-direction: row;
    background: none;
    border: none;
    padding: 0;
  }
  
  /* Hero */
  .hero {
    min-height: 420px;
    padding-top: var(--spacing-xl);
  }
  
  .hero-text h1 {
    font-size: clamp(3rem, 5vw, 4rem);
  }
  
  /* Grid Improvements */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Screenshots */
  .screenshots {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Steps */
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================
   LARGE DESKTOPS (≥ 1280px)
   ========================================== */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
  
  .hero-text h1 {
    font-size: 4.5rem;
  }
  
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .screenshots {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================
   EXTRA LARGE SCREENS (≥ 1536px)
   ========================================== */
@media (min-width: 1536px) {
  .hero {
    min-height: 480px;
    padding-top: var(--spacing-xl);
  }
}

/* ==========================================
   MOBILE-SPECIFIC ADJUSTMENTS
   ========================================== */
@media (max-width: 640px) {
  /* Typography */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  
  /* Sections */
  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  /* Buttons */
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .btn-large {
    padding: 14px 24px;
    font-size: var(--text-base);
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
  }
  
  /* Cards */
  .card {
    padding: var(--spacing-md);
  }
  
  /* Modal */
  .modal-content {
    padding: 1rem;
  }
  
  /* Download Modal - Smaller icons on mobile */
  .download-icon {
    width: 80px;
    height: 80px;
  }
  
  .download-link {
    padding: 0.5rem;
    gap: 0.75rem;
  }
  
  .download-text h4 {
    font-size: var(--text-base);
  }
  
  .download-text p {
    font-size: var(--text-xs);
  }
  
  /* Forms */
  .form-input,
  .form-textarea,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Footer */
  .footer {
    text-align: center;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  /* Legal Pages */
  .legal-content {
    padding: var(--spacing-lg) 0;
  }
  
  /* Screenshots */
  .screenshots {
    grid-template-columns: 1fr;
  }
  
  /* FAQ */
  .faq-question {
    font-size: var(--text-base);
    padding: var(--spacing-sm);
  }
  
  .faq-answer-content {
    padding: var(--spacing-sm);
  }
}

/* ==========================================
   LANDSCAPE MOBILE (height < 500px)
   ========================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--spacing-xl) 0;
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
  .header,
  .nav,
  .footer,
  .btn,
  .mobile-menu-toggle,
  .nav-actions,
  .modal {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
  
  a {
    text-decoration: underline;
    color: #000;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
}

/* ==========================================
   HIGH CONTRAST MODE
   ========================================== */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid #000;
  }
  
  .card {
    border-width: 2px;
  }
  
  .form-input,
  .form-textarea,
  .form-select {
    border-width: 2px;
  }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-image img,
  .screenshot,
  .card {
    transform: none !important;
  }
}

/* ==========================================
   DARK MODE MEDIA QUERY (System Preference)
   ========================================== */
@media (prefers-color-scheme: dark) {
  /* Theme is handled via data-theme attribute in theme.css */
  /* This is just a fallback if JavaScript doesn't load */
  :root:not([data-theme]) {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --border-color-dark: #475569;
  }
}
