/* ========================================
   ZAutoSound - Main Stylesheet
   ========================================
   Core styles and base components for the ZAutoSound website.
   Works alongside specialized CSS files and Tailwind CSS.
   
   This file contains:
   - Base styles & global reset
   - Typography & brand elements  
   - Buttons & interactive elements
   - Cards & layout components
   - Hero sections & page layouts
   - Animations & transitions
   - Utility classes
   - Responsive design breakpoints
   
   Specialized styles are in separate files:
   - global-header.css (navigation & header)
   - global-footer.css (footer & site info)
   - floating-social-bar.css (social media bar)
   - form-handler.css (forms & inputs)
   ======================================== */

/* ========================================
   1. BASE STYLES & GLOBAL RESET
   ======================================== */
html {
  overflow-x: hidden;
  max-width: 100%;
}

/* Wider container for that "zoomed out" feeling */
.container-wide {
  max-width: 1400px; /* More reasonable - between 1280px (7xl) and 1536px (2xl) */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 1536px) {
  .container-wide {
    max-width: 1500px; /* Slightly wider on very large screens */
  }
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* ========================================
   2. TYPOGRAPHY & BRAND ELEMENTS
   ======================================== */
.font-heading {
  font-family: "Montserrat", sans-serif;
}

.text-gradient {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Text wrapping for all headings and paragraphs */
h1, h2, h3, h4, h5, h6, p {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ========================================
   3. BUTTONS & INTERACTIVE ELEMENTS
   ======================================== */
.btn-primary {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  border: 2px solid #ef4444;
  color: #ef4444;
  background: transparent;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 44px;
}

.btn-secondary:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-2px);
}

/* Touch-friendly focus states */
button:focus, a:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

button:focus:not(:focus-visible), a:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   4. CARDS & LAYOUT COMPONENTS
   ======================================== */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gradient-bg {
  background: linear-gradient(135deg, #0f172a, #1e293b, #374151);
}

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Fix flex and grid containers to prevent overflow */
.flex {
  min-width: 0;
}

.grid {
  min-width: 0;
}

/* ========================================
   5. ANIMATIONS & TRANSITIONS
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
  width: 100%;
  min-width: 0;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-pulse-custom {
  animation: pulse 2s infinite;
}

/* ========================================
   6. UTILITY CLASSES
   ======================================== */
.hidden {
  display: none !important;
}

/* ========================================
   7. MOBILE & RESPONSIVE DESIGN (576px and below)
   ======================================== */
@media (max-width: 576px) {
  /* Prevent horizontal overflow */
  body, html {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  /* Hero section improvements */
  .hero-content {
    padding: 0 0.75rem;
  }
  
  section#home {
    padding-top: 100px !important;
    padding-bottom: 60px !important;
    min-height: 100vh !important;
  }
  
  /* Typography scaling for mobile */
  .text-4xl {
    font-size: 1.875rem !important;
    line-height: 1.2;
  }
  
  .text-6xl {
    font-size: 2.25rem !important;
    line-height: 1.1;
  }
  
  .text-xl {
    font-size: 1rem !important;
    line-height: 1.5;
  }
  
  section#home h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }
  
  section#home p {
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    margin-bottom: 1.5rem !important;
  }
  
  /* Button improvements for mobile */
  .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    min-height: 44px;
  }
  
  .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    min-height: 44px;
    border: 2px solid #ffffff;
    background: transparent;
  }
  
  /* Hero buttons stack vertically */
  section#home .flex.flex-col.sm\\:flex-row {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  section#home .flex.flex-col.sm\\:flex-row a {
    width: 100% !important;
    text-align: center !important;
  }
  
  /* Grid layouts for mobile */
  .grid.md\\:grid-cols-2.lg\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .grid.md\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .grid.lg\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  
  .grid.grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  section#home .grid.grid-cols-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }
  
  section#home .grid.grid-cols-2 > div {
    font-size: 0.75rem !important;
  }
  
  /* Card improvements */
  .card {
    padding: 1.5rem !important;
  }
  
  /* Contact form improvements */
  .space-y-6 {
    margin-top: 2rem !important;
  }
  
  /* Form inputs - prevent zoom on iOS */
  input, select, textarea {
    font-size: 16px !important;
  }
  
  /* Stars and rating */
  .flex.items-center.mb-4 {
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-start;
  }
  
  .flex.items-center {
    width: auto !important;
    min-width: auto !important;
    flex-shrink: 0 !important;
  }
  
  /* Hide complex elements on small screens */
  section#home .hidden.md\\:block {
    display: none !important;
  }
  
  /* Final CTA section */
  section:last-of-type .flex.flex-col.sm\\:flex-row {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  section:last-of-type .grid.grid-cols-1.sm\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

/* ========================================
   8. TABLET DESIGN (577px - 991px)
   ======================================== */
@media (min-width: 577px) and (max-width: 991px) {
  .hero-content {
    padding: 0 1.5rem;
  }
  
  /* Typography for tablets */
  .text-4xl {
    font-size: 2.5rem !important;
  }
  
  .text-6xl {
    font-size: 3rem !important;
  }
  
  .text-xl {
    font-size: 1.125rem !important;
  }
  
  /* Button sizing for tablets */
  .btn-primary, .btn-secondary {
    padding: 14px 24px;
    font-size: 16px;
    width: auto;
    max-width: none;
    margin: 0;
  }
  
  /* Tablet-specific grid layouts */
  .grid.lg\\:grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  /* Mobile menu for tablets */
  #mobileMenu {
    max-width: 400px !important;
    right: 16px !important;
    left: auto !important;
    border-radius: 12px !important;
    margin-top: 8px !important;
    width: auto !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
  }
}

/* ========================================
   9. DESKTOP DESIGN (992px and above)
   ======================================== */
@media (min-width: 992px) {
  .hero-content {
    padding: 0 2rem;
    max-width: 1400px;
  }
  
  /* Desktop typography scaling */
  .text-4xl {
    font-size: 3.5rem !important;
  }
  
  .text-6xl {
    font-size: 4rem !important;
  }
  
  .text-xl {
    font-size: 1.25rem !important;
  }
  
  /* Desktop button sizing */
  .btn-primary, .btn-secondary {
    padding: 16px 28px;
    font-size: 16px;
  }
  
  /* Restore full grid layouts */
  .grid.lg\\:grid-cols-2 {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* Extra large screens (1200px+) */
@media (min-width: 1200px) {
  .hero-content {
    max-width: 1400px;
  }
  
  .text-4xl {
    font-size: 3.75rem !important;
  }
  
  .text-6xl {
    font-size: 4.5rem !important;
  }
  
  .text-xl {
    font-size: 1.375rem !important;
  }
  
  .btn-primary, .btn-secondary {
    padding: 18px 32px;
    font-size: 17px;
  }
}

/* ========================================
   10. PERFORMANCE & ACCESSIBILITY
   ======================================== */

/* Text shadows for better readability */
@media (min-width: 576px) {
  .hero-section .text-white {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* GPU acceleration for smooth animations on mobile */
@media (max-width: 991px) {
  .animate-fade-in-up,
  .card:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn-primary, .btn-secondary {
    min-height: 44px;
    padding: 10px 20px;
    max-width: 240px;
  }
}


