/* Auction Pages */

/* Page layout (duplicated from car-detail since it's loaded separately) */
.main {
  padding-top: 6rem;
  padding-bottom: 4rem;
}

/* Sections */
.auction-section {
  padding: 2rem 0;
}

.auction-section:first-child {
  padding-top: 0;
}

.auction-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.auction-section-header .section-title {
  font-size: 1.75rem;
}

/* --- Lot Card Timer Overlay --- */

.lot-card .car-image {
  position: relative;
}

.lot-timer {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  background: var(--primary);
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  z-index: 2;
}

.lot-timer .count {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  min-width: 1.5ch;
  text-align: center;
}

.lot-timer-sep {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-weight: 600;
}

.lot-timer-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.lot-timer-ended {
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 500;
}

/* --- Detail Page --- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.back-link:hover {
  color: var(--foreground);
}

.detail-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* Gallery */
.gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.main-image {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--muted);
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.main-image:hover .gallery-arrow {
  opacity: 1;
}

.gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-arrow-left {
  left: 0.75rem;
}

.gallery-arrow-right {
  right: 0.75rem;
}

.image-counter {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  z-index: 2;
}

.thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
  min-width: 0;
}

.thumbnails::-webkit-scrollbar {
  display: none;
}

.thumbnail {
  width: 3.5rem;
  aspect-ratio: 4/3;
  flex-shrink: 0;
  border-radius: calc(var(--radius) / 2);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
  background: var(--muted);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail.active {
  border-color: var(--primary);
}

.thumbnail:hover {
  border-color: var(--muted-foreground);
}

/* Info panel */
.info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.car-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
  .car-title {
    font-size: 2.5rem;
  }
}


/* Price (archived lots) */
.car-detail-price {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.5rem;
}

/* Detail Badges */
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.country-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--muted);
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
}

.country-flag {
  font-size: 1.125rem;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.detail-badge.green {
  color: #059669;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.detail-badge.amber {
  color: #d97706;
  border-color: #fde68a;
  background: #fffbeb;
}

.detail-badge .count {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-weight: 600;
  min-width: 1.5ch;
  text-align: center;
  color: inherit;
}

.badge-sep {
  opacity: 0.5;
  font-weight: 600;
}

.badge-label {
  margin-left: 0.25rem;
  opacity: 0.8;
}

.badge-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.detail-badges .lot-timer {
  position: static;
}

.detail-badges .lot-timer .count {
  color: inherit;
}

/* Quick Specs */
.quick-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .quick-specs {
    grid-template-columns: repeat(auto-fit, minmax(0, auto));
    justify-content: start;
    gap: 1.5rem;
  }
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  white-space: nowrap;
}

.spec-icon {
  width: 1rem;
  height: 1rem;
}

.separator {
  height: 1px;
  background: var(--border);
}

/* Detailed Specs */
.specs-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.specs-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
  }
}

.specs-grid .spec-row {
  display: flex;
  justify-content: space-between;
}

.specs-grid .spec-label {
  color: var(--muted-foreground);
}

.specs-grid .spec-value {
  font-weight: 500;
}

/* CTA Buttons */
.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .cta-buttons {
    flex-direction: row;
  }

  .cta-buttons .btn {
    flex: 1;
  }
}

/* Description & Extra Section */
.extra-section {
  margin-top: 3rem;
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .extra-section {
    grid-template-columns: 1fr 1fr;
  }
}

.extra-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.description {
  color: var(--muted-foreground);
  line-height: 1.7;
}

/* Calculator Slider */
.calc-slider {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
}

.calc-slider-value {
  font-weight: 600;
  color: var(--primary);
}

.calc-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--background);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.calc-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--background);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.calc-tick-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  color: var(--muted-foreground);
}

.calc-probability {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.calc-probability sup {
  font-size: 0.5rem;
  position: relative;
  top: -0.4em;
  left: -0.3em;
  line-height: 0;
}

.calc-probability-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  color: var(--foreground);
}

/* Cost Breakdown Dropdown (matches car-detail pattern) */
.cost-breakdown {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
}

.cost-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.5rem 0;
}

.cost-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cost-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.cost-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.cost-chevron {
  transition: transform 0.2s;
}

.cost-content {
  margin-top: 1rem;
}

.cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.cost-item:last-of-type {
  border-bottom: none;
}

.cost-item-label {
  color: var(--muted-foreground);
}

.cost-item-value {
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  font-size: 0.875rem;
}

.cost-total {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.05);
  border-radius: var(--radius);
}

.cost-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cost-total-label {
  font-weight: 600;
}

.cost-total-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.cost-note {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-top: 0.75rem;
}

.cost-note a {
  color: var(--primary);
  text-decoration: none;
}

.cost-note a:hover {
  text-decoration: underline;
}

/* Cost breakdown sections */
.cost-section {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.cost-section:first-child {
  margin-top: 0;
}

.cost-section .cost-total {
  margin-top: 0.75rem;
}

.cost-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination-current {
  font-weight: 600;
  color: var(--foreground);
}

/* Slider scroll-fixed behavior (toggled by JS on lot detail, mobile only) */
@media (max-width: 1023px) {
  .slider-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--background);
    padding: 1rem;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  }
}

/* Cost breakdown mobile: stack label and value */
@media (max-width: 480px) {
  .cost-breakdown {
    padding: 0.75rem 1rem;
  }

  .cost-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
  }

  .cost-item-value {
    text-align: left;
  }

  .cost-total-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
