/* ============================================
   E-SCOOTER GUIDE - Responsive Styles
   Mobile First Breakpoints
   ============================================ */

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .container {
    padding: 0 48px;
  }
}

/* Desktop (1024px - 1279px) */
@media (max-width: 1279px) {
  :root {
    --section-padding: 80px;
  }

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

  .hero-visual {
    flex: 0 0 40%;
  }

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

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

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  :root {
    --section-padding: 64px;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 32px;
  }

  /* Header */
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 24px;
    gap: 8px;
    border-bottom: 1px solid var(--card-border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
  }

  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    text-align: center;
  }

  .menu-toggle {
    display: flex;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: 140px;
    padding-bottom: 60px;
  }

  .hero>.container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .hero-badge {
    margin: 0 auto 24px;
  }

  /* Hide the green underline on mobile - fixes display issue */
  .hero h1 .highlight::after {
    display: none;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
    gap: 40px;
  }

  .stat-item {
    text-align: center;
  }

  .hero-visual {
    flex: 0 0 100%;
    max-width: 350px;
    margin-top: 40px;
  }

  /* Categories */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .category-card {
    padding: 24px;
  }

  .category-icon {
    width: 56px;
    height: 56px;
  }

  /* Products */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Benefits */
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  /* Newsletter */
  .newsletter-content {
    flex-direction: column;
    text-align: center;
  }

  .newsletter-form {
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }

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

  .footer-brand {
    grid-column: span 2;
    max-width: none;
    margin-bottom: 24px;
  }

  /* Comparison Cards */
  .comparison-cards {
    grid-template-columns: 1fr;
    max-width: 450px;
  }

  /* Country Grid */
  .country-grid {
    grid-template-columns: 1fr;
  }

  /* Feature Grid */
  .feature-grid {
    grid-template-columns: 1fr;
  }

  /* Filter Bar */
  .filter-bar {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .search-container {
    width: 100%;
  }

  /* Table horizontal scroll - contained within viewport */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .comparison-table {
    min-width: 700px;
  }

  /* Prevent body horizontal scroll */
  body {
    overflow-x: hidden;
  }
}

/* Mobile Large (640px - 767px) */
@media (max-width: 767px) {
  :root {
    --section-padding: 48px;
  }

  body {
    font-size: 16px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 26px;
  }

  h3 {
    font-size: 20px;
  }

  .container {
    padding: 0 16px;
  }

  /* Buttons */
  .btn {
    padding: 12px 24px;
    font-size: 15px;
    width: 100%;
  }

  /* Keep small and outline buttons auto-width */
  .btn.btn-sm,
  .btn.btn-outline {
    width: auto;
  }

  .btn-lg {
    padding: 16px 28px;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }

  /* Hero Stats */
  .hero-stats {
    flex-wrap: wrap;
    gap: 24px;
  }

  .stat-item {
    flex: 1;
    min-width: 100px;
  }

  .stat-number {
    font-size: 28px;
  }

  /* Categories */
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    display: flex;
    gap: 20px;
    padding: 20px;
  }

  .category-icon {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .category-content {
    flex: 1;
  }

  .category-card h3 {
    font-size: 18px;
  }

  .category-card p {
    font-size: 14px;
  }

  .category-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .category-arrow {
    display: none;
  }

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

  .product-card {
    display: flex;
    flex-direction: row;
  }

  .product-image {
    width: 140px;
    flex-shrink: 0;
    aspect-ratio: 1;
  }

  .product-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
  }

  .product-specs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .product-footer {
    margin-top: auto;
    padding-top: 12px;
  }

  .product-price {
    font-size: 18px;
  }

  .product-action {
    width: 36px;
    height: 36px;
  }

  /* Benefits */
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .benefit-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    text-align: left;
  }

  .benefit-icon {
    margin: 0;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: span 1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-legal {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  /* Cookie Banner */
  .cookie-banner {
    left: 16px;
    right: 16px;
    max-width: none;
  }

  .cookie-buttons {
    flex-direction: column;
  }

  /* Page Header */
  .page-header {
    padding: 120px 0 40px;
  }

  .page-header p {
    font-size: 16px;
  }

  /* Info Box */
  .info-box {
    padding: 20px;
  }

  /* Tabs */
  .tabs-nav {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
  }

  /* Accordion */
  .accordion-header {
    padding: 16px 20px;
    font-size: 15px;
  }

  .accordion-content-inner {
    padding: 0 20px 20px;
    font-size: 14px;
  }

  /* Comparison Cards */
  .comparison-card {
    padding: 24px;
  }

  .comparison-card-price {
    font-size: 24px;
  }

  /* Modal */
  .modal {
    width: 95%;
    max-height: 85vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 13px;
    flex-wrap: wrap;
  }

  /* Mobile Comparison Table Improvements */
  .table-responsive {
    position: relative;
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* Scroll indicator */
  .table-responsive::after {
    content: '→ Zum Scrollen wischen';
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px;
    background: rgba(10, 207, 131, 0.08);
    border-radius: 8px;
    margin-top: 12px;
  }

  .comparison-table {
    min-width: 600px;
    font-size: 13px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 10px 8px;
    white-space: nowrap;
  }

  .comparison-table .product-cell {
    min-width: 160px;
  }

  .comparison-table .product-thumb {
    width: 40px;
    height: 40px;
  }

  /* Top recommendations grid - single column on mobile */
  #top-recommendations {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* ====== KAUFRATGEBER MOBILE STYLES ====== */

  /* Quick Navigation - scrollable on mobile */
  .content-section article {
    padding: 20px !important;
    margin-bottom: 24px;
  }

  .content-section article h2 {
    font-size: 20px;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }

  /* Feature Grid - single column on mobile */
  .feature-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .feature-item {
    padding: 16px !important;
  }

  .feature-icon {
    width: 48px !important;
    height: 48px !important;
  }

  .feature-icon svg {
    width: 24px !important;
    height: 24px !important;
  }

  .feature-content h4 {
    font-size: 16px !important;
  }

  .feature-content p {
    font-size: 14px !important;
  }

  /* Product Recommendations - stack vertically on mobile */
  .product-recommendation>div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .product-recommendation img {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto !important;
  }

  .product-recommendation div[style*="text-align: right"] {
    text-align: center !important;
    width: 100%;
  }

  /* Criteria cards */
  .criteria-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .criteria-card {
    padding: 20px !important;
  }

  /* Info boxes */
  .info-box {
    padding: 16px !important;
  }

  .info-box h4 {
    font-size: 16px !important;
  }

  /* Comparison grids in Kaufratgeber */
  .comparison-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Quick nav buttons - better visibility on mobile */
  .btn-outline.btn-sm {
    padding: 10px 14px !important;
    font-size: 13px !important;
    background: rgba(10, 207, 131, 0.1) !important;
    border: 2px solid var(--neo-green) !important;
    color: var(--neo-green-dark) !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Accordion improvements */
  .accordion-header {
    padding: 14px 16px !important;
    font-size: 14px !important;
  }

  .accordion-content-inner {
    padding: 12px 16px 16px !important;
    font-size: 13px !important;
  }

  /* Tables within Kaufratgeber */
  .content-section table {
    font-size: 12px;
  }

  .content-section th,
  .content-section td {
    padding: 8px 6px;
  }

  /* Pros/Cons lists */
  .pros-cons-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* Mobile Small (< 640px) */
@media (max-width: 479px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
  }

  .stat-item {
    width: 100%;
    padding: 16px;
    background: var(--ultra-light-bg);
    border-radius: var(--radius-md);
  }

  /* Section Header */
  .section-header {
    margin-bottom: 40px;
  }

  .section-header p {
    font-size: 15px;
  }

  /* Product Card Mobile */
  .product-card {
    flex-direction: column;
  }

  .product-image {
    width: 100%;
    aspect-ratio: 4/3;
  }

  .product-badge {
    top: 12px;
    left: 12px;
    font-size: 11px;
    padding: 4px 10px;
  }

  /* Newsletter */
  .newsletter-section {
    padding: 48px 0;
  }

  .newsletter-text h2 {
    font-size: 22px;
  }

  .newsletter-text p {
    font-size: 15px;
  }

  /* Country Card */
  .country-card {
    padding: 24px;
  }

  .country-header {
    gap: 12px;
  }

  .country-flag {
    font-size: 28px;
  }

  .country-name {
    font-size: 18px;
  }

  .country-rules li {
    font-size: 14px;
  }

  /* Comparison Table */
  .comparison-table th,
  .comparison-table td {
    padding: 12px 10px;
    font-size: 13px;
  }

  .comparison-table .product-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Feature Item */
  .feature-item {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .feature-icon {
    margin: 0 auto;
  }

  /* ====== KAUFRATGEBER MOBILE SMALL ====== */

  .content-section article {
    padding: 16px !important;
  }

  .content-section article h2 {
    font-size: 18px !important;
  }

  .product-recommendation {
    padding: 16px !important;
  }

  .product-recommendation h5 {
    font-size: 16px !important;
  }

  .product-recommendation span[style*="font-size: 24px"] {
    font-size: 20px !important;
  }

  /* Quick nav - wrap on small screens for visibility */
  section>.container>div[style*="flex-wrap: wrap"] {
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
  }

  /* Kaufratgeber quick nav specific styling */
  section[style*="border-bottom"] .container>div {
    padding: 0 !important;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

  .nav-link:hover,
  .btn:hover,
  .category-card:hover,
  .product-card:hover,
  .benefit-card:hover {
    transform: none;
  }

  .btn-primary:hover {
    background: var(--cta-orange);
    color: #fff;
    box-shadow: var(--shadow-lg), 0 4px 16px rgba(255, 149, 0, 0.3);
  }

  .btn:active {
    transform: scale(0.98);
  }

  .category-card:active,
  .product-card:active {
    transform: scale(0.99);
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
  }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .hero-stats {
    margin-top: 32px;
  }
}

/* Print Styles */
@media print {

  .header,
  .nav,
  .cookie-banner,
  .btn,
  .newsletter-section,
  .footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .hero {
    padding-top: 0;
    min-height: auto;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .page-header {
    padding-top: 0;
  }
}

/* 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 Support (optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
  /* Currently the design is light-mode only per Apple aesthetic */
}