/* 
 * Product Comparison Page Styles
 */

.product-compare-page {
    padding-top: 120px;
    padding-bottom: 80px;
}

.compare-header {
    text-align: center;
    margin-bottom: 40px;
}

.compare-description {
    color: #666;
    font-size: 16px;
    max-width: 600px;
    margin: 20px auto 0;
}

.compare-table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    position: relative;
    border: 1px solid #ebebeb;
}

.compare-search-section {
    margin: 30px auto 40px;
    max-width: 800px;
}

.search-box-wrapper {
    position: relative;
}

.search-box-wrapper input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #eee;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-box-wrapper input:focus {
    border-color: #ED7E19;
    box-shadow: 0 5px 15px rgba(237, 126, 25, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 18px;
}

.search-results-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
    display: none;
    border: 1px solid #eee;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f9f9f9;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #fdf5ef;
}

.search-result-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.result-info {
    flex: 1;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.result-code {
    font-size: 12px;
    color: #888;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #888;
}

.global-see-more-wrapper {
    text-align: center;
    padding: 20px;
    background: #fdfdfd;
    border-top: 1px solid #f0f0f0;
}

.compare-table {
    /* width: 100%; */
    border-collapse: collapse;
    min-width: 800px;
    table-layout: fixed;
}

.compare-table th,
.compare-table td {
    padding: 20px;
    border: 1px solid #f0f0f0;
    text-align: center;
    vertical-align: middle;
    font-size: 16px;
}

.compare-table .sticky-col {
    position: sticky;
    left: 0;
    background: #f9f9f9;
    z-index: 10;
    text-align: left;
    width: 250px;
    font-weight: 600;
    color: #333;
    border-right: 2px solid #eee;
}

.compare-table .group-title {
    background: #fdfdfd;
}

.compare-table .section-divider td {
    background: #f1f1f1;
    font-weight: 700;
    text-align: left;
    padding: 12px 20px;
    color: #ED7E19;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 4px solid #ED7E19;
    position: relative;
    z-index: 5;
}

.compare-table .section-divider td span {
    position: sticky;
    left: 20px;
    display: inline-block;
    z-index: 6;
}

.compare-card {
    position: relative;
    padding-top: 20px;
}

.remove-product {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fff;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #f44336;
    font-size: 12px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.remove-product:hover {
    background: #f44336;
    color: #fff;
    border-color: #f44336;
}

.compare-card .product-image-wrapper {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.product-image-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.compare-card .product-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    height: 100px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.compare-card .product-price {
    color: #ED7E19;
    font-weight: 700;
    font-size: 16px;
}

/* See More Rows Styling */
.compare-table tr[data-collapsible="true"].collapsed {
    display: none;
}

.see-more-row td {
    padding: 0 !important;
    border: none !important;
}

.see-more-btn-wrapper {
    padding: 20px 0;
    text-align: center;
    background: transparent;
    display: flex;
    justify-content: center;
}

.btn-see-more-compare {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #ED7E19;
    padding: 10px 30px;
    border-radius: 25px;
    border: 2px solid #ED7E19;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(237, 126, 25, 0.15);
}

.btn-see-more-compare:hover {
    background: #ED7E19;
    color: #fff;
    border-color: #ED7E19;
}

.btn-see-more-compare i {
    transition: transform 0.3s;
}

.btn-see-more-compare.active i {
    transform: rotate(180deg);
}

/* Slider Section */
.compare-section {
    margin-top: 60px;
}

.compare-section .section-title {
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
}

.add-products-slider-wrapper {
    position: relative;
    padding: 20px 10px;
    margin-bottom: 40px;
}

.add-products-swiper {
    padding: 20px 0px !important;
    margin: -20px -10px !important;
}

.add-product-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 12px 10px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.add-product-brand {
    font-size: 13px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 15px;
    text-align: left;
}

.add-product-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

.add-product-image-wrapper {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.add-product-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.add-product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    height: 2.8em;
    min-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: left;
    line-height: 1.4;
    color: #333;
}

.add-product-meta-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* Allow wrapping to prevent overflow */
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f9f9f9;
    min-height: 1em;
    gap: 4px;
}

.add-product-price {
    color: #ED7E19;
    font-weight: 700;
    font-size: 14px;
    /* Reduced for better fit */
    text-align: left;
    margin: 0;
}

/* Support mini compare button inside slider card */
.add-product-card .btn-compare-mini {
    padding: 0;
    gap: 5px;
    flex-shrink: 0;
    width: auto;
}

.add-product-card .compare-text {
    font-size: 12px;
    /* Reduced for better fit */
    font-weight: 500;
}

.add-product-card .compare-circle {
    width: 16px;
    /* Reduced for better fit */
    height: 16px;
}

/* Swiper Nav Custom */
.add-products-next,
.add-products-prev {
    color: #333;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    top: 50%;
}

@media (max-width: 768px) {

    .add-products-next,
    .add-products-prev {
        display: none !important;
    }
}

.add-products-next:after,
.add-products-prev:after {
    font-size: 18px;
    font-weight: bold;
}

.add-products-next:hover,
.add-products-prev:hover {
    background: #ED7E19;
    color: #fff;
}

/* Global Comparison UI Elements (Used across the site) */

.btn-compare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #fff;
    white-space: nowrap;
    cursor: pointer;
}

.btn-compare:hover {
    background: rgba(237, 126, 25, 0.05);
    border-color: #ED7E19;
    color: #ED7E19;
}

/* Prevent sticky hover on touch devices */
@media (hover: none) {
    .btn-compare:hover {
        background: #fff;
        border-color: #ddd;
        color: #333;
    }
}

.btn-compare.active {
    background-color: #ea7d19 !important;
    border-color: #ea7d19 !important;
    color: #fff !important;
}

.btn-compare.active i {
    color: #fff !important;
}

.btn-compare.active:hover {
    background-color: #d66d12 !important;
}

.btn-compare i {
    font-size: 16px !important;
    /* Reset icon size if fa-2x used */
    margin-top: 0 !important;
}

/* Mini comparison button in cards */
.btn-compare-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    user-select: none;
}

.compare-circle {
    width: 20px;
    height: 20px;
    border: 1.5px solid #666;
    border-radius: 50%;
    display: block;
    position: relative;
    transition: all 0.2s ease;
}

.compare-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.btn-compare-mini:hover .compare-circle {
    border-color: #ED7E19;
}

.btn-compare-mini.active .compare-circle {
    background: #ED7E19;
    border-color: #ED7E19;
}

.btn-compare-mini.active .compare-circle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.btn-compare-mini.active .compare-text {
    color: #ED7E19;
    font-weight: 700;
}

/* Floating comparison bar */
.compare-floating-bar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border-radius: 40px;
    padding: 10px 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    z-index: 99;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(237, 126, 25, 0.1);
}

.compare-floating-bar.show {
    transform: translateX(-50%) translateY(0);
}

.compare-info {
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.compare-info .compare-count {
    color: #ED7E19;
    font-weight: 700;
    margin-right: 2px;
    font-size: 14px;
}

.btn-compare-now {
    background: #ED7E19;
    color: #fff;
    padding: 7px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(237, 126, 25, 0.2);
    border: 1.5px solid transparent;
}

.btn-compare-now:hover {
    background: #fff;
    color: #ED7E19;
    border-color: #ED7E19;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(237, 126, 25, 0.3);
}

.btn-clear-compare {
    color: #888;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-clear-compare:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

/* Custom Modal & Notification */
.compare-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

.compare-modal {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.compare-modal-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
    font-weight: 500;
}

.compare-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.compare-modal-actions button {
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    flex: 1;
}

.btn-confirm {
    background: #ED7E19;
    color: #fff;
}

.btn-confirm:hover {
    background: #d66d12;
    transform: translateY(-2px);
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e8e8e8;
}

.compare-notification {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(60%);
    background: rgba(33, 33, 33, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    z-index: 99999;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    font-size: 13px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .product-compare-page {
        padding-top: 120px;
        padding-bottom: 40px;
    }

    .compare-table {
        min-width: 600px;
    }

    .compare-table .sticky-col {
        width: 120px;
        font-size: 13px;
        padding: 12px 10px;
    }

    .compare-table th,
    .compare-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .compare-card .product-image-wrapper {
        height: 120px;
    }

    .compare-card .product-title {
        font-size: 14px;
        height: 150px;
    }

    .compare-card .product-price {
        font-size: 12px;
    }

    .compare-table .section-divider td {
        font-size: 14px;
        padding: 8px 15px;
    }

    .compare-header h1 {
        font-size: 24px;
    }

    .compare-description {
        font-size: 14px;
        padding: 0 20px;
    }

    .compare-floating-bar {
        width: 95%;
        padding: 8px 15px;
        gap: 10px;
        bottom: 10px;
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 20px;
    }

    .compare-info {
        font-size: 12px;
    }

    .btn-compare-now {
        padding: 6px 15px;
        font-size: 12px;
    }

    .add-product-price {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .compare-table .sticky-col {
        width: 80px;
    }

    .compare-table {
        min-width: 500px;
    }

    .compare-header h1 {
        font-size: 20px;
    }

    .btn-compare {
        font-size: 12px;
        padding: 0 15px;
    }

    .compare-circle {
        width: 15px;
        height: 15px;
    }
}