/* Mobile Responsive Fixes */

/* Prevent horizontal scrolling */
* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Mobile Header Fixes */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 10px;
  }
  
  .logo {
    font-size: 20px;
  }
  
  .logo-text {
    display: flex;
    flex-direction: column;
  }
  
  .logo-tagline {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.8;
  }
  
  .header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  
  .menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }
  
  .menu-line {
    width: 20px;
    height: 2px;
    background: var(--text);
    margin: 2px 0;
    transition: 0.3s;
  }
  
  .menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(-45deg) translate(-4px, 4px);
  }
  
  .menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
  }
  
  .menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(45deg) translate(-4px, -4px);
  }
}

/* Hero Section Mobile */
@media (max-width: 768px) {
  .hero {
    min-height: 60vh;
    padding: 40px 0;
  }
  
  .hero h1 {
    font-size: 28px;
    line-height: 1.2;
  }
  
  .hero p {
    font-size: 16px;
    margin: 15px 0 25px;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .stat-item {
    min-width: auto;
  }
}

/* Cards and Grid Mobile */
@media (max-width: 768px) {
  .cards-3 {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .cards-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .feature-card,
  .category-card,
  .offer-card {
    margin: 0;
    width: 100%;
  }
}

/* Button Mobile Fixes */
@media (max-width: 768px) {
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .btn-group {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
    text-align: center;
  }
}

/* Form Mobile Fixes */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .form input,
  .form textarea,
  .form select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Cart Mobile Fixes */
@media (max-width: 768px) {
  .cart-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .cart-item {
    flex-direction: column;
    text-align: center;
  }
  
  .item-image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto 15px;
  }
  
  .item-footer {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }
  
  .quantity-controls {
    justify-content: center;
  }
}

/* Modal Mobile Fixes */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 95vw;
    margin: 20px auto;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .checkout-modal {
    padding: 20px;
  }
  
  .modal-header h3 {
    font-size: 18px;
  }
}

/* Footer Mobile Fixes */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  
  .footer-col {
    padding: 0;
  }
  
  .social-links {
    justify-content: center;
  }
}

/* Search Mobile Fixes */
@media (max-width: 768px) {
  .search-overlay {
    padding: 20px;
  }
  
  .search-container {
    width: 100%;
    max-width: 100%;
  }
  
  .search-input-wrapper input {
    font-size: 16px;
  }
  
  .search-filters {
    flex-direction: column;
    gap: 15px;
  }
  
  .filter-options {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Slider Mobile Fixes */
@media (max-width: 768px) {
  .slide-content {
    padding: 20px;
    text-align: center;
  }
  
  .slide h2 {
    font-size: 24px;
  }
  
  .slide p {
    font-size: 14px;
  }
  
  .slide-controls {
    bottom: 20px;
  }
  
  .slide-dots {
    justify-content: center;
  }
}

/* Utility Classes for Mobile */
@media (max-width: 768px) {
  .mobile-hidden {
    display: none !important;
  }
  
  .mobile-center {
    text-align: center !important;
  }
  
  .mobile-full-width {
    width: 100% !important;
  }
  
  .mobile-no-padding {
    padding: 0 !important;
  }
  
  .mobile-small-text {
    font-size: 14px !important;
  }
}

/* Prevent text selection on mobile for better UX */
@media (max-width: 768px) {
  .btn,
  .nav a,
  .menu-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
}

/* Fix tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
  }
  
  body {
    -webkit-overflow-scrolling: touch;
  }
}
