/* ==========================================================================
   Partsmercedestr — Obsidian & Brass OEM Portal
   Editorial Mercedes-Benz-inspired design system: warm off-white canvas,
   anthracite ink, single brass accent, cinematic obsidian bookends.
   ========================================================================== */

:root {
  /* --- Canvas & Surfaces --- */
  --bg-canvas: #F7F6F3;
  --bg-surface: #FFFFFF;
  --bg-obsidian: #0B0C0E;
  --bg-obsidian-surface: #18191C;

  /* --- Ink (text) --- */
  --ink: #1C1D20;
  --ink-soft: #55585E;
  --ink-faint: #8B877E;
  --ink-inverse: #F5F3EE;
  --ink-inverse-soft: #ABA8A2;

  /* --- Borders --- */
  --border: #E4E1DA;
  --border-strong: #D2CDC2;
  --border-inverse: rgba(245, 243, 238, 0.14);
  --border-inverse-strong: rgba(245, 243, 238, 0.24);

  /* --- Single accent: brass --- */
  --accent: #A9814A;
  --accent-deep: #86642F;
  --accent-tint: #F3E9D6;

  /* --- Functional (muted, not neon) --- */
  --success: #2F6B4F;
  --success-deep: #234F3A;
  --danger: #A63A2E;
  --steel: #5B6B7A;

  /* --- Typography --- */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* --- Motion & Elevation --- */
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-soft: 0 15px 40px rgba(20, 18, 14, 0.06), 0 2px 8px rgba(20, 18, 14, 0.04);
  --shadow-lift: 0 25px 60px rgba(20, 18, 14, 0.14);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-canvas) !important;
  color: var(--ink) !important;
  overflow-x: hidden;
  position: relative;
  letter-spacing: -0.01em;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- LIGHT THEME UTILITY OVERRIDES (site is intentionally light by default) --- */
.bg-dark, .bg-black, body.bg-dark {
  background-color: var(--bg-canvas) !important;
}

.bg-dark-subtle {
  background-color: #F0EEE7 !important;
}

.text-white, .text-light {
  color: var(--ink) !important;
}

.text-white-50 {
  color: var(--ink-faint) !important;
}

.border-secondary {
  border-color: var(--border) !important;
}

/* Bootstrap semantic color utilities re-mapped to the brand palette */
.bg-cyan { background-color: var(--accent) !important; }
.bg-emerald { background-color: var(--success) !important; }
.bg-primary { background-color: var(--ink) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--bg-obsidian) !important; color: var(--accent) !important; }
.bg-warning.text-dark { color: var(--accent) !important; }

/* --- NAVBAR --- */
.navbar {
  background: rgba(247, 246, 243, 0.92) !important;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border) !important;
  transition: var(--transition-smooth);
  padding: 10px 0 !important;
  box-shadow: 0 4px 20px rgba(20, 18, 14, 0.03);
}

.brand-logo-img {
  height: 44px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(20, 18, 14, 0.06);
  transition: var(--transition-smooth);
}

.brand-logo-img:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.text-cyan { color: var(--accent) !important; }
.text-gold { color: var(--accent) !important; }
.text-emerald { color: var(--success) !important; }

.btn-glass-search {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink-soft) !important;
  transition: var(--transition-smooth);
  width: 320px;
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-glass-search:hover {
  background: var(--accent-tint) !important;
  border-color: var(--accent) !important;
  color: var(--ink) !important;
}

/* --- ACCOUNT DROPDOWN --- */
.account-dropdown-toggle {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 30px;
  transition: var(--transition-smooth);
}

.account-dropdown-toggle:hover {
  background: var(--accent-tint) !important;
  border-color: var(--accent) !important;
}

.account-avatar-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.dropdown-menu-luxury {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow-lift) !important;
  padding: 10px !important;
  min-width: 230px !important;
}

.dropdown-menu-luxury .dropdown-item {
  color: var(--ink) !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-smooth);
}

.dropdown-menu-luxury .dropdown-item:hover {
  background: var(--accent-tint) !important;
  color: var(--accent-deep) !important;
}

/* --- HERO FULLSCREEN STAGE --- */
.hero-fullscreen {
  min-height: 88vh;
  position: relative;
  display: flex;
  align-items: center;
  padding-top: 110px;
  padding-bottom: 60px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-canvas) 0%, var(--bg-surface) 100%) !important;
}

.hero-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.10;
  filter: grayscale(0.3) contrast(1.1) brightness(1.15);
}

.hero-video-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 75% 30%, rgba(255, 255, 255, 0.4) 0%, rgba(247, 246, 243, 0.96) 80%);
  z-index: 1;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(47, 107, 79, 0.6);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(47, 107, 79, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(47, 107, 79, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(47, 107, 79, 0); }
}

.live-pulse-badge {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.82rem;
  box-shadow: 0 4px 15px rgba(20, 18, 14, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s ease;
}

.hero-search-wrapper {
  position: relative;
  max-width: 580px;
  z-index: 10;
}

.hero-search-input {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--ink) !important;
  border-radius: 40px !important;
  padding: 14px 24px 14px 50px !important;
  font-size: 1rem !important;
  box-shadow: 0 10px 30px rgba(20, 18, 14, 0.06) !important;
}

.hero-search-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 10px 30px rgba(169, 129, 74, 0.22) !important;
}

/* --- 3D TILT SHOWCASE STAGE --- */
.tilt-wrapper {
  perspective: 1400px;
}

.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.stage-3d-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow-soft) !important;
  transition: box-shadow 0.4s ease;
}

.stage-3d-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 30px 60px rgba(169, 129, 74, 0.16) !important;
}

.hero-stage-fade {
  animation: heroFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heroFadeIn {
  from { opacity: 0.3; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- MODEL SHOWCASE BANNERS --- */
.model-banner-card {
  position: relative;
  height: 220px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(20, 18, 14, 0.04);
  transform-style: preserve-3d;
  will-change: transform;
}

.model-banner-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  filter: brightness(0.9) grayscale(0.15);
}

.model-banner-card:hover img {
  transform: scale(1.08);
  filter: brightness(1) grayscale(0);
}

.model-banner-card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(169, 129, 74, 0.22);
}

.model-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 12, 14, 0.05) 0%, rgba(11, 12, 14, 0.92) 85%) !important;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 2;
}

.model-banner-overlay h5,
.model-banner-overlay h6,
.model-banner-overlay .text-white,
.model-banner-overlay strong {
  color: var(--ink-inverse) !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
}

.model-banner-overlay .text-muted {
  color: var(--ink-inverse-soft) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}

/* --- TYPOGRAPHY --- */
.hero-title {
  font-family: var(--font-display);
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--ink) !important;
  background: none !important;
  -webkit-text-fill-color: var(--ink) !important;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--ink-soft) !important;
  max-width: 560px;
  line-height: 1.65;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- GLASS / SURFACE CARDS --- */
.glass-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px;
  transition: var(--transition-smooth);
  box-shadow: 0 6px 20px rgba(20, 18, 14, 0.04);
}

.glass-card:hover {
  border-color: var(--border-strong) !important;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift) !important;
}

.glass-panel {
  background: var(--bg-canvas) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
}

.glass-panel .text-white { color: var(--ink) !important; text-shadow: none !important; }

.glass-input {
  background: var(--bg-canvas) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--ink) !important;
  border-radius: 12px !important;
  padding: 11px 16px !important;
}

.glass-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 20px rgba(169, 129, 74, 0.18) !important;
}

.border-cyan-glow {
  border-color: rgba(169, 129, 74, 0.35) !important;
  box-shadow: 0 0 0 1px rgba(169, 129, 74, 0.12), var(--shadow-soft) !important;
}

/* --- BUTTONS --- */
.btn-chrome {
  background: var(--ink) !important;
  color: var(--ink-inverse) !important;
  font-weight: 700;
  border: none;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 15px rgba(20, 18, 14, 0.16);
  transition: var(--transition-smooth);
}

.btn-chrome:hover {
  background: #33353A !important;
  color: var(--ink-inverse) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(20, 18, 14, 0.24);
}

.btn-cyan-glow {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: none;
  box-shadow: 0 4px 15px rgba(169, 129, 74, 0.28);
  transition: var(--transition-smooth);
}

.btn-cyan-glow:hover {
  background: var(--accent-deep) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(169, 129, 74, 0.38);
}

.btn-outline-cyan {
  background: transparent !important;
  border: 1px solid var(--accent) !important;
  color: var(--accent-deep) !important;
  transition: var(--transition-smooth);
}

.btn-outline-cyan:hover {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px);
}

.btn-emerald {
  background: var(--success) !important;
  color: #FFFFFF !important;
  border: none;
  box-shadow: 0 4px 15px rgba(47, 107, 79, 0.25);
  transition: var(--transition-smooth);
}

.btn-emerald:hover {
  background: var(--success-deep) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(47, 107, 79, 0.35);
}

/* --- BADGES & TAGS --- */
.badge-oem {
  background: var(--accent-tint) !important;
  border: 1px solid rgba(169, 129, 74, 0.35) !important;
  color: var(--accent-deep) !important;
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 30px;
  letter-spacing: 0.03em;
}

.recent-search-tag {
  background: var(--bg-canvas) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.recent-search-tag:hover {
  background: var(--accent-tint) !important;
  border-color: var(--accent) !important;
  color: var(--accent-deep) !important;
}

/* --- PRODUCT CARD --- */
.product-card {
  overflow: hidden;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 20px rgba(20, 18, 14, 0.04);
}

.product-img-wrapper {
  background: var(--bg-canvas) !important;
  border-bottom: 1px solid var(--border) !important;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img {
  max-height: 145px;
  object-fit: contain;
  transition: transform 0.5s ease;
  filter: drop-shadow(0 6px 12px rgba(20, 18, 14, 0.1));
}

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

.hover-cyan:hover { color: var(--accent) !important; }

/* --- HERITAGE / TRUST SECTION (intentional dark bookend) --- */
.heritage-section {
  background: var(--bg-obsidian);
  color: var(--ink-inverse);
  position: relative;
  overflow: hidden;
}

.heritage-section .text-white,
.heritage-section .text-light { color: var(--ink-inverse) !important; text-shadow: none !important; }

.heritage-section .text-muted { color: var(--ink-inverse-soft) !important; }

.heritage-section .border-secondary,
.heritage-section .border-top,
.heritage-section .border-bottom { border-color: var(--border-inverse) !important; }

.heritage-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid var(--border-inverse-strong);
  border-radius: 30px;
  padding: 6px 16px;
  font-family: var(--font-main);
  font-weight: 600;
}

.heritage-heading {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 2.4rem;
  line-height: 1.2;
  color: var(--ink-inverse);
  max-width: 780px;
}

.heritage-copy {
  color: var(--ink-inverse-soft);
  max-width: 620px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.heritage-video-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-inverse-strong);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  background: #000;
}

.heritage-video-frame video {
  width: 100%;
  display: block;
  max-height: 480px;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
}

.heritage-video-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  background: rgba(11, 12, 14, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-inverse-strong);
  color: var(--ink-inverse);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 7px 14px;
  border-radius: 30px;
  font-weight: 600;
}

.heritage-play-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(245, 243, 238, 0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-obsidian);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.heritage-play-btn:hover {
  transform: scale(1.08);
  background: var(--accent);
  color: #fff;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-inverse-soft);
  font-size: 0.92rem;
}

.trust-item i { color: var(--accent); font-size: 1.15rem; }

/* --- SITE FOOTER (intentional dark bookend) --- */
.site-footer {
  background: var(--bg-obsidian) !important;
}

.site-footer .text-white,
.site-footer .text-light { color: var(--ink-inverse) !important; }

.site-footer .text-muted { color: var(--ink-inverse-soft) !important; }

.site-footer .border-secondary,
.site-footer .border-top { border-color: var(--border-inverse) !important; }

.site-footer a.text-muted:hover { color: var(--accent) !important; }

/* --- INSTAGRAM REEL CARD --- */
.instagram-reel-card {
  box-shadow: var(--shadow-lift) !important;
  border-color: var(--border) !important;
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.6rem; }
  .heritage-heading { font-size: 1.85rem; }
}

/* ==========================================================================
   MOBILE UI/UX OPTIMIZATION SYSTEM (iOS & Android Native Experience)
   ========================================================================== */

@media (max-width: 768px) {
  body { padding-bottom: 75px !important; }

  .hero-fullscreen {
    padding-top: 95px !important;
    padding-bottom: 40px !important;
    min-height: auto !important;
  }

  .hero-title { font-size: 2.2rem !important; line-height: 1.15 !important; }
  .hero-subtitle { font-size: 0.98rem !important; }

  .hero-search-input {
    padding: 12px 18px 12px 42px !important;
    font-size: 0.9rem !important;
  }

  .btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .glass-card { padding: 18px !important; }
  .model-banner-card { height: 170px; }

  /* Disable pointer-based 3D tilt on touch — handled via JS media query too */
  .tilt-card { transform: none !important; }
}

/* Mobile Bottom Navigation Dock (iOS App Feel) */
.mobile-bottom-nav {
  background: rgba(247, 246, 243, 0.96) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border) !important;
  box-shadow: 0 -8px 25px rgba(20, 18, 14, 0.08) !important;
  z-index: 1040;
}

.mobile-nav-link {
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
  padding: 4px 8px;
}

.mobile-nav-link i { font-size: 1.35rem; }

.mobile-nav-link.active,
.mobile-nav-link:hover { color: var(--accent); }

.mobile-nav-link:active { transform: scale(0.92); }

/* --- CART TRIGGER BUMP (fires whenever cart contents change) --- */
@keyframes cart-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22) rotate(-4deg); }
  60% { transform: scale(0.96) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

.cart-bump { animation: cart-bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }

@media (prefers-reduced-motion: reduce) {
  .cart-bump { animation: none; }
}
