/* ============================================
   RESPONSIVE STYLES
   Mobile, Tablet, and Desktop Breakpoints
   ============================================ */

/* ===== LARGE DESKTOP (1400px and above) ===== */
@media (min-width: 1400px) {
  .container-wide {
    max-width: 1400px;
  }
}

/* ===== DESKTOP (992px - 1399px) ===== */
@media (max-width: 1399px) {
  .hero-stats {
    min-width: 700px;
    padding: var(--space-lg) var(--space-xl);
  }
}

/* ===== TABLET (768px - 991px) ===== */
@media (max-width: 991px) {
  /* Header */
  .header {
    height: var(--header-height-mobile);
  }

  /* Logo text - smaller on tablet */
  .logo-text {
    padding: 6px 12px;
  }

  .logo-text .logo-name {
    font-size: 1.1rem;
  }

  .logo-text .logo-y {
    font-size: 1.3rem;
  }

  .logo-text .logo-suffix {
    font-size: 1.1rem;
  }

  .nav {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    height: calc(100vh - var(--header-height-mobile));
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--space-2xl);
    gap: 0;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
  }

  .nav.active {
    transform: translateX(0);
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-gray-light);
    font-size: var(--font-size-body-large);
  }

  .nav-link::after {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .header-cta {
    margin-top: var(--space-xl);
  }

  /* Hero */
  .hero {
    min-height: 80vh;
    padding-top: var(--header-height-mobile);
  }

  .hero-stats {
    position: relative;
    bottom: auto;
    transform: none;
    grid-template-columns: repeat(2, 1fr);
    min-width: auto;
    width: 90%;
    margin: var(--space-2xl) auto 0;
    padding: var(--space-lg);
    gap: var(--space-lg);
    animation: none; /* Disable float animation on tablet */
  }

  .stat-item {
    border-right: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: var(--space-md);
  }

  .stat-item:nth-child(2n) {
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  }

  .stat-item:nth-last-child(-n+2) {
    border-bottom: none;
    padding-bottom: 0;
  }

  .stat-number {
    font-size: var(--font-size-h3);
  }

  /* Marquee */
  .marquee-item {
    font-size: var(--font-size-h5);
  }

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

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

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

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

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

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

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
  }

  .footer-brand {
    max-width: 100%;
  }

  /* CTA */
  .cta-section::before {
    width: 300px;
    height: 300px;
  }
}

/* ===== MOBILE LANDSCAPE (576px - 767px) ===== */
@media (max-width: 767px) {
  /* Typography adjustments handled in variables.css */

  /* Logo text - smaller on mobile */
  .logo-text {
    padding: 5px 10px;
  }

  .logo-text .logo-name {
    font-size: 0.9rem;
  }

  .logo-text .logo-y {
    font-size: 1.05rem;
  }

  .logo-text .logo-suffix {
    font-size: 0.9rem;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: calc(var(--header-height-mobile) + var(--space-3xl)) 0 var(--space-3xl);
  }

  .hero-badge {
    font-size: 0.65rem;
    padding: var(--space-xs) var(--space-md);
  }

  .hero-cta {
    flex-direction: column;
    gap: var(--space-md);
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    border-width: 1.5px; /* Thinner border on mobile */
  }

  .hero-stats::before {
    display: none; /* Remove shine effect on mobile for performance */
  }

  .stat-item {
    border-right: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: var(--space-md);
  }

  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .stat-number {
    font-size: var(--font-size-h4);
  }

  /* Marquee */
  .marquee-section {
    padding: var(--space-lg) 0;
  }

  .marquee-item {
    font-size: var(--font-size-h6);
    gap: var(--space-md);
  }

  .marquee-item::before {
    font-size: var(--font-size-h4);
  }

  /* Section Header */
  .section-header {
    margin-bottom: var(--space-2xl);
  }

  .section-badge {
    font-size: 0.65rem;
  }

  /* Grids */
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .coverage-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Cards */
  .card,
  .service-card,
  .coverage-card {
    padding: var(--space-lg);
  }

  .card-icon,
  .service-icon {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }

  /* Buttons */
  .btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-body-small);
  }

  .btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-body);
  }

  /* CTA Section */
  .cta-buttons {
    flex-direction: column;
    gap: var(--space-md);
  }

  .cta-buttons .btn {
    width: 100%;
  }

  .cta-section::before {
    width: 200px;
    height: 200px;
    top: -30%;
  }

  /* Footer */
  .footer {
    padding: var(--space-3xl) 0 var(--space-lg);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-logo {
    height: 40px;
  }

  /* Testimonial */
  .testimonial-card {
    padding: var(--space-lg);
  }

  .testimonial-quote {
    font-size: var(--font-size-h4);
  }

  .testimonial-text {
    font-size: var(--font-size-body-small);
  }

  /* Trust Badges */
  .trust-badges {
    gap: var(--space-lg);
  }

  .trust-badge {
    flex-direction: column;
    text-align: center;
    padding: var(--space-md);
  }

  /* Contact Items */
  .contact-item {
    padding: var(--space-md);
  }

  .contact-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
  /* Container */
  :root {
    --container-padding: 0.75rem;
  }

  /* Logo - show shortened name on small mobile */
  .logo {
    height: 40px;
    gap: var(--space-xs);
  }

  .logo-text {
    padding: 4px 8px;
  }

  .logo-text .logo-name {
    font-size: 0.75rem;
  }

  .logo-text .logo-y {
    font-size: 0.9rem;
  }

  .logo-text .logo-suffix {
    font-size: 0.75rem;
  }

  /* Hero */
  .hero-title {
    font-size: 1.75rem;
  }

  .hero-description {
    font-size: var(--font-size-body);
  }

  .hero-stats {
    padding: var(--space-md);
    backdrop-filter: blur(15px) saturate(150%); /* Reduce blur on small mobile */
    -webkit-backdrop-filter: blur(15px) saturate(150%);
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item {
    aspect-ratio: 16 / 9;
  }

  /* Marquee */
  .marquee {
    gap: var(--space-2xl);
  }

  .marquee-item {
    font-size: var(--font-size-body-large);
    gap: var(--space-sm);
  }

  .marquee-item::before {
    font-size: var(--font-size-h5);
  }

  /* Section Spacing */
  section {
    padding: var(--space-2xl) 0;
  }

  /* Cards */
  .card,
  .service-card,
  .stat-card,
  .coverage-card,
  .testimonial-card {
    padding: var(--space-md);
  }

  /* Carousel Navigation */
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* Form */
  .form-input,
  .form-textarea,
  .form-select {
    padding: var(--space-sm);
    font-size: var(--font-size-body-small);
  }

  /* CTA */
  .cta-title {
    font-size: var(--font-size-h3);
  }

  .cta-description {
    font-size: var(--font-size-body);
  }
}

/* ===== EXTRA SMALL MOBILE (360px and below) ===== */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: var(--font-size-h4);
  }

  .stat-number {
    font-size: var(--font-size-h5);
  }

  .btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
  }
}

/* ===== LANDSCAPE ORIENTATION (Mobile) ===== */
@media (max-width: 991px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(var(--header-height-mobile) + var(--space-2xl)) 0 var(--space-2xl);
  }

  .nav {
    height: calc(100vh - var(--header-height-mobile));
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .header,
  .mobile-menu-toggle,
  .nav,
  .hero-cta,
  .cta-section,
  .carousel-nav,
  .carousel-pagination {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

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

/* ===== HIGH RESOLUTION DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images and icons for retina displays */
  .logo img,
  .footer-logo img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ===== DARK MODE SUPPORT (Optional) ===== */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode */
  /*
  :root {
    --color-white: #1a1a1a;
    --color-gray-dark: #f5f5f5;
    --color-gray-light: #333;
    --color-gray-lighter: #2a2a2a;
  }
  */
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets for touch devices */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-link {
    min-height: 44px;
  }

  /* Remove hover effects on touch devices */
  .hover-lift:hover,
  .hover-scale:hover,
  .hover-tilt:hover {
    transform: none;
  }

  /* Simplify animations for better performance */
  * {
    animation-duration: 0.3s !important;
  }
}
