@font-face {
  font-family: Mulish;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/mulish-300.ttf") format("truetype");
}

@font-face {
  font-family: Mulish;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/mulish-400.ttf") format("truetype");
}

@font-face {
  font-family: Mulish;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/mulish-500.ttf") format("truetype");
}

@font-face {
  font-family: Mulish;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/mulish-600.ttf") format("truetype");
}

@font-face {
  font-family: Mulish;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/mulish-700.ttf") format("truetype");
}

@font-face {
  font-family: Mulish;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/mulish-800.ttf") format("truetype");
}

@font-face {
  font-family: Mulish;
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/fonts/mulish-900.ttf") format("truetype");
}

/* GTSC brand tokens and component styles, adapted to Bootstrap. */
:root {
  --gtsc-red: #d4290e;
  --gtsc-red-dark: #ad220c;
  --gtsc-surface: #f8f8f8;
  --gtsc-card-radius: 25px;
  --gtsc-card-shadow: 0 5px 20px rgb(0 44 95 / 10%);
  --bs-body-font-family: Mulish, sans-serif;
  --bs-body-color: #333;
  --bs-body-bg: #fff;
  --bs-link-color: var(--gtsc-red);
  --bs-link-hover-color: var(--gtsc-red-dark);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: #fff;
  color: #333;
  font-family: Mulish, sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gtsc-red);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 20px;
  background: #fff;
  color: var(--gtsc-red);
}

.skip-link:focus {
  top: 10px;
}

.site-shell {
  width: calc(100% - 96px);
  max-width: 1800px;
  margin-inline: auto;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  min-height: 140px;
}

.site-brand {
  flex-shrink: 0;
  width: 270px;
}

.site-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.site-navigation {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 76px);
}

.site-navigation a {
  padding: 14px 0;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-navigation a:hover,
.site-navigation a.is-current {
  color: var(--gtsc-red);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 30px;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 600;
}

.nav-toggle span {
  color: var(--gtsc-red);
  font-size: 18px;
}

.stock-page {
  padding-top: 20px;
  padding-bottom: 80px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
}

.page-heading h1 {
  margin: 0 0 8px;
  color: #000;
  font-size: clamp(32px, 3vw, 48px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.page-heading p {
  margin: 0;
  color: #757575;
  font-size: 15px;
}

.inventory-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

#mode {
  padding: 6px 10px;
  border: 1px solid #e1e1e1;
  border-radius: 20px;
  background: #fff !important;
  color: #777 !important;
  font-size: 10px;
  font-weight: 500;
}

#mode.text-bg-success::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #54835b;
  content: "";
}

#mode.text-bg-danger {
  color: var(--gtsc-red) !important;
}

.inventory-notice {
  min-height: 22px;
  margin-bottom: 26px;
  color: #999;
  font-size: 12px;
}

.quick-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px clamp(24px, 8vw, 160px);
  margin-bottom: 24px;
}

.quick-filters:empty {
  display: none;
}

.quick-filter {
  min-width: 0;
}

.form-select,
.form-control {
  min-height: 44px;
  border: 1px solid #c6c6c6;
  border-radius: 24px;
  background-color: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.form-control {
  padding: 11px 18px;
}

.form-select {
  padding: 11px 54px 11px 18px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2' d='m4 6 4 4 4-4'/%3E%3C/svg%3E"),
    linear-gradient(to left, #d4290e 44px, transparent 44px);
  background-position:
    right 14px center,
    right center;
  background-size:
    16px 16px,
    100% 100%;
  background-repeat: no-repeat;
}

.form-select[multiple] {
  min-height: 116px;
  padding: 10px;
  border-radius: 15px;
  background-image: none;
}

.form-select[multiple] option {
  padding: 3px 7px;
  border-radius: 4px;
}

.form-select:focus,
.form-control:focus {
  border-color: var(--gtsc-red);
  box-shadow: 0 0 0 3px rgb(212 41 14 / 9%);
}

.form-label {
  margin-bottom: 8px;
  color: #555;
  font-size: 12px;
  font-weight: 600;
}

.filter-panel,
.advanced-panel {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
}

summary {
  cursor: pointer;
}

.filter-panel > summary,
.advanced-panel > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

.summary-note {
  color: #999;
  font-size: 11px;
  font-weight: 400;
}

.summary-arrow {
  margin-left: auto;
  color: var(--gtsc-red);
  font-size: 20px;
  line-height: 1;
}

details[open] > summary .summary-arrow {
  transform: rotate(45deg);
}

.filter-panel-content {
  padding: 6px 22px 22px;
}

#common-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.filter-section {
  min-width: 0;
  padding: 14px 0;
  border-top: 1px solid #eee;
}

.filter-section > summary {
  margin-bottom: 16px;
  color: #111;
  font-size: 14px;
  font-weight: 700;
}

.filter-section > summary::after {
  float: right;
  color: var(--gtsc-red);
  content: "+";
}

.filter-section[open] > summary::after {
  content: "−";
}

.filter-help {
  color: #999;
  font-size: 10px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  padding: 18px 0 24px;
}

.filter-count {
  margin-right: auto;
  color: #999;
  font-size: 11px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 11px;
}

.btn-dark {
  --bs-btn-bg: var(--gtsc-red);
  --bs-btn-border-color: var(--gtsc-red);
  --bs-btn-hover-bg: var(--gtsc-red-dark);
  --bs-btn-hover-border-color: var(--gtsc-red-dark);
  --bs-btn-active-bg: var(--gtsc-red-dark);
  --bs-btn-active-border-color: var(--gtsc-red-dark);
  --bs-btn-disabled-bg: #d5a89f;
  --bs-btn-disabled-border-color: #d5a89f;
}

.btn-outline-dark {
  --bs-btn-color: var(--gtsc-red);
  --bs-btn-border-color: #dfb7af;
  --bs-btn-hover-bg: var(--gtsc-red);
  --bs-btn-hover-border-color: var(--gtsc-red);
  --bs-btn-active-bg: var(--gtsc-red-dark);
  --bs-btn-active-border-color: var(--gtsc-red-dark);
}

.btn-link {
  padding: 7px 0;
  color: var(--gtsc-red);
  font-size: 12px;
  text-decoration-color: #e7c1ba;
}

.btn-link:hover {
  color: var(--gtsc-red-dark);
}

.advanced-panel {
  margin-bottom: 28px;
  background: #fafafa;
}

.advanced-panel .card-body {
  padding: 4px 22px 22px;
}

.condition-row {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  background: #fff;
}

.condition-description {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

#result-count {
  margin: 0;
  color: #000;
  font-size: 20px;
  font-weight: 800;
}

#result-meta {
  color: #999;
  font-size: 11px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-control label {
  color: #999;
  font-size: 12px;
  white-space: nowrap;
}

.sort-select {
  width: 225px;
}

#results {
  --bs-gutter-x: 30px;
  --bs-gutter-y: 36px;
}

#results .card {
  overflow: hidden;
  border: 0;
  border-radius: var(--gtsc-card-radius);
  background: #fff;
  box-shadow: var(--gtsc-card-shadow);
}

.stock-media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 0;
  background: #f4f4f4;
}

.vehicle-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: #f4f4f4;
  object-fit: cover;
  transition: transform 0.3s;
}

.stock-media:hover .vehicle-image {
  transform: scale(1.025);
}

.stock-photo-count {
  position: absolute;
  right: 15px;
  bottom: 15px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #0009;
  color: #fff;
  font-size: 10px;
}

#results .card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: start;
  padding: 24px 26px;
}

.vehicle-title {
  margin: 0 0 8px;
  color: #000;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.25;
}

.vehicle-title button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.vehicle-title button:hover {
  color: var(--gtsc-red);
}

.vehicle-version {
  display: -webkit-box;
  overflow: hidden;
  min-height: 36px;
  margin: 0 0 14px;
  color: #444;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.65;
  text-transform: uppercase;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.vehicle-summary {
  margin: 0 0 24px;
  color: #777;
  font-size: 13px;
  line-height: 1.75;
}

.stock-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #eee;
}

.vehicle-price {
  margin: 0;
  color: #000;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.stock-tax-note,
.stock-warranty {
  color: #999;
  font-size: 11px;
}

.stock-warranty {
  padding: 5px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  white-space: nowrap;
}

.stock-detail-button {
  justify-content: space-between;
  width: 100%;
  margin-top: 22px;
}

.vehicle-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: #777;
  font-size: 13px;
}

.vehicle-specs span {
  overflow-wrap: anywhere;
}

.tag,
.filter-chip {
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid #e7e7e7;
  border-radius: 20px;
  background: #fff;
  color: #777;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 50px;
}

.site-footer {
  padding: 56px 0 0;
  border-top: 1px solid #eee;
  background: var(--gtsc-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 70px;
}

.site-footer h2 {
  margin: 0 0 24px;
  color: #000;
  font-size: 25px;
  font-weight: 800;
}

.site-footer p,
.site-footer a {
  color: #666;
  font-size: 14px;
  line-height: 1.9;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gtsc-red);
}

.site-footer section > a {
  display: block;
  margin-bottom: 7px;
}

.site-footer .footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  margin-top: 10px;
  color: var(--gtsc-red);
  font-weight: 600;
}

.site-footer .footer-small {
  font-size: 11px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding-block: 22px;
  border-top: 1px solid #e5e5e5;
  color: #999;
  font-size: 11px;
}

dialog {
  overflow-y: auto;
  width: min(1000px, 94vw);
  max-height: 90dvh;
  border: 1px solid #ddd;
  border-radius: 20px;
}

dialog::backdrop {
  background: #0008;
}

pre {
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.gallery img {
  max-width: 100%;
  height: 200px;
  border-radius: 12px;
  object-fit: contain;
}

@media (max-width: 1199px) {
  .header-inner {
    min-height: 120px;
    gap: 25px;
  }

  .site-brand {
    width: 220px;
  }

  .site-navigation {
    gap: 24px;
  }

  .site-navigation a {
    font-size: 12px;
  }

  .footer-grid {
    gap: 36px;
  }
}

@media (max-width: 991px) {
  .site-shell {
    width: calc(100% - 48px);
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
    min-height: 110px;
    padding-block: 20px;
  }

  .site-brand {
    width: 200px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-navigation {
    display: none;
    flex: 0 0 100%;
    align-items: stretch;
    gap: 0;
    padding: 12px 0;
    border-top: 1px solid #eee;
  }

  .site-navigation.is-open {
    display: flex;
    flex-direction: column;
  }

  .site-navigation a {
    padding: 10px 0;
    font-size: 14px;
  }

  #common-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-title {
    font-size: 23px;
  }
}

@media (max-width: 575px) {
  .site-shell {
    width: calc(100% - 36px);
  }

  .header-inner {
    min-height: 100px;
    gap: 14px;
  }

  .site-brand {
    width: 170px;
  }

  .stock-page {
    padding-top: 20px;
    padding-bottom: 50px;
  }

  .page-heading {
    flex-direction: column;
    align-items: start;
    gap: 16px;
  }

  .inventory-status {
    justify-content: start;
  }

  .page-heading p {
    font-size: 13px;
  }

  .inventory-notice {
    margin-top: 16px;
    margin-bottom: 20px;
    font-size: 11px;
  }

  .quick-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  #common-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .filter-panel > summary,
  .advanced-panel > summary {
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 14px;
  }

  .summary-note {
    flex-basis: 100%;
    order: 3;
  }

  .filter-panel-content,
  .advanced-panel .card-body {
    padding: 4px 14px 14px;
  }

  .filter-actions {
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  .filter-count {
    flex: 0 0 100%;
  }

  #apply {
    margin-left: auto;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .sort-control {
    justify-content: space-between;
  }

  .sort-select {
    width: min(225px, 75%);
  }

  #results {
    --bs-gutter-x: 20px;
    --bs-gutter-y: 24px;
  }

  #results .card-body {
    padding: 22px;
  }

  .pagination-controls {
    gap: 14px;
    margin-top: 30px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .site-footer {
    padding-top: 36px;
  }

  .site-footer h2 {
    margin-bottom: 16px;
    font-size: 23px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
