/*
Theme Name: Quality Auto Sales
Theme URI: https://yoursite.com
Description: A distinctive WordPress theme for used car dealerships with refined aesthetics
Version: 1.0
Author: Your Dealership
Author URI: https://yoursite.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quality-auto
*/

/* CSS Variables for Brand Consistency */
:root {
  --primary-green: #2d5016;
  --accent-green: #4a7c2c;
  --light-green: #e8f3e0;
  --dark-bg: #1a1a1a;
  --light-bg: #f8f9fa;
  --text-dark: #2c3e50;
  --text-light: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 4px 20px rgba(45, 80, 22, 0.1);
  --shadow-hover: 0 8px 30px rgba(45, 80, 22, 0.15);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--light-bg);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--primary-green);
}

h1 { font-size: 4.5rem; }
h2 { font-size: 3.5rem; }
h3 { font-size: 2.5rem; }
h4 { font-size: 2rem; }

a {
  color: var(--accent-green);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-green);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Header - FIXED: Improved sticky behavior to prevent jumpiness */
.site-header {
  background: var(--dark-bg);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  /* ADDED: Smooth transition and will-change for better performance */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  /* ADDED: Prevent layout shifts */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.site-logo h1 {
  color: var(--text-light);
  font-size: 2.5rem;
  letter-spacing: 0.05em;
  margin: 0;
}

.site-logo span {
  color: var(--accent-green);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 40px;
}

.main-navigation a {
  color: var(--text-light);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  position: relative;
  padding: 5px 0;
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-green);
  transition: width 0.3s ease;
}

.main-navigation a:hover::after,
.main-navigation a.current::after {
  width: 100%;
}

/* Mobile Menu Toggle - Hidden on desktop, shown on mobile */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 2rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
}

.mobile-menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--text-light);
  margin: 6px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><path d="M0 0L50 50M50 50L100 0M50 50L100 100M50 50L0 100" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
  color: var(--text-light);
  font-size: 5rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
  color: var(--light-green);
  font-size: 1.5rem;
  max-width: 700px;
  margin: 0 auto 40px;
}

.cta-button {
  display: inline-block;
  background: var(--text-light);
  color: var(--primary-green);
  padding: 18px 50px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  background: var(--light-green);
}

/* Inventory Grid */
.inventory-section {
  padding: 100px 0;
  background: var(--text-light);
}

.section-header {
  text-align: center;
  margin-bottom: 70px;
  animation: fadeIn 0.8s ease-out;
}

.section-header h2 {
  margin-bottom: 20px;
}

.section-header p {
  font-size: 1.3rem;
  color: #666;
  max-width: 700px;
  margin: 0 auto;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 40px;
  animation: fadeInUp 1s ease-out 0.2s backwards;
}

.vehicle-card {
  background: var(--text-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.4s ease;
  border: 1px solid var(--border-color);
}

.vehicle-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.vehicle-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.vehicle-card:hover .vehicle-image {
  transform: scale(1.05);
}

.vehicle-info {
  padding: 30px;
}

.vehicle-title {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--primary-green);
}

.vehicle-details {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #666;
}

.detail-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-green);
}

.vehicle-price {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: var(--accent-green);
  margin: 20px 0;
  letter-spacing: 0.02em;
}

.vehicle-cta {
  display: inline-block;
  background: var(--accent-green);
  color: var(--text-light);
  padding: 12px 30px;
  border-radius: 4px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.vehicle-cta:hover {
  background: var(--primary-green);
  transform: translateX(5px);
}

/* About Section */
.about-section {
  padding: 100px 0;
  background: var(--light-green);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-text h2 {
  margin-bottom: 30px;
}

.about-text p {
  margin-bottom: 25px;
  font-size: 1.2rem;
  line-height: 1.8;
}

.about-image {
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}

.about-image:hover img {
  transform: scale(1.05);
}

/* Contact Section */
.contact-section {
  padding: 100px 0;
  background: var(--text-light);
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.contact-form {
  background: var(--light-bg);
  padding: 50px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: var(--primary-green);
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-green);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-button {
  background: var(--accent-green);
  color: var(--text-light);
  padding: 15px 40px;
  border: none;
  border-radius: 4px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.submit-button:hover {
  background: var(--primary-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.info-card {
  background: var(--light-bg);
  padding: 35px;
  border-radius: 8px;
  border-left: 5px solid var(--accent-green);
  box-shadow: var(--shadow);
}

.info-card h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.info-card p {
  font-size: 1.1rem;
  line-height: 1.8;
}

.map-container {
  margin-top: 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 400px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Footer */
.site-footer {
  background: var(--dark-bg);
  color: var(--text-light);
  padding: 60px 0 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  margin-bottom: 40px;
}

.footer-section h3 {
  color: var(--text-light);
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
  display: block;
  margin-bottom: 10px;
}

.footer-section a:hover {
  color: var(--accent-green);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 0 30px;
  }
  
  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
  }
  
  .about-content,
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 50px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  /* FIXED: Add padding to body for fixed header */
  body {
    padding-top: 70px;
  }
  
  /* FIXED: Typography for mobile */
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  /* FIXED: Mobile Navigation - Hide by default, show as overlay */
  .site-header {
    position: fixed; /* Changed from sticky to fixed for better mobile behavior */
    width: 100%;
  }
  
  /* FIXED: Show mobile menu toggle button */
  .mobile-menu-toggle {
    display: block !important;
    z-index: 1001;
  }
  
  .header-content {
    flex-direction: row; /* Keep logo and menu icon horizontal */
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
  }
  
  .site-logo h1 {
    font-size: 1.8rem;
  }
  
  /* FIXED: Hide navigation by default on mobile */
  .main-navigation {
    position: fixed;
    top: 0;
    left: -100%; /* Hidden off-screen by default */
    width: 280px;
    height: 100vh;
    background: var(--dark-bg);
    padding: 80px 30px 30px;
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
  }
  
  .main-navigation.active {
    left: 0; /* Slide in when active */
  }
  
  .main-navigation ul {
    flex-direction: column;
    gap: 25px;
    text-align: left;
  }
  
  .main-navigation a {
    font-size: 1.5rem;
    display: block;
    padding: 10px 0;
  }
  
  /* FIXED: Mobile menu toggle button */
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
  }
  
  /* FIXED: Mobile overlay */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }
  
  .mobile-menu-overlay.active {
    display: block;
  }
  
  /* FIXED: Vehicle page layout for mobile */
  .vehicle-page-grid {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }
  
  /* FIXED: Remove sticky positioning on mobile for sidebar */
  .vehicle-page-grid > div:last-child > div[style*="position: sticky"] {
    position: static !important;
  }
  
  /* FIXED: Trust signals grid on mobile */
  div[style*="display: grid"][style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  /* FIXED: Inventory grid */
  .inventory-grid {
    grid-template-columns: 1fr;
    padding: 0 15px;
  }
  
  /* FIXED: Contact form */
  .contact-form {
    padding: 20px;
  }
  
  /* FIXED: Hero section padding */
  .hero-section {
    padding: 40px 0 !important; /* Reduced since body already has padding-top */
  }
  
  /* FIXED: Container padding */
  .container {
    padding: 0 15px;
  }
  
  /* FIXED: CTA buttons full width on mobile */
  .cta-button,
  .vehicle-cta {
    width: 100%;
    padding: 15px 30px;
    text-align: center;
  }
}

/* FIXED: Extra small mobile devices */
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.8rem; }
  
  .site-logo h1 {
    font-size: 1.5rem;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-content p {
    font-size: 1.8rem;
  }
  
  .vehicle-price {
    font-size: 2rem;
  }
  
  .container {
    padding: 0 10px;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .hero-section,
  .site-footer {
    display: none;
  }
}
