﻿/* ============================================
   TOYOTA QUOTE SYSTEM - BASE STYLES
   Common structure, layout, and animations
   ============================================ */

/* ============================================
   BASE LAYOUT
   ============================================ */
.qp-quote-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.qp-quote-header {
    padding: 0.75rem;
}

.qp-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .qp-header-content.qp-sticky {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        padding: 0.75rem 1.25rem;
        border: none;
        animation: qp-slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
    }

/* Quote Number Badge */
.qp-quote-number {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .qp-quote-number:hover {
        transform: none;
    }

/* Broker Info */
.qp-broker-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.qp-consultant-info {
    display: flex;
    align-items: center;
    padding-left: 0.75rem;
    margin-left: 0.75rem;
    font-size: 0.875rem;
}

.qp-consultant-code {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.qp-quote-content {
    flex: 1;
    overflow: hidden;
    padding: 0.75rem;
}

.qp-quote-grid {
    display: grid;
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
    gap: 0.75rem;
    height: 100%;
    margin: 0 auto;
}

    /* Collapsed States */
    .qp-quote-grid.left-collapsed {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    .qp-quote-grid.right-collapsed {
        grid-template-columns: minmax(320px, 400px) 60px;
    }

    .qp-quote-grid.left-collapsed.right-collapsed {
        grid-template-columns: 60px 1fr 60px;
    }

/* ============================================
   PANELS
   ============================================ */
.qp-left-panel,
.qp-right-panel {
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qp-panel-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .qp-panel-header h3 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 700;
    }

.qp-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Collapse Button */
.qp-btn-collapse {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

/* Collapsed Indicators */
.qp-collapsed-indicator {
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

    .qp-collapsed-indicator i {
        font-size: 1.5rem;
        writing-mode: horizontal-tb;
    }

    .qp-collapsed-indicator span {
        font-weight: 600;
        font-size: 0.875rem;
    }

/* ============================================
   TABS
   ============================================ */
.qp-tab-buttons {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.qp-tab-button {
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 600;
}

.qp-tab-content {
    flex: 1;
    overflow-y: auto;
}

/* ============================================
   VALIDATION CONTAINER
   ============================================ */
.qp-quote-validation-container {
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 1rem;
}

.qp-quote-validation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

.qp-quote-validation-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .qp-quote-validation-icon-wrapper i {
        font-size: 1.25rem;
    }

.qp-quote-validation-header-text h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.qp-quote-validation-header-text p {
    margin: 0.5rem 0 0;
    font-size: 0.9375rem;
}

.qp-quote-validation-body {
    padding: 1.5rem;
}

.qp-quote-validation-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.qp-quote-validation-field-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    animation: qp-slideIn 0.3s ease-out forwards;
    animation-delay: calc(var(--animation-order) * 0.1s);
    opacity: 0;
}

.qp-quote-validation-field-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .qp-quote-validation-field-icon i {
        font-size: 1rem;
    }

.qp-quote-validation-field-text {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes qp-slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes qp-slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes qp-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes qp-toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes qp-toast-progress {
    from {
        width: 100%;
    }

    to {
        width: 0;
    }
}

@keyframes pulse-marker {
    0%, 100% {
        box-shadow: 0 0 20px rgba(235, 10, 30, 0.6);
    }

    50% {
        box-shadow: 0 0 30px rgba(235, 10, 30, 0.8);
    }
}

/* ============================================
   MODAL STRUCTURE
   ============================================ */
.qp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: qp-fadeIn 0.2s ease-out;
}

.qp-modal {
    border-radius: 0.75rem;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: qp-slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
}

.qp-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

    .qp-modal-title h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
    }

    .qp-modal-title i {
        font-size: 1.125rem;
    }

.qp-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.qp-modal-footer {
    padding: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.qp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.qp-btn-icon {
    padding: 0.625rem;
    width: 40px;
    height: 40px;
    justify-content: center;
}

.qp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.qp-form-group {
    margin-bottom: 1.25rem;
}

    .qp-form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9375rem;
        font-weight: 600;
    }

.qp-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

    .qp-form-control:focus {
        outline: none;
    }

.form-select,
.form-control {
    transition: all 0.2s ease;
}

    .form-select:focus,
    .form-control:focus {
        outline: none;
    }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.qp-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

.qp-toast {
    display: flex;
    align-items: center;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    pointer-events: auto;
    animation: qp-toast-slide-in 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.qp-toast-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qp-toast-content {
    flex: 1;
}

.qp-toast-message {
    line-height: 1.5;
    font-weight: 500;
}

.qp-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: qp-toast-progress linear forwards;
}

/* ============================================
   QUOTE DETAILS STRUCTURE
   ============================================ */
.products-container {
    padding: 1.5rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

    .section-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
    }

    .section-header p {
        margin: 0;
        font-size: 0.9375rem;
    }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: var(--sp-4, 1rem);
}

.product-card-main {
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .product-card-main .icon-container {
        width: 48px;
        height: 48px;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1rem;
    }

        .product-card-main .icon-container i {
            font-size: 1.5rem;
        }

    .product-card-main .product-title {
        font-size: 1.125rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
    }

    .product-card-main .product-description {
        font-size: 0.9375rem;
        line-height: 1.5;
        margin: 0;
    }

.qd-container {
    padding: 1.5rem;
}

.qd-header {
    margin-bottom: 2rem;
}

.qd-section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.qd-section-title p {
    margin: 0;
    font-size: 0.9375rem;
}

.qd-unsaved-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.qd-unsaved-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qd-unsaved-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.qd-unsaved-message {
    font-size: 0.875rem;
    margin: 0;
}

.qd-item-card {
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.qd-item-header {
    padding: 1rem 1.5rem;
}

.qd-item-type {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.qd-vehicle-info,
.qd-motorcycle-info,
.qd-household-info {
    padding: 1.5rem;
}

    .qd-vehicle-info h3,
    .qd-motorcycle-info h3,
    .qd-household-info h3 {
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
    }

.qd-variant {
    font-size: 0.9375rem;
    margin: 0 0 1rem;
}

.qd-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.qd-value {
    font-size: 1rem;
    font-weight: 700;
}

.qd-summary-panel {
    border-radius: 0.75rem;
    overflow: hidden;
    position: sticky;
    top: 1rem;
}

.qd-summary-header {
    padding: 1.25rem 1.5rem;
}

    .qd-summary-header h3 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 700;
    }

.qd-summary-row,
.qd-summary-total {
    padding: 1rem 1.5rem;
}

.qd-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 0.75rem;
}

.qd-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

    .qd-empty-icon i {
        font-size: 2rem;
    }

.qd-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.qd-empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Status Badges */
.qd-status {
    border-radius: 9999px;
    padding: 0.375rem 0.875rem;
    font-weight: 600;
    display: inline-block;
}

/* History Timeline */
.qp-history-timeline {
    position: relative;
}

    .qp-history-timeline::before {
        content: '';
        position: absolute;
        left: 19px;
        top: 0;
        bottom: 0;
        width: 2px;
    }

.qp-timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 2rem;
}

.qp-timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.qp-timeline-content {
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.qp-version-number {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.qp-version-date,
.qp-version-author {
    font-size: 0.875rem;
    margin: 0;
}

.qp-change-item {
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.75rem;
    transition: all 0.2s ease;
}

.qp-change-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.qp-change-description {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.qp-old-value,
.qp-new-value {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.qp-change-meta {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

/* Back Button */
.back-button {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.qp-panel-content::-webkit-scrollbar,
.qp-tab-content::-webkit-scrollbar,
.qp-modal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.qp-panel-content::-webkit-scrollbar-track,
.qp-tab-content::-webkit-scrollbar-track,
.qp-modal-body::-webkit-scrollbar-track {
    border-radius: 4px;
}

.qp-panel-content::-webkit-scrollbar-thumb,
.qp-tab-content::-webkit-scrollbar-thumb,
.qp-modal-body::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .qp-quote-grid {
        grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
    }
}

/* ============================================================================
   MOBILE / TABLET  (<= 1023px)  — stacked, card-based, natural page scroll.
   The desktop split-panel + collapse paradigm doesn't work on phones, so here
   the workspace becomes a single scrolling column of clean cards:
     Customer Information  →  segmented tab switcher  →  active tab content.
   ============================================================================ */
@media (max-width: 1023px) {
    /* The whole page scrolls with the document — no locked viewport, no traps. */
    .qp-quote-page {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .qp-quote-content {
        overflow: visible;
        padding: var(--sp-3, 0.75rem);
    }

    .qp-quote-grid,
    .qp-quote-grid.left-collapsed,
    .qp-quote-grid.right-collapsed,
    .qp-quote-grid.left-collapsed.right-collapsed {
        grid-template-columns: 1fr;
        height: auto;
        gap: var(--sp-3, 0.75rem);
    }

    /* Each panel becomes a self-contained card */
    .qp-left-panel,
    .qp-right-panel {
        overflow: visible;
        background: var(--content-bg, #fff);
        border: 1px solid var(--border-light, rgba(0,0,0,.08));
        border-radius: var(--radius-lg, 14px);
        box-shadow: var(--elev-1, 0 1px 3px rgba(0,0,0,.08));
    }

    .qp-panel-content,
    .qp-tab-content {
        overflow-y: visible;
        height: auto;
    }

    /* Collapse controls make no sense when everything is stacked */
    .qp-btn-collapse,
    .qp-collapsed-indicator {
        display: none !important;
    }

    .qp-panel-header {
        padding: var(--sp-3, 0.9rem) var(--sp-4, 1rem);
        border-bottom: 1px solid var(--border-light, rgba(0,0,0,.06));
    }

        .qp-panel-header h3 {
            font-size: 1.02rem;
        }

    .qp-panel-content {
        padding: var(--sp-4, 1rem);
    }

    /* Header: keep the quote-number + broker on one tidy row that can wrap */
    .qp-header-content {
        flex-wrap: wrap;
        gap: var(--sp-2, 0.5rem);
        padding: var(--sp-3, 0.75rem) var(--sp-3, 0.75rem);
    }

    /* Don't let the quote header pin itself over the app top bar on scroll. */
    .qp-header-content.qp-sticky {
        position: static;
        animation: none;
        z-index: auto;
    }

    /* Tabs → full-width segmented control */
    .qp-right-panel .qp-panel-header {
        padding: var(--sp-3, 0.75rem);
    }

    .qp-tab-buttons {
        width: 100%;
        gap: 0;
        background: var(--input-bg, #f2f2f3);
        border-radius: var(--radius-md, 10px);
        padding: 4px;
    }

    .qp-tab-button {
        flex: 1;
        justify-content: center;
        border: none;
        border-radius: var(--radius-sm, 7px);
        padding: 0.6rem 0.5rem;
        min-height: 44px;
    }
}

/* Sticky segmented tabs so the switcher stays reachable while scrolling the
   list of products/details (offset for the mobile app top bar). */
@media (max-width: 1023px) {
    .qp-right-panel > .qp-panel-header {
        position: sticky;
        top: var(--topbar-h, 60px);
        z-index: var(--z-sticky, 40);
        background: var(--content-bg, #fff);
        border-radius: var(--radius-lg, 14px) var(--radius-lg, 14px) 0 0;
    }
}

@media (max-width: 480px) {
    .qp-quote-content {
        padding: var(--sp-2, 0.5rem);
    }

    .qp-panel-content {
        padding: var(--sp-3, 0.75rem);
    }

    .qp-tab-button {
        font-size: 0.82rem;
        gap: 0.35rem;
    }

    /* Keep the icon + label; just tighten so both fit two-up */
    .qp-tab-button i {
        font-size: 0.85rem;
    }

    .qp-toast-container {
        left: var(--sp-3, 0.75rem);
        right: var(--sp-3, 0.75rem);
        bottom: var(--sp-3, 0.75rem);
    }

    .qp-toast {
        min-width: 0;
        width: 100%;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .qp-btn,
    .qp-tab-buttons {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .qp-timeline-item.qp-active .qp-timeline-marker {
        animation: none;
    }
}

.qp-modal *:focus-visible {
    outline-offset: 2px;
}

/* ============================================
   TOYOTA REDESIGN — QUOTING FLOW POLISH
   Card grids for the child components
   (InsuranceOptionCards / ProductList) and the
   sticky premium summary (rail ≥1024 / dock <1024).
   Selectors are parent-qualified so they win over
   the components' inline <style> blocks.
   ============================================ */

/* --- Insurance option cards: consistent responsive card grid --- */
.insurance-options .insurance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: var(--sp-4);
    padding: var(--sp-2) 0;
}

.insurance-options .option-card {
    height: auto;
    min-height: 200px;
    border-radius: var(--radius-lg);
    box-shadow: var(--elev-1);
    transition: box-shadow var(--dur-med) var(--ease),
                transform var(--dur-med) var(--ease),
                border-color var(--dur-med) var(--ease);
}

    .insurance-options .option-card:hover {
        box-shadow: var(--elev-2);
        transform: none;
    }

/* Staggered entrance for the option cards (mirrors .tds-stagger,
   applied here because the grid lives inside a child component). */
.insurance-options .insurance-grid > .option-card {
    animation: tds-rise var(--dur-slow) var(--ease) backwards;
}

.insurance-options .insurance-grid > .option-card:nth-child(1) { animation-delay: 30ms; }
.insurance-options .insurance-grid > .option-card:nth-child(2) { animation-delay: 70ms; }
.insurance-options .insurance-grid > .option-card:nth-child(3) { animation-delay: 110ms; }
.insurance-options .insurance-grid > .option-card:nth-child(4) { animation-delay: 150ms; }
.insurance-options .insurance-grid > .option-card:nth-child(5) { animation-delay: 190ms; }
.insurance-options .insurance-grid > .option-card:nth-child(6) { animation-delay: 230ms; }
.insurance-options .insurance-grid > .option-card:nth-child(n+7) { animation-delay: 260ms; }

@media (max-width: 767px) {
    .insurance-options .option-card {
        min-height: 150px;
    }
}

/* --- Selected products: same card grid language --- */
.selected-products .product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: var(--sp-4);
    padding: var(--sp-2) 0;
    align-items: stretch;
}

.selected-products .product-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--elev-1);
    transition: box-shadow var(--dur-med) var(--ease),
                transform var(--dur-med) var(--ease);
}

    .selected-products .product-card:hover {
        box-shadow: var(--elev-2);
    }

/* --- Premium summary: sticky dock <1024px, sticky rail column ≥1024px --- */

/* The big figure reads as engineered data at every size */
.vehicle-quote .quote-summary .total-amount {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1023px) {
    .vehicle-quote .quote-summary.tds-summary-dock {
        display: block;
        position: sticky;
        bottom: 0;
        z-index: var(--z-sticky);
        background: var(--content-bg);
        border-top: 2px solid var(--toyota-red);
        box-shadow: 0 -8px 24px rgba(26, 26, 26, 0.12);
        padding: var(--sp-3) var(--sp-4);
        padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
        margin-top: auto;
    }

        .vehicle-quote .quote-summary.tds-summary-dock .summary-content {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: var(--sp-3);
            flex-wrap: wrap;
        }

    .vehicle-quote .quote-summary.tds-summary-dock .total-section {
        margin-bottom: 0;
        flex-direction: row;
        align-items: center;
        gap: var(--sp-3);
        flex: 1 1 auto;
    }

    .vehicle-quote .quote-summary.tds-summary-dock .total-label {
        margin-bottom: 0;
    }

    .vehicle-quote .quote-summary.tds-summary-dock .premium-display {
        animation: none; /* no pulsing inside the compact dock */
        padding: var(--sp-2) var(--sp-3);
    }

    .vehicle-quote .quote-summary.tds-summary-dock .action-container {
        flex: 1 1 220px;
    }

    .vehicle-quote .quote-summary.tds-summary-dock .add-quote-btn {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    /* Two-column layout: content on the left, summary rail on the right */
    .vehicle-quote .vehicle-details {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
        grid-template-rows: auto auto auto 1fr;
        gap: 0 var(--sp-5);
        align-items: start;
    }

        .vehicle-quote .vehicle-details > .vehicle-header {
            grid-column: 1 / -1;
        }

        .vehicle-quote .vehicle-details > .insurance-options-container,
        .vehicle-quote .vehicle-details > .selected-products-container {
            grid-column: 1;
            min-width: 0;
        }

    .vehicle-quote .quote-summary.tds-summary-rail {
        grid-column: 2;
        grid-row: 2 / span 3;
        display: block;
        position: sticky;
        top: var(--sp-4);
        bottom: auto; /* neutralise the global dock helper */
        align-self: start;
        margin-top: var(--sp-4);
        margin-right: var(--sp-4);
        border: 1px solid var(--border-light);
        border-top: 2px solid var(--toyota-red);
        border-radius: var(--radius-lg);
        box-shadow: var(--elev-2);
        background: var(--content-bg);
        padding: var(--sp-5);
        overflow: hidden; /* clip the decorative radial background to the rounded card */
    }

        .vehicle-quote .quote-summary.tds-summary-rail .summary-content {
            flex-direction: column;
            align-items: stretch;
            gap: var(--sp-4);
        }

        .vehicle-quote .quote-summary.tds-summary-rail .premium-display {
            justify-content: center;
        }

        .vehicle-quote .quote-summary.tds-summary-rail .add-quote-btn {
            width: 100%;
        }

        .vehicle-quote .quote-summary.tds-summary-rail .validation-errors {
            position: static;
            width: 100%;
            margin-top: var(--sp-3);
        }

            .vehicle-quote .quote-summary.tds-summary-rail .validation-errors::after {
                display: none;
            }
}

/* ============================================================================
   WORKSPACE POLISH — shared (all sizes). Token-only; colour comes from the
   theme files so both dark & light stay correct. These refine typography,
   hierarchy and contrast without touching any @code-referenced class names.
   ============================================================================ */

/* Panel headings read as engineered section labels */
.qp-panel-header h3 {
    font-family: var(--font-display);
    letter-spacing: 0.01em;
}

/* The two workspace tabs sit as one tidy switcher on every size */
.qp-tab-buttons {
    align-items: stretch;
}

.qp-tab-button {
    font-family: var(--font-display);
    letter-spacing: 0.01em;
    min-height: var(--touch-target);
    transition: background-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease);
}

/* Vehicle-flow section titles ("Insurance Options", "Selected Products") */
.vehicle-quote .section-title {
    font-family: var(--font-display);
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* Contrast guardrail: the quiet helper lines must clear WCAG AA on charcoal.
   --text-secondary already resolves to a legible value on both themes; pin the
   quoting-flow helpers to it so none inherit a too-faint grey. */
.vehicle-quote .section-header p,
.vehicle-quote .search-hint,
.vehicle-quote .no-results-content span {
    color: var(--text-secondary);
}

/* Details-tab premium/summary figures read as tabular engineered data */
.qd-value,
.qd-summary-total,
.qd-summary-row {
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   DESKTOP (>=1024px) — keep the workspace centred and comfortable, panels as
   clean cards with a natural max reading width. No fixed pixel widths that
   could trap narrow viewports (the grid tracks are all minmax()).
   ============================================================================ */
@media (min-width: 1024px) {
    .qp-quote-grid {
        max-width: var(--content-max, 1440px);
    }

    .qp-panel-header {
        padding: var(--sp-4) var(--sp-5);
    }
}
