/* General styles */
body {
    background-color: #f8f9fa;
    font-family: 'Arial', sans-serif;
    padding-top: 20px;
    padding-bottom: 20px;
    overflow-x: hidden;
    font-size: 1rem;
}

.container {
    margin-bottom: 30px;
}

.comparison-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: bold;
}

.comparison-table {
    width: 100%;
    margin: 0 auto;
    table-layout: fixed;
    border-collapse: separate;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #FFFFFF;
}

.comparison-table th,
.comparison-table td {
    vertical-align: top;
    padding: 15px;
    border: 1px solid #dee2e6;
    word-wrap: break-word;
    transition: background-color 0.3s ease;
    min-width: 250px;
    text-align: center;
}

.comparison-table th {
    background: #f1f1f1;
    color: #000054;
    position: sticky;
    top: 0;
    z-index: 1100;
    font-size: 1.1em;
    border-bottom: 1px solid #dee2e6;
}

.comparison-table th i {
    margin-right: 8px;
}

.comparison-table td:hover {
    background-color: #f9f9f9;
}

/* Feature Group Styles */
.feature-group {
    text-align: left !important;
    font-weight: bold;
    padding-left: 15px;
    color: #ff00ff;
    background-color: #ff00ff !important;
    border-bottom: 2px solid #dee2e6;
    font-size: 1em;
}



.feature-group i {
    margin-right: 8px;
    color: #007bff;
    vertical-align: middle;
}

.feature-name {
    text-align: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
    font-size: 0.9em;
}

/* Product Header Styles - Horizontal Compact Layout */
.product-header {
    position: static;
    /* Let remove-btn position relative to TH */
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    text-align: left;
    padding: 5px 25px 5px 5px;
    /* Added right padding for remove button */
    flex-wrap: wrap;
    width: 100%;
}

.product-header>a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
}

.product-header img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 0;
    border: none;
    padding: 2px;
    border-radius: 6px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.product-header img:hover {
    transform: scale(1.05);
}

/* Compact Sticky Header Styles */
.comparison-table th {
    padding: 8px 6px;
    vertical-align: middle;
}

.product-header-img {
    width: 50px !important;
    height: 50px !important;
    height: 50px !important;
    max-height: 50px;
}

/* Sticky Group Header */
.feature-group-row th,
tr.feature-group td {
    position: sticky;
    top: 70px;
    /* Adjust based on main sticky header height */
    z-index: 100;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

@media (max-width: 576px) {

    .feature-group-row th,
    tr.feature-group td {
        top: 55px;
        /* Mobile header is smaller */
        font-size: 11px;
        padding: 4px !important;
    }
}

.product-header-name {
    font-size: 0.75em;
    line-height: 1.3;
    display: block;
    margin-bottom: 0;
    word-wrap: break-word;
    white-space: normal;
    flex: 1 1 auto;
    min-width: 0;
}

.product-header-price {
    font-size: 0.75em;
    margin-bottom: 0;
    color: #28a745;
    font-weight: 600;
}

/* Check Deal Button Styles - Amazon Style */
.btn-check-deal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(to bottom, #f7dfa5 0%, #f0c14b 100%);
    color: #111 !important;
    font-size: 0.8em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #a88734;
    text-decoration: none !important;
    transition: all 0.15s ease;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
    margin-top: 0;
    cursor: pointer;
    width: auto !important;
    flex: 0 0 auto;
    white-space: nowrap;
}

.btn-check-deal:hover {
    background: linear-gradient(to bottom, #f5d78e 0%, #eeb933 100%);
    border-color: #a88734;
    color: #111 !important;
}

.btn-check-deal:active {
    background: linear-gradient(to bottom, #f0c14b 0%, #e7b32e 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) inset;
}

.btn-check-deal i {
    font-size: 1.1em;
    color: #111;
}

@media (max-width: 576px) {
    .product-header {
        gap: 2px;
        flex-wrap: wrap;
        padding: 3px 18px 3px 3px;
        /* Right padding optimized for X button */
        align-content: flex-start;
    }

    .product-header>a {
        gap: 3px;
        flex: 1 1 100%;
        /* Make name header take full width of line if needed, or share */
        width: 100%;
    }

    .product-header img {
        margin-bottom: 0;
    }

    .product-header-img {
        width: 30px !important;
        height: 30px !important;
        max-height: 30px;
    }

    .product-header-name {
        font-size: 10px !important;
        line-height: 1.1 !important;
        max-height: 3.3em;
        overflow: hidden;
    }

    .product-header-price {
        font-size: 10px !important;
        width: auto;
        margin-right: auto;
        padding-left: 33px;
        /* Indent under name */
    }

    .btn-check-deal {
        font-size: 8px !important;
        padding: 0 3px;
        gap: 2px;
        height: auto;
        min-height: 16px;
        margin-top: 4px;
        line-height: title;
        width: auto !important;
        max-width: 100%;
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
        border-width: 0.5px;
    }

    .btn-check-deal i {
        display: inline-block !important;
        font-size: 8px;
        line-height: 1;
    }

    .remove-btn {
        width: 16px !important;
        height: 16px !important;
        font-size: 10px !important;
        top: 0 !important;
        right: 0 !important;
        background: rgba(255, 255, 255, 0.9);
    }

    /* Reduce Header Cell Padding */
    .comparison-table th {
        padding: 4px 2px !important;
    }

    /* Optimize Search Container */
    .product-header .search-container {
        margin-bottom: 2px !important;
        width: 100%;
    }

    .product-header .live-search {
        font-size: 9px !important;
        padding: 2px 4px;
        height: 24px;
        line-height: normal;
    }

    /* Optimize Empty/Random Product States */
    .empty-product-info img {
        width: 30px !important;
        height: 30px !important;
        max-height: 30px;
        object-fit: contain;
    }

    .empty-product-info {
        margin-bottom: 2px;
    }

    /* Random Product Title */
    .random-product-title {
        font-size: 9px !important;
        line-height: 1.1 !important;
        margin-bottom: 2px;
        white-space: normal;
        /* unexpected wrap fix */
        max-height: 2.4em;
        overflow: hidden;
    }

    /* Actions */
    .empty-product-actions .btn {
        padding: 1px 4px;
        font-size: 9px !important;
        line-height: 1.2;
    }

    .empty-product-actions .btn i {
        font-size: 10px;
    }
}


/* Remove Button Styles */
/* Remove Button Styles */
.remove-btn {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    font-size: 16px;
    color: #dc3545;
    z-index: 1200;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

/* Hover Effect for Remove Icon */
.remove-btn:hover {
    color: #ff0000;
    /* Darker red when hovered */
    cursor: pointer;
}


/* Search Container Styles */
.search-container {
    position: relative;
    width: 100%;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    z-index: 2000;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.suggestion-item:hover {
    background-color: #f1f1f1;
}

.suggestion-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 10px;
    border: none;
    border-radius: 4px;
}

.suggestion-item .product-info {
    display: flex;
    flex-direction: column;
}

.suggestion-item .product-info .name {
    font-weight: bold;
    color: #343a40;
    font-size: 0.9em;
}

.suggestion-item .product-info .price {
    color: #28a745;
    font-size: 0.8em;
}

/* Random Product Section Styles */
.random-product-section {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.random-product-section img {
    width: 80px;
    height: auto;
    object-fit: contain;
    margin-right: 20px;
    border: none;
    padding: 2px;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.random-product-section img:hover {
    transform: scale(1.05);
}

.random-product-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}



.random-product-details {
    flex-grow: 1;
    font-size: 0.6em;
}

.add-random-btn {
    font-size: 1.5em;
    color: #28a745;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.add-random-btn:hover {
    color: #218838;
}

/* Reset Button Styles */
.reset-btn {
    font-size: 0.5em;
    color: #dc3545;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
}

.reset-btn:hover {
    color: #bd2130;
}

/* Highlight Styles */
.differ {
    background-color: #ffeeba;
}

.highlight-green {
    background-color: #d4edda !important;
    border: 2px solid #28a745;
}

.highlight-red {
    background-color: #f8d7da !important;
    border: 2px solid #dc3545;
}

/* VS Icon Styles */
.vs-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 1px;
    border: 1px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background-color: green;
    color: whitesmoke;
    font-size: 0.6em;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: 550;
}

.default-heading {
    font-size: 20px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .vs-icon {
        width: 30px;
        height: 30px;
        font-size: 0.6em;
        padding: 12px;
    }
}

@media (max-width: 576px) {
    .vs-icon {
        width: 20px;
        height: 20px;
        font-size: 0.6em;
        padding: 12px;
    }

    .vs-circle {

        width: 30px !important;
        height: 30px !important;

        font-size: 12px;
        color: #007bff;
        margin: 0 1px;
    }



}

/* Swiper.js Container Styles */
.swiper-container {
    width: 100%;
    padding: 20px 0;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Swiper Navigation Button Styles */
.swiper-button-next,
.swiper-button-prev {
    color: #007bff;
}

/* Comparison Card Styles */
.comparison-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 5px;
    background-color: #fff;
    margin: 5px;
    transition: transform 0.2s;
    cursor: pointer;
    width: 400px !important;
}

.comparison-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.comparison-card img {
    max-width: 80px;
    height: auto;
    margin-bottom: 10px;
}

/* VS Circle Styles */
.vs-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #007bff;
    border-radius: 50%;
    font-size: 16px;
    color: #007bff;
    margin: 0 20px;
}

/* Phone Name Styles */
.phone-name {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 10px;
}

/* Section Title Styles */
.section-title {
    border-left: 5px solid #007bff;
    padding-left: 10px;
    background-color: #f1f1f1;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Conclusion Section Styles */
.conclusion-section {
    background-color: #ffffff;
    padding: 30px;
    margin-top: 50px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.conclusion-section h3 {
    font-size: 1.75rem;
    margin-bottom: 15px;
}

.conclusion-section h4 {
    font-size: 1.3rem;
    margin-top: 20px;
    color: green !important;
}

.pros-list {
    list-style: none;
    padding-left: 0;
}

.pros-list li {
    margin-bottom: 10px;
    font-size: 1rem;
}

.pros-list li i {
    color: #28a745;
    margin-right: 10px;
}

/* Modal Header Styles */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: none;
}

.modal-header .live-search-modal {
    flex-grow: 1;
    margin-right: 10px;
}

/* Suggestions Modal Styles */
.suggestions-modal {
    max-height: 60vh;
    overflow-y: auto;
}

.suggestions-modal .suggestion-item {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}





/* Additional Custom Styles */

/* Table Header Styles */
.comparison-title {
    font-size: 2rem;
    font-weight: bold;
}

.vs-icon {
    font-weight: bold;
    margin: 0 1px;
    color: white !important;
}

/* Responsive Adjustments for Table Header */
@media (max-width: 576px) {
    .comparison-title {
        font-size: 1.2rem;
    }

    .comparison-title img {
        width: 60px !important;
        height: auto;
    }

    .comparison-title strong {
        font-size: 1rem;
    }

    .comparison-title .price {
        margin-top: 5px;
        font-size: 0.8rem;
    }

    .comparison-table th img {
        width: 60px !important;
    }

    .comparison-table th div strong {
        font-size: 1rem;
    }

    .comparison-table th div .price {
        font-size: 0.8rem;
    }
}

/* Random Product Section Styles */
.empty-product-info img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

@media (max-width:576px) {
    .random-product-title {
        font-size: 12px !important;
    }
}

.empty-product-actions .btn-primary {
    font-size: 0.8rem;
}

/* Swiper.js Random Comparisons Styles */
.random-comparisons {
    border: 1px solid #dee2e6;
    padding: 10px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.random-comparisons .section-title {
    border-bottom: 2px solid #dc3545;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 15px;
    color: #5D5D5D;
}

.random-comparisons .comparison-card {
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: transform 0.3s;
    margin: 5px;
}

.random-comparisons .comparison-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.random-comparisons .comparison-card .phone-name {
    font-weight: bold;
    margin-top: 10px;
}

/* Swiper Pagination and Navigation Removed */
/* Swiper Pagination Customization */
.swiper-pagination-bullet {
    display: none;
}

/* Related Comparisons Heading */
.popular-comparisons h4.section-title {
    border-bottom: 2px solid #5D5D5D;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* Responsive Swiper Settings */
@media (min-width: 992px) {
    .swiper-container {
        padding: 10px 0;
    }

    .comparison-card {
        width: 400px;
        /* Adjusted width for swiper on desktop */
        padding: 10px !important;
    }
}

@media (max-width: 576px) {

    /* Ensure no Swiper styles affect mobile */
    .swiper-container {
        /* Optional: Implement a different style or behavior for mobile */
    }

    /* Use Bootstrap Carousel on mobile if needed */


    .comparison-card {
        width: 300px;
        /* Adjusted width for swiper on desktop */
        padding: 5px !important;
    }

    .swiper-container {
        padding: 5px 1px !important;
    }


    .default-heading {
        font-size: 14px;
        font-weight: 700;
    }
}

/* Additional Table Styles */
.comparison-table th,
.comparison-table td {
    vertical-align: middle;
    text-align: center;
}

.comparison-table th .product-header img {
    width: 100px;
    height: auto;
}

/* Conclusion Section Styles */
.conclusion-section h3 {
    font-size: 1.75rem;
    color: green;
}

.conclusion-section h4 {
    font-size: 1.25rem;
    color: green;
}

.conclusion-section ul.pros-list li {
    margin-left: 0;
}

/* Which is Better Section Styles */
.which-better-section h3 {
    font-size: 1.75rem;
    color: #343a40;
}

.which-better-section h4 {
    font-size: 1.25rem;
    color: #dc3545;
}

.which-better-section ul.pros-list li {
    margin-left: 0;
}

/* Popular Comparisons Swiper Container Adjustments */
.swiper-container {
    overflow: hidden;
    /* Hide scrollbar */
}

.swiper-wrapper {
    display: flex;
    transition: transform 0.3s ease;
}

.swiper-slide {
    flex: 0 0 auto;
    width: auto;
}

/* Hide Swiper.js Navigation Buttons */
.swiper-button-next,
.swiper-button-prev {
    display: none;
}

/* Updated Highlight Classes: Replaced background highlights with border highlights */
table td.border-success {
    border: 3px solid #198754 !important;
    /* Increase border width */
}

table td.border-danger {
    border: 3px solid #dc3545 !important;
    /* Increase border width */
}