/* ==========================================================================
   Saved-vehicles panel
   Sits under the main menu, inside .fixedwidth, populated by the script in
   includes/footer.cfm. Always renders as a collapsible banner ("Saved
   vehicle(s)") when there's at least one saved vehicle; click to expand and
   pick / remove / switch.
   ========================================================================== */

#vehicle-summary {
    margin: 12px 0;
}

/* Hidden when no saved vehicles */
#vehicle-summary:empty {
    display: none;
}

/* ==========================================================================
   Banner toggle (always visible when there are saved vehicles)
   ========================================================================== */

.vehicle-summary__box {
    /* container for toggle + expandable list */
}

.vehicle-summary__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: #4b3144;  /* octane purple — matches .currency-bar */
    color: #fff;
    border: 1px solid #4b3144;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: background-color .12s ease-in;
}

.vehicle-summary__toggle:hover,
.vehicle-summary__toggle:focus {
    background: #3a2635;
    outline: none;
}

/* When expanded, the toggle flattens its bottom so it merges into the list */
.vehicle-summary__toggle[aria-expanded="true"] {
    border-radius: 6px 6px 0 0;
}

.vehicle-summary__toggle-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    /* SVG <path fill="currentColor"> picks up the toggle's white text colour */
}

.vehicle-summary__toggle-label {
    flex: 1 1 auto;
    min-width: 0;
}

.vehicle-summary__toggle-chevron {
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.vehicle-summary__toggle-chevron::before {
    content: "\25B8"; /* ▸ */
}

.vehicle-summary__toggle[aria-expanded="true"] .vehicle-summary__toggle-chevron {
    transform: rotate(90deg);
}

/* ==========================================================================
   Expandable list of saved vehicles
   ========================================================================== */

.vehicle-summary__list {
    list-style: none;
    padding: 4px 16px;
    margin: 0;
    background: #fff;
    border: 1px solid #4b3144;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.vehicle-summary__list[hidden] {
    display: none;
}

/* Each row mirrors the old active card: plate (left) / title+meta (flex-grow) / remove (right).
   The plate + text together form a single "open this vehicle" button. */
.vehicle-summary__item {
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 4px 0;
    border-top: 1px dashed #dedee3;
}

.vehicle-summary__item:first-child {
    border-top: none;
}

.vehicle-summary__item-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: background-color .12s ease-in, border-color .12s ease-in;
}

.vehicle-summary__item-main:hover,
.vehicle-summary__item-main:focus {
    background: #f5f5f7;
    border-color: #dedee3;
    outline: none;
}

.vehicle-summary__item-main[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Plate pill (smaller, with the GB/EU flag icon on the left) */
.vehicle-summary__item-plate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px 6px 34px;
    width: 128px;
    background: url(../images/icons/vrm-flag.png) no-repeat left center / auto 100% #ffd800;
    color: #111;
    font-family: "Charles Wright", "UKNumberPlate", Arial, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    border: 1px solid #cda300;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Placeholder for vehicles without a registration (manual selector) so text
   columns still align vertically with rows that do have a plate. */
.vehicle-summary__item-plate--placeholder {
    padding: 6px 14px;
    background: transparent;
    border: 1px dashed #c9c9cf;
    color: #999;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0;
    text-transform: none;
}

.vehicle-summary__item-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
}

.vehicle-summary__item-title {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    word-wrap: break-word;
}

.vehicle-summary__item-meta {
    display: block;
    color: #555;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* "Current" badge on the active vehicle's row */
.vehicle-summary__item-current-badge {
    flex-shrink: 0;
    padding: 2px 10px;
    background: #ffd800;
    color: #111;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Give the current row a subtle highlight */
.vehicle-summary__item--current .vehicle-summary__item-main {
    background: #fafafa;
}

/* Small circular × remove button */
.vehicle-summary__item-remove {
    align-self: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #777;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: all .12s ease-in;
}

.vehicle-summary__item-remove:hover,
.vehicle-summary__item-remove:focus {
    color: #c62828;
    background: #fce4e4;
    border-color: #f3b8b8;
}

.vehicle-summary__item-remove[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 600px) {
    .vehicle-summary__toggle {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .vehicle-summary__item-main {
        flex-wrap: wrap;
        gap: 10px;
    }

    .vehicle-summary__item-current-badge {
        margin-left: auto;
    }
}
