/* Cloudflair — easyJet-authentic layout with Cloudflare colours */
:root {
  /* Cloudflare palette */
  --cf-orange: #F6821F;
  --cf-orange-dark: #E1680B;
  --cf-orange-light: #FFF4EB;
  --cf-blue: #0051C3;
  --cf-blue-light: #E8F0FA;
  --cf-gray: #404041;

  /* easyJet-style tokens */
  --color-primary: var(--cf-orange);
  --color-primary-dark: var(--cf-orange-dark);
  --color-primary-light: var(--cf-orange-light);
  --color-secondary: var(--cf-blue);
  --color-secondary-light: var(--cf-blue-light);

  /* Neutrals */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-ink: #1a1a1a;
  --color-ink-secondary: #4a4a4a;
  --color-muted: #6b6b6b;
  --color-border: #e0e0e0;
  --color-border-light: #f0f0f0;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* Radii — easyJet uses small, crisp corners */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Typography — easyJet uses a bold geometric sans */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', 'Inter', sans-serif;

  --container: 1200px;
  --header-height: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-ink);
  background: #f5f5f5;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* ============================================
   HEADER — easyJet: Orange top bar + white nav
   ============================================ */

/* Orange utility bar */
.utility-bar {
  background: linear-gradient(90deg, var(--cf-orange) 0%, var(--cf-orange-dark) 100%);
  color: white;
  font-size: 0.8rem;
  padding: 8px 0;
}

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

.utility-links {
  display: flex;
  gap: 20px;
  font-weight: 500;
}

.utility-links a:hover { text-decoration: underline; }

.live-viewers {
  display: none;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.75rem;
}

.live-viewers.show { display: inline-flex; }

.live-viewers .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7dd87d;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* Main header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 24px;
}

/* Logo — Cloudflair SVG logo */
.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-mark { display: none; }
.logo-text { color: var(--cf-orange); }

/* Main nav */
.main-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink);
  transition: background 0.15s, color 0.15s;
}

.main-nav a:hover {
  background: var(--color-primary-light);
  color: var(--cf-orange);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: none;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  border-color: var(--cf-orange);
  color: var(--cf-orange);
}

.cart-count {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--cf-orange);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ============================================
   BUTTONS — easyJet: solid, bold, uppercase
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover { transform: translateY(-1px); }

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

.btn-primary:hover {
  background: var(--cf-orange-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--cf-blue);
  color: white;
}

.btn-secondary:hover {
  background: #003d94;
}

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

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

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

.btn-white:hover {
  background: var(--cf-orange-light);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

.btn-full { width: 100%; }

/* ============================================
   HERO — easyJet: Full-width search panel
   ============================================ */
.hero {
  position: relative;
  padding: 0;
  background: linear-gradient(135deg, var(--cf-orange) 0%, #ff9a44 50%, var(--cf-blue) 100%);
  min-height: 420px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><ellipse cx="1000" cy="100" rx="400" ry="300" fill="rgba(255,255,255,0.05)"/><ellipse cx="200" cy="500" rx="300" ry="200" fill="rgba(255,255,255,0.03)"/></svg>') center/cover;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 48px 0 56px;
}

.hero-tagline {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: white;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  max-width: 540px;
}

/* Flight search form — easyJet's signature element */
.flight-search {
  background: white;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-width: 900px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-field input,
.search-field select {
  padding: 14px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}

.search-field input:focus,
.search-field select:focus {
  border-color: var(--cf-orange);
}

.search-field input::placeholder {
  color: var(--color-muted);
  font-weight: 400;
}

.search-btn {
  padding: 14px 28px;
  height: fit-content;
}

/* Hero stats */
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-stats div {
  text-align: left;
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.hero-stats span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
}

/* ============================================
   SECTIONS
   ============================================ */
section {
  padding: 56px 0;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--color-ink);
}

.section-header p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
}

/* ============================================
   DESTINATION CARDS — easyJet tile style
   ============================================ */
.collections {
  background: var(--color-surface);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.collection-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-media {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.5) 100%);
}

/* easyJet-style destination gradients */
.card-media-1 { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.card-media-2 { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.card-media-3 { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }

.card-body {
  padding: 16px 18px;
}

.card-body h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
}

.card-body p {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--cf-orange);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.link-arrow:hover { color: var(--cf-orange-dark); }

/* ============================================
   DEAL CARDS — easyJet destination tiles
   ============================================ */
.featured {
  background: #f5f5f5;
}

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

.product-card {
  position: relative;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--cf-orange);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.product-media {
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Destination gradients */
.product-1 { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.product-2 { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.product-3 { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.product-4 { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.product-5 { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.product-6 { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }
.product-7 { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.product-8 { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.product-9 { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }

.product-media-photo { background: none; }
.product-media-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  padding: 14px 16px;
}

.product-body h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-ink);
}

.product-route {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.product-price-from {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.product-price-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--cf-orange);
}

.product-price::before {
  content: 'from ';
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.product-stock {
  margin: 6px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
}

.product-stock-low { color: var(--cf-orange-dark); }
.product-stock-out { color: var(--color-muted); }

.product-card-soldout .product-media {
  filter: grayscale(1);
  opacity: 0.5;
}

.btn-add {
  margin-top: 12px;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.8rem;
}

.btn-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.catalog-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-muted);
  padding: 40px 0;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 0 24px;
}

.search-input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: white;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--cf-orange);
}

.search-results { margin-bottom: 32px; }

.search-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--cf-orange-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cf-orange-dark);
}

.search-clear {
  background: none;
  border: none;
  font-weight: 700;
  color: var(--cf-orange-dark);
  text-decoration: underline;
  cursor: pointer;
}

.search-score {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cf-blue);
}

/* ============================================
   REVIEWS — Traveller testimonials
   ============================================ */
.reviews {
  background: white;
}

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

.review-card {
  margin: 0;
  padding: 24px;
  background: #fafafa;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.review-card p {
  margin: 0 0 14px;
  font-size: 1rem;
  font-style: italic;
  color: var(--color-ink-secondary);
  line-height: 1.6;
}

.review-card footer {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-ink);
}

/* ============================================
   CTA BANNER
   ============================================ */
.signup-cta {
  padding: 48px 0;
  background: white;
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 32px;
  background: linear-gradient(135deg, var(--cf-orange) 0%, var(--cf-orange-dark) 100%);
  border-radius: var(--radius-md);
  color: white;
}

.cta-banner h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.cta-banner p {
  margin: 0;
  opacity: 0.9;
}

.cta-banner .btn-white {
  flex-shrink: 0;
}

/* ============================================
   FOOTER — easyJet dark footer
   ============================================ */
.site-footer {
  padding: 48px 0 24px;
  background: #1a1a1a;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-grid .logo { margin-bottom: 12px; }
.footer-grid .logo-img { height: 36px; }
.footer-grid .logo-text { color: var(--cf-orange); }

.footer-about {
  max-width: 260px;
  line-height: 1.6;
}

.footer-grid h4 {
  margin: 0 0 14px;
  color: white;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li + li { margin-top: 8px; }
.footer-grid a:hover { color: white; }

.copyright {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
}

/* ============================================
   CART DRAWER
   ============================================ */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 220;
  height: 100vh;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  background: white;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

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

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--cf-orange);
  color: white;
}

.cart-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item-info span {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: white;
  font-weight: 700;
  cursor: pointer;
}

.qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

.cart-remove {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.cart-empty {
  text-align: center;
  color: var(--color-muted);
  padding: 40px 0;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cart-subtotal strong {
  font-size: 1.2rem;
  color: var(--cf-orange);
}

.cart-clear {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
}

.cart-note {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cf-orange-dark);
  text-align: center;
}

.cart-email-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-secondary);
}

.cart-footer .form-input { width: 100%; }
.cart-footer .turnstile-widget { min-height: 0; }

/* ============================================
   CHAT LAUNCHER & PANEL
   ============================================ */
.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--cf-orange);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s, background 0.15s;
}

.chat-launcher:hover {
  transform: scale(1.05);
  background: var(--cf-orange-dark);
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 201;
  width: min(400px, calc(100% - 40px));
  max-height: min(600px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--cf-orange);
  color: white;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: white;
  color: var(--cf-orange);
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1rem;
}

.chat-title h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.chat-status {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.8);
}

.chat-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #7dd87d;
}

.chat-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255,255,255,0.2);
  font-size: 1.2rem;
  color: white;
  cursor: pointer;
}

.chat-close:hover { background: rgba(255,255,255,0.3); }

/* Plan switcher */
.chat-plan-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--color-border-light);
}

.plan-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-toggle {
  display: flex;
  gap: 4px;
  background: white;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.plan-option {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.plan-option-active {
  background: var(--cf-orange-light);
  color: var(--cf-orange-dark);
}

.plan-option[data-plan="paid"].plan-option-active {
  background: var(--cf-blue-light);
  color: var(--cf-blue);
}

.plan-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}

.plan-option-active .plan-dot { opacity: 1; }

.plan-badge {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--cf-blue);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-user { align-self: flex-end; }
.message-bot { align-self: flex-start; }

.message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.message-user .message-bubble {
  background: var(--cf-orange);
  color: white;
  border-bottom-right-radius: 2px;
}

.message-bot .message-bubble {
  background: #f5f5f5;
  color: var(--color-ink);
  border: 1px solid var(--color-border-light);
  border-bottom-left-radius: 2px;
}

.message-meta {
  font-size: 0.65rem;
  color: var(--color-muted);
}

.message-user .message-meta { align-self: flex-end; }

.message-bot .message-bubble.fallback-bubble {
  border: 1px solid #d97706;
  background: #fffbeb;
  color: #92400e;
}

.message-execution-note {
  margin: 4px 0;
  font-size: 0.72rem;
  color: #b45309;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  height: 18px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-muted);
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.error-bubble { border-left: 3px solid #ef4444; }

/* Chat Input */
.chat-input-area {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--color-border-light);
  background: white;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input:focus {
  border-color: var(--cf-orange);
  background: white;
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--cf-orange);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.chat-send:hover { background: var(--cf-orange-dark); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-disclaimer {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.65rem;
  color: var(--color-muted);
}

.chat-disclaimer code {
  background: #f5f5f5;
  padding: 1px 4px;
  border-radius: 2px;
  font-family: ui-monospace, monospace;
}

/* Suggestions */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  justify-content: center;
}

.chat-suggest {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.chat-suggest:hover {
  color: var(--color-ink);
  border-color: var(--cf-orange);
  background: var(--cf-orange-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
  .main-nav { display: flex; }
  .icon-btn { display: inline-block; }
  .utility-bar { display: block; }
}

@media (max-width: 900px) {
  .search-row {
    grid-template-columns: 1fr 1fr;
  }
  .search-btn {
    grid-column: span 2;
  }
}

@media (max-width: 767px) {
  .utility-bar { display: none; }

  .hero { min-height: auto; }
  .hero-content { padding: 32px 0 40px; }
  .hero h1 { font-size: 1.8rem; }

  .search-row {
    grid-template-columns: 1fr;
  }
  .search-btn {
    grid-column: auto;
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .chat-panel {
    right: 10px;
    bottom: 76px;
    width: calc(100% - 20px);
  }

  .chat-launcher {
    right: 10px;
    bottom: 10px;
  }

  .cart-drawer { width: 100%; }
}

/* ============================================
   FORMS & ACCOUNT
   ============================================ */
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--cf-orange);
  background: white;
}

.turnstile-widget {
  margin: 8px 0 14px;
  min-height: 65px;
}

.form-status {
  margin: 12px 0 0;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.form-status-success { color: #059669; }
.form-status-error { color: #dc2626; }

.account-section {
  background: white;
  border-top: 1px solid var(--color-border-light);
}

.signup-main { padding: 48px 0 80px; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.account-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.account-card h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
}

.account-card-demo p {
  color: var(--color-ink-secondary);
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.generated-user {
  margin-top: 16px;
  padding: 14px;
  background: #fafafa;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.7;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 4px;
}

.badge-free { background: var(--cf-orange-light); color: var(--cf-orange-dark); }
.badge-paid { background: var(--cf-blue-light); color: var(--cf-blue); }
.badge-seed { background: #f3f4f6; color: #6b7280; }
.badge-autofill { background: #d1fae5; color: #059669; }
.badge-manual { background: #dbeafe; color: #1d4ed8; }

.login-alt {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--color-ink-secondary);
}

.login-alt a {
  color: var(--cf-orange);
  font-weight: 600;
}

.demo-cred-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.demo-cred-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #fafafa;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.demo-cred-list li + li { margin-top: 6px; }

.demo-cred-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-ink-secondary);
  line-height: 1.5;
}

.demo-cred-note code,
.demo-cred-list code {
  background: white;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid var(--color-border);
}

.account-signed-in { font-weight: 700; }
.account-signout {
  color: var(--color-ink-secondary) !important;
  font-style: italic;
}

/* ============================================
   ORDER CARDS
   ============================================ */
.order-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.order-card:last-child { border-bottom: none; }

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.order-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-id span {
  font-size: 0.72rem;
  color: var(--color-muted);
}

.order-status {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.order-status-confirmed { background: var(--cf-blue-light); color: var(--cf-blue); }
.order-status-fulfilled { background: #d1fae5; color: #059669; }
.order-status-cancelled { background: #fee2e2; color: #dc2626; }

.order-items {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.order-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--color-ink-secondary);
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.order-total strong { color: var(--cf-orange); }

/* ============================================
   SERVER-RENDERED PAGES
   ============================================ */
.page-section { padding-top: 40px; }

.section-header h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}

.crumbs {
  margin: 0 0 20px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.crumbs a { color: var(--color-ink-secondary); }
.crumbs a:hover { color: var(--cf-orange); }
.crumbs span { color: var(--cf-orange); }

.product-detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}

.product-detail-media .product-media {
  height: 380px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
}

.product-detail-info h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
}

.product-detail-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--cf-orange-light);
  color: var(--cf-orange-dark);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-detail-desc {
  margin: 0 0 16px;
  color: var(--color-ink-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.product-detail-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px;
}

.product-detail-price strong {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--cf-orange);
}

.product-detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fafafa;
}

.product-detail-facts dt {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.product-detail-facts dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.product-detail-support {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--color-ink-secondary);
}

.product-detail-support a { color: var(--cf-orange); }
.product-detail-support a:hover { text-decoration: underline; }

.product-media-link { display: block; }

.collection-count {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cf-orange);
}

.content-prose { max-width: 720px; }

.content-prose h2 {
  margin: 32px 0 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.support-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.support-table th,
.support-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.support-table th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  background: #fafafa;
}

.support-table tr:last-child td { border-bottom: none; }

.support-notes {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--color-ink-secondary);
}

.support-notes li + li { margin-top: 6px; }

.support-crosslink {
  margin-top: 28px;
  padding: 12px 16px;
  border-left: 3px solid var(--cf-orange);
  background: #fafafa;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-ink-secondary);
}

@media (max-width: 880px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .product-detail-media .product-media { height: 280px; }
}

/* eyebrow legacy alias */
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* hero-actions legacy */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.hero-actions .btn-primary {
  background: white;
  color: var(--cf-orange);
}

.hero-actions .btn-primary:hover { background: var(--cf-orange-light); }

.hero-actions .btn-outline {
  border-color: white;
  color: white;
}

.hero-actions .btn-outline:hover {
  background: white;
  color: var(--cf-orange);
}
