/* ===========================================
   COMPARE PAGE STYLES
=========================================== */

/* Generic Layout */
.product_single_layout {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 0 10px;
}

.product_single_grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: flex-start;
}

@media (max-width: 992px) {
    .product_single_grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Mobile: Move sidebar to bottom */
@media (max-width: 768px) {
    .product_single_grid {
        display: flex;
        flex-direction: column;
    }
    
    .product_single_grid > div:first-child {
        order: 1;
    }
    
    .compare_sidebar_wrapper {
        order: 2;
    }
}

.product_card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15,23,42,0.06);
    padding: 14px 16px;
    margin-bottom: 14px;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Breadcrumb - Using global product_breadcrumb styles from product_single_view.css */

/* Compare Header */
.compare_header_title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 3px;
}

.compare_header_sub {
    font-size: 0.82rem;
    color: #6b7280;
}

/* Top Variant Cards */
.compare_top_section {
    padding-bottom: 8px;
}

.compare_top_cards_row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

/* On mobile: No scroll if 2 or fewer items */
@media (max-width: 768px) {
    .compare_top_cards_row.compare_2_items {
        overflow-x: visible;
        flex-wrap: wrap;
    }
    
    .compare_top_cards_row.compare_2_items .compare_car_card {
        flex: 1 1 calc(50% - 6px);
        min-width: calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
    
    .compare_top_cards_row.compare_1_item .compare_car_card {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }
}

.compare_top_cards_row::-webkit-scrollbar {
    height: 6px;
}

.compare_top_cards_row::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.compare_car_card {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 12px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
}

.compare_car_card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    /* Only apply min-width for 3+ items (allows scrolling) */
    .compare_top_cards_row.compare_3_items .compare_car_card,
    .compare_top_cards_row:not(.compare_1_item):not(.compare_2_items) .compare_car_card {
        min-width: 85%;
    }
    
    .compare_car_imgwrap {
        height: 70px;
        margin-bottom: 6px;
    }
    
    .compare_car_brandmodel {
        font-size: 0.85rem;
    }
    
    .compare_car_variant {
        font-size: 0.75rem;
    }
    
    .compare_car_price {
        font-size: 0.88rem;
    }
}

.compare_car_imgwrap {
    border-radius: 10px;
    overflow: hidden;
    background: #0f172a;
    margin-bottom: 8px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare_car_imgwrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.compare_car_brandmodel {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}

.compare_car_variant {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.compare_car_price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.compare_car_price small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #6b7280;
    margin-top: 2px;
}

.compare_car_meta {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

.compare_car_link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.compare_car_link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Sticky Header */
.compare_sticky_header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(15,23,42,0.12);
    z-index: 99999;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
    border-bottom: 2px solid #e5e7eb;
}

.compare_sticky_header.show {
    transform: translateY(0);
}

.compare_sticky_inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    align-items: center;
}

.compare_sticky_inner::-webkit-scrollbar {
    height: 4px;
}

.compare_sticky_inner::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.compare_sticky_item {
    flex: 1 1 0;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.compare_sticky_item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.compare_sticky_item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: #0f172a;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .compare_sticky_header {
        padding: 0;
    }
    
    .compare_sticky_inner {
        padding: 8px 10px;
        gap: 6px;
        max-width: 100%;
    }
    
    .compare_sticky_item {
        min-width: 140px;
        max-width: 140px;
        padding: 6px 8px;
        gap: 6px;
        flex-shrink: 0;
    }
    
    .compare_sticky_item img {
        width: 28px;
        height: 28px;
    }
    
    .compare_sticky_name {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    .compare_sticky_price {
        font-size: 0.7rem;
    }
    
    .compare_sticky_content {
        gap: 1px;
    }
}

.compare_sticky_content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compare_sticky_name {
    font-size: 0.8rem;
    color: #111827;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.compare_sticky_price {
    font-size: 0.85rem;
    color: #059669;
    font-weight: 700;
    line-height: 1.2;
}

.compare_sticky_spacer {
    height: 70px;
}

@media (max-width: 768px) {
    .compare_sticky_spacer {
        height: 60px;
    }
}

/* Specs Grid (Modern Row/Column Layout) */
.compare_specs_title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #2563eb;
}

.compare_specs_grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.compare_specs_row {
    display: grid;
    grid-template-columns: 200px repeat(auto-fit, minmax(150px, 1fr));
    gap: 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.compare_specs_row:last-child {
    border-bottom: none;
}

.compare_specs_row:hover {
    background-color: #f9fafb;
}

.compare_specs_row.compare_specs_header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid #1d4ed8;
}

.compare_specs_row.compare_specs_header:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.compare_specs_label_col {
    padding: 14px 16px;
    font-weight: 600;
    color: #111827;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    position: sticky;
    left: 0;
    z-index: 2;
}

.compare_specs_row.compare_specs_header .compare_specs_label_col {
    background: transparent;
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.compare_specs_row:hover .compare_specs_label_col {
    background: #f3f4f6;
}

.compare_specs_row.compare_specs_header:hover .compare_specs_label_col {
    background: transparent;
}

.compare_specs_value_col {
    padding: 14px 16px;
    color: #4b5563;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-right: 1px solid #f3f4f6;
}

.compare_specs_value_col:last-child {
    border-right: none;
}

.compare_specs_row.compare_specs_header .compare_specs_value_col {
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.compare_specs_variant_name {
    font-weight: 600;
    font-size: 0.95rem;
}

.compare_specs_row_price .compare_specs_value_col {
    font-weight: 700;
    color: #059669;
    font-size: 1rem;
}

.compare_specs_row_price .compare_specs_label_col {
    font-weight: 700;
}

.compare_note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 16px;
    font-style: italic;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #2563eb;
}

@media (max-width: 768px) {
    .compare_specs_grid {
        border: none;
        border-radius: 0;
        gap: 12px;
    }
    
    .compare_specs_row {
        display: flex;
        flex-direction: column;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .compare_specs_row.compare_specs_header {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        border: none;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    }
    
    .compare_specs_row.compare_specs_header .compare_specs_label_col {
        display: none;
    }
    
    .compare_specs_row.compare_specs_header .compare_specs_value_col {
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        text-align: center;
    }
    
    .compare_specs_row.compare_specs_header .compare_specs_value_col::before {
        display: none;
    }
    
    .compare_specs_row.compare_specs_header .compare_specs_value_col:last-child {
        border-bottom: none;
    }
    
    .compare_specs_label_col {
        padding: 12px 16px;
        font-size: 0.9rem;
        font-weight: 700;
        background: #f9fafb;
        border-right: none;
        border-bottom: 2px solid #e5e7eb;
        color: #111827;
        position: static;
    }
    
    .compare_specs_value_col {
        padding: 12px 16px;
        font-size: 0.9rem;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
        background: #ffffff;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
    
    .compare_specs_value_col:last-child {
        border-bottom: none;
    }
    
    .compare_specs_value_col::before {
        content: attr(data-variant-name);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.8rem;
        flex-shrink: 0;
        min-width: 100px;
    }
    
    .compare_specs_value_col > * {
        text-align: right;
        font-weight: 500;
        flex: 1;
    }
    
    .compare_specs_row_price .compare_specs_value_col {
        font-weight: 700;
    }
    
    .compare_specs_row_price .compare_specs_value_col > * {
        color: #059669;
        font-size: 0.95rem;
    }
}

/* Features Grid (Modern Row/Column Layout) */
.compare_features_title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #2563eb;
}

.compare_feature_section_title {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    margin: 24px 0 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 4px solid #2563eb;
}

.compare_features_grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    margin-bottom: 20px;
}

.compare_features_row {
    display: grid;
    grid-template-columns: 220px repeat(auto-fit, minmax(150px, 1fr));
    gap: 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.compare_features_row:last-child {
    border-bottom: none;
}

.compare_features_row:hover {
    background-color: #f9fafb;
}

.compare_features_row.compare_features_header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid #1d4ed8;
}

.compare_features_row.compare_features_header:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.compare_features_label_col {
    padding: 14px 16px;
    font-weight: 600;
    color: #111827;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    position: sticky;
    left: 0;
    z-index: 2;
}

.compare_features_row.compare_features_header .compare_features_label_col {
    background: transparent;
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.compare_features_row:hover .compare_features_label_col {
    background: #f3f4f6;
}

.compare_features_row.compare_features_header:hover .compare_features_label_col {
    background: transparent;
}

.compare_features_value_col {
    padding: 14px 16px;
    color: #4b5563;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-right: 1px solid #f3f4f6;
}

.compare_features_value_col:last-child {
    border-right: none;
}

.compare_features_row.compare_features_header .compare_features_value_col {
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.compare_features_variant_name {
    font-weight: 600;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .compare_features_grid {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        position: relative;
    }
    
    .compare_features_row {
        display: flex;
        flex-direction: row;
        border-bottom: 1px solid #f3f4f6;
        background: #ffffff;
        min-width: 100%;
    }
    
    .compare_features_row:last-child {
        border-bottom: none;
    }
    
    .compare_features_row.compare_features_header {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .compare_features_label_col {
        padding: 12px 14px;
        font-size: 0.85rem;
        font-weight: 700;
        background: #f9fafb;
        border-right: 1px solid #e5e7eb;
        color: #111827;
        position: sticky;
        left: 0;
        z-index: 3;
        width: 180px;
        min-width: 180px;
        max-width: 180px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .compare_features_row.compare_features_header .compare_features_label_col {
        background: transparent;
        color: #ffffff;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .compare_features_row:hover .compare_features_label_col {
        background: #f3f4f6;
    }
    
    .compare_features_row.compare_features_header:hover .compare_features_label_col {
        background: transparent;
    }
    
    /* Scrollable container for value columns */
    .compare_features_row {
        position: relative;
    }
    
    .compare_features_value_col {
        padding: 12px 14px;
        font-size: 0.85rem;
        text-align: center;
        border-right: 1px solid #f3f4f6;
        background: #ffffff;
        width: 140px;
        min-width: 140px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .compare_features_row.compare_features_header .compare_features_value_col {
        color: #ffffff;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
        background: transparent;
    }
    
    .compare_features_value_col:last-child {
        border-right: none;
    }
    
    .compare_features_value_col::before {
        display: none;
    }
    
    .compare_features_value_col > * {
        text-align: center;
    }
    
    .compare_feat_yes,
    .compare_feat_no {
        display: inline-block;
    }
    
    /* Create scrollable wrapper for value columns */
    .compare_features_grid {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
    
    .compare_features_grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .compare_features_grid::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 999px;
    }
}

.compare_feat_yes {
    color: #16a34a;
    font-weight: 600;
    font-size: 1.1rem;
}

.compare_feat_no {
    color: #dc2626;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .product_card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .compare_header_title {
        font-size: 1.05rem;
    }
    
    .compare_specs_title,
    .compare_features_title {
        font-size: 0.95rem;
    }
    
    .compare_car_imgwrap {
        height: 70px;
        margin-bottom: 4px;
    }
    
    .compare_car_brandmodel {
        font-size: 0.8rem;
    }
    
    .compare_car_variant {
        font-size: 0.72rem;
    }
    
    .compare_car_price {
        font-size: 0.85rem;
    }
    
    .compare_car_card {
        padding: 10px;
    }
}

/* Compare Button in Hero */
.hero_compare_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.hero_compare_btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.hero_compare_btn:active {
    transform: translateY(0);
}

.hero_compare_btn_icon {
    font-size: 1.1rem;
}

/* Floating Compare Widget */
.compare_floating_widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 12px;
    border: 2px solid #2563eb;
}

.compare_floating_widget.show {
    display: flex;
}

.compare_widget_count {
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.compare_widget_text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.compare_widget_btn {
    padding: 8px 16px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.compare_widget_btn:hover {
    background: #1d4ed8;
}

@media (max-width: 768px) {
    .compare_floating_widget {
        bottom: 80px;
        right: 16px;
        left: 16px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .compare_widget_text {
        text-align: center;
    }
}

