/* DubiCars-style car detail page */
.dc-page {
  --dc-gallery-max-width: 720px;
  --dc-gallery-ratio: 4 / 3;
  --dc-thumb-width: 88px;
  --dc-thumb-height: 66px;
  background: #f4f5f7;
  padding-bottom: 5rem;
}

.dc-breadcrumb {
  padding: .85rem 1rem;
  font-size: .8rem;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.dc-breadcrumb a:hover { color: var(--primary); }
.dc-sep { color: #9ca3af; font-size: .7rem; }
.dc-bc-current { color: #374151; }

.dc-mobile-bar {
  display: none;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: .75rem 1rem;
}
.dc-mobile-title { display: flex; flex-direction: column; gap: .15rem; }
.dc-make-model { font-weight: 600; font-size: .95rem; }
.dc-mobile-price { color: var(--primary); font-weight: 700; }

/* Sticky tabs */
.dc-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  position: sticky;
  top: 64px;
  z-index: 90;
  -webkit-overflow-scrolling: touch;
}
.dc-tab {
  padding: .9rem 1.25rem;
  font-size: .875rem;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.dc-tab:hover { color: #111; }
.dc-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Two-column layout */
.dc-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  padding-top: 1.25rem;
  align-items: start;
}

.dc-gallery-col {
  width: 100%;
  min-width: 0;
}

.dc-gallery-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  width: 100%;
  max-width: var(--dc-gallery-max-width);
  margin-inline: auto;
}

.dc-gallery-top {
  width: 100%;
}

.dc-gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: var(--dc-gallery-ratio);
  max-height: calc(var(--dc-gallery-max-width) * 3 / 4);
  background: #e5e7eb;
  overflow: hidden;
}
.dc-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dc-gallery-main-hit {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
}

.dc-gallery-swipe,
.dc-gallery-swipe img {
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
}

.dc-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.dc-gallery-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}

.dc-gallery-nav--prev {
  right: 0.75rem;
  left: auto;
}

.dc-gallery-nav--next {
  left: 0.75rem;
  right: auto;
}

/* Lightbox album */
.dc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dc-lightbox[hidden] {
  display: none !important;
}

.dc-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dc-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dc-lightbox-close {
  position: absolute;
  top: -0.25rem;
  left: 0;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.dc-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.dc-lightbox-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--dc-gallery-ratio);
  max-height: min(70vh, calc(var(--dc-gallery-max-width) * 3 / 4));
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

.dc-lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.dc-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.dc-lightbox-nav--prev {
  right: 0.75rem;
  left: auto;
}

.dc-lightbox-nav--next {
  left: 0.75rem;
  right: auto;
}

.dc-lightbox-counter {
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
}

.dc-lightbox-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.dc-lightbox-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: 0.7;
}

.dc-lightbox-thumb.active {
  border-color: #fff;
  opacity: 1;
}

.dc-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .dc-lightbox {
    padding: 0.5rem;
  }

  .dc-lightbox-stage {
    max-height: 58vh;
    border-radius: 8px;
  }
}

.dc-gallery-badges {
  position: absolute;
  top: .75rem;
  right: .75rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  z-index: 2;
}
.dc-badge {
  display: inline-block;
  padding: .3rem .65rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
}
.dc-badge-premium { background: #1a1a2e; }
.dc-badge-warranty { background: #2563eb; }

.dc-gallery-toolbar {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: auto;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  direction: ltr;
}

.dc-gallery-fav {
  position: static;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #374151;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}

.dc-gallery-fav:hover {
  transform: scale(1.06);
}

.dc-gallery-fav .fav-heart-icon {
  width: 20px;
  height: 20px;
}

.dc-gallery-fav.is-active,
.dc-gallery-fav.fav-btn--active {
  color: var(--primary);
  background: #fef2f2;
}

.dc-gallery-fav.is-active .fav-heart-icon,
.dc-gallery-fav.fav-btn--active .fav-heart-icon {
  fill: var(--primary);
  stroke: var(--primary);
}
.dc-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: background .2s;
}
.dc-icon-btn:hover { background: #fff; }

.dc-gallery-share {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.dc-icon-btn.fav-btn.is-active {
  color: var(--primary);
  background: #fef2f2;
}

.dc-icon-btn.fav-btn.is-active .fav-heart-icon {
  fill: var(--primary);
  stroke: var(--primary);
}

.dc-img-counter {
  position: absolute;
  bottom: .75rem;
  left: .75rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: .25rem .6rem;
  border-radius: 4px;
  font-size: .75rem;
}

.dc-gallery-thumbs {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  overflow-x: auto;
  border-top: 1px solid #f3f4f6;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.dc-thumb {
  flex-shrink: 0;
  width: var(--dc-thumb-width);
  height: var(--dc-thumb-height);
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: none;
}
.dc-thumb.active { border-color: var(--primary); }
.dc-thumb img { width: 100%; height: 100%; object-fit: cover; }

.dc-gallery-mobile-info {
  display: none;
  padding: 1rem;
  border-top: 1px solid #f3f4f6;
  width: 100%;
  max-width: var(--dc-gallery-max-width);
  margin-inline: auto;
}
.dc-subtitle { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.dc-price-row { margin-bottom: .35rem; }
.dc-price-label { font-size: .85rem; color: #6b7280; }
.dc-price-main { font-size: 1.35rem; font-weight: 700; color: #111; }
.dc-meta-inline { font-size: .85rem; color: #6b7280; }
.dc-dot { margin: 0 .35rem; }

/* Sidebar */
.dc-sidebar-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.dc-sidebar-sticky { position: sticky; top: 120px; }

.dc-verified-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.dc-verified {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: .2rem .5rem;
  border-radius: 4px;
}
.dc-tag-warranty {
  font-size: .75rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  padding: .2rem .5rem;
  border-radius: 4px;
}

.dc-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 1rem;
  color: #111;
}

.dc-price-block { margin-bottom: 1.25rem; }
.dc-price-request { font-size: .85rem; color: #6b7280; margin-bottom: .25rem; }
.dc-price-numbers {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  flex-wrap: wrap;
}
.dc-price-big {
  font-size: 1.65rem;
  font-weight: 800;
  color: #111;
  letter-spacing: -.02em;
}
.dc-price-old {
  font-size: 1rem;
  color: #9ca3af;
  text-decoration: line-through;
}
.dc-finance {
  font-size: .875rem;
  color: #6b7280;
  margin-top: .5rem;
}
.dc-finance strong { color: #111; }
.dc-meta-line {
  font-size: .85rem;
  color: #6b7280;
  margin-top: .5rem;
}

.dc-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.dc-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem .5rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #fff;
  transition: all .2s;
}
.dc-cta-call {
  grid-column: 1 / -1;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.dc-cta-call:hover { background: var(--primary-dark); }
.dc-cta-wa { color: #25d366; border-color: #25d366; }
.dc-cta-wa:hover { background: #f0fdf4; }
.dc-cta-email:hover { border-color: var(--primary); color: var(--primary); }

.dc-dealer-box {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.dc-dealer-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .65rem;
}
.dc-dealer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.dc-dealer-verified {
  display: block;
  font-size: .72rem;
  color: #059669;
  font-weight: 500;
}
.dc-dealer-link {
  font-size: .85rem;
  color: var(--primary);
  font-weight: 600;
}
.dc-dealer-link:hover { text-decoration: underline; }

.dc-favorite-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.dc-favorite-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fef2f2;
}

.dc-favorite-btn.is-active,
.dc-favorite-btn.fav-btn--active {
  border-color: var(--primary);
  color: var(--primary);
  background: #fef2f2;
}

.dc-favorite-btn.is-active .fav-heart-icon,
.dc-favorite-btn.fav-btn--active .fav-heart-icon {
  fill: var(--primary);
  stroke: var(--primary);
}

/* Sections */
.dc-sections { padding-top: .5rem; }
.dc-section {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.dc-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #111;
}
.dc-sub-heading {
  font-size: .95rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .75rem;
}

/* Highlight chips */
.dc-highlight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.dc-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
  flex: 1 1 88px;
  max-width: 120px;
  padding: 0.85rem 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dc-chip:hover {
  border-color: #e5e7eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.dc-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.45rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #fef2f2 0%, #fff5f5 100%);
  color: var(--primary);
}

.dc-chip-icon img {
  width: 20px;
  height: 20px;
  display: block;
  opacity: 0.9;
}

.dc-chip span:not(.dc-chip-icon) {
  font-size: 0.82rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.dc-chip small {
  font-size: 0.68rem;
  color: #9ca3af;
  margin-top: 0.2rem;
  font-weight: 500;
}

/* Specs grid */
.dc-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}

.dc-spec-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dc-spec-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #fef2f2 0%, #fff5f5 100%);
}

.dc-spec-icon img {
  width: 18px;
  height: 18px;
  display: block;
  opacity: 0.9;
}

.dc-spec-body {
  min-width: 0;
  flex: 1;
}

.dc-spec-body span {
  display: block;
  font-size: .75rem;
  color: #9ca3af;
  margin-bottom: .2rem;
  font-weight: 500;
}

.dc-spec-body strong {
  display: block;
  font-size: .9rem;
  color: #111827;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

/* Description */
.dc-desc-wrap { position: relative; }
.dc-desc-text {
  color: #374151;
  font-size: .9rem;
  line-height: 1.75;
  max-height: 180px;
  overflow: hidden;
  transition: max-height .4s ease;
}
.dc-desc-text.expanded { max-height: none; }
.dc-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  margin-top: .75rem;
  font-family: inherit;
  padding: 0;
}
.dc-link-btn:hover { text-decoration: underline; }

.dc-features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .5rem;
}
.dc-features li {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .875rem;
  color: #374151;
}
.dc-check { color: #059669; font-weight: 700; flex-shrink: 0; }

/* Dealer section */
.dc-dealer-card-lg {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.dc-posted-by { font-size: .9rem; margin-bottom: .5rem; }
.dc-dealer-loc { font-size: .85rem; color: #6b7280; margin-top: .5rem; }

/* Similar cars horizontal scroll */
.dc-similar-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  -webkit-overflow-scrolling: touch;
}
.dc-similar-card {
  flex: 0 0 260px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.dc-similar-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.dc-similar-img {
  position: relative;
  aspect-ratio: 4/3;
  background: #eee;
}
.dc-similar-img img { width: 100%; height: 100%; object-fit: cover; }
.dc-similar-img .dc-badge { top: .5rem; right: .5rem; }
.dc-similar-body { padding: .85rem; }
.dc-similar-body h3 { font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.dc-similar-price { font-size: .95rem; font-weight: 700; color: #111; margin-bottom: .2rem; }
.dc-similar-meta { font-size: .75rem; color: #9ca3af; }

/* Sticky bottom bar - mobile */
.dc-sticky-bottom {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: .75rem 0;
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.dc-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.dc-sticky-price strong { display: block; font-size: 1.1rem; color: #111; }
.dc-sticky-price small { font-size: .75rem; color: #6b7280; }
.dc-sticky-call {
  background: var(--primary);
  color: #fff;
  padding: .75rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .dc-layout {
    grid-template-columns: 1fr;
  }
  .dc-sidebar { order: 2; }
  .dc-gallery-col { order: 1; }
  .dc-sidebar-sticky { position: static; }
  .dc-gallery-mobile-info { display: block; }
  .dc-title { font-size: 1rem; }
  .dc-price-big { font-size: 1.4rem; }

  .dc-gallery-card,
  .dc-gallery-mobile-info {
    max-width: var(--dc-gallery-max-width);
  }

  .dc-gallery-main {
    aspect-ratio: var(--dc-gallery-ratio);
    max-height: calc(var(--dc-gallery-max-width) * 3 / 4);
  }
}

@media (max-width: 768px) {
  .dc-mobile-bar { display: block; }
  .dc-tabs { top: 0; }
  .dc-page { padding-bottom: 1.5rem; }
  .dc-sidebar .dc-title,
  .dc-sidebar .dc-price-block { display: none; }

  .dc-gallery-card {
    border-radius: 10px;
    max-width: min(100%, var(--dc-gallery-max-width));
  }

  .dc-highlight-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .dc-chip {
    min-width: 0;
    max-width: none;
    padding: 0.7rem 0.35rem 0.65rem;
  }

  .dc-chip-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 0.35rem;
  }

  .dc-chip-icon img {
    width: 18px;
    height: 18px;
  }

  .dc-specs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .dc-spec-item {
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
  }

  .dc-spec-body span {
    font-size: 0.7rem;
  }

  .dc-spec-body strong {
    font-size: 0.82rem;
  }
}
