/* ============================================
   TOPOGRAPHY — Design Tokens & Stylesheet
   ============================================ */

@font-face {
  font-family: 'Novel Mono Pro';
  src: url('../fonts/Novel Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cloth';
  src: url('../fonts/Cloth Font BLACK.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colors */
  --red: #AD4E38;
  --red-hover: #944333;
  --dark: #1E1E1E;
  --dark-surface: #2A2A2A;
  --off-white: #F8F5F0;
  --white: #FDFBF8;
  --grey-100: #EBE8E4;
  --grey-200: #D0CCC7;
  --grey-300: #9E9A94;
  --grey-400: #6B6762;
  --grey-500: #4A4743;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Cloth', 'Novel Mono Pro', 'Inter', system-ui, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2rem;
  --fs-2xl: 2.75rem;
  --fs-3xl: 3.5rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --container: 1200px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.3s;
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Red accent for checkboxes / toggles */
.gpx-stat-toggle input[type="checkbox"] {
  accent-color: var(--red);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}
.gpx-stat-toggle label {
  cursor: pointer;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--dark);
  background: var(--off-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul, ol { list-style: none; }

/* ============================================
   Contour Canvas (background)
   ============================================ */

#contour-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   Container & Layout
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ============================================
   Sections — Alternating Light/Dark
   ============================================ */

.section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section--dark {
  background: var(--dark);
  color: var(--off-white);
}

.section--light {
  background: var(--off-white);
  color: var(--dark);
}

.section--dark,
.section--light {
  /* Semi-transparent so contour canvas shows through */
  background-color: transparent;
}

.section--dark::before,
.section--light::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

.section--dark::before {
  background: rgba(30, 30, 30, 0.88);
}

.section--light::before {
  background: rgba(248, 245, 240, 0.88);
}

.section > .container {
  position: relative;
  z-index: 1;
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xl);
}

.section__subtitle {
  font-size: var(--fs-md);
  color: var(--grey-300);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
}

.section--light .section__subtitle {
  color: var(--grey-400);
}

/* ============================================
   Header
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: var(--space-md) 0;
  transition: background var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.header--scrolled {
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--off-white);
  display: flex;
  align-items: center;
}

.logo__img {
  height: 64px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav__link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--grey-200);
  transition: color var(--duration) var(--ease);
  letter-spacing: 0.02em;
}

.nav__link:hover,
.nav__link--active {
  color: var(--white);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  padding: 4px 0;
}

.nav__toggle span {
  display: block;
  height: 2px;
  background: var(--off-white);
  border-radius: 1px;
  transition: transform var(--duration) var(--ease),
              opacity var(--duration) var(--ease);
}

.nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Cart Button */
.cart-btn {
  position: relative;
  color: var(--off-white);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.cart-btn__icon {
  width: 22px;
  height: 22px;
}

.cart-btn__count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--red);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}

.cart-btn__count.visible {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero__content {
  max-width: 560px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}

.hero__text {
  font-size: var(--fs-md);
  color: var(--grey-200);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Carousel */
.carousel {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--dark-surface);
}

.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.5s var(--ease);
}

.carousel__slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-300);
  font-size: var(--fs-sm);
  background: var(--dark-surface);
}

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

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.7);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(4px);
  transition: background var(--duration) var(--ease);
  z-index: 2;
}

.carousel__btn:hover {
  background: rgba(30, 30, 30, 0.9);
}

.carousel__btn--prev { left: 12px; }
.carousel__btn--next { right: 12px; }

.carousel__dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}

.carousel__dot.active {
  background: var(--white);
  transform: scale(1.2);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 14px 28px;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 999px;
  transition: all var(--duration) var(--ease);
  letter-spacing: 0.02em;
}

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

.btn--primary:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(173, 78, 56, 0.3);
}

.btn--outline {
  border: 1.5px solid var(--grey-300);
  color: var(--off-white);
}

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

.btn--outline-dark {
  border: 1.5px solid var(--grey-400);
  color: var(--dark);
}

.btn--outline-dark:hover {
  border-color: var(--dark);
  color: var(--dark);
}

.btn--sm {
  padding: 10px 20px;
  font-size: var(--fs-xs);
}

.btn--lg {
  padding: 16px 36px;
  font-size: var(--fs-base);
}

/* ============================================
   Trust Bar
   ============================================ */

.trust-bar {
  background: rgba(30, 30, 30, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: var(--space-md) 0;
  position: relative;
  z-index: 1;
}

.trust-bar__items {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.trust-bar__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--grey-300);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.trust-bar__item svg {
  color: var(--red);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .trust-bar__items {
    gap: var(--space-lg);
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-xs);
  }
  .trust-bar__item {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: var(--fs-xs);
  }
}

/* ============================================
   How It Works — Steps
   ============================================ */

.steps-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-xl);
  max-width: 900px;
  margin: 0 auto;
}

.step-card {
  flex: 1;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
}

.step-card__number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.step-card__icon {
  color: var(--red);
  margin: 0 auto var(--space-md);
  display: block;
  opacity: 0.7;
}

.step-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.step-card__text {
  font-size: var(--fs-sm);
  color: var(--grey-400);
  line-height: 1.6;
}

.step-card__arrow {
  display: flex;
  align-items: center;
  padding-top: var(--space-3xl);
  color: var(--grey-200);
}

@media (max-width: 768px) {
  .steps-row {
    flex-direction: column;
    gap: var(--space-md);
  }
  .step-card__arrow {
    display: none;
  }
}

/* ============================================
   Final CTA
   ============================================ */

.final-cta {
  padding: var(--space-4xl) 0;
}

.final-cta .section__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-md);
}

.final-cta .btn {
  margin-top: var(--space-lg);
}

/* ============================================
   Cursor Glow
   ============================================ */


@media (hover: none) {
  .cursor-glow { display: none; }
}

/* ============================================
   Dropzone — GPX Upload
   ============================================ */

.dropzone {
  border: 2px dashed var(--grey-300);
  border-radius: var(--radius-xl);
  padding: var(--space-4xl) var(--space-2xl);
  text-align: center;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease);
  cursor: pointer;
  max-width: 700px;
  margin: 0 auto;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--red);
  background: rgba(173, 78, 56, 0.06);
}

.section--dark .dropzone {
  border-color: var(--grey-500);
  background: rgba(255, 255, 255, 0.03);
}

.section--dark .dropzone:hover,
.section--dark .dropzone.dragover {
  border-color: var(--red);
  background: rgba(173, 78, 56, 0.08);
}

.section--dark .dropzone__title {
  color: var(--off-white);
}

.section--dark .dropzone__text {
  color: var(--grey-300);
}

.section--dark .dropzone__text span {
  color: var(--red);
}

.dropzone__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-lg);
  color: var(--grey-300);
}

.dropzone__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.dropzone__text {
  font-size: var(--fs-sm);
  color: var(--grey-400);
  margin-bottom: var(--space-lg);
}

.dropzone__text span {
  color: var(--red);
  font-weight: 600;
}

.dropzone__formats {
  font-size: var(--fs-xs);
  color: var(--grey-300);
}

/* ============================================
   Upload Row — Dropzone + Video side by side
   ============================================ */

.upload-row {
  display: flex;
  gap: var(--space-2xl);
  align-items: stretch;
  max-width: 1000px;
  margin: 0 auto;
}

.upload-row__dropzone {
  flex: 1;
  display: flex;
}

.upload-row__dropzone .dropzone {
  flex: 1;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.upload-row__video {
  width: 300px;
  flex-shrink: 0;
}

.video-placeholder {
  height: 100%;
  border: 2px dashed var(--grey-500);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
  color: var(--grey-300);
  gap: var(--space-md);
  background: rgba(255, 255, 255, 0.03);
}

.video-placeholder svg {
  opacity: 0.3;
  color: var(--grey-300);
}

.video-placeholder p {
  font-size: var(--fs-sm);
  color: var(--grey-400);
  font-weight: 500;
}

.video-placeholder__sub {
  font-weight: 400 !important;
  font-size: var(--fs-xs) !important;
  color: var(--grey-300) !important;
  line-height: 1.6;
  max-width: 220px;
}

@media (max-width: 768px) {
  .upload-row {
    flex-direction: column;
  }
  .upload-row__video {
    width: 100%;
  }
}

/* ============================================
   About / Workshop Section
   ============================================ */

.about-row {
  display: flex;
  gap: var(--space-4xl);
  align-items: center;
}

.about-row__image {
  flex: 1.1;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about-row__image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

.about-row__text {
  flex: 0.9;
}

.about-row__text .section__title {
  margin-bottom: var(--space-xl);
}

.about-row__text p {
  color: var(--grey-500);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
  font-size: var(--fs-base);
}

.section--dark .about-row__text p {
  color: var(--grey-300);
}

.about-row__text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .about-row {
    flex-direction: column;
    gap: var(--space-xl);
  }
}

/* ============================================
   Product Cards & Grid
   ============================================ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-xl);
}

.product-card {
  background: var(--dark-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.product-card__image {
  aspect-ratio: 1;
  background: var(--grey-500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-300);
  font-size: var(--fs-sm);
  overflow: hidden;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__body {
  padding: var(--space-lg);
}

.product-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.product-card__price {
  font-size: var(--fs-sm);
  color: var(--grey-300);
  margin-bottom: var(--space-md);
}

.product-card__btn {
  width: 100%;
}

/* Light section variant */
.section--light .product-card {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.section--light .product-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.section--light .product-card__image {
  background: var(--grey-100);
  color: var(--grey-400);
}

.section--light .product-card__price {
  color: var(--grey-400);
}

/* ============================================
   Location Search
   ============================================ */

.location-search {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  max-width: 500px;
}

.location-search__input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--grey-400);
  border-radius: var(--radius);
  background: var(--dark-surface);
  color: var(--off-white);
  font-family: var(--font);
  font-size: var(--fs-sm);
  transition: border-color var(--duration) var(--ease);
}

.location-search__input::placeholder {
  color: var(--grey-400);
}

.location-search__input:focus {
  outline: none;
  border-color: var(--red);
}

/* ============================================
   Sport Routes — Circle links
   ============================================ */

.sport-routes {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
  flex-wrap: wrap;
}

.sport-route {
  text-align: center;
  cursor: pointer;
  transition: transform var(--duration) var(--ease);
}

.sport-route:hover {
  transform: translateY(-4px);
}

.sport-route__circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--white);
  margin: 0 auto var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: box-shadow var(--duration) var(--ease);
  overflow: hidden;
  color: var(--grey-400);
  font-size: var(--fs-sm);
}

.sport-route:hover .sport-route__circle {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.sport-route__label {
  font-size: var(--fs-base);
  font-weight: 600;
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease),
              visibility var(--duration) var(--ease);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 95vw;
  max-width: 960px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--duration) var(--ease);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--grey-500);
  z-index: 2;
  transition: background var(--duration) var(--ease);
}

.modal__close:hover {
  background: var(--grey-200);
}

/* Progress Bar */
.progress-bar {
  display: flex;
  padding: var(--space-md) var(--space-2xl) var(--space-sm);
  gap: var(--space-md);
  border-bottom: 1px solid var(--grey-100);
}

.progress-bar__step {
  flex: 1;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--grey-300);
  position: relative;
  padding-top: var(--space-lg);
}

.progress-bar__step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grey-100);
  transition: background var(--duration) var(--ease);
}

.progress-bar__step.active::before,
.progress-bar__step.completed::before {
  background: var(--red);
}

.progress-bar__step.active,
.progress-bar__step.completed {
  color: var(--dark);
}

.modal__body {
  padding: var(--space-lg) var(--space-2xl);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.modal__actions {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) var(--space-2xl) var(--space-lg);
  border-top: 1px solid var(--grey-100);
}

/* Preview Layout — stats left, 3D viewer right */
.preview-layout {
  position: relative;
  height: 420px;
}

.preview-stats {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  font-size: var(--fs-sm);
  color: var(--grey-600);
}

.preview-stats span {
  display: block;
  line-height: 1.3;
  color: #e0e0e0;
}

.preview-stats strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.preview-viewer {
  position: absolute;
  left: 180px;
  top: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1a1a1a;
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  z-index: 5;
}

.loading-icon {
  opacity: 0.8;
  animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.loading-text {
  color: var(--grey-300);
  font-size: var(--fs-sm);
  margin: 0;
}

.loading-bar {
  width: 160px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar__fill {
  height: 100%;
  width: 0%;
  background: #AD4E38;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Split View */
.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  min-height: 0;
}

/* ============================================
   Cart Sidebar
   ============================================ */

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--white);
  z-index: 300;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--grey-100);
}

.cart-sidebar__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.cart-sidebar__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--grey-500);
}

.cart-sidebar__items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.cart-sidebar__empty {
  text-align: center;
  color: var(--grey-300);
  padding: var(--space-3xl) 0;
  font-size: var(--fs-sm);
}

.cart-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--grey-100);
}

.cart-item__image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--grey-100);
  flex-shrink: 0;
}

.cart-item__info {
  flex: 1;
}

.cart-item__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.cart-item__price {
  font-size: var(--fs-sm);
  color: var(--grey-400);
}

.cart-item__remove {
  font-size: var(--fs-xs);
  color: var(--red);
  align-self: center;
}

.cart-sidebar__footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--grey-100);
}

.cart-sidebar__total {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.cart-sidebar__checkout {
  width: 100%;
}

/* Cart Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease),
              visibility var(--duration) var(--ease);
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: rgba(20, 20, 20, 0.95);
  color: var(--grey-300);
  padding: var(--space-3xl) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copy {
  font-size: var(--fs-sm);
}

.footer__links {
  display: flex;
  gap: var(--space-xl);
}

.footer__link {
  font-size: var(--fs-sm);
  transition: color var(--duration) var(--ease);
}

.footer__link:hover {
  color: var(--off-white);
}

/* ============================================
   Trackside — Additional Styles
   ============================================ */

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.track-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.track-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.track-card__image {
  aspect-ratio: 1;
  background: var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-400);
  font-size: var(--fs-xs);
}

.track-card__body {
  padding: var(--space-md);
}

.track-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 4px;
}

.track-card__price {
  font-size: var(--fs-xs);
  color: var(--grey-400);
  margin-bottom: var(--space-sm);
}

.track-card__btn {
  width: 100%;
}

/* See More Toggle */
.see-more-wrapper {
  position: relative;
  max-height: 480px;
  overflow: hidden;
  transition: max-height 0.5s var(--ease);
}

.see-more-wrapper.expanded {
  max-height: 3000px;
}

.see-more-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(transparent, var(--off-white));
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}

.see-more-wrapper.expanded::after {
  opacity: 0;
}

.see-more-btn {
  display: block;
  margin: var(--space-xl) auto 0;
}

/* Featured Prints — Side by Side */
.featured-prints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
}

.featured-print {
  background: var(--dark-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--duration) var(--ease);
}

.featured-print:hover {
  transform: translateY(-4px);
}

.featured-print__image {
  aspect-ratio: 3 / 4;
  background: var(--grey-500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-300);
  font-size: var(--fs-sm);
}

.featured-print__body {
  padding: var(--space-xl);
}

.featured-print__name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.featured-print__desc {
  font-size: var(--fs-sm);
  color: var(--grey-300);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.featured-print__price {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

/* Race Calendars */
.calendars-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
}

.calendar-group__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.calendar-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.calendar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.calendar-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.calendar-item__name {
  font-weight: 600;
  font-size: var(--fs-sm);
}

.calendar-item__price {
  font-size: var(--fs-sm);
  color: var(--grey-400);
  margin-right: var(--space-md);
}

/* ============================================
   Form Elements
   ============================================ */

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

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: var(--fs-sm);
  transition: border-color var(--duration) var(--ease);
  background: var(--white);
}

.form-input:focus {
  outline: none;
  border-color: var(--red);
}

.form-input--error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(173, 78, 56, 0.15);
}

/* ============================================
   Utility
   ============================================ */

/* ============================================
   Product Detail Modal
   ============================================ */

.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease),
              visibility var(--duration) var(--ease);
}

.product-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.product-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 95vw;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--duration) var(--ease);
}

.product-modal-overlay.active .product-modal {
  transform: translateY(0) scale(1);
}

.product-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--grey-500);
  z-index: 2;
  transition: background var(--duration) var(--ease);
}

.product-modal__close:hover {
  background: var(--grey-200);
}

.product-modal__gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--grey-100);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}

.product-modal__image {
  aspect-ratio: 1;
  background: var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-400);
  font-size: var(--fs-sm);
}

.product-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal__content {
  padding: var(--space-2xl);
}

.product-modal__name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
}

.product-modal__price {
  font-size: var(--fs-lg);
  color: var(--red);
  font-weight: 600;
  margin-bottom: var(--space-xl);
}

.product-modal__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.product-modal__detail {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.product-modal__detail-icon {
  width: 20px;
  height: 20px;
  color: var(--red);
  flex-shrink: 0;
  margin-top: 2px;
}

.product-modal__detail-text h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.product-modal__detail-text p {
  font-size: var(--fs-xs);
  color: var(--grey-400);
  line-height: 1.5;
}

.product-modal__dimensions {
  background: var(--grey-100);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.product-modal__dimensions h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.product-modal__size-options {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.product-modal__size {
  padding: 8px 16px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--white);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.product-modal__size:hover,
.product-modal__size.selected {
  border-color: var(--red);
  color: var(--red);
}

.product-modal__actions {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.product-modal__actions .btn {
  flex: 1;
}

/* Product Info Section */
.product-modal__info {
  border-top: 1px solid var(--grey-100);
  padding-top: var(--space-xl);
}

.product-modal__info h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.product-modal__info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.product-modal__info-item {
  padding: var(--space-md);
  background: var(--grey-100);
  border-radius: var(--radius);
}

.product-modal__info-item h4 {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-400);
  margin-bottom: 4px;
}

.product-modal__info-item p {
  font-size: var(--fs-sm);
  line-height: 1.5;
}

/* Cart notification toast */
.cart-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark);
  color: var(--off-white);
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  z-index: 400;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--duration) var(--ease);
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cart-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* Clickable cards */
.product-card[data-product],
.track-card[data-product],
.featured-print[data-product] {
  cursor: pointer;
}

/* See More for Maps Collection (dark section variant) */
.see-more-wrapper--dark {
  position: relative;
  max-height: 520px;
  overflow: hidden;
  transition: max-height 0.5s var(--ease);
}

.see-more-wrapper--dark.expanded {
  max-height: 3000px;
}

.see-more-wrapper--dark::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(transparent, rgba(30, 30, 30, 0.95));
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
  z-index: 1;
}

.see-more-wrapper--dark.expanded::after {
  opacity: 0;
}

.text-center { text-align: center; }
.text-red { color: var(--red); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================
   Responsive — Tablet (640px)
   ============================================ */

@media (max-width: 1024px) {
  :root {
    --fs-3xl: 2.5rem;
    --fs-2xl: 2rem;
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__content {
    max-width: 100%;
    order: 1;
  }

  .hero__actions {
    justify-content: center;
  }

  .carousel {
    max-width: 480px;
    margin: 0 auto;
    order: 0;
    aspect-ratio: 4/4;
  }

  .preview-layout {
    height: auto;
  }

  .preview-stats {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-lg);
    margin-bottom: var(--space-md);
  }

  .preview-viewer {
    position: static;
    height: 300px;
  }

  .split-view {
    grid-template-columns: 1fr;
  }

  .featured-prints {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .calendars-split {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
}

@media (max-width: 640px) {
  :root {
    --fs-3xl: 2rem;
    --fs-2xl: 1.75rem;
    --fs-lg: 1.25rem;
    --space-4xl: 3.5rem;
  }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(30, 30, 30, 0.98);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2xl);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration) var(--ease),
                visibility var(--duration) var(--ease);
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
  }

  .nav__link {
    font-size: var(--fs-lg);
  }

  .nav__toggle {
    display: flex;
    z-index: 110;
  }

  .hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: var(--space-2xl);
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
  }

  .sport-routes {
    gap: var(--space-xl);
  }

  .sport-route__circle {
    width: 120px;
    height: 120px;
  }

  .dropzone {
    padding: var(--space-2xl) var(--space-lg);
  }

  .track-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal {
    width: 100vw;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 95vh;
  }

  .progress-bar {
    padding: var(--space-md);
  }

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

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  .product-modal__gallery {
    grid-template-columns: 1fr;
  }

  .product-modal__details {
    grid-template-columns: 1fr;
  }

  .product-modal__actions {
    flex-direction: column;
  }

  .product-modal__info-grid {
    grid-template-columns: 1fr;
  }
}
