/**
 * Responsive Stylesheet — DR Digital Solution
 * Breakpoint overrides for all Bootstrap 5 breakpoints.
 * xs <576 | sm ≥576 | md ≥768 | lg ≥992 | xl ≥1200 | xxl ≥1400
 */

/* ─── xxl (≥1400px) ─────────────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .container { max-width: var(--container-max); }
}

/* ─── xl (≥1200px) ──────────────────────────────────────────────────────── */
@media (min-width: 1200px) {
  .hero-title { font-size: 4rem; }
}

/* ─── lg (≥992px) ───────────────────────────────────────────────────────── */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .hamburger { display: none; }
  .hero-section .row { align-items: center; min-height: 85vh; }
}

/* ─── Below lg (<992px) — Mobile Navigation ─────────────────────────────── */
@media (max-width: 991.98px) {
  html, body { overflow-x: hidden !important; width: 100% !important; max-width: 100vw !important; }
  .site-header { width: 100% !important; max-width: 100vw !important; left: 0 !important; right: 0 !important; }
  .header-inner { width: 100% !important; padding: 0 1.25rem !important; display: flex !important; align-items: center !important; justify-content: space-between !important; }
  .main-nav { display: none; }
  .hamburger { display: flex; }

  /* Hero */
  .hero-section { padding-top: calc(var(--header-height) + 1.5rem); text-align: center; overflow: hidden; }
  .hero-subtitle { margin: 0 auto 2rem; }
  .hero-cta-group { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { margin-top: 2rem; overflow: hidden; padding: 10px 0; }
  .hero-dashboard-wrap { max-width: 100%; width: 100%; margin: 0 auto; }

  /* Contain floating mini cards on tablet */
  .hd-mini-seo { left: 0; bottom: -15px; width: 160px; }
  .hd-mini-social { right: 0; top: 40px; width: 160px; }
  .hd-badge-1 { top: -14px; left: 10px; }
  .hd-badge-2 { bottom: 10px; right: 10px; }

  /* Process timeline — stack vertically */
  .process-timeline { flex-direction: column; align-items: center; }
  .process-step { width: 100%; max-width: 400px; }
  .process-step::after { display: none; }

  /* Footer */
  .footer-brand { margin-bottom: 2.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }
}

/* ─── md (≥768px) ───────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .newsletter-form { flex-direction: row; }
}

/* ─── Below md (<768px) ─────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* Typography */
  .section-title { font-size: 1.75rem; }
  .page-hero-title { font-size: 2rem; }

  /* Section spacing */
  .section { padding: var(--section-py-mobile) 0; }
  .cta-banner { padding: 3rem 1.5rem; border-radius: var(--radius-lg); }

  /* Hero */
  .hero-title { font-size: 2rem; }
  .stat-chip { min-width: 120px; padding: 0.875rem 1rem; }

  /* Pricing — single column on mobile */
  .pricing-card.featured { transform: none; }
  .pricing-card.featured:hover { transform: translateY(-4px); }

  /* Portfolio filter — wrap on small screens */
  .portfolio-filter { gap: 0.375rem; }
  .filter-btn { font-size: 0.8125rem; padding: 0.4rem 1rem; }

  /* Blog sidebar — stacks below content */
  .blog-sidebar-col { margin-top: 3rem; }

  /* Contact */
  .contact-right { margin-top: 2.5rem; }

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

  /* Footer */
  .footer-socials { justify-content: flex-start; }
  .footer-desc { max-width: 100%; }
}

/* ─── sm (≥576px) ───────────────────────────────────────────────────────── */
@media (min-width: 576px) {
  .hero-cta-group .btn { min-width: 180px; }
}

/* ─── xs (<576px) ───────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  /* Full-width buttons on very small screens */
  .hero-cta-group { flex-direction: column; width: 100%; }
  .hero-cta-group .btn { width: 100%; justify-content: center; }

  /* Hero dashboard on small phones */
  .hd-mini-seo, .hd-mini-social, .hd-badge-2 { display: none !important; }
  .hd-badge-1 { top: -14px; left: 50%; transform: translateX(-50%); }
  .hd-main-card { padding: 1rem 0.875rem; }
  .hd-metrics { gap: 0.25rem; }
  .hd-metric-val { font-size: 0.95rem; }

  /* Hero stats — 2 per row */
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .stat-chip { min-width: auto; padding: 0.75rem; }
  .stat-chip-value { font-size: 1.1rem; }

  /* Service cards — 2x2 compact 4-grid on mobile */
  .row.g-4 { --bs-gutter-x: 0.65rem; --bs-gutter-y: 0.65rem; }
  .service-card {
    padding: 1rem 0.75rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .service-icon-badge {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.6rem;
  }
  .service-card-title {
    font-size: 0.875rem;
    font-weight: var(--fw-bold);
    line-height: 1.2;
    margin-bottom: 0.3rem;
  }
  .service-card-desc {
    font-size: 0.75rem;
    line-height: 1.35;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .service-card-link {
    font-size: 0.725rem;
    margin-top: auto;
  }

  /* Scrollable table on mobile */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* WhatsApp and scroll-to-top adjust */
  .whatsapp-float { width: 48px; height: 48px; right: 14px; bottom: 14px; font-size: 1.35rem; }
  .scroll-to-top  { right: 14px; bottom: 74px; width: 42px; height: 42px; }

  /* Footer */
  .footer-top { padding: 3rem 0 2.5rem; }
  .footer-bottom-links { flex-wrap: wrap; gap: 1rem; }
}

/* ─── 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;
  }
  [data-aos] { opacity: 1 !important; transform: none !important; }
}

/* ─── Print ──────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .whatsapp-float, .scroll-to-top,
  .hero-cta-group, .cta-banner, #page-loader { display: none !important; }
  body { background: #fff; color: #000; }
  .container { max-width: 100%; }
}
