/* ============================================
   RESPONSIVE.CSS
   Mobile-First Breakpoints
   ============================================ */

/* ===== MOBILE: 480px - 767px ===== */
@media (min-width: 480px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  
  .navbar-menu {
    gap: 1rem;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .feature-row:nth-child(even) .feature-image {
    order: 0;
  }
}

/* ===== TABLET: 768px - 1023px ===== */
@media (min-width: 768px) {
  :root {
    --section-padding: 80px 0;
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.75rem; }

  .container {
    padding: 0 3rem;
  }

  .navbar-menu {
    gap: 2rem;
  }

  .navbar-toggle {
    display: none;
  }

  .grid {
    gap: 2rem;
  }

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

  .feature-row {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .feature-row:nth-child(even) .feature-image {
    order: -1;
  }

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

  /* Cards on tablet */
  .card-treatment {
    padding: 1.5rem;
  }

  .card-stat {
    padding: 2rem;
  }

  /* Forms on tablet */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  /* Tabs on tablet */
  .tabs {
    gap: 1.5rem;
  }

  .tab-button {
    padding: 1rem 2rem;
  }

  /* Blog cards */
  .card-blog {
    flex-direction: row;
  }

  .card-blog-image {
    width: 40%;
    height: 100%;
    min-height: 250px;
  }

  .card-blog-content {
    width: 60%;
  }
}

/* ===== DESKTOP: 1024px - 1279px ===== */
@media (min-width: 1024px) {
  :root {
    --section-padding: 100px 0;
  }

  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.875rem; }

  .container {
    padding: 0 4rem;
  }

  .navbar-menu {
    gap: 2.5rem;
  }

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

  .feature-row {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .floating-cta {
    bottom: 40px;
    right: 40px;
  }

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

  /* Hero sections */
  .hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
  }

  /* Card variations */
  .card-treatment {
    padding: 2rem;
  }

  .card-stat {
    padding: 2.5rem;
  }

  .card-testimonial {
    padding: 2.5rem;
  }

  /* Forms */
  .form-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .form-row.full {
    grid-template-columns: 1fr;
  }

  /* Section layouts */
  .section-padding-lg {
    padding: 150px 0;
  }
}

/* ===== WIDE: 1280px - 1535px ===== */
@media (min-width: 1280px) {
  :root {
    --container-max: 1280px;
    --section-padding: 120px 0;
  }

  .container {
    padding: 0 2rem;
  }

  /* Large grids */
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(5, 1fr); }

  /* Larger cards for wide screens */
  .card {
    padding: 2rem;
  }

  /* Blog featured post larger */
  .featured-post {
    grid-column: span 2;
  }

  /* Multi-column layouts */
  .content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
  }

  .sidebar {
    position: sticky;
    top: 80px;
  }
}

/* ===== ULTRA-WIDE: 1536px+ ===== */
@media (min-width: 1536px) {
  :root {
    --container-max: 1400px;
  }

  h1 { font-size: 4rem; }
  h2 { font-size: 3rem; }

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

  /* Extra padding for wide layouts */
  .container {
    padding: 0;
  }

  .feature-row {
    gap: 5rem;
  }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover effects on touch devices */
  .card:hover,
  .btn:hover,
  .navbar-menu a:hover {
    transform: none;
  }

  /* Larger touch targets */
  .btn {
    padding: 14px 28px;
  }

  .btn-icon {
    width: 48px;
    height: 48px;
  }

  /* Remove hover pseudo-elements */
  .navbar-menu a::after {
    display: none;
  }

  /* Larger form inputs */
  input, textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 14px 16px;
  }

  /* Reduce animations on touch */
  * {
    animation-duration: 0.5s !important;
  }
}

/* ===== LANDSCAPE MODE (Mobile) ===== */
@media (max-height: 500px) and (min-width: 320px) {
  :root {
    --section-padding: 40px 0;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .hero-section {
    min-height: auto;
    padding: 2rem 0;
  }

  .navbar {
    padding: 0.5rem 0;
  }

  .section-title {
    margin-bottom: 1.5rem;
  }

  .feature-row {
    gap: 1rem;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  * {
    animation: none !important;
    transition: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .navbar,
  .footer,
  .floating-cta,
  .floating-btn,
  .btn-whatsapp,
  .btn-phone,
  .no-print {
    display: none !important;
  }

  a {
    color: #0a6e8a;
    text-decoration: underline;
  }

  img {
    max-width: 100%;
  }

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

  p {
    orphans: 3;
    widows: 3;
  }

  .page-break {
    page-break-before: always;
  }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: more) {
  :root {
    --color-text: #000000;
    --color-border: #000000;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .card,
  .btn {
    border: 1px solid var(--color-text);
  }
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --color-white: #1a1a1a;
    --color-off-white: #2a2a2a;
    --color-light-gray: #404040;
    --color-border: #404040;
    --color-text: #e0e0e0;
    --color-text-muted: #a0a0a0;
    --color-dark: #ffffff;
  }

  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }

  a {
    color: #12a3c4;
  }

  .navbar {
    background: rgba(26, 26, 26, 0.95);
  }

  .card {
    background: #2a2a2a;
  }

  .glassmorphism {
    background: rgba(42, 42, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
  }

  input, textarea, select {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #404040;
  }
}

/* ===== 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;
  }
}

/* ===== RETINA DISPLAYS (2x+) ===== */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* Fine-tune border-radius on high-DPI */
  .btn,
  .card {
    border-radius: calc(var(--radius-card) * 1.05);
  }

  /* Thinner borders on retina */
  input, textarea, select {
    border-width: 0.5px;
  }
}

/* ===== SCROLLBAR ON DESKTOP ===== */
@media (min-width: 1024px) {
  body {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary-light) var(--color-off-white);
  }
}

/* ===== UTILITY: HIDE/SHOW ON BREAKPOINTS ===== */
.hidden-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hidden-mobile {
    display: block;
  }
  .hidden-tablet {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hidden-tablet {
    display: block;
  }
  .hidden-desktop {
    display: none;
  }
}

@media (min-width: 1280px) {
  .hidden-desktop {
    display: block;
  }
  .hidden-wide {
    display: none;
  }
}

@media (max-width: 767px) {
  .visible-mobile-only {
    display: block;
  }
  .hidden-mobile-only {
    display: none;
  }
}

/* ===== CONTAINER QUERIES (Future Support) ===== */
@supports (container-type: inline-size) {
  .container-responsive {
    container-type: inline-size;
  }

  @container (min-width: 400px) {
    .container-responsive-content {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
  }

  @container (min-width: 700px) {
    .container-responsive-content {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}
