/* =====================================================
   EXOTIC CARS TECHNICIAN - MOBILE RESPONSIVE STYLES
   Comprehensive mobile-first responsive enhancements
   ===================================================== */

/* === MOBILE VIEWPORT FIX === */
@supports (height: 100dvh) {
  .hero,
  .mobile-menu {
    min-height: 100dvh;
  }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
  /* Disable custom cursor on touch devices */
  body,
  a,
  button,
  input,
  select,
  textarea {
    cursor: auto !important;
  }

  .cursor,
  .cursor-dot {
    display: none !important;
  }

  /* Larger touch targets */
  .btn,
  .nav-link,
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects that don't work on touch */
  .service-card:hover,
  .gallery-item:hover,
  .team-card:hover {
    transform: none;
  }

  /* Show gallery overlay by default on touch */
  .gallery-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 60%);
  }

  .gallery-zoom {
    opacity: 1;
    transform: scale(1);
  }

  /* Hero video responsive for touch/mobile */
  .hero-bg video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
  }
}

/* === HERO VIDEO MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  .hero-bg video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: 100%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    object-fit: cover;
  }
}

@media (max-width: 480px) {
  .hero-bg video {
    width: auto;
    height: 100%;
    min-width: 100vw;
    min-height: 100%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    object-fit: cover;
  }
}

/* Landscape mobile - video fills width */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-bg video {
    width: 100%;
    height: auto;
    min-height: 100%;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
  }
}

/* === SMALL MOBILE (320px - 480px) === */
@media (max-width: 480px) {
  /* Base Typography */
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative !important;
  }

  html {
    font-size: 14px;
  }

  h1,
  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  h2,
  .section-title {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
  }

  h3 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  /* Container */
  .container,
  .container-fluid,
  .container-narrow,
  .container-wide {
    padding-inline: var(--space-4);
  }

  /* Sections */
  .section {
    padding-block: var(--space-12);
  }

  .section-sm {
    padding-block: var(--space-8);
  }

  .section-lg {
    padding-block: var(--space-16);
  }

  /* Hero Section */
  .hero {
    padding-top: var(--space-20);
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem);
    line-height: 1.1;
  }

  .hero-text {
    font-size: 0.95rem;
    margin-bottom: var(--space-6);
    max-width: 90%;
    margin-inline: auto;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

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

  .hero-scroll {
    display: none;
  }

  .hero-badge {
    margin-bottom: var(--space-4);
  }

  .hero-badge-line {
    width: 24px;
  }

  /* Page Header */
  .page-header {
    min-height: 40vh;
    padding-top: var(--space-24);
    padding-bottom: var(--space-10);
  }

  .page-header-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .page-header-subtitle {
    font-size: var(--text-sm);
    padding: 0 var(--space-2);
  }

  /* Section Headers */
  .section-header {
    margin-bottom: var(--space-8);
  }

  .section-badge {
    font-size: 10px;
    padding: var(--space-1) var(--space-3);
  }

  .section-subtitle {
    font-size: var(--text-sm);
    padding: 0 var(--space-2);
  }

  /* Buttons */
  .btn {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
  }

  .btn-lg {
    padding: var(--space-4) var(--space-6);
  }

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

  .service-card-icon {
    width: 50px;
    height: 50px;
    font-size: var(--text-xl);
  }

  .service-card-title {
    font-size: var(--text-base);
  }

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

  /* Stats */
  .stat-item {
    padding: var(--space-4);
  }

  .stat-number {
    font-size: var(--text-2xl);
  }

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

  /* Forms */
  .form-input,
  .form-select,
  .form-textarea {
    padding: var(--space-3) var(--space-4);
    font-size: 16px;
    /* Prevents iOS zoom */
  }

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

  .form-row {
    gap: var(--space-4);
  }

  /* Contact Info */
  .contact-info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .contact-info-icon {
    width: 40px;
    height: 40px;
  }

  .contact-form-container,
  .booking-form-container {
    padding: var(--space-5);
  }

  /* Gallery */
  .gallery-grid {
    gap: var(--space-2);
  }

  .gallery-caption {
    padding: var(--space-3);
  }

  .gallery-caption-title {
    font-size: var(--text-sm);
  }

  /* Team */
  .team-card-name {
    font-size: var(--text-base);
  }

  .team-card-role {
    font-size: var(--text-xs);
  }

  /* Footer */
  .footer {
    padding: var(--space-8) 0 var(--space-4);
  }

  .footer-grid {
    gap: var(--space-6);
  }

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

  .footer-link {
    font-size: var(--text-xs);
    padding: var(--space-2) 0;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
  }

  /* Testimonials */
  .testimonial-card {
    padding: var(--space-5);
  }

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

  /* Booking */
  .booking-progress-number {
    width: 32px;
    height: 32px;
    font-size: var(--text-xs);
  }

  .booking-progress-line {
    width: 20px;
  }

  .booking-step-title {
    font-size: var(--text-base);
  }

  .booking-nav {
    flex-direction: column-reverse;
    gap: var(--space-3);
  }

  .booking-nav .btn {
    width: 100%;
  }

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

  .service-select-card {
    padding: var(--space-3);
  }

  .service-select-inner svg {
    width: 20px;
    height: 20px;
  }

  .service-select-name {
    font-size: var(--text-xs);
  }

  /* Map */
  .map-container {
    height: 250px;
  }

  /* Lightbox */
  .lightbox-nav,
  .lightbox-close {
    width: 40px;
    height: 40px;
  }

  .lightbox-nav {
    display: none;
  }
}

/* === MEDIUM MOBILE (481px - 640px) === */
@media (min-width: 481px) and (max-width: 640px) {
  .hero-title {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
  }

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

/* === MOBILE LANDSCAPE (641px - 768px) === */
@media (min-width: 641px) and (max-width: 768px) {
  .hero {
    min-height: 80vh;
  }

  .hero-cta {
    flex-direction: row;
  }

  .hero-cta .btn {
    width: auto;
  }

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

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

/* === TABLET (769px - 1024px) === */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-title {
    font-size: var(--text-5xl);
  }

  .container {
    padding-inline: var(--space-8);
  }

  .section {
    padding-block: var(--space-20);
  }

  /* Navigation adjustments */
  .navbar-logo-text {
    display: none;
  }

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

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

  /* Booking sidebar comes first on tablet */
  .grid-booking {
    grid-template-columns: 1fr;
  }

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

  /* CTA section adjustments */
  .cta-title {
    font-size: var(--text-3xl);
  }

  .cta-text {
    font-size: var(--text-base);
  }

  /* Page Header adjustments */
  .page-header {
    min-height: 40vh;
    padding-top: var(--space-24);
  }

  .page-header-title {
    font-size: var(--text-4xl);
  }

  /* Hero text smaller on tablet */
  .hero-text {
    font-size: var(--text-lg);
  }

  /* Brands marquee */
  .brand-logo {
    height: 35px;
  }

  /* Stats grid 2 columns on tablet */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2)::after {
    display: none;
  }

  /* Team cards */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Why cards */
  .why-card {
    padding: var(--space-6);
  }

  /* Contact form */
  .contact-form-container {
    padding: var(--space-8);
  }

  /* Map smaller on tablet */
  .map-container {
    height: 350px;
  }
}

/* === TABLET PORTRAIT TO MOBILE (max 768px) === */
@media (max-width: 768px) {
  /* Footer single column */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }

  .footer-brand {
    align-items: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-description {
    margin-inline: auto;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2) var(--space-4);
  }

  .footer-column {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* CTA section */
  .cta-title {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
  }

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

  .cta-content .hero-cta {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin-inline: auto;
  }

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

  /* Brands marquee */
  .brand-logo {
    height: 30px;
  }

  .brands-marquee {
    padding: var(--space-4) 0;
  }

  /* Page Header */
  .page-header {
    min-height: 35vh;
    padding-top: var(--space-20);
    padding-bottom: var(--space-8);
  }

  .page-header-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .page-header-subtitle {
    font-size: var(--text-sm);
  }

  /* Contact info stack */
  .contact-info-card {
    padding: var(--space-5);
  }

  /* Booking */
  .booking-form-container {
    padding: var(--space-5);
  }

  .booking-summary-card {
    padding: var(--space-5);
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .stat-item {
    padding: var(--space-5);
  }

  .stat-item::after {
    display: none;
  }

  .stat-number {
    font-size: var(--text-3xl);
  }

  /* Gallery filters */
  .gallery-filters {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .gallery-filter-btn {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
  }

  /* About section */
  .about-image {
    height: 300px;
  }

  /* Service cards full width */
  .service-card {
    padding: var(--space-6);
  }
}

/* === SMALL MOBILE ADDITIONS (max 480px) === */
@media (max-width: 480px) {
  /* Hero video ensure cover */
  .hero-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transform: none;
  }

  /* Brands smaller */
  .brand-logo {
    height: 24px;
  }

  /* Footer compact */
  .footer-social {
    gap: var(--space-3);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  /* Stats single column */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* CTA section padding */
  .cta-section {
    padding-block: var(--space-12);
  }

  /* Map smaller */
  .map-container {
    height: 200px;
  }

  /* Form row single column */
  .form-row {
    flex-direction: column;
  }

  /* Breadcrumb wrap */
  .breadcrumb {
    flex-wrap: wrap;
    font-size: var(--text-xs);
  }
}

/* === SAFE AREA INSETS (Notched Phones) === */
@supports (padding: max(0px)) {
  .navbar {
    padding-left: max(var(--space-6), env(safe-area-inset-left));
    padding-right: max(var(--space-6), env(safe-area-inset-right));
  }

  .mobile-menu {
    padding-top: max(var(--space-24), env(safe-area-inset-top));
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
    padding-left: max(var(--space-6), env(safe-area-inset-left));
    padding-right: max(var(--space-6), env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
  }

  .back-to-top {
    bottom: max(
      var(--space-6),
      calc(env(safe-area-inset-bottom) + var(--space-4))
    );
    right: max(
      var(--space-6),
      calc(env(safe-area-inset-right) + var(--space-4))
    );
  }
}

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

  .hero-scroll-line {
    animation: none;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .stagger-children > * {
    opacity: 1;
    transform: none;
  }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
  /* Site is already dark themed, maps use default colors */
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
  :root {
    --border-color: rgba(255, 255, 255, 0.5);
    --border-color-light: rgba(255, 255, 255, 0.3);
  }

  .btn,
  .form-input,
  .form-select,
  .form-textarea {
    border-width: 2px;
  }

  .nav-link::after {
    height: 3px;
  }
}

/* === MOBILE MENU ENHANCEMENTS === */
.mobile-menu {
  padding: var(--space-24) var(--space-6);
  text-align: center;
}

.mobile-menu .nav-link {
  display: block;
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-xl);
  border-bottom: 1px solid var(--border-color-light);
}

.mobile-menu .nav-link:last-of-type {
  border-bottom: none;
}

.mobile-menu .btn {
  width: 100%;
  max-width: 300px;
  margin-top: var(--space-6);
  justify-content: center;
}

.mobile-search-container {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto var(--space-6);
}

.mobile-search-input {
  width: 100%;
  padding: 12px 45px 12px 20px;
  border: 1px solid var(--border-color-light);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

.mobile-search-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-gold);
  box-shadow: 0 0 15px rgba(201, 162, 39, 0.15);
}

.mobile-search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gold);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.mobile-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: none;
  text-align: left;
  z-index: 100;
  box-shadow: var(--shadow-xl);
  max-height: 300px;
  overflow-y: auto;
}

.mobile-search-results.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color-light);
  transition: all 0.2s;
  text-decoration: none;
  font-size: var(--text-sm);
}

.search-result-item:hover {
  background: rgba(201, 162, 39, 0.1);
  color: var(--color-gold);
  padding-left: 25px;
}

.search-result-item:last-child {
  border-bottom: none;
}

/* === SWIPE HINT FOR GALLERIES === */
@media (max-width: 768px) {
  .gallery-grid::after {
    content: "← Swipe to explore →";
    display: none;
    /* Hidden by default, show for horizontal scroll galleries */
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-xs);
    padding: var(--space-4);
    grid-column: 1 / -1;
  }
}

/* === STICKY CTA FOR MOBILE === */
@media (max-width: 768px) {
  .mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: var(--space-4);
    border-top: 1px solid var(--border-color-light);
    z-index: var(--z-sticky);
    display: flex;
    gap: var(--space-3);
  }

  .mobile-sticky-cta .btn {
    flex: 1;
    justify-content: center;
  }

  /* Add bottom padding to body when sticky CTA is present */
  body:has(.mobile-sticky-cta) {
    padding-bottom: 80px;
  }
}

/* === ORIENTATION SPECIFIC === */
@media (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: auto;
    padding: var(--space-20) 0 var(--space-10);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-text {
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
  }

  .page-header {
    min-height: auto;
    padding: var(--space-20) 0 var(--space-8);
  }

  .mobile-menu {
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: var(--space-20);
  }
}

/* === PRINT STYLES === */
@media print {
  .navbar,
  .mobile-menu,
  .scroll-progress,
  .cursor,
  .cursor-dot,
  .page-loader,
  .back-to-top,
  .hero-scroll,
  .mobile-sticky-cta {
    display: none !important;
  }

  .hero,
  .page-header {
    min-height: auto;
    padding: var(--space-8);
  }

  .section {
    padding: var(--space-8) 0;
    page-break-inside: avoid;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
