/* ============================================================
   TL CRITICAL FIXES v2 - loaded separately to bypass caching
   of the main style.css on the live server.
   ============================================================ */

/* ---- SELL HERO: kill any gap, force compact layout ---- */
.sell-hero {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  background: linear-gradient(135deg, #0A1A0A 0%, #0F0F0F 60%) !important;
  padding: 140px 0 64px !important;
  position: relative;
  overflow: hidden;
}
.sell-hero .container {
  position: relative;
  z-index: 2;
  min-height: 0 !important;
  height: auto !important;
}
.sell-hero span.eyebrow,
.sell-hero h1,
.sell-hero p {
  background: transparent !important;
  background-color: transparent !important;
}
.sell-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(138,154,134,0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* ---- Kill any residual large empty blocks site-wide ---- */
.tl-animate {
  opacity: 1 !important;
  transform: none !important;
}

/* ---- NAV FIXES ---- */
/* Home stays grey, not orange, even when current page */
#primary-nav .current-menu-item > a,
#primary-nav .current_page_item > a {
  color: var(--offwhite-dim) !important;
}
#primary-nav .current-menu-item > a::after,
#primary-nav .current_page_item > a::after {
  opacity: 0 !important;
}
/* Hover still works for everyone - opacity fade, no width animation = no blink */
#primary-nav a:hover {
  color: #E87722 !important;
}
#primary-nav a::after {
  width: 100% !important;
}
#primary-nav a:hover::after {
  opacity: 1 !important;
}

/* Swap or Sell + Clearance always orange */
#primary-nav li a[href*="/sell"],
#primary-nav li a[href*="swap"],
#primary-nav li a[href*="clearance"],
#primary-nav li a[href*="discount"] {
  color: #E87722 !important;
}
#primary-nav li a[href*="/sell"]::after,
#primary-nav li a[href*="swap"]::after,
#primary-nav li a[href*="clearance"]::after,
#primary-nav li a[href*="discount"]::after {
  width: 100% !important;
  opacity: 1 !important;
  background: #E87722 !important;
}

/* Remove Fresh Stock dot */
#primary-nav li a[target="_blank"]::before {
  display: none !important;
  content: none !important;
}

/* ---- COOKIE CONSENT POPUP ---- */
#tl-cookie-popup {
  position: fixed !important;
  z-index: 99999 !important;
  left: 0; right: 0;
  padding: 0 16px;
  transform: translateY(120%);
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
#tl-cookie-popup.tl-cookie-visible { transform: translateY(0) !important; }
#tl-cookie-popup.tl-cookie-pos-bottom { bottom: 0; }
#tl-cookie-popup.tl-cookie-pos-bottom-left { bottom: 24px; left: 24px; right: auto; max-width: 420px; }
#tl-cookie-popup.tl-cookie-pos-bottom-right { bottom: 24px; right: 24px; left: auto; max-width: 420px; }
#tl-cookie-popup.tl-cookie-pos-center {
  top: 50%; left: 50%; right: auto; bottom: auto;
  transform: translate(-50%, -50%) scale(0.9);
  max-width: 480px;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
#tl-cookie-popup.tl-cookie-pos-center.tl-cookie-visible {
  transform: translate(-50%, -50%) scale(1) !important;
  opacity: 1 !important;
}
.tl-cookie-inner {
  background: #1A1A1A;
  border: 1px solid #2E2E2E;
  border-top: 2px solid #E87722;
  border-radius: 8px 8px 0 0;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.4);
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
}
.tl-cookie-pos-bottom-left .tl-cookie-inner,
.tl-cookie-pos-bottom-right .tl-cookie-inner,
.tl-cookie-pos-center .tl-cookie-inner {
  border-radius: 8px;
  flex-direction: column;
  text-align: center;
}
.tl-cookie-icon { font-size: 28px; flex-shrink: 0; }
.tl-cookie-content { flex: 1; min-width: 0; }
.tl-cookie-content h4 { font-size: 0.95rem; color: #F5F5F7; margin-bottom: 4px; }
.tl-cookie-content p { font-size: 0.82rem; color: rgba(245,245,247,0.6); margin: 0; line-height: 1.5; }
.tl-cookie-content a { color: #E87722; text-decoration: underline; }
.tl-cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.tl-cookie-btn {
  font-family: 'Syncopate', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.tl-cookie-btn-accept { background: #E87722; color: #fff; }
.tl-cookie-btn-accept:hover { background: #FF8C35; }
.tl-cookie-btn-decline { background: transparent; color: rgba(245,245,247,0.6); border: 1px solid #2E2E2E; }
.tl-cookie-btn-decline:hover { border-color: rgba(245,245,247,0.6); color: #F5F5F7; }
.tl-cookie-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  color: rgba(245,245,247,0.6);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 8px;
  transition: color 0.2s;
}
.tl-cookie-close:hover { color: #F5F5F7; }

/* ---- APP INSTALL POPUP ---- */
#tl-app-popup { position: fixed !important; inset: 0; z-index: 99998 !important; }
.tl-app-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.tl-app-popup-card {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #1A1A1A;
  border-top: 2px solid #E87722;
  border-radius: 16px 16px 0 0;
  padding: 40px 32px 32px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 -8px 48px rgba(0,0,0,0.5);
}
#tl-app-popup.tl-app-visible .tl-app-popup-card { transform: translateY(0) !important; }
.tl-app-close {
  position: absolute;
  top: 16px; right: 16px;
  background: #222222;
  border: 1px solid #2E2E2E;
  color: rgba(245,245,247,0.6);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.tl-app-close:hover { background: #2E2E2E; color: #F5F5F7; }
.tl-app-icon-wrap { margin: 0 auto 16px; }
.tl-app-icon-img { width: 80px; height: 80px; border-radius: 18px; object-fit: cover; margin: 0 auto; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.tl-app-icon-placeholder {
  width: 80px; height: 80px;
  border-radius: 18px;
  background: linear-gradient(135deg, #E87722 0%, #FF8C35 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(232,119,34,0.4);
}
.tl-app-title { font-size: 1.3rem; color: #F5F5F7; margin-bottom: 8px; }
.tl-app-text { font-size: 0.9rem; color: rgba(245,245,247,0.6); margin-bottom: 24px; line-height: 1.6; }
.tl-app-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.tl-app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: 'Syncopate', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
}
.tl-app-android { background: #E87722; color: #fff; }
.tl-app-android:hover { background: #FF8C35; transform: translateY(-2px); }
.tl-app-ios { background: #F5F5F7; color: #0F0F0F; }
.tl-app-ios:hover { background: #e0e0e2; transform: translateY(-2px); }
.tl-app-later {
  background: none;
  border: none;
  color: rgba(245,245,247,0.6);
  font-family: 'Syncopate', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
  text-decoration: underline;
}
.tl-app-later:hover { color: #F5F5F7; }

@media (max-width: 480px) {
  .tl-cookie-inner { gap: 12px; }
  .tl-cookie-actions { width: 100%; }
  .tl-cookie-btn { flex: 1; justify-content: center; }
  .tl-app-popup-card { padding: 32px 20px 24px; }
  .tl-app-btns { flex-direction: column; }
  .tl-app-store-btn { justify-content: center; }
}

/* ============================================================
   MEGA MENU DROPDOWN - hardened override (loaded after main
   stylesheet). Guarantees a solid background and correct
   stacking even if a cache serves a stale style.css.
   ============================================================ */
#primary-nav li { position: relative !important; }

#primary-nav .sub-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  margin-top: 0 !important;
  padding-top: 12px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-6px) !important;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease !important;
  pointer-events: none !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 200px !important;
}

#primary-nav li > .sub-menu {
  background: #1A1A1A !important;
  border: 1px solid #2E2E2E !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5) !important;
  padding: 8px 0 !important;
  margin-top: 12px !important;
}

#primary-nav li:hover > .sub-menu,
#primary-nav li.sub-menu-open > .sub-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: all !important;
}

#primary-nav .sub-menu a {
  display: block !important;
  padding: 12px 22px !important;
  font-family: 'Syne', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: #F5F5F7 !important;
  white-space: nowrap !important;
  background: transparent !important;
}
#primary-nav .sub-menu a:hover {
  background: #242424 !important;
  color: #8A9A86 !important;
}

/* Nested submenu (3rd level) - opens to the right, solid background */
#primary-nav .sub-menu .sub-menu {
  top: -8px !important;
  left: 100% !important;
  margin-top: 0 !important;
  padding: 8px 0 !important;
  background: #1A1A1A !important;
  border: 1px solid #2E2E2E !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5) !important;
  min-width: 190px !important;
  z-index: 10000 !important;
}

#primary-nav .sub-menu li.tl-flip-left > .sub-menu {
  left: auto !important;
  right: 100% !important;
}

/* Ensure header itself doesn't clip dropdowns via its own stacking context */
#site-header {
  z-index: 1000 !important;
}
#site-header nav {
  position: relative;
  z-index: 1001;
}
