/* =============================================
   RESPONSIVE.CSS - Mobile-First Responsive Design
   Works with main.css + components.css
   ============================================= */

/* ---------------------------------------------
   TABLET (min-width: 768px)
---------------------------------------------- */

@media (min-width: 768px) {
  :root {
    --text-h1: 3rem;
    --text-h2: 2.25rem;
    --text-h3: 1.875rem;
    --text-h4: 1.375rem;
  }

  .container,
  .vm-container {
    padding: 0 var(--spacing-2xl);
  }

  /* Legacy grid helpers (kept for safety) */
  .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }

  .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
  }

  .grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }

  .grid-auto--lg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-xl);
  }

  .feature-box {
    display: flex;
    gap: var(--spacing-2xl);
  }

  .hero,
  .vm-hero {
    padding: var(--spacing-4xl) 0;
  }

  .hero__title,
  .vm-hero__title {
    font-size: var(--text-h1);
  }

  .section,
  .vm-section {
    padding: var(--spacing-4xl) 0;
  }

  .hide-md-up {
    display: none;
  }

  .show-md-up {
    display: block;
  }

  /* Navigation: show desktop, hide mobile */
  .nav-mobile {
    display: none !important;
  }

  .nav-desktop {
    display: block !important;
  }

  .nav-toggle {
    display: none !important;
  }

  /* vm hero and contact grids on tablet+ */
  .vm-hero__grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
  }

  .vm-contact {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: flex-start;
  }

  .vm-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------------------------------------
   LARGE DEVICES (min-width: 1024px)
---------------------------------------------- */

@media (min-width: 1024px) {
  :root {
    --text-h1: 3.5rem;
    --text-h2: 2.5rem;
    --text-h3: 2rem;
    --text-h4: 1.5rem;
  }

  .container,
  .vm-container {
    padding: 0 var(--spacing-xl);
  }

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

  .hide-lg-up {
    display: none;
  }

  .show-lg-up {
    display: block;
  }

  /* Sticky header offset (desktop only) */
  body.sticky-header-active {
    padding-top: 80px;
  }

  /* Ensure desktop nav visible */
  .nav-mobile {
    display: none !important;
  }

  .nav-desktop {
    display: block !important;
  }

  .nav-toggle {
    display: none !important;
  }
}

/* ---------------------------------------------
   EXTRA LARGE (min-width: 1280px)
---------------------------------------------- */

@media (min-width: 1280px) {
  .section,
  .vm-section {
    padding: var(--spacing-4xl) 0;
  }

  .hide-xl-up {
    display: none;
  }

  .show-xl-up {
    display: block;
  }

  /* Keep desktop nav visible on XL */
  .nav-mobile {
    display: none !important;
  }

  .nav-desktop {
    display: block !important;
  }

  .nav-toggle {
    display: none !important;
  }
}

/* ---------------------------------------------
   MOBILE (max-width: 767px)
---------------------------------------------- */

@media (max-width: 767px) {
  :root {
    --text-h1: 2rem;
    --text-h2: 1.75rem;
    --text-h3: 1.5rem;
    --text-h4: 1.25rem;
    --spacing-4xl: 3rem;
  }

  body {
    font-size: 1rem;
  }

  .container,
  .vm-container {
    padding: 0 var(--spacing-lg);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-bottom: var(--spacing-lg);
  }

  p {
    margin-bottom: var(--spacing-lg);
    font-size: 0.95rem;
  }

  a {
    word-break: break-word;
  }

  /* Grid adjustments */
  .grid-2,
  .grid-3,
  .grid-4,
  .vm-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .grid-auto {
    grid-template-columns: 1fr;
  }

  /* Cards */
  .card,
  .vm-card {
    padding: var(--spacing-xl);
  }

  .hero,
  .vm-hero {
    padding: var(--spacing-3xl) 0;
  }

  .hero__title,
  .vm-hero__title {
    font-size: var(--text-h2);
    line-height: 1.2;
  }

  .hero__subtitle,
  .vm-hero__subtitle {
    margin-bottom: var(--spacing-lg);
  }

  .hero__description {
    font-size: var(--text-base);
    margin-bottom: var(--spacing-xl);
  }

  .hero__cta,
  .vm-hero__actions {
    gap: var(--spacing-md);
    flex-direction: column;
  }

  .hero__cta .btn,
  .vm-hero__actions .vm-btn {
    width: 100%;
  }

  /* Buttons */
  .btn,
  .vm-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--text-sm);
    width: 100%;
  }

  .btn--block,
  .vm-btn--full {
    display: block;
  }

  /* Sections */
  .section,
  .vm-section {
    padding: var(--spacing-2xl) 0;
  }

  .section__header,
  .vm-section__header {
    margin-bottom: var(--spacing-2xl);
    text-align: left;
  }

  .section__title,
  .vm-section__title {
    font-size: var(--text-h3);
  }

  .section__subtitle,
  .vm-section__subtitle {
    font-size: var(--text-sm);
  }

  /* Feature boxes (if used) */
  .feature-box {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-lg);
  }

  .feature-box__icon {
    margin: 0 auto;
  }

  /* Pricing cards (styles kept for future use) */
  .pricing-card {
    padding: var(--spacing-xl);
  }

  .pricing-card--highlighted {
    transform: scale(1);
  }

  .pricing-card--highlighted:hover {
    transform: translateY(-8px);
  }

  .pricing-card__price {
    font-size: 2rem;
  }

  /* CTA section */
  .cta {
    padding: var(--spacing-2xl) var(--spacing-lg);
  }

  .cta__title {
    font-size: var(--text-h3);
  }

  .cta__description {
    font-size: var(--text-sm);
  }

  /* Testimonials */
  .testimonial {
    padding: var(--spacing-lg);
  }

  .testimonial__author {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  /* Stats */
  .stats-box__number {
    font-size: 2rem;
  }

  /* Hide/show utilities */
  .hide-mobile {
    display: none;
  }

  .show-mobile {
    display: block;
  }

  /* Navigation (mobile menu) - show mobile, hide desktop */
  .nav-mobile {
    display: block !important;
  }

  .nav-desktop {
    display: none !important;
  }

  .nav-toggle {
    display: flex !important;
  }

  /* Images */
  img {
    max-width: 100%;
  }

  /* Forms */
  input,
  textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: var(--spacing-md);
  }

  /* Lists */
  ul,
  ol {
    padding-left: var(--spacing-lg);
  }

  /* Tables (if used) */
  table {
    font-size: var(--text-sm);
    overflow-x: auto;
    display: block;
  }

  /* Flex utilities */
  .flex-between {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  /* Spacing utilities */
  .mt-4,
  .mt-5 {
    margin-top: var(--spacing-2xl);
  }

  .mb-4,
  .mb-5 {
    margin-bottom: var(--spacing-2xl);
  }

  .py-4,
  .py-5 {
    padding: var(--spacing-2xl) 0;
  }

  /* vm-specific contact layout */
  .vm-contact {
    gap: var(--spacing-3xl);
  }
}

/* ---------------------------------------------
   SMALL MOBILE (max-width: 480px)
---------------------------------------------- */

@media (max-width: 480px) {
  :root {
    --text-h1: 1.75rem;
    --text-h2: 1.5rem;
    --text-h3: 1.25rem;
    --spacing-3xl: 3rem;
    --spacing-4xl: 2.5rem;
  }

  .container,
  .vm-container {
    padding: 0 var(--spacing-md);
  }

  h1 {
    font-size: var(--text-h1);
  }

  h2 {
    font-size: var(--text-h2);
  }

  .hero__cta,
  .vm-hero__actions {
    flex-direction: column;
  }

  .btn,
  .vm-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--text-sm);
  }

  .btn--lg {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .card,
  .vm-card {
    padding: var(--spacing-lg);
  }

  .pricing-card {
    padding: var(--spacing-lg);
  }

  .cta {
    padding: var(--spacing-2xl) var(--spacing-md);
  }

  .testimonial {
    padding: var(--spacing-md);
  }

  .section__title,
  .vm-section__title {
    font-size: var(--text-h4);
  }

  .text-sm {
    font-size: var(--text-xs);
  }

  .mt-1,
  .mt-2 {
    margin-top: var(--spacing-md);
  }

  .mb-1,
  .mb-2 {
    margin-bottom: var(--spacing-md);
  }

  .px-1,
  .px-2 {
    padding: 0 var(--spacing-md);
  }
}

/* ---------------------------------------------
   LANDSCAPE LOW-HEIGHT (e.g. phones)
---------------------------------------------- */

@media (max-height: 500px) and (orientation: landscape) {
  .hero,
  .vm-hero {
    padding: var(--spacing-2xl) 0;
  }

  .hero__title,
  .vm-hero__title {
    margin-bottom: var(--spacing-md);
  }

  .section,
  .vm-section {
    padding: var(--spacing-2xl) 0;
  }
}

/* ---------------------------------------------
   HIGH DPI / RETINA
---------------------------------------------- */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card,
  .vm-card,
  .testimonial,
  .pricing-card {
    border-width: 0.5px;
  }
}

/* ---------------------------------------------
   PRINT STYLES
---------------------------------------------- */

@media print {
  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  .no-print,
  .sidebar,
  .nav-primary,
  .site-footer .widget,
  .nav-mobile {
    display: none;
  }

  .container,
  .vm-container {
    max-width: 100%;
    padding: 0 1.5rem;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
  }

  p {
    page-break-inside: avoid;
  }
}

/* ---------------------------------------------
   ACCESSIBILITY PREFERENCES
---------------------------------------------- */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode preference (hook for future use) */
@media (prefers-color-scheme: dark) {
  /* reserved for future theme variations */
}

/* High contrast mode */
@media (prefers-contrast: more) {
  .card,
  .vm-card {
    border-width: 2px;
  }

  .btn,
  .vm-btn {
    border-width: 2px;
  }
}
