.stock-section {
    scroll-margin-top: 5rem;
}

.stock-eyebrow {
    margin-bottom: 0.75rem;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.stock-intro {
    max-width: 44rem;
    margin: 0 auto 3rem;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.75;
}

.stock-controls {
    display: grid;
    grid-template-columns: minmax(15rem, 2fr) repeat(2, minmax(10rem, 1fr));
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
}

.stock-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stock-field span {
    color: #4b5563;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.stock-field input,
.stock-field select {
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 0.35rem;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.stock-field input:focus,
.stock-field select:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

.stock-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.5rem;
    gap: 1rem;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-clear {
    padding: 0.3rem 0;
    border-bottom: 1px solid #111;
    color: #111;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-clear:hover {
    color: #6b7280;
    border-color: #6b7280;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.vehicle-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    border-color: #c5c5c5;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.vehicle-card-image-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e5e7eb;
}

.vehicle-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.vehicle-card:hover .vehicle-card-image {
    transform: scale(1.035);
}

.vehicle-card-image-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    padding: 2rem;
    background: linear-gradient(140deg, #111 0%, #2f2f2f 100%);
    color: #d1d5db;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

.vehicle-status {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 1.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
}

.vehicle-card .vehicle-status {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 1;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.vehicle-status[data-status="reserved"] {
    background: #b45309;
}

.vehicle-status[data-status="sold"] {
    background: #4b5563;
}

.vehicle-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.35rem;
}

.vehicle-card-year {
    margin-bottom: 0.35rem;
    color: #6b7280;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.vehicle-card h3 {
    color: #111;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.vehicle-card-title-link {
    color: inherit;
    text-decoration: none;
    text-underline-offset: 0.18em;
}

.vehicle-card-title-link:hover {
    text-decoration: underline;
}

.vehicle-card-title-link:focus-visible {
    border-radius: 0.15rem;
    outline: 2px solid #111;
    outline-offset: 3px;
}

.vehicle-card-variant {
    min-height: 2.7em;
    margin-top: 0.35rem;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.45;
}

.vehicle-card-specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    margin: 1.2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.75rem;
}

.vehicle-card-specs span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-card-footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}

.vehicle-card-price {
    color: #111;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.vehicle-card-button {
    flex: 0 0 auto;
    padding: 0.72rem 0.9rem;
    border: 1px solid #111;
    border-radius: 0.25rem;
    background: #111;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    transition: background 160ms ease, color 160ms ease;
}

.vehicle-card-button:hover,
.vehicle-card-button:focus-visible {
    background: #fff;
    color: #111;
}

.stock-message {
    padding: 4rem 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    background: #fff;
    color: #4b5563;
    text-align: center;
    line-height: 1.7;
}

.stock-more-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.25rem;
}

.stock-more-wrap[hidden],
.stock-more[hidden],
#stockPrevious[hidden] {
    display: none !important;
}

.stock-more,
#stockPrevious {
    display: inline-flex;
    min-height: 3.1rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border: 1px solid #111;
    border-radius: 0.25rem;
    background: #111;
    color: #fff;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
    transition: background 160ms ease, color 160ms ease;
}

.stock-more:hover,
.stock-more:focus-visible,
#stockPrevious:hover,
#stockPrevious:focus-visible {
    background: #fff;
    color: #111;
}

#stockPrevious {
    background: #fff;
    color: #111;
}

#stockPrevious:hover,
#stockPrevious:focus-visible {
    background: #111;
    color: #fff;
}

.stock-loading-card {
    min-height: 26rem;
    border-radius: 0.7rem;
    background: linear-gradient(100deg, #ececec 30%, #f7f7f7 48%, #ececec 66%);
    background-size: 250% 100%;
    animation: stock-shimmer 1.25s infinite linear;
}

@keyframes stock-shimmer {
    to { background-position-x: -250%; }
}

.vehicle-dialog {
    width: min(76rem, calc(100vw - 2rem));
    max-width: none;
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0.75rem;
    background: #fff;
    color: #111;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.vehicle-dialog::backdrop {
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.vehicle-dialog-shell {
    position: relative;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
}

.vehicle-dialog-open {
    overflow: hidden;
}

.vehicle-dialog-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 5;
    width: 2.6rem;
    height: 2.6rem;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
}

.vehicle-dialog-close:hover,
.vehicle-dialog-close:focus-visible {
    background: #fff;
    color: #111;
}

.vehicle-dialog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
}

.vehicle-gallery {
    min-width: 0;
    padding: 1.25rem;
    background: #111;
}

.vehicle-gallery-stage {
    position: sticky;
    top: 1.25rem;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 0.35rem;
    background: #252525;
}

.vehicle-gallery-stage.is-empty::before {
    content: 'Photo unavailable';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 2rem;
    color: #d1d5db;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

.vehicle-gallery-stage > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    transform: translateY(-50%);
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
    background: #fff;
    color: #111;
}

.gallery-arrow-prev { left: 0.7rem; }
.gallery-arrow-next { right: 0.7rem; }

.vehicle-image-count {
    position: absolute;
    right: 0.7rem;
    bottom: 0.7rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

.vehicle-thumbnails {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding-bottom: 0.2rem;
    overflow-x: auto;
    scrollbar-color: #71717a #27272a;
}

.vehicle-thumbnail {
    flex: 0 0 5.3rem;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 0.25rem;
    opacity: 0.65;
}

.vehicle-thumbnail[aria-current="true"] {
    border-color: #fff;
    opacity: 1;
}

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

.vehicle-dialog-content {
    min-width: 0;
    padding: 3.25rem 2.25rem 2.25rem;
}

.vehicle-dialog-content > .vehicle-status {
    margin-bottom: 1rem;
}

.vehicle-dialog-content h2 {
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
}

.vehicle-dialog-variant {
    margin-top: 0.55rem;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.55;
}

.vehicle-dialog-price {
    margin-top: 1.25rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.vehicle-spec-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.vehicle-spec-item {
    padding: 0.9rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.vehicle-spec-item:nth-child(odd) {
    padding-right: 1rem;
}

.vehicle-spec-item:nth-child(even) {
    padding-left: 1rem;
    border-left: 1px solid #e5e7eb;
}

.vehicle-spec-item dt {
    color: #6b7280;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.vehicle-spec-item dd {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.vehicle-copy {
    margin-top: 1.6rem;
}

.vehicle-copy h3 {
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.vehicle-copy p {
    color: #4b5563;
    font-size: 0.88rem;
    line-height: 1.75;
}

.vehicle-feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem 1rem;
    color: #4b5563;
    font-size: 0.82rem;
}

.vehicle-feature-list li {
    position: relative;
    padding-left: 1rem;
    line-height: 1.45;
}

.vehicle-feature-list li::before {
    content: '';
    position: absolute;
    top: 0.48em;
    left: 0;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: #111;
}

.vehicle-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 2rem;
}

.vehicle-primary-action,
.vehicle-secondary-action {
    display: inline-flex;
    min-height: 3.2rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border: 1px solid #111;
    border-radius: 0.25rem;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-align: center;
    text-transform: uppercase;
    transition: background 160ms ease, color 160ms ease;
}

.vehicle-primary-action {
    background: #111;
    color: #fff;
}

.vehicle-secondary-action {
    background: #fff;
    color: #111;
}

.vehicle-primary-action:hover,
.vehicle-primary-action:focus-visible {
    background: #fff;
    color: #111;
}

.vehicle-secondary-action:hover,
.vehicle-secondary-action:focus-visible {
    background: #111;
    color: #fff;
}

@media (max-width: 960px) {
    .stock-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vehicle-dialog-layout {
        grid-template-columns: 1fr;
    }

    .vehicle-gallery-stage {
        position: relative;
        top: 0;
    }
}

@media (max-width: 720px) {
    .stock-controls {
        grid-template-columns: 1fr;
    }

    .stock-grid {
        grid-template-columns: 1fr;
    }

    .stock-more-wrap {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .stock-more,
    #stockPrevious {
        width: 100%;
    }

    .vehicle-dialog {
        width: 100%;
        max-height: 100dvh;
        border-radius: 0;
    }

    .vehicle-dialog-shell {
        max-height: 100dvh;
    }

    .vehicle-gallery {
        padding: 0;
    }

    .vehicle-gallery-stage {
        border-radius: 0;
    }

    .vehicle-thumbnails {
        margin: 0;
        padding: 0.65rem;
    }

    .vehicle-dialog-content {
        padding: 2rem 1.2rem 1.5rem;
    }

    .vehicle-feature-list,
    .vehicle-dialog-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 390px) {
    .vehicle-spec-list {
        grid-template-columns: 1fr;
    }

    .vehicle-spec-item:nth-child(odd),
    .vehicle-spec-item:nth-child(even) {
        padding-right: 0;
        padding-left: 0;
        border-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vehicle-card,
    .vehicle-card-image,
    .stock-loading-card {
        animation: none;
        transition: none;
    }
}
