/* Inventory and the shared vehicle dialog. Load after compact-cards.css. */
.catalog-page {
  background: #f7f8f6;
}

.catalog-page .catalog-top {
  padding: 30px 0 28px;
  border-color: #dfe4dd;
  background: linear-gradient(135deg, #f7f8f6, #ecefeb);
}

.catalog-page .catalog-top h1 {
  margin: 8px 0 10px;
  font-size: 46px;
}

.catalog-page .inventory-section {
  padding-top: 22px;
}

.catalog-page .catalog-search {
  gap: 12px;
}

.catalog-page .catalog-search > label:first-child {
  min-height: 48px;
  border-color: #d5dcd3;
  border-radius: 10px;
  background: #ffffffdb;
  box-shadow: inset 0 1px 0 #fff;
}

.catalog-page .catalog-search input {
  min-height: 46px;
  font-size: 14px;
}

.catalog-page .sort-label select {
  height: 48px;
  border-color: #d5dcd3;
  border-radius: 10px;
  background: #ffffffdb;
  font-size: 12px;
}

.catalog-page .filters {
  display: block;
}

.catalog-page .category-filters {
  align-items: center;
}

.catalog-page .category-filters .filter {
  flex: none;
  align-self: center;
  height: 44px;
  min-height: 44px;
}

.filter-disclosures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}

.filter-panel {
  min-width: 0;
  border: 1px solid #d5dcd3;
  border-radius: 10px;
  background: #ffffffdb;
  box-shadow: inset 0 1px 0 #fff;
}

.filter-panel[open] {
  border-color: #b5c3b6;
  box-shadow: 0 4px 16px #18211a0a;
}

.filter-panel > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

.filter-panel > summary::-webkit-details-marker,
#vehicle-dialog .condition-box > summary::-webkit-details-marker {
  display: none;
}

.filter-panel > summary::marker,
#vehicle-dialog .condition-box > summary::marker {
  content: '';
}

.filter-panel > summary:hover {
  background: #f2f5ef;
}

.filter-panel > summary .filter-value {
  min-width: 0;
  max-width: 58%;
  margin-left: auto;
  overflow: hidden;
  color: #6a7467;
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel > summary svg,
.filter-panel > summary [data-icon] {
  width: 16px;
  height: 16px;
  flex: none;
}

.filter-panel > summary > :is(svg, [data-icon]):last-child,
.filter-panel > summary .filter-chevron {
  color: #6a7467;
  transform: rotate(90deg);
  transition: transform .16s ease;
}

.filter-panel[open] > summary {
  border-bottom: 1px solid #e3e8df;
  border-radius: 9px 9px 0 0;
}

.filter-panel[open] > summary > :is(svg, [data-icon]):last-child,
.filter-panel[open] > summary .filter-chevron {
  transform: rotate(270deg);
}

.filter-panel-body {
  padding: 12px;
}

.filter-panel-body > p:not(.filter-error),
.filter-explanation {
  margin: 0 0 10px;
  color: #687361;
  font-size: 11px;
  line-height: 1.55;
}

.filter-error {
  margin: 9px 0 0;
  padding: 8px 10px;
  border: 1px solid #edccc2;
  border-left: 3px solid var(--red);
  border-radius: 5px;
  background: #fff2ee;
  color: #963a29;
  font-size: 11px;
  line-height: 1.5;
}

.filter-error:empty {
  display: none;
}

.price-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.price-inputs label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: #566052;
  font-size: 11px;
  line-height: 1.35;
}

.price-inputs input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #cfd8cb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.price-inputs input::placeholder {
  color: #868d81;
}

.price-inputs input[aria-invalid=true] {
  border-color: var(--red);
  background: #fff8f5;
}

.price-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.price-presets button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid #dce2d7;
  border-radius: 6px;
  background: #f5f7f2;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.price-presets button:hover {
  border-color: #bdc8b6;
  background: #edf1e7;
}

.price-presets button:is([aria-pressed=true], .active) {
  border-color: #d9a9a4;
  background: #fff2ee;
  color: #9d2922;
}

.filter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 9px;
  max-height: 264px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 4px 0;
  color: #414b3d;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.filter-options .filter-explanation {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}

.filter-options input[type=checkbox] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--red);
}

.filter-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
}

#active-filter-summary {
  min-width: 0;
  color: #687361;
  font-size: 11px;
  line-height: 1.5;
}

#active-filter-summary.filter-error {
  color: #963a29;
}

#clear-filters {
  flex: none;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #525f4b;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#clear-filters:hover:not(:disabled) {
  background: #ecf0e6;
  color: var(--red);
}

#clear-filters:disabled {
  color: #959c8f;
  cursor: default;
}

.filter-panel > summary:focus-visible,
.price-inputs input:focus-visible,
.filter-options input:focus-visible,
#vehicle-dialog .condition-box > summary:focus-visible {
  outline: 3px solid #2368b4;
  outline-offset: 2px;
}

.catalog-page .inventory-meta {
  gap: 12px;
  padding: 11px 0;
  color: #687361;
  font-size: 11px;
}

.catalog-page .vehicle-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.vehicle-card.inventory-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #d4dbd4;
  border-radius: 13px;
  background: linear-gradient(140deg, #fff, #edf0ec);
  box-shadow: 0 3px 13px #17251b09, inset 0 1px 0 #fff;
  transform: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.vehicle-card.inventory-card:hover {
  border-color: #bac6ba;
  box-shadow: 0 6px 20px #17251b12;
  transform: none;
}

.inventory-card .card-media {
  container-type: inline-size;
  background: linear-gradient(145deg, #e8ece8, #dce2dd);
}

.inventory-card .card-image {
  background: transparent;
}

.inventory-card .card-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.6;
  object-fit: contain;
  object-position: center;
  transform: none;
}

.inventory-card .card-tag {
  top: 11px;
  left: 11px;
  max-width: min(145px, calc(45% - 15px));
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: break-word;
  text-overflow: clip;
}

.inventory-card .card-price-overlay {
  position: absolute;
  z-index: 2;
  top: 11px;
  right: 11px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  width: max-content;
  max-width: min(155px, calc(55% - 17px));
  padding: 8px 10px;
  border: 1px solid #efd29254;
  border-radius: 8px;
  background: linear-gradient(135deg, #292d32f2, #13171ded);
  color: #fff;
  box-shadow: 0 3px 12px #10151b52, inset 0 1px 0 #ffe3a21a;
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  text-align: right;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
  transition: border-color .25s ease, box-shadow .25s ease;
}

/* Share the Home cards' gold illumination without changing the card geometry. */
.inventory-card .card-price-overlay::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -45%;
  background: radial-gradient(ellipse at center, #f7d48638, transparent 60%);
  opacity: 0;
  transform: translateX(-35%);
  pointer-events: none;
  transition: opacity .25s ease;
}

.inventory-card .card-price-overlay strong {
  max-width: 100%;
  font-size: 27px;
  font-size: clamp(22px, 7.5cqw, 27px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.7px;
  white-space: nowrap;
  color: #f4d17d;
  text-shadow: 0 1px 2px #0009;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .inventory-card .card-price-overlay strong {
    background: linear-gradient(105deg, #e5b65b 0%, #ffe5a5 27%, #ffe5a5 39%, #fff9de 48%, #e8b75b 59%, #f7d58a 78%, #e5b65b 100%);
    background-size: 240% 100%;
    background-position: 100% 50%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 12px #f3c65e1c;
  }
}

.inventory-card:is(:hover, :focus-within) .card-price-overlay {
  border-color: #f5d58f9c;
  box-shadow: 0 3px 15px #10151b60, 0 0 14px #e6b75224, inset 0 1px 0 #ffe3a230;
}

.inventory-card:is(:hover, :focus-within) .card-price-overlay strong {
  animation: rail-gold-letter-halo 2.4s ease-in-out infinite;
}

.inventory-card:is(:hover, :focus-within) .card-price-overlay::before {
  opacity: 1;
  animation: rail-gold-reflection 2.4s ease-in-out infinite;
}

.inventory-card .card-price-overlay small {
  max-width: 100%;
  color: #f1f3f5;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
  .inventory-card .card-price-overlay,
  .inventory-card .card-price-overlay::before {
    transition: none;
  }

  .inventory-card:is(:hover, :focus-within) .card-price-overlay strong,
  .inventory-card:is(:hover, :focus-within) .card-price-overlay::before {
    animation: none;
  }

  .inventory-card:is(:hover, :focus-within) .card-price-overlay strong {
    text-shadow: 0 0 7px #f4cc7770;
  }
}

.inventory-card .card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
  border-top: 1px solid #ffffffb8;
  background: linear-gradient(135deg, #fffffff2, #e8eceaf2);
}

.inventory-card .card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}

.inventory-card .card-body h3 {
  display: -webkit-box;
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: -.35px;
}

.inventory-card .card-mileage {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  max-width: 78px;
  color: #586456;
  text-align: right;
}

.inventory-card .card-mileage strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.inventory-card .card-mileage small {
  font-size: 10px;
  line-height: 1;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.inventory-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: #687363;
  font-size: 10px;
  line-height: 1.5;
}

.inventory-card-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.inventory-card-meta svg {
  width: 12px;
  height: 12px;
}

.inventory-card-actions {
  display: flex;
  align-items: stretch;
  gap: 7px;
  margin-top: 12px;
}

.inventory-card-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #303a31;
  border-radius: 7px;
  background: linear-gradient(135deg, #343e37, #202922);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.inventory-card-actions > button:hover {
  border-color: #202922;
  background: #202922;
  transform: none;
}

.inventory-card-actions .card-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #c7d1c5;
  border-radius: 7px;
  background: #ffffffa8;
  color: #364631;
  font-size: 11px;
  line-height: 1.25;
}

.inventory-card-actions .card-contact:hover {
  border-color: #a7b6a2;
  background: #fff;
}

.inventory-card-actions .card-contact.whatsapp {
  border-color: #c4d7c7;
  background: #e9f2e9;
  color: #24663c;
}

.inventory-card-actions .card-contact.whatsapp:hover {
  border-color: #a6c3ab;
  background: #dcebdd;
}

.inventory-card-actions svg {
  width: 17px;
  height: 17px;
}

.inventory-card :is(button, a):focus-visible {
  outline: 3px solid #2368b4;
  outline-offset: -3px;
}

/* Both sticky rows share one explicit height so their controls never overlap. */
#vehicle-dialog {
  --detail-header-height: 64px;
  scroll-padding-top: calc(var(--detail-header-height) + 66px);
}

#vehicle-dialog .dialog-top {
  z-index: 7;
  height: var(--detail-header-height);
  min-height: var(--detail-header-height);
  padding: 9px 16px;
  border-bottom-color: #dce2d8;
  background: #fffffff2;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#vehicle-dialog .detail-contact-bar {
  position: sticky;
  z-index: 6;
  top: var(--detail-header-height);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 10px 16px;
  border-bottom: 1px solid #dce2d8;
  background: linear-gradient(135deg, #fffffff2, #eef3edf2);
  box-shadow: 0 3px 10px #15291a0a;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#vehicle-dialog .detail-contact-bar > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #c6d2c1;
  border-radius: 7px;
  background: #fff;
  color: #2f3b2a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

#vehicle-dialog .detail-contact-bar > .detail-contact-call:hover {
  border-color: #a6b89e;
  background: #f2f6ee;
}

#vehicle-dialog .detail-contact-bar > .detail-contact-whatsapp {
  border-color: #1b633f;
  background: #1b633f;
  color: #fff;
}

#vehicle-dialog .detail-contact-bar > .detail-contact-whatsapp:hover {
  border-color: #154f32;
  background: #154f32;
}

#vehicle-dialog .detail-contact-bar svg {
  width: 18px;
  height: 18px;
}

#vehicle-dialog details.condition-box {
  padding: 0;
  border: 1px solid #d7dfd3;
  border-radius: 9px;
  background: linear-gradient(135deg, #fff, #f2f5ef);
}

#vehicle-dialog .condition-box > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

#vehicle-dialog .condition-box > summary:hover {
  background: #eaf0e5;
}

#vehicle-dialog .condition-box > summary > span:first-child {
  flex: 1;
  min-width: 0;
}

#vehicle-dialog .condition-box > summary strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#vehicle-dialog .condition-box > summary [data-condition-hint] {
  display: block;
  margin-top: 3px;
  color: #687361;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

#vehicle-dialog .condition-box > summary svg,
#vehicle-dialog .condition-box > summary [data-icon] {
  width: 17px;
  height: 17px;
  flex: none;
}

#vehicle-dialog .condition-box > summary > :is(svg, [data-icon]):first-child {
  color: var(--red);
}

#vehicle-dialog .condition-box > summary > :is(svg, [data-icon]):last-child {
  margin-left: auto;
  color: #6a7467;
  transform: rotate(90deg);
  transition: transform .16s ease;
}

#vehicle-dialog .condition-box[open] > summary {
  border-bottom: 1px solid #dfe6da;
  border-radius: 8px 8px 0 0;
}

#vehicle-dialog .condition-box[open] > summary > :is(svg, [data-icon]):last-child {
  transform: rotate(270deg);
}

#vehicle-dialog .condition-box > p {
  margin: 0;
  padding: 12px 14px 14px;
  color: #56614f;
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 1000px) {
  .catalog-page .vehicle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
  }

  .filter-panel > summary {
    flex-wrap: wrap;
    gap: 3px 7px;
  }

  .filter-panel > summary .filter-value {
    max-width: none;
    font-size: 10px;
  }

  .filter-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .catalog-page .catalog-top {
    padding: 24px 0 21px;
  }

  .catalog-page .catalog-top h1 {
    font-size: 40px;
  }

  .catalog-page .inventory-section {
    padding-top: 17px;
  }

  .catalog-page .catalog-search {
    gap: 9px;
  }

  .catalog-page .catalog-search input,
  .catalog-page .sort-label select,
  .price-inputs input {
    font-size: 16px;
  }

  .filter-disclosures {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 10px;
  }

  .filter-panel > summary {
    flex-wrap: nowrap;
    gap: 9px;
    min-height: 48px;
    padding-block: 9px;
  }

  .filter-panel > summary .filter-value {
    max-width: 58%;
    font-size: 11px;
  }

  .filter-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-status {
    gap: 8px;
    margin-top: 3px;
  }

  #active-filter-summary {
    font-size: 10px;
  }

  #clear-filters {
    padding-inline: 6px;
  }

  .catalog-page .inventory-meta {
    align-items: flex-start;
    font-size: 10px;
    line-height: 1.4;
  }

  .catalog-page .vehicle-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
  }

  .inventory-card .card-body {
    padding: 13px;
  }

  .inventory-card .card-summary {
    gap: 10px;
  }

  .inventory-card .card-body h3 {
    font-size: 18px;
  }

  .inventory-card-actions {
    margin-top: 11px;
  }

  #vehicle-dialog .dialog-top {
    padding-inline: 14px;
  }

  #vehicle-dialog .detail-contact-bar {
    gap: 8px;
    padding: 8px 12px;
  }

  #vehicle-dialog .detail-contact-bar > a {
    padding-inline: 8px;
    font-size: 12px;
  }

  #vehicle-dialog .condition-box > p {
    font-size: 13px;
  }
}
