﻿/* Phase 2.0F.4C.3 - final mobile shortlist containment.
   Grid and block items already stretch automatically. Using width: 100% on nested
   padded panels made their content box equal to the parent width in the live mobile
   layout, which pushed the border box and its controls beyond the viewport. */

@media (max-width: 760px) {
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] {
        inline-size: auto !important;
        width: auto !important;
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;
        overflow-x: clip;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-overview,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-cards,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-cards > .shortlist-car-card,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-cards > [data-shortlist-card-layout="responsive"] {
        box-sizing: border-box !important;
        inline-size: auto !important;
        width: auto !important;
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;
        margin-inline: 0 !important;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-overview,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-cards {
        justify-self: stretch;
        align-self: stretch;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-cards {
        grid-template-columns: minmax(0, 1fr) !important;
        justify-items: stretch;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-cards > [data-shortlist-card-layout="responsive"] {
        justify-self: stretch !important;
        contain: layout inline-size;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-topline,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-car-card-head,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-scores,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-summary,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-progress,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-actions {
        box-sizing: border-box;
        inline-size: auto !important;
        width: auto !important;
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-topline > *,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-car-card-head > *,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-scores > *,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-summary > *,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-progress > *,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-actions > * {
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-remove-action {
        justify-self: end;
        max-width: 2.75rem !important;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-card-actions .btn,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-fit,
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] .shortlist-score {
        inline-size: 100%;
        width: 100%;
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;
    }
}

/* Phase 2.0F.4C.3.5 - constrain the shortlist page parent grid.
   The cards were constrained, but the shortlist page's implicit grid
   column could still expand to a child's intrinsic width. */
@media (max-width: 760px) {
    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .shortlist-page[data-shortlist-responsive="phase-2f4c2"] > * {
        box-sizing: border-box !important;
        inline-size: auto !important;
        width: auto !important;
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;
    }
}
