/* ============================================================
   學車天使 APASS - RWD 響應式樣式
   ============================================================ */

/* --- Tablet (max 1024px) --- */
@media (max-width: 1024px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero { padding: 60px 0 70px; }
  .hero h1 { font-size: 2.2rem; }

  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .feature-row { gap: 40px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }

  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-sidebar { display: none; }
  .blog-layout { grid-template-columns: 1fr; }
}

/* --- Mobile Nav Trigger (max 900px) --- */
@media (max-width: 900px) {
  .mobile-toggle { display: block; }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 24px 24px;
    gap: 0;
    box-shadow: var(--shadow-lg);
    transition: right 0.35s ease;
    overflow-y: auto;
    z-index: 9999;
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-menu > li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu > li > a {
    padding: 14px 0;
    font-size: 1.05rem;
  }

  /* Mobile dropdown */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 8px 16px;
    display: none;
  }

  .dropdown.open .dropdown-menu {
    display: block;
  }

  /* Mobile nav overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  .nav-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  /* Mobile nav close */
  .nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text);
    cursor: pointer;
  }
}

/* --- Mobile (max 640px) --- */
@media (max-width: 640px) {
  html { font-size: 15px; }

  .container { width: 94%; }

  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.35rem; }

  .hero {
    padding: 50px 0 60px;
    text-align: center;
  }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; margin-left: auto; margin-right: auto; }
  .hero-badges { justify-content: center; }

  section { padding: 50px 0; }
  .section-header { margin-bottom: 2rem; }

  .card-grid { grid-template-columns: 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 16px; }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .feature-row.reverse { direction: ltr; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .page-header { padding: 36px 0; }
  .page-header h1 { font-size: 1.6rem; }

  .cta-banner { padding: 40px 0; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .cta-buttons .btn { width: 100%; max-width: 300px; justify-content: center; }

  /* Tables scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .price-table,
  .comparison-table {
    min-width: 540px;
  }

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; }
  .blog-article { padding: 20px; }
  .blog-article h1 { font-size: 1.5rem; }

  .blog-card-img { height: 180px; }
}

/* --- Small Mobile (max 380px) --- */
@media (max-width: 380px) {
  html { font-size: 14px; }
  .hero h1 { font-size: 1.5rem; }
  .btn { padding: 10px 20px; font-size: 0.9rem; }
  .nav-menu { width: 90%; }
}

/* --- Print --- */
@media print {
  #site-header, #site-footer, .cta-banner, .btn { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: underline; }
}
