/* Cardinal Motors · Stock page styles */

.stock-page {
  padding-top: 100px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.stock-page__head {
  margin-bottom: 40px;
}
.stock-page__head h1 {
  font-weight: 900;
  font-style: italic;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
  margin: 0 0 12px 0;
  letter-spacing: 0.005em;
}
.stock-page__head h1 em { color: var(--cardinal-yellow); font-style: italic; }
.stock-page__head p {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  max-width: 640px;
  margin: 0;
}

.stock-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 1024px) {
  .stock-layout { grid-template-columns: 280px 1fr; gap: 48px; }
}

/* ─── Filters sidebar ──────────────────────────────── */
.filters {
  background: #111;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 24px 22px;
}
@media (min-width: 1024px) {
  .filters {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}
.filters__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.filters__head h2 {
  font-weight: 800; font-style: italic;
  font-size: 18px;
  margin: 0; letter-spacing: 0.02em;
}
.filters__clear {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  font-weight: 700;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.filters__clear:hover { color: var(--cardinal-yellow); }

.filter-group { margin-bottom: 22px; }
.filter-group__label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  margin-bottom: 10px;
}

.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  background: #1f1f1f;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  font-size: 11px;
  letter-spacing: 0.05em;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  color: rgba(255,255,255,0.75);
}
.chip:hover { border-color: var(--cardinal-yellow); color: var(--cardinal-white); }
.chip.is-active {
  background: var(--cardinal-yellow);
  color: var(--cardinal-black);
  border-color: var(--cardinal-yellow);
}

.range {
  display: flex; gap: 8px; align-items: center;
}
.range input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--cardinal-white);
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 4px;
}
.range input:focus { outline: none; border-color: var(--cardinal-yellow); }
.range span { font-size: 11px; color: rgba(255,255,255,0.4); }

.filters select {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--cardinal-white);
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 4px;
}
.filters select:focus { outline: none; border-color: var(--cardinal-yellow); }

/* Mobile drawer */
.filters-toggle {
  display: flex;
  width: 100%;
  margin-bottom: 16px;
}
@media (min-width: 1024px) {
  .filters-toggle { display: none; }
  .filters { display: block !important; }
}
.filters-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 95;
}
@media (max-width: 1023px) {
  .filters {
    display: none;
  }
  .filters.is-open {
    display: block;
    position: fixed;
    z-index: 96;
    top: 0; right: 0;
    width: 90vw;
    max-width: 360px;
    height: 100dvh;
    border-radius: 0;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid rgba(255,255,255,0.08);
  }
  .filters-mobile-backdrop.is-visible { display: block; }
}

/* ─── Toolbar ──────────────────────────────────────── */
.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}
@media (min-width: 720px) {
  .toolbar { grid-template-columns: 1fr auto auto; gap: 16px; }
}

.toolbar__search {
  position: relative;
}
.toolbar__search input {
  width: 100%;
  background: #111;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--cardinal-white);
  padding: 12px 16px 12px 44px;
  font-size: 14px;
  border-radius: 4px;
}
.toolbar__search input:focus { outline: none; border-color: var(--cardinal-yellow); }
.toolbar__search svg {
  position: absolute;
  top: 50%; left: 14px;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: rgba(255,255,255,0.45);
}

.toolbar__sort {
  background: #111;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--cardinal-white);
  padding: 12px 14px;
  font-size: 13px;
  border-radius: 4px;
  font-family: inherit;
}
.toolbar__sort:focus { outline: none; border-color: var(--cardinal-yellow); }

.toolbar__count {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Cards grid ───────────────────────────────────── */
.stock-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 600px)  { .stock-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .stock-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .stock-grid { grid-template-columns: repeat(3, 1fr); } }

/* ─── Empty state ──────────────────────────────────── */
.stock-empty {
  text-align: center;
  padding: 80px 24px;
  background: #111;
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,0.1);
}
.stock-empty__icon {
  width: 64px; height: 64px;
  color: rgba(255,255,255,0.2);
  margin: 0 auto 20px;
}
.stock-empty__title {
  font-weight: 800; font-style: italic;
  font-size: 22px;
  margin: 0 0 10px 0;
}
.stock-empty p {
  color: rgba(255,255,255,0.55);
  margin: 0 0 24px 0;
  max-width: 480px;
  margin-left: auto; margin-right: auto;
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Loader ───────────────────────────────────────── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ─── Detail view ──────────────────────────────────── */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  margin-bottom: 32px;
}
.detail-back:hover { color: var(--cardinal-yellow); }

.detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 1024px) {
  .detail { grid-template-columns: 1.5fr 1fr; gap: 56px; }
}

.detail__gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail__main {
  aspect-ratio: 4/3;
  background: #1a1a1a center/cover no-repeat;
  border-radius: 8px;
  overflow: hidden;
}
.detail__main img { width: 100%; height: 100%; object-fit: cover; }
.detail__main--placeholder {
  background:
    radial-gradient(ellipse at 50% 80%, rgba(255,214,10,0.08), transparent 60%),
    linear-gradient(135deg, #1f1f1f, #0a0a0a);
}
.detail__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.detail__thumb {
  aspect-ratio: 4/3;
  background: #1a1a1a center/cover no-repeat;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease;
}
.detail__thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail__thumb.is-active { border-color: var(--cardinal-yellow); }

.detail__info { display: flex; flex-direction: column; gap: 24px; }
.detail__make {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--cardinal-yellow);
  text-transform: uppercase;
  font-weight: 700;
}
.detail__model {
  font-weight: 900; font-style: italic;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
  margin: 8px 0 16px 0;
}
.detail__price {
  font-weight: 800; font-style: italic;
  font-size: clamp(28px, 3.5vw, 36px);
  color: var(--cardinal-yellow);
}
.detail__estado {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  margin-left: 12px;
  vertical-align: middle;
}
.detail__estado--reservado { background: rgba(255,214,10,0.2); color: var(--cardinal-yellow); }
.detail__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
}
.detail__spec {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}
.detail__spec strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  font-style: italic;
  color: var(--cardinal-white);
  margin-top: 4px;
  letter-spacing: 0;
  text-transform: none;
}

.detail__desc {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  white-space: pre-wrap;
}

.detail__cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 480px) { .detail__cta { flex-direction: row; } }

/* ─── Lightbox ─────────────────────────────────────── */
.detail__main { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__stage {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cardinal-white);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, color .15s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--cardinal-yellow);
  color: var(--cardinal-black);
}

.lightbox__close {
  top: -54px;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-display);
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
}
.lightbox__nav:hover { transform: translateY(-50%) scale(1.05); }
.lightbox__nav--prev { left: -76px; }
.lightbox__nav--next { right: -76px; }
.lightbox__nav svg { width: 24px; height: 24px; }

.lightbox__counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}

@media (max-width: 768px) {
  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__nav { width: 44px; height: 44px; }
  .lightbox__nav svg { width: 18px; height: 18px; }
}

body.lightbox-open { overflow: hidden; }
