/* ============================================
   SnowReady Auto Canada - Winter Road Atlas Theme
   ============================================ */

/* === CSS Variables === */
:root {
  /* Colors */
  --snow: #F6F9FC;
  --night-asphalt: #1C2430;
  --ice-blue: #7FB7E6;
  --highway-yellow: #FFC93C;
  --cone-orange: #F08A24;
  --slate: #8896A6;
  
  /* Typography */
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  
  /* Spacing */
  --section-padding: 80px 0;
  --container-max-width: 1200px;
  
  /* Effects */
  --card-radius: 14px;
  --card-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  --transition-speed: 160ms;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.7;
  color: var(--night-asphalt);
  background-color: var(--snow);
  overflow-x: hidden;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 1rem;
  font-weight: 700;
}

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

p {
  margin-bottom: 1rem;
}

a {
  color: var(--ice-blue);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--highway-yellow);
}

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

/* === Frost Pattern Background === */
.frost-pattern {
  position: relative;
  overflow: hidden;
}

.frost-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238896A6' fill-opacity='0.07'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.frost-pattern > * {
  position: relative;
  z-index: 1;
}

/* === Header & Navigation === */
header {
  background: white;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-speed) ease;
}

header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--night-asphalt);
}

.logo svg {
  color: var(--ice-blue);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav ul li a {
  color: var(--night-asphalt);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all var(--transition-speed) ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--highway-yellow);
  background: rgba(255, 201, 60, 0.1);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle svg {
  width: 28px;
  height: 28px;
  stroke: var(--night-asphalt);
}

/* === Hero Section === */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  overflow: hidden;
  background: linear-gradient(135deg, var(--night-asphalt) 0%, #2a3647 100%);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(28, 36, 48, 0.85) 0%, rgba(127, 183, 230, 0.3) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-align: center;
}

.btn-primary {
  background: var(--highway-yellow);
  color: var(--night-asphalt);
  box-shadow: 0 4px 14px rgba(255, 201, 60, 0.4);
}

.btn-primary:hover {
  background: #FFD666;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 201, 60, 0.5);
}

.btn-secondary {
  background: white;
  color: var(--night-asphalt);
  border: 2px solid var(--slate);
}

.btn-secondary:hover {
  border-color: var(--ice-blue);
  color: var(--ice-blue);
}

/* === Statistics Section === */
.statistics {
  padding: var(--section-padding);
  background: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-card {
  padding: 2rem;
  border-radius: var(--card-radius);
  background: var(--snow);
  border: 1px solid var(--slate);
  transition: all var(--transition-speed) ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--ice-blue);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--ice-blue);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 1rem;
  color: var(--slate);
  margin-top: 0.5rem;
}

/* === Section Styles === */
section {
  padding: var(--section-padding);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  color: var(--night-asphalt);
  margin-bottom: 1rem;
}

.section-title p {
  color: var(--slate);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* === Card Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  background: white;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--slate);
  transition: all var(--transition-speed) ease;
  box-shadow: var(--card-shadow);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--ice-blue);
}

.card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--night-asphalt);
}

.card-content p {
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(136, 150, 166, 0.2);
}

.card-category {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(127, 183, 230, 0.15);
  color: var(--ice-blue);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(240, 138, 36, 0.15);
  color: var(--cone-orange);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.card-badge svg {
  width: 16px;
  height: 16px;
}

/* === Advantages Grid === */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.advantage-card {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: var(--card-radius);
  border: 1px solid var(--slate);
  transition: all var(--transition-speed) ease;
}

.advantage-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--ice-blue);
}

.advantage-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  padding: 16px;
  background: rgba(127, 183, 230, 0.1);
  border-radius: 50%;
  color: var(--ice-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.advantage-icon svg {
  width: 32px;
  height: 32px;
}

.advantage-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.advantage-card p {
  color: var(--slate);
  line-height: 1.6;
}

/* === Safety Callout === */
.safety-callout {
  background: rgba(240, 138, 36, 0.05);
  border-left: 4px solid var(--cone-orange);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.safety-callout-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.75rem;
}

.safety-callout-header svg {
  width: 24px;
  height: 24px;
  color: var(--cone-orange);
}

.safety-callout-header h4 {
  color: var(--cone-orange);
  margin: 0;
}

.safety-callout p {
  margin: 0;
  color: var(--night-asphalt);
}

/* === Reviews Section === */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.review-card {
  background: white;
  padding: 2rem;
  border-radius: var(--card-radius);
  border: 1px solid var(--slate);
  box-shadow: var(--card-shadow);
  position: relative;
}

.review-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 5rem;
  color: rgba(127, 183, 230, 0.2);
  font-family: Georgia, serif;
}

.review-text {
  font-style: italic;
  color: var(--night-asphalt);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.review-author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ice-blue), var(--highway-yellow));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}

.review-author-info h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--night-asphalt);
}

.review-author-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--slate);
}

/* === Categories Section === */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: linear-gradient(135deg, var(--ice-blue), var(--night-asphalt));
  color: white;
  padding: 2rem;
  border-radius: var(--card-radius);
  text-align: center;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.category-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.category-card p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* === Newsletter Section === */
.newsletter {
  background: linear-gradient(135deg, var(--night-asphalt), #2a3647);
  color: white;
  text-align: center;
  padding: 4rem 0;
}

.newsletter h2 {
  color: white;
  margin-bottom: 1rem;
}

.newsletter p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.newsletter-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  transition: all var(--transition-speed) ease;
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--highway-yellow);
  background: rgba(255, 255, 255, 0.15);
}

.newsletter-success {
  display: none;
  background: rgba(76, 175, 80, 0.2);
  border: 2px solid #4CAF50;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.newsletter-success.show {
  display: block;
}

/* === Footer === */
footer {
  background: var(--night-asphalt);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  display: block;
  margin-bottom: 0.5rem;
  transition: color var(--transition-speed) ease;
}

.footer-section a:hover {
  color: var(--highway-yellow);
}

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

/* === Category Page Header === */
.category-header {
  background: linear-gradient(135deg, var(--ice-blue), var(--snow));
  padding: 4rem 0 3rem;
  text-align: center;
}

.category-header h1 {
  color: var(--night-asphalt);
  font-size: 3rem;
  margin-bottom: 1rem;
}

.category-header p {
  color: var(--slate);
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

/* === Readiness Score Widget === */
.readiness-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: white;
  border-radius: var(--card-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 2px solid var(--ice-blue);
  z-index: 900;
  transition: all 0.3s ease;
}

.readiness-widget.collapsed {
  width: auto;
}

.readiness-widget.collapsed .widget-content {
  display: none;
}

.widget-header {
  background: linear-gradient(135deg, var(--ice-blue), var(--night-asphalt));
  color: white;
  padding: 1rem;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.widget-header h3 {
  margin: 0;
  font-size: 1rem;
}

.widget-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  line-height: 1;
}

.widget-content {
  padding: 1.5rem;
}

.progress-bar {
  width: 100%;
  height: 24px;
  background: var(--snow);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--slate);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ice-blue), var(--highway-yellow));
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}

.checklist {
  list-style: none;
}

.checklist li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(136, 150, 166, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--ice-blue);
}

.checklist label {
  cursor: pointer;
  flex: 1;
  user-select: none;
}

.checklist input[type="checkbox"]:checked + label {
  text-decoration: line-through;
  opacity: 0.6;
}

/* === Back to Top Button === */
.back-to-top {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: var(--highway-yellow);
  color: var(--night-asphalt);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-speed) ease;
  z-index: 800;
}

.back-to-top:hover {
  background: #FFD666;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
  display: flex;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* === Scroll Reveal Animation === */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive Design === */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  nav ul {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: white;
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
    transition: left 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }
  
  nav ul.active {
    left: 0;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .card-grid,
  .advantages-grid,
  .reviews-grid,
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .readiness-widget {
    width: calc(100% - 40px);
    left: 20px;
    right: 20px;
  }
  
  .back-to-top {
    bottom: 90px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.4rem; }
  
  .category-header h1 {
    font-size: 2rem;
  }
  
  .category-header p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 50px 0;
  }
  
  .hero {
    min-height: 400px;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  .card-image {
    height: 180px;
  }
}

/* === Print Styles === */
@media print {
  header,
  .newsletter,
  .back-to-top,
  .readiness-widget {
    display: none;
  }
  
  .checklist {
    page-break-inside: avoid;
  }
  
  .card {
    page-break-inside: avoid;
  }
}

/* === Accessibility === */
@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 Styles */
a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--ice-blue);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --snow: #FFFFFF;
    --night-asphalt: #000000;
    --slate: #4A4A4A;
  }
  
  .card,
  .advantage-card,
  .stat-card,
  .review-card {
    border-width: 2px;
  }
}
