/* ================================================================
   VinFast Compare Cars — Frontend Stylesheet v1.0
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@400;500;600;700;800&display=swap');

/* ── Variables & Reset ──────────────────────────────────────── */
.vfcc-wrap {
    --vfcc-blue:    #1464f4;
    --vfcc-blue-dk: #0a4ecb;
    --vfcc-text:    #111827;
    --vfcc-muted:   #6b7280;
    --vfcc-border:  #e5e7eb;
    --vfcc-bg:      #ffffff;
    --vfcc-row-bg:  #f8fafc;
    --vfcc-hdr-bg:  #e5e7eb;
    --vfcc-radius:  8px;
    --vfcc-font:    'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
}

.vfcc-wrap *,
.vfcc-wrap *::before,
.vfcc-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.vfcc-wrap {
    font-family: var(--vfcc-font);
    color: var(--vfcc-text);
    background: var(--vfcc-bg);
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 16px;
    line-height: 1.5;
}

/* ── Header Section ─────────────────────────────────────────── */
.vfcc-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.vfcc-title {
    font-size: 32px;
    font-weight: 400;
    color: var(--vfcc-text);
    line-height: 1.2;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.vfcc-subtitle {
    font-size: 13px;
    color: var(--vfcc-muted);
}

.vfcc-filter-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vfcc-filter-wrap label {
    font-size: 13px;
    color: var(--vfcc-muted);
}

.vfcc-filter-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--vfcc-border);
    border-radius: 6px;
    padding: 8px 36px 8px 14px;
    font-family: var(--vfcc-font);
    font-size: 13px;
    font-weight: 700;
    color: var(--vfcc-blue);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%231464f4' stroke-width='2' fill='none'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
    cursor: pointer;
    outline: none;
}

/* ── 3 Car Selection Cards (Slots Grid) ──────────────────────── */
.vfcc-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.vfcc-card-slot {
    background: #fff;
    border-radius: 8px;
    min-height: 200px;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Empty slot */
.vfcc-card-slot.empty {
    border: 1.5px solid var(--vfcc-blue);
    cursor: pointer;
    background: #ffffff;
}

.vfcc-card-slot.empty:hover {
    background: #f0f5ff;
    border-color: var(--vfcc-blue-dk);
}

.vfcc-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vfcc-plus-icon {
    font-size: 32px;
    font-weight: 300;
    color: #4b5563;
    line-height: 1;
}

.vfcc-empty-label {
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

/* Filled slot */
.vfcc-card-slot.filled {
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    padding: 16px 12px 20px;
    text-align: center;
}

.vfcc-remove-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    background: #1f2937;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    z-index: 2;
}

.vfcc-remove-btn:hover {
    background: #ef4444;
}

.vfcc-car-img {
    max-width: 180px;
    max-height: 110px;
    object-fit: contain;
    margin: 8px auto 12px;
    display: block;
}

.vfcc-car-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--vfcc-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.vfcc-car-price {
    font-size: 13px;
    color: var(--vfcc-muted);
    margin-bottom: 6px;
}

.vfcc-car-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--vfcc-blue);
    text-decoration: underline;
}

/* ── Sticky Top Header ──────────────────────────────────────── */
.vfcc-sticky-header {
    position: sticky;
    top: 0;
    z-index: 998;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: none;
    border-bottom: 1px solid var(--vfcc-border);
    margin-bottom: 20px;
}

.vfcc-sticky-header.active {
    display: block;
}

.vfcc-sticky-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
}

.vfcc-sticky-item {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.vfcc-sticky-thumb {
    width: 50px;
    height: 32px;
    object-fit: contain;
}

.vfcc-sticky-info {
    flex: 1;
    min-width: 0;
}

.vfcc-sticky-title {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vfcc-sticky-price {
    font-size: 11px;
    color: var(--vfcc-muted);
}

/* ── Horizontal Navigation Tabs ────────────────────────────── */
.vfcc-nav-tabs {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--vfcc-border);
}

.vfcc-tabs-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none; /* Firefox */
}

.vfcc-tabs-scroll::-webkit-scrollbar { display: none; }

.vfcc-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 0;
    font-family: var(--vfcc-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--vfcc-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.vfcc-tab-btn:hover {
    color: var(--vfcc-text);
}

.vfcc-tab-btn.active {
    color: var(--vfcc-text);
    border-bottom-color: var(--vfcc-text);
    font-weight: 800;
}

/* ── Specifications Accordions List ─────────────────────────── */
.vfcc-accordions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.vfcc-accordion-item {
    border-radius: 6px;
    overflow: hidden;
}

.vfcc-accordion-header {
    background: #e2e8f0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s;
}

.vfcc-accordion-header:hover {
    background: #cbd5e1;
}

.vfcc-accordion-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.vfcc-accordion-chevron svg {
    width: 20px;
    height: 20px;
    stroke: #475569;
    stroke-width: 2.2;
    fill: none;
    transition: transform 0.25s ease;
}

.vfcc-accordion-item.open .vfcc-accordion-chevron svg {
    transform: rotate(180deg);
}

.vfcc-accordion-body {
    display: none;
}

.vfcc-accordion-item.open .vfcc-accordion-body {
    display: block;
}

/* Spec Rows Inside Accordion */
.vfcc-spec-rows {
    display: flex;
    flex-direction: column;
}

.vfcc-spec-row {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f1f5f9;
}

.vfcc-spec-row.highlight-diff {
    background: #fefce8 !important; /* Soft yellow tint for differences */
}

.vfcc-spec-label {
    background: #f8fafc;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

.vfcc-spec-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #ffffff;
}

.vfcc-spec-col {
    padding: 14px 20px;
    font-size: 13.5px;
    color: #1e293b;
    border-right: 1px solid #f1f5f9;
    line-height: 1.5;
    word-break: break-word;
}

.vfcc-spec-col:last-child {
    border-right: none;
}

.vfcc-disclaimer {
    text-align: center;
    font-size: 12px;
    color: var(--vfcc-muted);
    margin: 30px 0 20px;
}

/* ── Modal Popup (Selection up to 3 cars) ───────────────────── */
.vfcc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: vfccFadeIn 0.2s ease;
}

@keyframes vfccFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vfcc-modal-card {
    background: #ffffff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 28px 32px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.vfcc-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    transition: color 0.18s;
}

.vfcc-modal-close:hover {
    color: #111827;
}

.vfcc-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--vfcc-text);
    margin-bottom: 24px;
}

.vfcc-modal-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 24px;
    flex: 1;
}

.vfcc-group-title {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--vfcc-border);
}

.vfcc-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vfcc-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.vfcc-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    accent-color: var(--vfcc-blue);
    cursor: pointer;
}

.vfcc-checkbox-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.vfcc-modal-footer {
    display: flex;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--vfcc-border);
}

.vfcc-modal-submit-btn {
    background: #6b7280;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 48px;
    font-family: var(--vfcc-font);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.18s;
}

.vfcc-modal-submit-btn.active {
    background: #1f2937;
    cursor: pointer;
}

.vfcc-modal-submit-btn.active:hover {
    background: #111827;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
    .vfcc-cards-grid {
        grid-template-columns: 1fr;
    }
    .vfcc-modal-cols {
        grid-template-columns: 1fr;
    }
    .vfcc-sticky-inner {
        grid-template-columns: 1fr;
    }
}
