/* ============================================
   CSS Styles for Bus Sales Landing Page
   ============================================ */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Colors */
  --color-primary: #003d82;
  --color-primary-light: #0052ad;
  --color-primary-dark: #002952;
  --color-secondary: #f59e0b;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-background: #ffffff;
  --color-background-alt: #f8fafc;
  --color-border: #e2e8f0;
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  
  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Layout */
  --container-max-width: 1200px;
  --header-height: 80px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Z-index layers */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
}

/* ============================================
   Skip Link (Accessibility)
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Header & Navigation
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-sticky);
  transition: box-shadow var(--transition-base);
}

header.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo h1 {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  font-weight: 700;
}

nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
}

nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

nav a:hover,
nav a:focus {
  color: var(--color-primary);
}

nav a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

nav a.active {
  color: var(--color-primary);
  font-weight: 600;
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
}

/* ============================================
   Mobile Hamburger Menu
   ============================================ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: calc(var(--z-sticky) + 1);
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  transition: all var(--transition-base);
  border-radius: 2px;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }

  .mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--color-background);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left var(--transition-base);
    z-index: var(--z-sticky);
    padding-top: 60px;
    overflow-y: auto;
    flex-direction: column;
    gap: 0;
  }

  .mobile-menu.active {
    left: 0;
  }

  .mobile-menu li {
    margin: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-menu a {
    display: block;
    padding: var(--space-md) var(--space-lg);
  }

  .mobile-menu a.active::after {
    display: none;
  }
}

/* ============================================
   Main Content
   ============================================ */
main {
  margin-top: var(--header-height);
}

section {
  padding: var(--space-3xl) var(--space-lg);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  text-align: center;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-md);
  font-weight: 700;
}

.hero-content p {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-xl);
  opacity: 0.95;
}

.cta-button {
  display: inline-block;
  background-color: var(--color-secondary);
  color: white;
  padding: var(--space-md) var(--space-2xl);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-lg);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.cta-button:hover,
.cta-button:focus {
  background-color: #d97706;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.cta-button:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}

/* ============================================
   Inventory Section
   ============================================ */
.inventory {
  background-color: var(--color-background-alt);
}

.inventory h2 {
  text-align: center;
  font-size: var(--font-size-3xl);
  color: var(--color-primary);
  margin-bottom: var(--space-2xl);
}
/* Inventory Section Styles */
.inventory-intro {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .inventory-intro {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
}
.bus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.bus-card {
  background-color: var(--color-background);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.bus-card:hover,
.bus-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.bus-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
  transition: transform var(--transition-base);
}

.bus-card img:hover {
  transform: scale(1.05);
}

.bus-card img:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.bus-info {
  padding: var(--space-lg);
}

.bus-info h3 {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.bus-info p {
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.bus-price {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-secondary);
  margin-top: var(--space-md);
}

/* ============================================
   About Section
   ============================================ */
.about {
  max-width: 800px;
  margin: 0 auto;
}

.about h2 {
  font-size: var(--font-size-3xl);
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.about p {
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--color-text-light);
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
  background-color: var(--color-background-alt);
  max-width: 600px;
  margin: 0 auto;
}

.contact h2 {
  font-size: var(--font-size-3xl);
  color: var(--color-primary);
  margin-bottom: var(--space-xl);
  text-align: center;
}

form fieldset {
  border: none;
  padding: 0;
}

form legend {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.field {
  margin-bottom: var(--space-lg);
}

.field label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.field label span {
  color: var(--color-error);
}

.field input,
.field textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.1);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--color-error);
}

.field .error {
  display: block;
  color: var(--color-error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

form button[type="submit"] {
  width: 100%;
  background-color: var(--color-primary);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

form button[type="submit"]:hover,
form button[type="submit"]:focus {
  background-color: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

form button[type="submit"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#form-status {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-align: center;
}

#form-status.success {
  background-color: #d1fae5;
  color: #065f46;
}

#form-status.error {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ============================================
   Footer
   ============================================ */
footer {
  background-color: var(--color-primary-dark);
  color: white;
  text-align: center;
  padding: var(--space-xl);
}

/* ============================================
   Lightbox Modal
   ============================================ */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.lightbox[hidden] {
  display: none;
}

.lightbox.active {
  opacity: 1;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base);
  cursor: zoom-in;
}

.lightbox-image.zoomed {
  cursor: zoom-out;
  transform-origin: center center;
}

.lightbox-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: var(--font-size-xl);
}

.loader-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lightbox-controls {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.lightbox-button {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--font-size-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.lightbox-button:hover {
  background-color: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.lightbox-button:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.lightbox-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-button:disabled:hover {
  transform: none;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: var(--space-md);
}

.lightbox-next {
  right: var(--space-md);
}

.lightbox-counter {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--space-md);
  font-size: var(--font-size-sm);
}

.lightbox-caption {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  max-width: 80%;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .hero-content h2 {
    font-size: var(--font-size-3xl);
  }

  .hero-content p {
    font-size: var(--font-size-lg);
  }

  section {
    padding: var(--space-2xl) var(--space-md);
  }

  .bus-grid {
    grid-template-columns: 1fr;
  }

  .lightbox-container {
    max-width: 95vw;
    max-height: 95vh;
  }

  .lightbox-button {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-lg);
  }

  .lightbox-prev {
    left: var(--space-sm);
  }

  .lightbox-next {
    right: var(--space-sm);
  }
}

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

/* ============================================
   Focus Visible for Keyboard Navigation
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
