/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile-First Base Adjustments */
@media (max-width: 1024px) {
  .container {
    padding: 0 30px !important;
  }

  /* Override inline grid styles */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================
   TABLET & MOBILE (768px and below)
   ======================================== */
@media (max-width: 768px) {
  /* Typography Scaling */
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 20px !important;
  }

  /* Override inline styles for mobile */
  [style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  [style*="padding: 100px"] {
    padding: 60px 0 !important;
  }

  [style*="padding: 80px"] {
    padding: 50px 0 !important;
  }

  [style*="font-size: 3.5rem"] {
    font-size: 2rem !important;
  }

  [style*="font-size: 3rem"] {
    font-size: 1.8rem !important;
  }

  [style*="font-size: 2.5rem"] {
    font-size: 1.6rem !important;
  }

  /* Header & Navigation */
  .site-header {
    padding: 10px 0;
    backdrop-filter: none !important;
  }

  .navbar-brand .logo {
    height: 45px;
  }

  .navbar-toggler {
    display: block;
    color: var(--white);
    padding: 8px;
  }

  .mobile-menu-close {
    display: block !important;
  }

  .navbar-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #f5f5f5 !important;
    transition: right 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
    padding: 80px 20px 20px;
    pointer-events: all;
    opacity: 1;
  }

  .navbar-menu.active {
    display: block;
    right: 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    pointer-events: all;
  }

  .mobile-menu-close {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #000000 !important;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    z-index: 10001;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
  }

  .nav-item {
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10001;
  }

  .nav-link {
    font-size: 1rem;
    display: block;
    padding: 5px 0;
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 10001;
    color: #000000 !important;
    opacity: 1 !important;
    font-weight: 600 !important;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
  }

  .nav-link:active,
  .nav-link:focus {
    color: var(--primary-color) !important;
  }

  .btn-contact {
    display: block;
    text-align: center;
    margin-top: 10px;
    width: 100%;
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 10001;
    opacity: 1 !important;
    background: var(--secondary-color) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
  }

  .btn-login {
    display: block !important;
    text-align: center;
    margin-top: 10px;
    width: 100%;
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 10001;
    background: var(--secondary-color) !important;
    color: #ffffff !important;
    padding: 12px 20px;
    border-radius: 25px;
    border: none;
    opacity: 1 !important;
    font-weight: 600 !important;
  }

  /* Mobile Menu Overlay */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .mobile-menu-overlay.active {
    display: block;
    pointer-events: auto;
    opacity: 1;
  }
  
  /* Prevent body scroll when mobile menu is open */
  body.mobile-menu-open {
    overflow: hidden;
  }

  /* Hero Section */
  .hero {
    min-height: 60vh;
    padding: 14rem 0 3rem !important;
    margin-top: 0;
    background-attachment: scroll;
  }

  .hero-content {
    padding: 0 20px;
  }

  .hero-content h1 {
    font-size: 2.5rem !important;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .hero-content .rotating-text {
    font-size: 1.8rem !important;
  }

  .hero-content p {
    font-size: 1rem !important;
    margin-bottom: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .cta-buttons .btn-primary,
  .cta-buttons .btn-secondary {
    width: 100%;
    text-align: center;
    padding: 15px 30px;
  }

  /* Sections */
  section {
    padding: 3rem 0 !important;
  }

  section h2 {
    font-size: 2rem !important;
    margin-bottom: 1.5rem;
  }

  section .section-subtitle {
    font-size: 1rem;
  }

  /* About Section Video */
  .about-intro-video {
    order: -1;
    margin-bottom: 30px;
  }

  video {
    max-height: 300px !important;
    object-fit: cover;
  }

  /* Override decorative elements on mobile */
  [style*="position: absolute"][style*="700px"] {
    display: none !important;
  }

  /* Cards Grid */
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .card {
    margin-bottom: 0;
  }

  /* Features Section */
  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 25px;
  }

  .feature-card {
    padding: 25px;
  }

  .feature-icon {
    font-size: 2.5rem;
  }

  /* Stats Section */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px;
  }

  .stat-item h3 {
    font-size: 2.5rem;
  }

  /* Franchise Cards */
  .franchises-grid {
    grid-template-columns: 1fr !important;
    gap: 25px;
  }

  .franchise-card {
    margin-bottom: 0;
  }

  .franchise-image {
    height: 200px;
  }

  /* Franchise Detail Page */
  .franchise-hero {
    height: 40vh;
    min-height: 300px;
  }

  .franchise-hero-content h1 {
    font-size: 2rem;
  }

  .detail-grid {
    grid-template-columns: 1fr !important;
    gap: 30px;
  }

  .franchise-sidebar {
    order: -1;
  }

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

  /* Contact Form */
  .contact-container {
    padding: 2rem 0;
  }

  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 30px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .contact-info-box {
    padding: 25px;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr !important;
    gap: 30px;
    text-align: center;
  }

  .footer-column {
    text-align: center;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  /* Buttons */
  .btn-primary,
  .btn-secondary {
    padding: 12px 25px;
    font-size: 0.9rem;
  }

  /* Login Drawer */
  .login-drawer {
    width: 100% !important;
    right: -100% !important;
  }

  .login-drawer.active {
    right: 0 !important;
  }

  /* Modals */
  .modal-content {
    width: 95%;
    margin: 20px auto;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 0.85rem;
  }

  /* Form Elements */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* ========================================
   SMALL MOBILE (480px and below)
   ======================================== */
@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .container {
    padding: 0 15px;
  }

  /* Hero */
  .hero {
    min-height: 50vh;
    padding: 7rem 0 2rem;
  }

  .hero-content h1 {
    font-size: 2rem !important;
  }

  .hero-content .rotating-text {
    font-size: 1.5rem !important;
  }

  .hero-content p {
    font-size: 0.95rem !important;
  }

  /* Typography */
  section h2 {
    font-size: 1.75rem !important;
  }

  section h3 {
    font-size: 1.25rem !important;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Buttons */
  .cta-buttons .btn-primary,
  .cta-buttons .btn-secondary {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  /* Cards */
  .card {
    padding: 20px;
  }

  .feature-card {
    padding: 20px;
  }

  /* Navigation */
  .navbar-menu {
    width: 100%;
  }

  /* Contact */
  .contact-info-box {
    padding: 20px;
  }

  /* Footer */
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

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

  .hero-content h1 {
    font-size: 2rem !important;
  }

  .hero-content .rotating-text {
    font-size: 1.5rem !important;
  }
}

/* ========================================
   TOUCH DEVICE IMPROVEMENTS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .nav-link {
    padding: 12px 0;
  }

  button,
  .btn-primary,
  .btn-secondary,
  .btn-contact {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects on touch devices */
  .card:hover,
  .feature-card:hover,
  .franchise-card:hover {
    transform: none;
  }

  /* Disable parallax on touch devices */
  .hero,
  .section-parallax {
    background-attachment: scroll !important;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }

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

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

  .mobile-full-width {
    width: 100% !important;
  }

  .mobile-no-padding {
    padding: 0 !important;
  }

  .mobile-stack {
    flex-direction: column !important;
  }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .nav-link,
  .btn-primary,
  .btn-secondary {
    border: 2px solid currentColor;
  }
}
