/* ===================================
   S9 SERVICES LLC - RESPONSIVE STYLES
   Mobile-First Design System
   =================================== */

/* ===================================
   TABLET BREAKPOINTS
   max-width: 980px
   =================================== */

@media (max-width: 980px) {
  /* Grid Layouts */
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

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

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

  /* Flex Layouts */
  .flex-wrap {
    flex-wrap: wrap;
  }

  /* Container adjustments */
  .container {
    padding: 0 var(--container-padding);
  }

  /* Typography */
  .text-responsive-lg {
    font-size: clamp(24px, 3vw, 32px);
  }

  /* Section Padding */
  section {
    padding: 50px 0;
  }

  /* Image Boxes */
  .image-box {
    min-height: 300px;
  }

  .image-box img {
    min-height: 300px;
  }
}


/* ===================================
   MOBILE BREAKPOINTS
   max-width: 760px
   =================================== */

@media (max-width: 760px) {
  /* Root Variables */
  :root {
    --spacing-5xl: 50px;
  }

  /* Typography Scaling */
  h1 {
    font-size: clamp(24px, 6vw, 36px);
  }

  h2 {
    font-size: clamp(20px, 5vw, 28px);
  }

  h3 {
    font-size: clamp(18px, 4vw, 24px);
  }

  /* Section Title */
  .section-title h2 {
    font-size: clamp(24px, 5vw, 40px) !important;
  }

  .section-title p {
    font-size: var(--text-base);
  }

  /* Section Padding */
  section {
    padding: 40px 0;
  }

  .section-spacing {
    padding: 40px 0 !important;
  }

  /* Container */
  .container {
    padding: 0 var(--container-padding);
  }

  /* Grid Layouts */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr !important;
  }

  .card-grid {
    grid-template-columns: 1fr !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Flex Layouts */
  .flex-row {
    flex-direction: column !important;
  }

  .flex-between {
    justify-content: flex-start !important;
  }

  /* Buttons */
  .btn {
    width: 100%;
    min-height: 48px;
    font-size: var(--text-xs);
    padding: 0 16px;
  }

  .btn-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .btn-group .btn {
    width: 100%;
  }

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

  .card-title {
    font-size: var(--text-2xl);
  }

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

  .image-box {
    min-height: 240px;
  }

  .image-box img {
    min-height: 240px;
  }

  /* Trust Bar */
  .trust-bar {
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
  }

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

  .trust-item:not(:last-child)::after {
    content: '';
    margin-left: 0;
  }

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

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

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

  /* Lists */
  .list-disc li {
    margin-bottom: var(--spacing-sm);
  }

  /* Spacing Utilities - Mobile Overrides */
  .mt-3xl { margin-top: var(--spacing-2xl) !important; }
  .mb-3xl { margin-bottom: var(--spacing-2xl) !important; }

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

  .modal-header {
    padding: var(--spacing-xl) var(--spacing-lg) 16px;
  }

  .modal-header h3 {
    font-size: 24px;
  }

  .modal-body {
    padding: var(--spacing-lg);
  }

  /* Utilities */
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }

  .text-center-mobile {
    text-align: center;
  }
}


/* ===================================
   SMALL MOBILE
   max-width: 480px
   =================================== */

@media (max-width: 480px) {
  /* Typography */
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 16px;
  }

  /* Spacing */
  :root {
    --spacing-2xl: 16px;
    --spacing-3xl: 20px;
    --spacing-5xl: 32px;
  }

  section {
    padding: 32px 0;
  }

  /* Gap */
  .gap-2xl {
    gap: var(--spacing-xl) !important;
  }

  /* Buttons */
  .btn {
    min-height: 44px;
    font-size: 11px;
  }

  /* Cards */
  .card {
    padding: var(--spacing-lg);
  }

  /* Images */
  .image-box {
    min-height: 200px;
  }

  .image-box img {
    min-height: 200px;
  }

  /* Forms */
  input,
  select,
  textarea {
    min-height: 44px;
  }
}


/* ===================================
   LANDSCAPE ORIENTATION
   Specific adjustments for landscape
   =================================== */

@media (max-height: 500px) and (orientation: landscape) {
  section {
    padding: 32px 0;
  }

  .section-title {
    margin-bottom: var(--spacing-2xl);
  }

  .section-title h2 {
    font-size: 24px;
  }

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

  .modal-card {
    max-height: 90vh;
  }
}


/* ===================================
   HIGH RESOLUTION DISPLAYS
   (Retina, 2x, 3x DPI)
   =================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: high-quality;
  }
}


/* ===================================
   DARK MODE SUPPORT
   For future dark mode implementation
   =================================== */

@media (prefers-color-scheme: dark) {
  /* Reserve for future dark theme */
}


/* ===================================
   REDUCED MOTION
   Accessibility: Disable animations
   =================================== */

@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;
  }
}


/* ===================================
   PRINT STYLES
   =================================== */

@media print {
  body {
    background-color: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

  a {
    text-decoration: underline;
  }

  .btn,
  .modal,
  .modal-overlay,
  nav {
    display: none !important;
  }

  section {
    page-break-inside: avoid;
  }

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}


/* ===================================
   TOUCH DEVICE OPTIMIZATIONS
   =================================== */

@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn {
    min-height: 48px;
  }

  a,
  button {
    padding: var(--spacing-md);
  }

  /* Reduce visual feedback on touch */
  .btn:hover {
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  /* Optimize form for touch */
  input,
  select,
  textarea {
    font-size: 16px; /* Prevents iOS zoom on input focus */
  }
}


/* ===================================
   DESKTOP ENHANCEMENT
   Extra large screens
   =================================== */

@media (min-width: 1600px) {
  :root {
    --container-max: 1400px;
  }

  .section-title h2 {
    font-size: 64px;
  }

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