﻿/* ═══════════════════════════════════════════
   CAR DETAILS — car-details.css
   Aesthetic: Refined automotive luxury
   Fonts: Syne (headings) + DM Sans (body)
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:        #F8F9FA;
  --surface:   #ffffff;
  --border:    #e8e6e1;
  --text:      #1A1A2A;
  --muted:     #6B7280;
  --accent:    #E63946;
  --accent-2:  #1B2A4A;
  --cta:       #F4A261;
  --radius:    14px;
  --shadow:    0 2px 20px rgba(0,0,0,.07);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── BREADCRUMB ───────────────────────── */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: .5; }
.crumbs .current { color: var(--text); font-weight: 500; }

/* ── WRAPPER & GRID ───────────────────── */
.details-wrapper {
  padding-bottom: 80px;
  overflow-x: hidden; /* prevents horizontal scroll from full-bleed gallery on mobile */
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  padding-top: 28px;
}

/* Prevent grid columns from blowing out beyond their track size */
.col-left,
.col-right {
  min-width: 0;
  overflow: hidden;
}

/* ── SHARED CARD ──────────────────────── */
.info-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-2);
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.card-heading svg { opacity: .7; flex-shrink: 0; }

/* ── GALLERY ──────────────────────────── */
.gallery-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 500px;   /* hard cap so it never grows too tall */
  background: #111;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Absolute fill — guaranteed no overflow */
.main-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .25s ease;
}

.main-photo.fade { opacity: 0; }

.no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  gap: 12px;
}

/* Gallery nav buttons */
.gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
  transition: all .2s;
  z-index: 5;
  color: var(--text);
}
.gal-nav:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-50%) scale(1.07);
}
.gal-prev { left: 14px; }
.gal-next { right: 14px; }

.gal-counter {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Thumbnail strip */
.thumbs-strip {
  display: flex;
  gap: 6px;
  padding: 10px;
  overflow-x: auto;
  background: #f9f8f6;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
}

.thumb {
  flex-shrink: 0;
  width: 72px;
  height: 52px;
  border-radius: 6px;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: border-color .2s, opacity .2s;
  opacity: .65;
}
.thumb:hover { opacity: .85; }
.thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

/* ── DESCRIPTION ──────────────────────── */
.desc-text {
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.75;
  color: #3a3a38;
  white-space: pre-wrap;
}

/* ── SPECS TABLE ──────────────────────── */
.specs-grid { padding: 8px 0 12px; }

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 22px;
  border-bottom: 1px solid #f2f1ee;
  transition: background .15s;
}
.spec-row:last-child { border-bottom: none; }
.spec-row:hover { background: #faf9f7; }

.spec-label {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 400;
}
.spec-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* ── EXTRAS ───────────────────────────── */
.extras-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px 20px;
}

.extra-chip {
  background: #f0f4f9;
  color: var(--accent-2);
  border: 1px solid #d4e0ee;
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all .15s;
}
.extra-chip:hover {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

/* ── TITLE CARD ───────────────────────── */
.title-card {
  padding: 22px;
}

.brand-badge {
  display: inline-block;
  background: var(--accent-2);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.offer-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -.01em;
}

.category-tag {
  display: inline-block;
  background: #f2f1ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.created-at-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.created-at-line i {
  color: var(--accent-2);
  font-size: 14px;
}

/* ── PRICE CARD ───────────────────────── */
.price-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.promo-ribbon {
  position: absolute;
  top: 16px;
  right: -28px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 5px 36px;
  transform: rotate(35deg);
}

.price-main {
  font-family: 'DM Sans', sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: var(--accent-2);
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.price-main.promo { color: var(--accent); }

.price-bgn {
  font-size: 16px;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 8px;
}

.price-old-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.price-old {
  font-size: 15px;
  color: var(--muted);
  text-decoration: line-through;
}
.old-label {
  font-size: 11px;
  color: var(--muted);
  background: #f2f1ee;
  padding: 2px 8px;
  border-radius: 10px;
}

.price-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(230,57,70,.3);
}
.btn-cta:hover {
  background: #c8242f;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230,57,70,.4);
}
.btn-cta:active { transform: translateY(0); }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: var(--accent-2);
  border: 1.5px solid var(--accent-2);
  border-radius: 10px;
  padding: 12px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.btn-secondary:hover {
  background: var(--accent-2);
  color: #fff;
}

/* ── VIEWS CARD ───────────────────────── */
.views-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.views-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.views-count {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.views-label { font-size: 13px; }

.views-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
}
.views-badge.hot { background: #fff0ee; color: var(--accent); border: 1px solid #ffd5d0; }
.views-badge.new { background: #F8F9FA; color: #1B2A4A; border: 1px solid rgba(230,57,70,0.15); }
.views-badge.mid { background: #f0f4ff; color: #3355cc; border: 1px solid #ccd5f5; }

/* ── QUICK SPECS ──────────────────────── */
.quick-specs {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

.qs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.qs-item:hover { background: #faf9f7; }
.qs-item:nth-child(2n) { border-right: none; }
.qs-item:nth-last-child(-n+2) { border-bottom: none; }

.qs-item svg {
  color: var(--accent);
  flex-shrink: 0;
}
.qs-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.qs-lbl {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── NOTE CARD ────────────────────────── */
.note-card {
  background: #fffbf0;
  border: 1px solid #f0dfa0;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.note-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.note-text { font-size: 13.5px; line-height: 1.6; color: #6b5a20; }

/* ── MT UTILS ─────────────────────────── */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }

/* ── BOOTSTRAP ICONS in QS items ─────── */
.qs-icon {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── CONTACT CTA CARD ─────────────────── */
.contact-cta-card {
  background: linear-gradient(135deg, #1B2A4A 0%, #0f1d35 100%);
  border-radius: var(--radius);
  padding: 24px 28px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 28px rgba(27,42,74,0.28);
}

.contact-cta-card h5 {
  color: #fff;
  font-family: 'DM Sans', sans-serif;
}

.contact-cta-card p {
  color: rgba(255,255,255,0.75);
}

.btn-white-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid rgba(255,255,255,0.6);
  color: #fff;
  background: transparent;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}

.btn-white-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
  color: #fff;
}

.btn-white-solid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #E63946;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .2s;
}

.btn-white-solid:hover {
  background: #c8242f;
  transform: translateY(-1px);
  color: #fff;
}

/* ── WHATSAPP / VIBER buttons ─────────── */
.btn-whatsapp,
.btn-viber {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
  border: none;
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
}
.btn-whatsapp:hover {
  background: #1ebe5b;
  color: #fff;
  transform: translateY(-1px);
}

.btn-viber {
  background: #7360f2;
  color: #fff;
}
.btn-viber:hover {
  background: #5f4dd6;
  color: #fff;
  transform: translateY(-1px);
}

/* ── SPEC LABEL icon alignment ────────── */
.spec-label {
  display: flex;
  align-items: center;
}

/* ── FOOTER inside details page ───────── */
.details-wrapper + footer {
  margin-top: 0;
}

/* ══════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.lightbox-overlay.lb-open {
  opacity: 1;
  pointer-events: all;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.7);
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.15s;
}
.lb-close {
  position: fixed;
  top: 14px;
  right: 18px;
  background: rgba(255, 255, 255, 0.13);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s;
  z-index: 10001;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.28); }
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.13);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s;
  z-index: 10001;
}
.lb-nav:hover  { background: rgba(255, 255, 255, 0.28); }
.lb-nav.lb-prev { left: 14px; }
.lb-nav.lb-next { right: 14px; }
.lb-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 16px;
  border-radius: 20px;
  z-index: 10001;
  pointer-events: none;
}
/* cursor hint on main photo */
.gallery-main .main-photo { cursor: zoom-in; }

/* ── RESPONSIVE ───────────────────────── */

/* Tablet */
@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 16px;
  }
  .col-right  { order: -1; }
}

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 0 14px; }

  .gallery-main {
    aspect-ratio: 4/3;          /* taller = better for portrait car shots */
    border-radius: 0;           /* full-bleed on small screens */
  }
  .gallery-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin: 0 -14px;            /* bleed past container padding */
  }

  .thumbs-strip { padding: 8px; gap: 5px; }
  .thumb { width: 58px; height: 42px; }

  .gal-nav { width: 36px; height: 36px; }
  .gal-prev { left: 8px; }
  .gal-next { right: 8px; }

  .offer-title { font-size: 20px; }
  .price-main  { font-size: 28px; }
  .brand-badge { font-size: 10px; }

  .title-card  { padding: 16px; }
  .price-card  { padding: 16px; }

  .quick-specs { grid-template-columns: 1fr 1fr; }

  /* Stack all CTA buttons full width */
  .contact-cta-card { padding: 16px; }
  .contact-cta-card .d-flex {
    flex-direction: column !important;
  }
  .btn-white-outline,
  .btn-white-solid {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
  }

  /* Spec rows — prevent label overflow */
  .spec-label { font-size: 12.5px; }
  .spec-value { font-size: 13px; }
  .spec-row   { padding: 10px 14px; }

  .card-heading { padding: 14px 16px 12px; font-size: 13px; }
  .desc-text    { padding: 14px 16px; font-size: 14px; }
  .extras-list  { padding: 12px 16px 16px; }
}
