/**
 * Compare Page Styles
 * Phase 7B – Side-by-side specs comparison.
 *
 * @package Motors77_Car_Database
 */

/* Container */
.m77-compare-page-wrapper {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px 0 60px;
}

.m77-compare-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumb */
.m77-breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.m77-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.m77-breadcrumb a:hover {
    text-decoration: underline;
}

.m77-breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.m77-breadcrumb .current {
    color: #333;
}

/* Title */
.m77-compare-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 30px;
    color: #222;
}

/* Loading State */
.m77-compare-loading {
    text-align: center;
    padding: 80px 20px;
}

.m77-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: m77-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes m77-spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.m77-compare-empty {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.m77-empty-icon .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #ccc;
    margin-bottom: 20px;
}

.m77-compare-empty h2 {
    font-size: 24px;
    margin: 0 0 10px;
    color: #333;
}

.m77-compare-empty p {
    color: #666;
    margin: 0 0 20px;
}

/* Buttons */
.m77-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.m77-btn-primary {
    background: #0073aa;
    color: #fff;
}

.m77-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.m77-btn-secondary {
    background: #333;
    color: #fff;
}

.m77-btn-secondary:hover {
    background: #222;
}

.m77-btn-outline {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.m77-btn-outline:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* Sticky Header */
.m77-compare-header-sticky {
    background: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 100;
    transition: box-shadow 0.2s ease;
}

.m77-compare-header-sticky.is-sticky {
    position: sticky;
    top: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Compare Row Structure */
.m77-compare-row {
    display: flex;
    border-bottom: 1px solid #eee;
}

.m77-compare-row:last-child {
    border-bottom: none;
}

.m77-compare-label-cell {
    flex: 0 0 200px;
    padding: 12px 16px;
    font-weight: 600;
    color: #333;
    background: #fafafa;
    display: flex;
    align-items: center;
}

.m77-compare-values {
    flex: 1;
    display: flex;
}

.m77-compare-value-cell {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    color: #444;
    border-left: 1px solid #eee;
}

/* Highlight Differences */
.m77-compare-row.m77-values-differ {
    background: #fffde7;
}

.m77-compare-row.m77-values-differ .m77-compare-value-cell {
    font-weight: 600;
    color: #e65100;
}

/* Car Header Cards */
.m77-compare-header-row {
    border-bottom: 2px solid #eee;
}

.m77-compare-header-row .m77-compare-label-cell {
    background: transparent;
}

.m77-compare-cars-container {
    flex: 1;
    display: flex;
}

.m77-compare-car-card {
    flex: 1;
    padding: 20px;
    text-align: center;
    border-left: 1px solid #eee;
    position: relative;
}

.m77-compare-remove-car {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff5252;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.m77-compare-remove-car:hover {
    background: #d32f2f;
}

.m77-compare-remove-car .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.m77-compare-car-image {
    width: 120px;
    height: 80px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m77-compare-car-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.m77-compare-car-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
}

.m77-compare-car-name a {
    color: #222;
    text-decoration: none;
}

.m77-compare-car-name a:hover {
    color: #0073aa;
}

.m77-compare-car-price {
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 8px;
}

.m77-compare-car-meta {
    font-size: 13px;
    color: #666;
}

.m77-compare-car-meta .sep {
    margin: 0 6px;
}

/* ===== FILTER BAR (Phase 7-C) ===== */

.m77-compare-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-top: 0;
    flex-wrap: wrap;
}

/* Toggle Pills */
.m77-compare-toggle-group {
    display: flex;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 3px;
    flex-shrink: 0;
}

.m77-compare-toggle-btn {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.m77-compare-toggle-btn:hover {
    color: #333;
}

.m77-compare-toggle-btn.m77-toggle-active {
    background: #fff;
    color: #0073aa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Category Dropdown */
.m77-compare-category-filter {
    flex-shrink: 0;
}

.m77-compare-category-select {
    padding: 12px 36px 12px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    color: #333;
    min-width: 330px;
    height: 44px;
    box-sizing: border-box;
}

.m77-compare-category-select:hover {
    border-color: #ccc;
}

.m77-compare-category-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

/* Spec Search */
.m77-compare-spec-search {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    height: 44px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.m77-compare-spec-search:focus-within {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

.m77-compare-spec-search-icon {
    color: #999;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.m77-compare-spec-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #333;
    outline: none;
    padding: 0;
    min-width: 0;
}

.m77-compare-spec-search-input::placeholder {
    color: #999;
}

.m77-compare-spec-search-input,
.m77-compare-spec-search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.m77-compare-spec-search-clear {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.m77-compare-spec-search-clear:hover {
    background: #eee;
    color: #666;
}

.m77-compare-spec-search-clear[hidden] {
    display: none;
}

/* Share Button */
.m77-compare-share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #0073aa;
    background: #e8f4fc;
    border: 1px solid #b8dff5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.m77-compare-share-btn:hover {
    background: #d4ebf8;
    border-color: #90cdf4;
}

.m77-compare-share-btn svg {
    flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .m77-compare-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 15px;
    }

    .m77-compare-toggle-group {
        width: 100%;
        justify-content: center;
    }

    .m77-compare-toggle-btn {
        flex: 1;
        text-align: center;
    }

    .m77-compare-category-filter {
        width: 100%;
    }

    .m77-compare-category-select {
        width: 100%;
    }

    .m77-compare-spec-search {
        max-width: 100%;
    }

    .m77-compare-share-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Hide rows when filtering (classes added via JS) */
.m77-compare-row.m77-row-hidden {
    display: none !important;
}

.m77-compare-section.m77-section-hidden {
    display: none !important;
}

/* Highlight search matches */
.m77-compare-search-match {
    background: #fff3cd;
}

/* No results message */
.m77-compare-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    background: #fff;
}

/* Share button success state */
.m77-compare-share-btn.m77-share-success {
    background: #d4edda;
    border-color: #28a745;
    color: #28a745;
}

/* Sections */
.m77-compare-section {
    background: #fff;
    margin-top: -1px;
}

.m77-compare-section:last-child {
    border-radius: 0 0 8px 8px;
}

.m77-compare-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    padding: 16px 20px;
    background: #f0f0f0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s ease;
}

.m77-compare-section-title:hover {
    background: #e8e8e8;
}

.m77-compare-section-title .dashicons {
    transition: transform 0.2s ease;
}

.m77-compare-table {
    border-top: 1px solid #eee;
}

/* Column widths based on count */
.m77-compare-col-2 { flex: 0 0 50%; max-width: 50%; }
.m77-compare-col-3 { flex: 0 0 33.333%; max-width: 33.333%; }
.m77-compare-col-4 { flex: 0 0 25%; max-width: 25%; }

/* Actions */
.m77-compare-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .m77-compare-container {
        padding: 0 10px;
    }

    .m77-compare-title {
        font-size: 22px;
    }

    .m77-compare-label-cell {
        flex: 0 0 120px;
        font-size: 13px;
        padding: 10px 12px;
    }

    .m77-compare-value-cell {
        padding: 10px 8px;
        font-size: 13px;
    }

    .m77-compare-car-card {
        padding: 12px 8px;
    }

    .m77-compare-car-image {
        width: 80px;
        height: 60px;
    }

    .m77-compare-car-name {
        font-size: 13px;
    }

    .m77-compare-car-price {
        font-size: 14px;
    }

    .m77-compare-car-meta {
        font-size: 11px;
    }

    .m77-compare-section-title {
        font-size: 14px;
        padding: 12px 16px;
    }

    .m77-compare-content {
        overflow-x: auto;
    }

    .m77-compare-row {
        min-width: 600px;
    }

    .m77-compare-header-row {
        min-width: 600px;
    }
}

/* Print Styles */
@media print {
    .m77-compare-page-wrapper {
        background: #fff;
        padding: 0;
    }

    .m77-breadcrumb,
    .m77-compare-actions,
    .m77-compare-remove-car,
    .m77-compare-variant-trigger {
        display: none !important;
    }

    .m77-compare-header-sticky {
        position: static !important;
        box-shadow: none !important;
    }

    .m77-compare-section-title {
        background: #f5f5f5 !important;
    }

    .m77-compare-row.m77-values-differ {
        background: #fff8e1 !important;
    }
}

/* ===== VARIANT SELECTOR (Phase 7-A) ===== */

body.m77-modal-open {
    overflow: hidden;
}

.m77-compare-variant-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #0073aa;
    transition: background 0.2s;
    margin: 4px 0;
}

.m77-compare-variant-trigger:hover {
    background: rgba(0, 115, 170, 0.1);
}

.m77-compare-variant-name {
    font-weight: 500;
}

.m77-compare-variant-arrow {
    font-size: 16px;
    font-weight: bold;
}

.m77-compare-variant-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m77-compare-variant-modal[hidden] {
    display: none;
}

.m77-compare-variant-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.m77-compare-variant-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.m77-compare-variant-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.m77-compare-variant-modal-title {
    flex: 1;
}

.m77-compare-variant-modal-title h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.m77-compare-variant-modal-model-name {
    font-size: 14px;
    color: #666;
}

.m77-compare-variant-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.m77-compare-variant-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.m77-compare-variant-filters {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.m77-compare-filter-group {
    margin-bottom: 10px;
}

.m77-compare-filter-group:last-child {
    margin-bottom: 0;
}

.m77-compare-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.m77-compare-filter-chip {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.m77-compare-filter-chip:hover {
    border-color: #999;
}

.m77-compare-filter-chip.m77-chip-active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.m77-compare-variant-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.m77-compare-variant-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.m77-compare-variant-option:last-child {
    border-bottom: none;
}

.m77-compare-variant-option:hover {
    background: #f5f5f5;
}

.m77-compare-variant-option.m77-variant-active {
    background: #e8f4ff;
}

.m77-compare-variant-option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.m77-compare-variant-option-name {
    font-weight: 600;
    color: #0073aa;
    font-size: 14px;
}

.m77-compare-variant-option-meta {
    font-size: 12px;
    color: #666;
}

.m77-compare-variant-option-price {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}

.m77-compare-variant-loading,
.m77-compare-variant-error,
.m77-compare-variant-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.m77-compare-variant-error {
    color: #d32f2f;
}

@media (max-width: 768px) {
    .m77-compare-variant-modal {
        align-items: flex-end;
    }

    .m77-compare-variant-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }

    .m77-compare-filter-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .m77-compare-filter-chip {
        flex-shrink: 0;
    }
}

/* ===== ADD CAR SLOTS & MODAL (Phase 7-B) ===== */

/* Empty Slot Card */
.m77-compare-empty-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.m77-compare-add-car-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 140px;
    padding: 30px 20px;
    background: #f9f9f9;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.m77-compare-add-car-btn:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.m77-compare-add-car-icon {
    color: #999;
    transition: color 0.2s ease;
}

.m77-compare-add-car-btn:hover .m77-compare-add-car-icon {
    color: #0073aa;
}

.m77-compare-add-car-text {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: color 0.2s ease;
}

.m77-compare-add-car-btn:hover .m77-compare-add-car-text {
    color: #0073aa;
}

/* Add Car Modal Container */
.m77-compare-addcar-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m77-compare-addcar-modal[hidden] {
    display: none;
}

.m77-compare-addcar-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.m77-compare-addcar-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    height: 70vh;           /* Fixed height instead of max-height */
    min-height: 400px;      /* Minimum height for small screens */
    max-height: 600px;      /* Maximum height for large screens */
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Modal Header */
.m77-compare-addcar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.m77-compare-addcar-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.m77-compare-addcar-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.m77-compare-addcar-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Search Bar in Add Car Modal */
.m77-compare-addcar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    flex-shrink: 0;
}

.m77-compare-addcar-search-icon {
    color: #999;
    display: flex;
    align-items: center;
}

.m77-compare-addcar-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
    padding: 0;
}

.m77-compare-addcar-search-input::placeholder {
    color: #999;
}

.m77-compare-addcar-search-clear {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.m77-compare-addcar-search-clear:hover {
    background: #eee;
    color: #666;
}

.m77-compare-addcar-search-clear[hidden] {
    display: none;
}

/* Highlight matched text in search results */
.m77-compare-search-highlight {
    background: #fff3cd;
    font-weight: 600;
}

/* No results message */
.m77-compare-addcar-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Step Container */
.m77-compare-addcar-step {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Ensure steps properly hide when hidden attribute is set */
.m77-compare-addcar-step[hidden] {
    display: none !important;
}

/* Step Header */
.m77-compare-addcar-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.m77-compare-addcar-step-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.m77-compare-addcar-selected-brand-name,
.m77-compare-addcar-selected-model-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-left: auto;
}

/* Back Button */
.m77-compare-addcar-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: -8px;
    border-radius: 4px;
    font-size: 14px;
    color: #0073aa;
    transition: background 0.2s;
}

.m77-compare-addcar-back:hover {
    background: rgba(0, 115, 170, 0.1);
}

.m77-compare-addcar-back-arrow {
    font-size: 16px;
}

/* List Container */
.m77-compare-addcar-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;    /* Required for flex child scrolling */
}

/* Smooth scrolling */
.m77-compare-addcar-list::-webkit-scrollbar {
    width: 6px;
}

.m77-compare-addcar-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.m77-compare-addcar-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.m77-compare-addcar-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Brand Item */
.m77-compare-brand-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.m77-compare-brand-item:last-child {
    border-bottom: none;
}

.m77-compare-brand-item:hover {
    background: #f5f5f5;
}

.m77-compare-brand-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.m77-compare-brand-item-arrow {
    font-size: 18px;
    color: #999;
}

/* Model Item */
.m77-compare-model-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.m77-compare-model-item:last-child {
    border-bottom: none;
}

.m77-compare-model-item:hover {
    background: #f5f5f5;
}

.m77-compare-model-item-image {
    width: 60px;
    height: 40px;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 4px;
}

.m77-compare-model-item-placeholder {
    width: 60px;
    height: 40px;
    background: #e0e0e0;
    border-radius: 4px;
}

.m77-compare-model-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m77-compare-model-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.m77-compare-model-item-price {
    font-size: 13px;
    color: #666;
}

.m77-compare-model-item-arrow {
    font-size: 18px;
    color: #999;
}

/* Variant Filters in Add Car Modal */
.m77-compare-addcar-filters {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
}

/* Variant list container - scrollable */
.m77-compare-addcar-variant-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Variant Item in Add Car Modal */
.m77-compare-addcar-variant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.m77-compare-addcar-variant-item:last-child {
    border-bottom: none;
}

.m77-compare-addcar-variant-item:hover {
    background: #e8f4ff;
}

.m77-compare-addcar-variant-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.m77-compare-addcar-variant-item-name {
    font-weight: 600;
    color: #0073aa;
    font-size: 14px;
}

.m77-compare-addcar-variant-item-meta {
    font-size: 12px;
    color: #666;
}

.m77-compare-addcar-variant-item-price {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}

/* Loading, Error, Empty States */
.m77-compare-addcar-loading,
.m77-compare-addcar-error,
.m77-compare-addcar-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.m77-compare-addcar-error {
    color: #d32f2f;
}

/* Mobile Styles for Add Car Modal */
@media (max-width: 768px) {
    .m77-compare-addcar-modal {
        align-items: flex-end;
    }

    .m77-compare-addcar-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        height: 85vh;           /* Fixed height on mobile */
        min-height: 300px;
        max-height: none;       /* Remove max constraint */
    }

    .m77-compare-add-car-btn {
        max-width: 100px;
        padding: 20px 12px;
    }

    .m77-compare-add-car-icon svg {
        width: 36px;
        height: 36px;
    }

    .m77-compare-add-car-text {
        font-size: 12px;
    }
}

/* Print Styles - Hide empty slots and modal */
@media print {
    .m77-compare-empty-slot,
    .m77-compare-addcar-modal {
        display: none !important;
    }
}

/* Empty cells in spec rows (Phase 7-B bug fix) */
.m77-compare-empty-cell {
    background: transparent;
}
