/* Layout */
:root {
    --primary: #18306F;
    --secondary: #def1f9;
    --box-shadow: rgb(0 0 0 / 5%) 0px 1px 4px;
}
.autodesktop-single-car {
    padding: 2rem 0;
}

.autodesktop-single-car .autodesktop-error {
    color: red;
    margin: 1rem 0;
}
h2 {
    font-family: 'Figtree', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0;
}
h3 {
    font-family: 'Figtree', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    margin-bottom: 2rem;
}
/* Card / article */
.car {
    width: 100%;
    max-width: 1400px;
    color: var(--primary);
    margin: 0 auto;
    font-family: 'Figtree', sans-serif;
}
@media only screen and (max-width: 1400px) {
    .car {
        width: 95%;
    }
}
.section {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
    padding: 45px 0;
}
.col {
    border-radius: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: rgb(0 0 0 / 5%) 0px 1px 4px;
    margin: 2rem 0 0 0;
}
@media only screen and (max-width: 980px) {
    .section {
        flex-direction: column;
        gap: 0;
    }
    .col {
        width: 100%!important;
        padding: 1rem;
    }
}
.col.empty {
    box-shadow: none;
    background: none;
}
.section .col:first-of-type {
    width: 70%;
}
.section .col:last-of-type {
    width: 30%;
}
.centered {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
}
.centered p {
    max-width: 550px;
    text-align: center;
}
.car-header .images {
    padding: 0!important;
}
.car-header .info {
    width: 30%;
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: rgb(0 0 0 / 5%) 0px 1px 4px;
}
/* Gallery */
#car-splide {
    width: calc(100% + 4rem);
    margin: -2rem;
}
@media only screen and (max-width: 980px) {
    #car-splide {
        width: 100%;
        margin: 0;
    }
}
.car .splide__pagination {
    bottom: -25px;
}

.car .splide__pagination__page {
    background: var(--secondary);
    opacity: 1;
    width: 10px;
    height: 10px;
}
.car .splide__pagination__page.is-active {
    background: var(--primary);
}
.car-gallery .splide__slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}
/* Highlights */
.highlights .col {
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.highlight-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 0;
    margin: 0;
}
.highlight-list li {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.highlight-list .icon {
    width: 36px;
    height: 36px;
    margin-bottom: 1rem;
}
.highlight-list li p {
    margin: 0;
}
.col.service {
    background: var(--primary);
    justify-content: flex-start;
}
.col.service h3 {
    font-size: 1.8rem;
    color: #fff;
    font-weight: 800;
}
.col.service p {
    font-family: 'Figtree';
    line-height: 1.5;
    color: #fff;
}
.expander {
    position: relative;
}
.expander::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-image: linear-gradient(180deg, transparent, #fff);
    opacity: 1;
    z-index: 9;
}
.is-expanded.expander::before {
    opacity: 0;
}
.car-details-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1rem;
}

.car-details-specs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.car-details-equipment {
    width: 100%;
}
.car-details-equipment-list {
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
}
.car-details-title {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.car-details-variant {
    margin-top: 0;
    color: var(--primary);
    font-size: 1rem;
}

.car-details-price {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 1rem;
    margin-bottom: 0;
}
.car-details-financing {
    padding-top: 1rem;
    font-size: 0.95rem;
}
.car-details-financing-header {
    display: flex;
    flex-direction: column-reverse;
    font-weight: 400;
    position: relative;
}
.car-details-financing-label {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 0.65rem;
    margin: 0;
}
.car-details-financing-price {
    white-space: nowrap;
    font-size: 1.5rem;
    font-weight: 800;
}
.car-details-financing-toggle {
    display: none;
    margin-left: .5rem;
    font-size: 1.2rem;
}
.car-details-financing-body {
    margin-top: 0.75rem;
}
.car-details-financing-list {
    border-top: 1px solid #eee;
    list-style: none;
    margin: 0;
    padding: 1rem 0 0 0;
}
.car-details-financing-list li {
    margin-bottom: 0.55rem;
    display: flex;
    justify-content: space-between;
}
.car-details-financing-list li strong {
    font-weight: 400;
    flex: 2;
}
.car-details-financing-list li .value {
    text-align: left;
    font-weight: 800;
    flex: 1;
}
.car-details-financing-comment {
    margin-top: 0.75rem;
    font-style: italic;
}
.col.main-details {
    display: flex;
    flex-direction: column;
}
.basic {
    flex: 2;
}
.button-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 80%;
    margin: 0 auto;
    margin-top: 2rem;
}
/* Mobile: accordion */
@media (max-width: 767px) {
    .car-details-financing-header {
        cursor: pointer;
    }
    .car-details-financing-body {
        display: none;
    }
    .car-details-financing.is-open .car-details-financing-body {
        display: block;
    }
    .car-details-financing-toggle {
        display: inline-block;
        position: absolute;
        top: -3px;
        right: 10px;
        font-size: 36px;
    }
}

/* Desktop: always open */
@media (min-width: 768px) {
    .car-details-financing-body {
        display: block !important;
    }
}

/* Spec groups collapse */
.car-details-spec-inner {
    margin-top: 0.5rem;
}

.car-details-spec-groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;

    overflow: hidden;
    max-height: 200px; /* default collapsed height */
    transition: max-height 0.35s ease;
}

@media (min-width: 768px) {
    .car-details-spec-groups {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.spec-group h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 800;
}

.spec-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spec-group-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}
.spec-group-list strong {
    font-weight: 400;
}
.spec-group-list .value {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.car-details-spec-groups.is-collapsed { /* height set in JS */ }
.car-details-spec-groups.is-expanded { /* height set in JS */ }

.car-details-spec-toggle {
    margin-top: 0.75rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.car-details-spec-toggle:hover {
    background: #eee;
    border-color: #bbb;
}

.car-details-spec-toggle:active {
    transform: scale(0.97);
}


/* Equipment grid + smooth “view more” */

.car-details-equipment-inner {
    margin-top: 0.5rem;
}

.car-details-equipment-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.35rem 1.5rem;
    overflow: hidden;
    max-height: 9999px;
    transition: max-height 0.35s ease;
}

.car-details-equipment-list li {
    position: relative;
    font-size: 0.95rem;
}

.car-details-equipment-list.is-collapsed {
    /* max-height is set dynamically with JS */
}

.car-details-equipment-list.is-expanded {
    /* max-height is set dynamically with JS */
}

.car-details-equipment-toggle {
    margin-top: 0.75rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.car-details-equipment-toggle:hover {
    background: #eee;
    border-color: #bbb;
}

.car-details-equipment-toggle:active {
    transform: scale(0.97);
}
/* Debug / raw data */
.car-details-debug {
    margin-top: 2rem;
}

.car-details-debug summary {
    cursor: pointer;
    font-weight: bold;
}

.car-details-debug pre {
    white-space: pre-wrap;
    background: #fff;
    padding: 1rem;
    border: 1px solid #ddd;
    overflow-x: auto;
}


/* FIX 

/* Spec groups collapse */
.car-details-spec-inner {
    margin-top: 0.5rem;
}

.car-details-spec-groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    overflow: hidden;
    max-height: none; /* JS sets this */
    transition: max-height 0.35s ease;
}

@media (min-width: 768px) {
    .car-details-spec-groups {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.spec-group h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.spec-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spec-group-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.spec-group-list .value {
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.car-details-spec-groups.is-collapsed { }
.car-details-spec-groups.is-expanded { }

.car-details-spec-toggle {
    margin-top: 0.75rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.car-details-spec-toggle {
    display: inline-block!important;
    margin-top: 2rem!important;
}

.car-details-spec-toggle:hover {
    background: #eee;
    border-color: #bbb;
}

.car-details-spec-toggle:active {
    transform: scale(0.97);
}

.serviceabonnementer {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: 2rem;
    margin: 2rem 0;
}
.service-col {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.service-col img {
    max-width: 200px;
    max-height: 50px;
    margin-bottom: 1rem;
}
.service-col p {
    text-align: left;
    max-width: 300px;
    color: #000;
}
.service-col .price {
    font-size: 3rem;
    font-style: italic;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
}