/* ==========================================================================
   AIPAS ELECTRIC BIKES EUROPE - COMPONENTS STYLES (PREMIUM LIGHT THEME)
   ========================================================================== */

/* Language Dropdown */
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  list-style: none;
  min-width: 220px;
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 1050;
  padding: 8px;
}

.lang-dropdown-wrap.open .lang-dropdown-menu {
  display: block;
}

/* Class names below must match the markup built in app.js initLanguagePicker().
   They previously did not (.lang-option / .lang-option-item vs the emitted
   .lang-option-btn), which left the whole menu unstyled. */
.lang-dropdown-menu li {
  list-style: none;
}

.lang-option-btn {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s, color 0.15s;
}

.lang-option-btn:hover,
.lang-option-btn:focus-visible {
  background: #f1f5f9;
  color: var(--color-primary);
}

.lang-option-btn.active {
  background: #f1f5f9;
  color: var(--color-primary);
}

.lang-option-btn .lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-option-btn .lang-name {
  font-weight: 700;
  white-space: nowrap;
}

.lang-option-btn .lang-region {
  font-size: 0.75rem;
  margin-left: auto;
  padding-left: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Cart Drawer */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1100;
}

.cart-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.active {
  right: 0;
}

.cart-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cart-item-color {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cart-item-price {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-primary);
}

.cart-drawer-footer {
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  background: #f8fafc;
}

/* GDPR Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 580px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-xl);
  z-index: 1500;
  display: none;
}

.cookie-banner.active {
  display: block;
}

.cookie-content h4 {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.cookie-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ==========================================================================
   Footer.

   Footer colours were set only by inline style="color:#ffffff" repeated on
   every page. pages/contact.html and pages/compare.html were missing it, so
   their column headings inherited --text-primary (#0f172a) on the #070a0e
   footer — a contrast ratio of 1.11:1, effectively invisible. Defining it
   here means it cannot drift page by page again.
   ========================================================================== */

footer {
  background: #070a0e;
  color: #cbd5e1;
}

footer h4 {
  color: #ffffff;
  font-weight: 800;
}

footer a {
  color: #cbd5e1;
}

footer a:hover,
footer a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

/* The bottom bar used #64748b on #070a0e — 4.19:1, just under the 4.5:1
   WCAG AA threshold for normal-size text. */
footer .text-muted,
footer .small.text-muted {
  color: #94a3b8;
}

/* ==========================================================================
   Form primitives and content cards.

   These lived only in checkout.css, which pages/contact.html and
   pages/warranty.html do not load — so both forms rendered completely
   unstyled: labels inline with the inputs, full-width controls collapsed to
   default browser size, textareas overlapping. They are shared components,
   not checkout-specific, so they belong here where every page gets them.
   ========================================================================== */

.checkout-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.checkout-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 96px;
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Added-to-cart toast (rendered by cart.js showAddedToast) */
.cart-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 90px; /* clear of the chat button */
  z-index: 2000;
  width: min(420px, calc(100vw - 24px));
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 14px 16px;
}
.cart-toast-msg { font-weight: 700; margin-bottom: 10px; }
.cart-toast-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cart-toast-actions .btn { flex: 1; text-align: center; min-width: 130px; }

/* Cookie banner: never wider than the viewport, buttons wrap on phones. */
.cookie-actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  .cookie-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: none;
    width: auto;
    padding: 14px 16px;
    box-sizing: border-box;
  }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { flex: 1; }
}

/* ==========================================================================
   Comparison matrix — rendered by comparison.js.
   These class names were emitted by the script but had no rules anywhere, so
   the whole "Side-by-Side E-Bike Comparison" section rendered as a bare table.
   ========================================================================== */

.table-comparison {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-comparison th,
.table-comparison td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}

.table-comparison tbody tr:nth-child(even) {
  background: #f8fafc;
}

.comp-col-header {
  background: #ffffff;
  text-align: center !important;
  vertical-align: top !important;
  min-width: 200px;
  border-bottom: 2px solid var(--border-subtle) !important;
}

.comp-thumb-wrap {
  height: 120px;
  background: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin-bottom: 10px;
}

.comp-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.comp-title {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.comp-price {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.add-to-cart-comp {
  width: 100%;
}

.comp-feature-label {
  font-weight: 700;
  color: var(--text-secondary);
  background: #f1f5f9;
  white-space: nowrap;
}

/* Blog article typography — .article-body is used on all nine guide pages. */
.article-body {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.article-body h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 36px 0 12px;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 28px 0 10px;
}

.article-body p { margin-bottom: 16px; }

.article-body ul,
.article-body ol {
  margin: 0 0 16px 22px;
}

.article-body li { margin-bottom: 8px; }

.article-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.review-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* index.html wraps the calculator inputs in .calc-controls. */
.calc-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
