/* ============================================================
   HorizonDrill — Mobile & Responsive Styles
   Loaded after style.css; depends on CSS custom properties defined there.
   ============================================================ */

/* --- Responsive --- */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .product-layout { grid-template-columns: 1fr; }
  .product-sidebar { display: none; }
  .product-hero { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 64px 24px; }
  .nav-inner { padding: 0 16px; }
  .nav-links { display: none; }
  .hero { padding: 0 24px; min-height: 90vh; }
  .hero-content { text-align: left; }
  .hero-title { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-desc { font-size: 0.9375rem; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item { padding: 28px 16px; }
  .stat-value { font-size: 1.75rem; }
  .form-row { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .case-detail { padding: 56px 16px 80px; }
  .case-hero-title { font-size: 1.5rem; }
  .case-meta { gap: 16px; }

  .section-title { font-size: 1.5rem; }
  .product-main { padding: 24px 16px; }
  .product-block { padding: 24px 16px; }

  /* Mobile language row — visible next to brand */
  .mobile-lang-row {
    display: flex;
    gap: 2px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .mobile-lang-row .lang-btn {
    padding: 8px 14px;
    font-size: 0.75rem;
  }

  /* Bottom tab bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(249, 248, 246, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-subtle);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: flex-start;
  }
  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.625rem;
    font-family: var(--font-sans);
    cursor: pointer;
    padding: 4px 8px;
    min-width: 48px;
    min-height: 48px;
    text-decoration: none;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tab.active {
    color: var(--accent);
  }
  .mobile-tab-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-tab-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Push content up for bottom nav */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* Product detail mobile section nav */
  .mobile-section-nav {
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 0;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 56px;
    z-index: 99;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mobile-section-nav::-webkit-scrollbar {
    display: none;
  }
  .section-tab {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    font-family: var(--font-sans);
    font-weight: 450;
    transition: all var(--transition);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .section-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  /* Product detail layout adjustments for section nav */
  .product-layout {
    scroll-margin-top: 106px; /* nav(56px) + section-nav(~50px) */
  }
  .product-hero,
  .product-block {
    scroll-margin-top: 106px;
  }

  /* Footer bottom padding for mobile nav */
  .footer {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  /* Larger touch targets for all buttons */
  .btn {
    padding: 14px 28px;
    font-size: 0.8125rem;
  }

  /* Card image responsive height */
  .card-image {
    height: 200px;
  }
}

/* Mobile-only elements hidden on desktop */
@media (min-width: 769px) {
  .mobile-lang-row,
  .mobile-bottom-nav,
  .mobile-section-nav {
    display: none !important;
  }
}
