/* Product Comparison Styles */

.compare-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Bahij', sans-serif;
}

.compare-table-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    padding: 0 0 30px 0;
    overflow-x: auto;
}

.compare-products-header {
    display: flex;
    justify-content: center;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    min-width: 600px;
}

.compare-product-col {
    flex: 1;
    text-align: center;
    border-right: 1px solid #e9ecef;
    padding: 0 0 20px 0;
    min-width: 200px;
}

.compare-product-col:last-child {
    border-right: none;
}

.compare-product-img {
    margin: 30px 0 10px 0;
}

.compare-product-img img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    background: #f8f9fa;
}

.compare-product-title {
    background: #131b4b;
    color: #ffc13b;
    font-weight: bold;
    font-size: 20px;
    padding: 12px 0;
    border-radius: 0 0 5px 5px;
    margin: 0 20px;
    word-wrap: break-word;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    background: #fff;
    min-width: 600px;
}

.compare-table tr {
    border-bottom: 1px solid #e9ecef;
}

.compare-table td {
    padding: 18px 16px;
    font-size: 16px;
    text-align: center;
    vertical-align: top;
}

.compare-table .compare-attr {
    background: #f8f9fa;
    color: #131b4b;
    font-weight: 700;
    text-align: left;
    width: 25%;
    font-size: 17px;
    min-width: 150px;
}

.compare-table td:not(.compare-attr) {
    color: #161a48;
    font-weight: 500;
    background: #fff;
    word-wrap: break-word;
    max-width: 200px;
}

.back-section {
    text-align: center;
    margin-top: 40px;
}

.back-button {
    display: inline-block;
    padding: 12px 30px;
    background: #ffc13b;
    color: #131b4b;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.back-button:hover {
    background: #e6a800;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.error-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 40px 0;
}

.error-message p {
    font-size: 18px;
    color: #495057;
    margin-bottom: 30px;
}

/* Compare Checkbox Styles */
.compare-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: scale(1.4);
    z-index: 10;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
}

.product-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {

}

/* Compare Button Styles */
.compare-bar {
    margin-top: 40px;
    text-align: right;
    padding-right: 20px;
    position: sticky;
    bottom: 20px;
    z-index: 100;
}

#compare-button {
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    background: #ccc;
    color: #666;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#compare-button.active {
    background: #ffc13b;
    color: #131b4b;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#compare-button:hover.active {
    background: #e6a800;
    transform: translateY(-2px);
}

#compare-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .compare-container {
        padding: 15px;
    }
    
    .compare-product-img img {
        width: 150px;
        height: 150px;
    }
    
    .compare-product-title {
        font-size: 18px;
        margin: 0 15px;
    }
}

@media (max-width: 900px) {
    .compare-products-header {
        flex-direction: column;
        gap: 0;
        min-width: auto;
    }
    
    .compare-product-col {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        margin-bottom: 10px;
        min-width: auto;
    }
    
    .compare-product-col:last-child {
        border-bottom: none;
    }
    
    .compare-product-img img {
        width: 140px;
        height: 140px;
    }
    
    .compare-table {
        min-width: auto;
    }
    
    .compare-table .compare-attr {
        width: 30%;
        min-width: 120px;
    }
}

@media (max-width: 600px) {
    .compare-container {
        padding: 8px;
    }
    
    .compare-product-title {
        font-size: 16px;
        margin: 0 8px;
    }
    
    .compare-table td {
        font-size: 13px;
        padding: 10px 6px;
    }
    
    .compare-table .compare-attr {
        font-size: 14px;
        min-width: 100px;
    }
    
    .compare-product-img img {
        width: 120px;
        height: 120px;
    }
    
    .compare-bar {
        text-align: center;
        padding-right: 0;
    }
    
    #compare-button {
        font-size: 16px;
        padding: 10px 20px;
    }
}

/* RTL Support */
.compare-container[dir="rtl"] .compare-table .compare-attr {
    text-align: right;
}

.compare-container[dir="rtl"] .compare-bar {
    text-align: left;
    padding-right: 0;
    padding-left: 20px;
}

.compare-container[dir="rtl"] .compare-checkbox {
    right: auto;
    left: 10px;
}

/* Loading States */
.compare-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.compare-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ffc13b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Highlight differences */
.compare-table td.highlight-diff {
    background: #fff3cd;
    color: #856404;
    font-weight: 600;
}

.compare-table td.highlight-same {
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}
