/* ============================================
   Twin Valley Tire, Inc. - Modern Stylesheet
   ============================================ */

/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1e3a5f;
  --primary-dark: #152a45;
  --accent: #e67e22;
  --accent-hover: #d35400;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --success: #10b981;
  --error: #ef4444;
  
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  
  --header-height: 70px;
  --container: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--white);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--gray-900);
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.logo-text span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray-500);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 1px;
  transition: 0.3s;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
}

.btn-white:hover {
  background: var(--gray-100);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  margin-top: var(--header-height);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  color: var(--white);
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 80px 0;
}

.section-light {
  background: var(--gray-50);
}

.section-title {
  text-align: center;
  margin-bottom: 16px;
}

.section-desc {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
  color: var(--gray-600);
}

/* ============================================
   Services Grid
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.service-card-content {
  padding: 24px;
}

.service-card h3 {
  margin-bottom: 12px;
}

.service-card p {
  color: var(--gray-600);
  margin-bottom: 0;
}

/* ============================================
   Features Grid
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  color: var(--white);
}

.feature-card h4 {
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--gray-600);
  margin-bottom: 0;
}

/* ============================================
   CTA Banner
   ============================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  text-align: center;
  padding: 60px 20px;
}

.cta-banner h2 {
  color: var(--white);
  margin-bottom: 16px;
}

.cta-banner p {
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto 24px;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 48px;
}

.contact-info h3 {
  margin-bottom: 24px;
}

.contact-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius);
  color: var(--primary);
}

.contact-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.contact-value {
  font-weight: 600;
  color: var(--gray-900);
}

.contact-value a:hover {
  color: var(--accent);
}

/* Hours */
.hours-card {
  background: var(--gray-50);
  padding: 24px;
  border-radius: var(--radius);
  margin-top: 32px;
}

.hours-card h4 {
  margin-bottom: 16px;
}

.hours-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.hours-row span:first-child {
  color: var(--gray-600);
}

.hours-row span:last-child {
  font-weight: 500;
  color: var(--gray-900);
}

.hours-closed {
  color: var(--gray-500);
}

/* ============================================
   Forms
   ============================================ */
.form-card {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--error);
}

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

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent);
}

.form-checkbox label {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 0;
}

.form-checkbox label a {
  color: var(--primary);
  text-decoration: underline;
}

.form-checkbox label a:hover {
  color: var(--accent);
}

.form-note {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.form-note a {
  color: var(--primary);
  text-decoration: underline;
}

.form-message {
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 500;
}

.form-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.form-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 6px;
}

.required {
  color: var(--error);
}

/* ============================================
   Map
   ============================================ */
.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 300px;
  margin-top: 32px;
}

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

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 60px 0 30px;
}

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

.footer-brand h3 {
  color: var(--white);
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 20px;
  font-size: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.footer-contact p {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

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

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

.footer-disclaimer {
  font-size: 0.85rem;
  margin-bottom: 16px;
  opacity: 0.8;
}

.footer-copyright {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ============================================
   Cookie Banner
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 2000;
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-content {
  max-width: var(--container);
  margin: 0 auto;
}

.cookie-content h4 {
  margin-bottom: 12px;
}

.cookie-content p {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.cookie-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cookie-learn-more {
  font-size: 0.9rem;
  margin-left: auto;
}

.cookie-learn-more a {
  color: var(--primary);
  text-decoration: underline;
}

/* Cookie Modal */
.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.cookie-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

.cookie-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  color: var(--gray-500);
  line-height: 1;
}

.cookie-modal-close:hover {
  color: var(--gray-900);
}

.cookie-modal h3 {
  margin-bottom: 16px;
}

.cookie-modal > p {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.cookie-preference {
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
}

.cookie-preference:last-of-type {
  border-bottom: none;
  margin-bottom: 24px;
}

.cookie-preference-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cookie-preference-header label {
  font-weight: 600;
  color: var(--gray-900);
}

.cookie-status {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
}

.cookie-preference-desc {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 0;
}

.cookie-preference input[type="checkbox"] {
  width: 44px;
  height: 24px;
  appearance: none;
  background: var(--gray-300);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: 0.2s;
}

.cookie-preference input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: 0.2s;
}

.cookie-preference input[type="checkbox"]:checked {
  background: var(--accent);
}

.cookie-preference input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.cookie-modal-buttons {
  display: flex;
  gap: 12px;
}

/* ============================================
   Page Header (Inner Pages)
   ============================================ */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 100px 0 60px;
  margin-top: var(--header-height);
}

.page-header h1 {
  color: var(--white);
  margin-bottom: 12px;
}

.page-header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

/* ============================================
   Content Pages (Privacy, Terms, etc.)
   ============================================ */
.content-page {
  padding: 60px 0;
}

.content-page h2 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
}

.content-page h2:first-child {
  margin-top: 0;
}

.content-page h3 {
  font-size: 1.25rem;
  margin: 24px 0 12px;
}

.content-page p {
  margin-bottom: 16px;
}

.content-page ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-page li {
  margin-bottom: 8px;
  list-style: disc;
}

.content-page a {
  color: var(--primary);
  text-decoration: underline;
}

.content-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.content-page th,
.content-page td {
  padding: 12px;
  text-align: left;
  border: 1px solid var(--gray-200);
}

.content-page th {
  background: var(--gray-50);
  font-weight: 600;
}

.last-updated {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

/* ============================================
   Service Detail Page
   ============================================ */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 60px;
}

.service-detail:nth-child(even) {
  direction: rtl;
}

.service-detail:nth-child(even) > * {
  direction: ltr;
}

.service-detail img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.service-detail-content h3 {
  font-size: 1.75rem;
  margin-bottom: 16px;
}

.service-detail-content p {
  color: var(--gray-600);
  margin-bottom: 20px;
}

.service-detail ul {
  margin-bottom: 24px;
  padding-left: 20px;
}

.service-detail li {
  margin-bottom: 8px;
  list-style: disc;
  color: var(--gray-600);
}

/* ============================================
   About Page
   ============================================ */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-intro img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.about-intro-content h2 {
  margin-bottom: 20px;
}

.about-intro-content p {
  color: var(--gray-600);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.value-card {
  text-align: center;
  padding: 32px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.value-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 50%;
  color: var(--white);
}

.value-card h4 {
  margin-bottom: 12px;
}

.value-card p {
  color: var(--gray-600);
  margin-bottom: 0;
}

/* ============================================
   Skip Link (Accessibility)
   ============================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 12px 24px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius);
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-brand {
    grid-column: 1 / -1;
  }
  
  .service-detail {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .service-detail:nth-child(even) {
    direction: ltr;
  }
  
  .about-intro {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  
  .section {
    padding: 60px 0;
  }
  
  /* Mobile Nav */
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s;
  }
  
  .nav-menu.open {
    transform: translateX(0);
  }
  
  .nav-link {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
  }
  
  .nav-link.active::after {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  .hero {
    min-height: 500px;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
  
  .values-grid {
    grid-template-columns: 1fr;
  }
  
  .form-card {
    padding: 24px;
  }
  
  .cookie-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .cookie-learn-more {
    margin-left: 0;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .btn {
    width: 100%;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .header,
  .cookie-banner,
  .cookie-modal {
    display: none;
  }
  
  .hero {
    margin-top: 0;
  }
  
  .section {
    padding: 30px 0;
  }
}
