/* ============================================================
   TruckMarket — loader.css
   Page loader + announcement banner + bonus features
   ============================================================ */

/* ── Page Loader ─────────────────────────────────────────────── */
#tm-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0D1B2A;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: opacity .45s ease, visibility .45s ease;
}

#tm-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Animated truck SVG track */
.loader-track {
  position: relative;
  width: 260px;
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 99px;
  margin-bottom: 28px;
  overflow: visible;
}

.loader-truck-icon {
  position: absolute;
  top: 50%;
  left: -18px;
  transform: translateY(-60%);
  font-size: 28px;
  color: var(--yellow, #f0de2c);
  animation: truckRide 1.8s cubic-bezier(.4,0,.2,1) infinite;
  filter: drop-shadow(0 0 8px rgba(244,196,48,.5));
}

@keyframes truckRide {
  0%   { left: -18px; }
  100% { left: calc(100% - 6px); }
}

.loader-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow, #f0de2c), #FFD95A);
  border-radius: 99px;
  animation: progressFill 1.8s cubic-bezier(.4,0,.2,1) infinite;
  box-shadow: 0 0 10px rgba(244,196,48,.4);
}

@keyframes progressFill {
  0%   { width: 0%; }
  100% { width: 100%; }
}

/* Logo inside loader */
.loader-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.loader-logo-icon {
  width: 52px; height: 52px;
  background: var(--yellow, #f0de2c);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: #0D1B2A;
  box-shadow: 0 8px 24px rgba(244,196,48,.3);
  animation: logoPulse 1.8s ease infinite alternate;
}

@keyframes logoPulse {
  from { box-shadow: 0 8px 24px rgba(244,196,48,.3); }
  to   { box-shadow: 0 8px 36px rgba(244,196,48,.55); }
}

.loader-logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

.loader-logo-text strong { color: var(--yellow, #f0de2c); }

.loader-label {
  font-size: 13px;
  color: rgba(255,255,255,.38);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 12px;
  animation: blink 1.2s ease infinite alternate;
}

@keyframes blink {
  from { opacity: .3; }
  to   { opacity: .8; }
}

/* ── Announcement / Promo Banner ─────────────────────────────── */
#announcement-banner {
  background: linear-gradient(90deg, #0D1B2A 0%, #132236 50%, #0D1B2A 100%);
  border-bottom: 1px solid rgba(244,196,48,.2);
  padding: 9px 0;
  position: relative;
  overflow: hidden;
}

#announcement-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(244,196,48,.04) 30%,
    rgba(244,196,48,.08) 50%,
    rgba(244,196,48,.04) 70%,
    transparent 100%);
  pointer-events: none;
}

.banner-scroll-wrap {
  overflow: hidden;
  width: 100%;
}

.banner-scroll-inner {
  display: flex;
  align-items: center;
  gap: 0;
  animation: bannerScroll 10s linear infinite;
  white-space: nowrap;
  width: max-content;
}

.banner-scroll-inner:hover { animation-play-state: paused; }

@keyframes bannerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.banner-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 32px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
}

.banner-item i {
  color: var(--yellow, #f0de2c);
  font-size: 14px;
  flex-shrink: 0;
}

.banner-item strong { color: var(--yellow, #f0de2c); }

.banner-sep {
  color: rgba(244,196,48,.3);
  font-size: 16px;
  padding: 0 8px;
  flex-shrink: 0;
}

.banner-close-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 5px;
  transition: all .2s;
  z-index: 10;
}

.banner-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}

/* ── Back to Top Button ───────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px; height: 42px;
  background: var(--yellow, #f0de2c);
  color: #0D1B2A;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(244,196,48,.35);
  z-index: 9000;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#back-to-top:hover {
  background: #FFD95A;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(244,196,48,.45);
}

/* ── Cookie / GDPR notice ─────────────────────────────────────── */
#cookie-notice {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #132236;
  border-top: 1px solid rgba(244,196,48,.15);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 8000;
  flex-wrap: wrap;
  transform: translateY(0);
  transition: transform .3s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,.3);
}

#cookie-notice.hidden { transform: translateY(110%); }

.cookie-text {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  flex: 1;
  min-width: 220px;
}
.cookie-text a { color: var(--yellow, #f0de2c); }

.cookie-btns { display: flex; gap: 10px; flex-shrink: 0; }

/* ── Floating WhatsApp button ─────────────────────────────────── */
#float-whatsapp {
  position: fixed;
  bottom: 82px;
  right: 28px;
  width: 46px; height: 46px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.35);
  z-index: 9000;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}

#float-whatsapp:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 28px rgba(37,211,102,.45);
  color: #fff;
}

.float-tooltip {
  position: absolute;
  right: 54px;
  top: 50%;
  transform: translateY(-50%);
  background: #132236;
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
#float-whatsapp:hover .float-tooltip { opacity: 1; }

/* ── Featured badge pulse ─────────────────────────────────────── */
@keyframes featuredPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,196,48,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(244,196,48,0); }
}
.badge-featured { animation: featuredPulse 2.4s ease infinite; }

/* ── Truck card entrance animation ───────────────────────────── */
.truck-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .4s ease, transform .4s ease, box-shadow .22s ease, border-color .22s ease;
}
.truck-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Stats counter section ────────────────────────────────────── */
.tm-stats-bar {
  background: var(--navy-2, #132236);
  border-top: 1px solid rgba(244,196,48,.1);
  border-bottom: 1px solid rgba(244,196,48,.1);
  padding: 28px 0;
}

.stat-block {
  text-align: center;
  padding: 8px 16px;
  position: relative;
}

.stat-block + .stat-block::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 1px;
  background: rgba(255,255,255,.07);
}

.stat-block-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--yellow, #f0de2c);
  line-height: 1;
  display: block;
}

.stat-block-label {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ── Search suggestions dropdown ─────────────────────────────── */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #132236;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
  z-index: 500;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  transition: background .15s;
}
.suggestion-item:hover { background: rgba(244,196,48,.07); color: #fff; }
.suggestion-item i { color: #f0de2c; font-size: 14px; flex-shrink: 0; }
.suggestion-item strong { color: #fff; }

/* ── Wishlist heart button ────────────────────────────────────── */
.wishlist-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: rgba(13,27,42,.75);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: rgba(255,255,255,.5);
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  backdrop-filter: blur(4px);
  z-index: 3;
}
.wishlist-btn:hover,
.wishlist-btn.active {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.4);
  color: #ef4444;
}
.wishlist-btn.active i::before { content: "\f415"; } /* bi-heart-fill */

/* ── Compare bar ─────────────────────────────────────────────── */
#compare-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #132236;
  border-top: 2px solid var(--yellow, #f0de2c);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 7000;
  transform: translateY(100%);
  transition: transform .3s ease;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(0,0,0,.4);
}

#compare-bar.visible { transform: translateY(0); }

.compare-slots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.compare-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.05);
  border: 1px dashed rgba(255,255,255,.15);
  border-radius: 9px;
  padding: 7px 12px;
  min-width: 160px;
  font-size: 13px;
  color: rgba(255,255,255,.5);
}

.compare-slot.filled {
  border-style: solid;
  border-color: rgba(244,196,48,.3);
  color: #fff;
}

.compare-slot .slot-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

/* ── Recently viewed strip ────────────────────────────────────── */
.recently-viewed-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(244,196,48,.3) transparent;
}

.rv-card {
  flex-shrink: 0;
  width: 130px;
  background: #132236;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.rv-card:hover { border-color: rgba(244,196,48,.25); transform: translateY(-2px); }
.rv-card img { width:100%;height:78px;object-fit:cover; }
.rv-card-label { padding: 6px 8px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-card-price { padding: 0 8px 7px; font-size: 12px; color: #f0de2c; font-weight: 700; }
