/* ============================================================
   HERBAL TRADE ROUTES — STYLESHEET
   The Wild Key | Milestone 1
   ============================================================ */

/* DESIGN TOKENS */
:root {
  --bone-cream: #f2ede4;
  --warm-sand: #d8c7a3;
  --root-brown: #4a3a2a;
  --smoked-amethyst: #5e3a63;
  --deep-plum: #3e1f3f;
  --petrol-blue: #2f4f5a;
  --mist-blue: #afc3c9;
  --soft-gold: #c6a769;

  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;

  --panel-width: 420px;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bone-cream);
  color: var(--root-brown);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.site-header {
  background-color: var(--deep-plum);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(198, 167, 105, 0.2);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  text-decoration: none;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--soft-gold);
  letter-spacing: 0.02em;
}

.header-nav {
  display: flex;
  gap: 2rem;
}

.header-nav a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--warm-sand);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition-fast);
}

.header-nav a:hover,
.header-nav a.nav-active {
  color: var(--soft-gold);
}

/* ── MAP SECTION ── */
.map-section {
  position: relative;
  background-color: var(--deep-plum);
}

/* Filter Bar */
.filter-bar {
  background: rgba(62, 31, 63, 0.95);
  border-bottom: 1px solid rgba(198, 167, 105, 0.15);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
}

.filter-label {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-style: italic;
  color: var(--soft-gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(175, 195, 201, 0.3);
  background: transparent;
  color: var(--mist-blue);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pill:hover {
  border-color: var(--soft-gold);
  color: var(--soft-gold);
  background: rgba(198, 167, 105, 0.08);
}

.pill.active {
  background: var(--soft-gold);
  border-color: var(--soft-gold);
  color: var(--deep-plum);
}

/* Map Container */
.map-container {
  position: relative;
  display: flex;
  height: 75vh;
  min-height: 500px;
  max-height: 800px;
  overflow: hidden;
}

#map {
  flex: 1;
  height: 100%;
}

/* ── SIDE PANEL ── */
.side-panel {
  width: var(--panel-width);
  background: var(--bone-cream);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: absolute;
  right: 0;
  top: 0;
  z-index: 10;
  box-shadow: -8px 0 40px rgba(62, 31, 63, 0.3);
}

.side-panel.open {
  transform: translateX(0);
}

.panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 11;
  background: rgba(216, 199, 163, 0.4);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--root-brown);
  transition: var(--transition-fast);
}

.panel-close:hover {
  background: var(--warm-sand);
  color: var(--deep-plum);
}

.panel-scroll {
  overflow-y: auto;
  height: 100%;
  padding-bottom: 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--warm-sand) transparent;
}

.panel-scroll::-webkit-scrollbar {
  width: 4px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
  background: var(--warm-sand);
  border-radius: 4px;
}

/* Panel Header */
.panel-header {
  background: linear-gradient(
    160deg,
    var(--deep-plum) 0%,
    var(--smoked-amethyst) 100%
  );
  padding: 2.5rem 1.75rem 2rem;
}

.panel-eyebrow {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft-gold);
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--bone-cream);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.panel-route-line {
  height: 2px;
  width: 48px;
  background: var(--soft-gold);
  border-radius: 2px;
  opacity: 0.7;
}

/* Panel Sections */
.panel-section {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(216, 199, 163, 0.5);
}

.panel-section:last-of-type {
  border-bottom: none;
}

.panel-section-title {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--smoked-amethyst);
  margin-bottom: 0.85rem;
}

.panel-story {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.75;
  color: var(--root-brown);
}

/* Tags */
.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  background: rgba(94, 58, 99, 0.1);
  color: var(--smoked-amethyst);
  border: 1px solid rgba(94, 58, 99, 0.2);
}

/* Ingredients */
.ingredient-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.ingredient-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--soft-gold);
  flex-shrink: 0;
  margin-top: 0.45rem;
}

.ingredient-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--root-brown);
  display: block;
  line-height: 1.2;
}

.ingredient-desc {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: #7a6a5a;
  display: block;
  margin-top: 0.1rem;
}

/* Journey Steps */
.journey-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.journey-step {
  display: flex;
  align-items: center;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.step-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.step-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--root-brown);
  text-align: center;
  max-width: 70px;
  line-height: 1.2;
}

.step-arrow {
  font-size: 0.8rem;
  color: var(--soft-gold);
  margin: 0 0.3rem;
  padding-bottom: 1rem;
  opacity: 0.7;
}

/* Ritual Benefits */
.ritual-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.benefit-tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  background: rgba(198, 167, 105, 0.15);
  color: var(--root-brown);
  border: 1px solid rgba(198, 167, 105, 0.4);
  font-weight: 500;
}

.ritual-role {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--smoked-amethyst);
  line-height: 1.6;
}

/* Products */
.panel-products {
  background: rgba(216, 199, 163, 0.15);
}

.product-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.product-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: white;
  border-radius: 8px;
  border: 1px solid rgba(216, 199, 163, 0.5);
  text-decoration: none;
  transition: var(--transition-fast);
}

.product-card:hover {
  border-color: var(--soft-gold);
  box-shadow: 0 2px 12px rgba(198, 167, 105, 0.2);
  transform: translateY(-1px);
}

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--warm-sand), var(--mist-blue));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.product-info {
  flex: 1;
}

.product-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--root-brown);
  display: block;
}

.product-type {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: #7a6a5a;
  display: block;
}

.product-arrow {
  color: var(--soft-gold);
  font-size: 1rem;
}

/* CTAs */
.panel-ctas {
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cta-btn {
  display: block;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.cta-primary {
  background: var(--deep-plum);
  color: var(--soft-gold);
}

.cta-primary:hover {
  background: var(--smoked-amethyst);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(62, 31, 63, 0.3);
}

.cta-secondary {
  background: transparent;
  color: var(--root-brown);
  border: 1.5px solid var(--warm-sand);
}

.cta-secondary:hover {
  border-color: var(--soft-gold);
  color: var(--smoked-amethyst);
}

/* ── BELOW MAP SEO ── */
.below-map-seo {
  background: var(--root-brown);
  padding: 5rem 2rem;
}

.seo-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
}

.seo-card h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--soft-gold);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.seo-card p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--warm-sand);
  line-height: 1.8;
  font-weight: 300;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--deep-plum);
  padding: 1.5rem 2rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: rgba(175, 195, 201, 0.6);
  border-top: 1px solid rgba(198, 167, 105, 0.1);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .map-container {
    height: 65vh;
    min-height: 400px;
  }

  .side-panel {
    width: 100%;
    height: 70vh;
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(62, 31, 63, 0.4);
  }

  .side-panel.open {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .pill {
    font-size: 0.68rem;
    padding: 0.35rem 0.75rem;
  }

  .panel-title {
    font-size: 1.5rem;
  }
}

/* ── LOADING STATE ── */
.map-loading {
  position: absolute;
  inset: 0;
  background: var(--deep-plum);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity 0.6s ease;
}

.map-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-pulse {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(198, 167, 105, 0.2);
  border-top-color: var(--soft-gold);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin-bottom: 1rem;
}

.loading-text {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-style: italic;
  color: var(--mist-blue);
  letter-spacing: 0.05em;
}

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

/* ── INGREDIENT ORIGIN ── */
.ingredient-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.ingredient-origin {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--smoked-amethyst);
  letter-spacing: 0.03em;
  margin-bottom: 0.1rem;
}

/* ── INGREDIENT STORY TOGGLE ── */
.ingredient-story-toggle {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--soft-gold);
  background: none;
  border: none;
  padding: 0.3rem 0;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.04em;
  transition: var(--transition-fast);
  margin-top: 0.25rem;
}

.ingredient-story-toggle:hover {
  color: var(--smoked-amethyst);
}

.ingredient-story-text {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.7;
  color: #6a5a4a;
  margin-top: 0.4rem;
  padding: 0.75rem;
  background: rgba(198, 167, 105, 0.08);
  border-left: 2px solid rgba(198, 167, 105, 0.4);
  border-radius: 0 4px 4px 0;
}

/* ── INGREDIENT TOOLTIP (on map) ── */
.ingredient-tooltip {
  position: absolute;
  z-index: 20;
  background: var(--deep-plum);
  border: 1px solid rgba(198, 167, 105, 0.3);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  pointer-events: none;
  display: none;
  max-width: 200px;
}

.tooltip-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--soft-gold);
  line-height: 1.2;
}

.tooltip-origin {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--mist-blue);
  margin-top: 0.2rem;
}

/* ── INGREDIENT ONE-LINER ── */
.ingredient-one-liner {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--root-brown);
  line-height: 1.4;
  display: block;
  margin-bottom: 0.3rem;
}

.ingredient-desc {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: #7a6a5a;
  display: block;
  margin-top: 0.15rem;
  line-height: 1.6;
}

/* ── INGREDIENT PRODUCT LINKS ── */
.ing-products {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.ing-products-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--smoked-amethyst);
  margin-right: 0.3rem;
}

.ing-product-link {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--soft-gold);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  border: 1px solid rgba(198, 167, 105, 0.3);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.ing-product-link:hover {
  background: rgba(198, 167, 105, 0.15);
  border-color: var(--soft-gold);
}

.ing-product-link.coming-soon {
  color: var(--mist-blue);
  border-color: rgba(175, 195, 201, 0.3);
  cursor: default;
  font-style: italic;
  opacity: 0.7;
}

.ing-product-link.coming-soon:hover {
  background: transparent;
  border-color: rgba(175, 195, 201, 0.3);
}

/* ── INGREDIENT IMAGE ── */
.ingredient-img-wrap {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--warm-sand);
  border: 1px solid rgba(198, 167, 105, 0.3);
  align-self: flex-start;
  margin-top: 0.15rem;
}

.ingredient-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.ingredient-img:hover {
  transform: scale(1.08);
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding-bottom: 0.75rem;
}

/* ── HERO WITH VIDEO ── */

/* ── IMAGE FADE IN ON LOAD ── */
.ingredient-img {
  opacity: 0;
  transition:
    opacity 0.4s ease,
    transform 0.3s ease;
}

.ingredient-img.loaded {
  opacity: 1;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

/* Prevent pills from shrinking on mobile */
.pill {
  flex-shrink: 0;
}

/* ── ROUTE HOVER TOOLTIP ── */
.route-tooltip {
  position: absolute;
  z-index: 20;
  background: rgba(62, 31, 63, 0.95);
  border: 1px solid rgba(198, 167, 105, 0.4);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.route-tooltip-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--soft-gold);
  line-height: 1.2;
}

.route-tooltip-region {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist-blue);
  margin-top: 0.2rem;
}

/* ── HERO SECTION ── */
.hero-section {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  max-height: 540px;
  overflow: hidden;
  background-color: var(--deep-plum);
  background-image: linear-gradient(
    160deg,
    rgba(62, 31, 63, 1) 0%,
    rgba(94, 58, 99, 0.9) 40%,
    rgba(47, 79, 90, 0.85) 100%
  );
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.hero-video.loaded {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    160deg,
    rgba(62, 31, 63, 0.82) 0%,
    rgba(94, 58, 99, 0.65) 40%,
    rgba(47, 79, 90, 0.55) 100%
  );
  pointer-events: none;
}

.hero-inner {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soft-gold);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  color: var(--bone-cream);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
  max-width: 760px;
}

.hero-subtitle {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 300;
  color: var(--mist-blue);
  max-width: 600px;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .hero-section {
    padding-bottom: 75%;
    max-height: 400px;
  }

  .hero-inner {
    padding: 1.5rem 1.25rem;
  }

  .hero-eyebrow {
    font-size: 0.7rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding-bottom: 90%;
    max-height: 360px;
  }
}
