/* Product Compare Modal Styles */

/* Compare Buttons */
.compare-actions {
    margin: 15px 0;
}

.add-to-compare,
.remove-from-compare,
.open-compare-modal {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    margin-right: 10px;
    text-decoration: none;
    display: inline-block;
}

.open-compare-modal:hover {
    background-color: #005a87;
}

.add-to-compare,
.remove-from-compare{
	background-color: transparent;
	background-repeat: no-repeat;
	background-size: 24px;
	border: none;
	background-position: 0px center;
    padding-left: 24px;
}

.add-to-compare{
	color: #005a87;
	background-image: url("data:image/svg+xml,%3Csvg%20%20xmlns=%22http://www.w3.org/2000/svg%22%20%20width=%2224%22%20%20height=%2224%22%20%20viewBox=%220%200%2024%2024%22%20%20fill=%22none%22%20%20stroke=%22%23005a87%22%20%20stroke-width=%221.5%22%20%20stroke-linecap=%22round%22%20%20stroke-linejoin=%22round%22%20%20%3E%3Cpath%20stroke=%22none%22%20d=%22M0%200h24v24H0z%22%20fill=%22none%22/%3E%3Cpath%20d=%22M6%206m-2%200a2%202%200%201%200%204%200a2%202%200%201%200%20-4%200%22%20/%3E%3Cpath%20d=%22M18%2018m-2%200a2%202%200%201%200%204%200a2%202%200%201%200%20-4%200%22%20/%3E%3Cpath%20d=%22M11%206h5a2%202%200%200%201%202%202v8%22%20/%3E%3Cpath%20d=%22M14%209l-3%20-3l3%20-3%22%20/%3E%3Cpath%20d=%22M13%2018h-5a2%202%200%200%201%20-2%20-2v-8%22%20/%3E%3Cpath%20d=%22M10%2015l3%203l-3%203%22%20/%3E%3C/svg%3E");

}
.remove-from-compare{
	color: #dc3545;
	background-image: url("data:image/svg+xml,%3Csvg%20%20xmlns=%22http://www.w3.org/2000/svg%22%20%20width=%2224%22%20%20height=%2224%22%20%20viewBox=%220%200%2024%2024%22%20%20fill=%22none%22%20%20stroke=%22%23dc3545%22%20%20stroke-width=%221.5%22%20%20stroke-linecap=%22round%22%20%20stroke-linejoin=%22round%22%20%20%3E%3Cpath%20stroke=%22none%22%20d=%22M0%200h24v24H0z%22%20fill=%22none%22/%3E%3Cpath%20d=%22M6%206m-2%200a2%202%200%201%200%204%200a2%202%200%201%200%20-4%200%22%20/%3E%3Cpath%20d=%22M18%2018m-2%200a2%202%200%201%200%204%200a2%202%200%201%200%20-4%200%22%20/%3E%3Cpath%20d=%22M11%206h5a2%202%200%200%201%202%202v8%22%20/%3E%3Cpath%20d=%22M14%209l-3%20-3l3%20-3%22%20/%3E%3Cpath%20d=%22M13%2018h-5a2%202%200%200%201%20-2%20-2v-8%22%20/%3E%3Cpath%20d=%22M10%2015l3%203l-3%203%22%20/%3E%3C/svg%3E");
}


.open-compare-modal {
    background-color: #28a745;
    position: relative;
}

.open-compare-modal:hover {
    background-color: #218838;
}

.compare-count {
    background-color: #fff;
    color: #28a745;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

/* Modal Styles */
.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.compare-modal.active {
    visibility: visible;
    opacity: 1;
}

.compare-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.compare-modal-content {
    position: relative;
    background: white;
    margin: 2% auto;
    max-width: 95%;
    width: 1200px;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.compare-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.compare-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.compare-modal-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.clear-compare {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.clear-compare:hover {
    background: #c82333;
}

.compare-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-modal-close:hover {
    color: #333;
}

.compare-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Compare Table */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.compare-table img {
	max-width: 150px;
	height: auto;
	display: block;
	margin: 0 auto 10px;
}

.compare-table th,
.compare-table td {
    padding: 15px;
    text-align: left;
    vertical-align: top;
	font-size: 14px;
}

.compare-table th {
    background: #f8f9fa;
    font-weight: 400;
    color: #333;
    min-width: 120px;
	text-transform: unset;
}

.compare-table td {
    background: white;
}

.compare-table tr:nth-child(odd) :is(th, td) {
    background: #d1e2ed;
}

/* Product Cards in Modal */
.compare-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.compare-product-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    background: white;
    text-align: center;
}

.compare-product-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: 15px;
}

.compare-product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.compare-product-price {
    font-size: 20px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 15px;
}

.compare-product-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.compare-product-remove:hover {
    background: #c82333;
}

/* Loading and Error States */
.compare-loading,
.compare-error,
.compare-empty {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
}

.compare-error {
    color: #dc3545;
}

.compare-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Messages */
.compare-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.compare-message-success {
    background: #28a745;
}

.compare-message-error {
    background: #dc3545;
}

.compare-message-warning {
    background: #ffc107;
    color: #333;
}

.compare-message-info {
    background: #17a2b8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Body class when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .compare-modal-content {
        margin: 5% auto;
        max-width: 98%;
    }
    
    .compare-modal-header {
        padding: 15px 20px;
    }
    
    .compare-modal-body {
        padding: 20px;
    }
    
    .compare-products {
        grid-template-columns: 1fr;
    }
    
    .compare-table {
        font-size: 14px;
    }
    
    .compare-table th,
    .compare-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .compare-modal-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .compare-modal-header h2 {
        font-size: 20px;
    }
    
    .add-to-compare,
    .remove-from-compare,
    .open-compare-modal {
        font-size: 12px;
        padding: 8px 12px;
    }
}
