/* Compare Page Styles */
.gk-compare-page {
    padding: 20px 0;
    background: var(--gk-neutral-100, #f5f5f5);
    min-height: 100vh;
}

.gk-compare-header {
    background: var(--gk-surface, #fff);
    padding: 30px 0;
    margin-bottom: 20px;
    box-shadow: var(--gk-shadow-sm, 0 2px 4px rgba(0,0,0,0.1));
    top: 0;
}

.gk-compare-header h1 {
    margin: 0 0 15px;
    font-size: 28px;
    text-align: center;
}

.gk-compare-warning {
    background: var(--gk-color-warning-100, #fff3cd);
    border: 1px solid var(--gk-warning, #ffc107);
    padding: 12px 20px;
    border-radius: var(--gk-radius-md, 6px);
    margin: 15px auto;
    color: var(--gk-text, #856404);
    text-align: center;
    max-width: 600px;
}

.gk-compare-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.gk-compare-actions button {
    padding: 10px 20px;
    border: 1px solid var(--gk-border-color, #ddd);
    background: var(--gk-surface, #fff);
    border-radius: var(--gk-radius-md, 6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--gk-duration, 0.3s);
    font-family: inherit;
    font-size: 14px;
}

.gk-compare-actions button:hover {
    background: var(--gk-neutral-50, #f8f9fa);
    border-color: var(--gk-primary, #007bff);
}

.gk-compare-actions button[data-active="true"] {
    background: var(--gk-primary, #007bff);
    color: var(--gk-white, #fff);
    border-color: var(--gk-primary, #007bff);
}

/* Table Container */
.gk-compare-table-container {
    background: var(--gk-surface, #fff);
    border-radius: var(--gk-radius-lg, 8px);
    box-shadow: var(--gk-shadow, 0 2px 8px rgba(0,0,0,0.1));
    overflow: hidden;
    margin-bottom: 40px;
}

.gk-compare-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gk-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

/* Table Header with Products */
/* Table Header with Products */
.gk-compare-table-header {
    background: var(--gk-surface, #fff);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all var(--gk-duration, 0.3s) ease;
}

.gk-compare-table-header.is-sticky {
    position: sticky;
    top: 0;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    z-index: 99;
}

/* مخفی کردن قیمت و رتبه در حالت sticky */
.gk-compare-table-header.is-sticky .product-price,
.gk-compare-table-header.is-sticky .product-rating,
.gk-compare-table-header.is-sticky .product-link {
    display: none;
}

.gk-compare-table-header.is-sticky .gk-product-header {
    padding: 10px;
}

.gk-compare-table-header.is-sticky .product-image {
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
}

.gk-compare-table-header.is-sticky .product-name {
    font-size: 12px;
    min-height: auto;
    margin-bottom: 0;
    -webkit-line-clamp: 1;
}

.gk-product-header-row {
    border-bottom: 2px solid var(--gk-border-color, #e0e0e0);
}

.gk-feature-label {
    width: 250px;
    min-width: 250px;
    background: var(--gk-neutral-50, #f8f9fa);
    padding: 20px;
    font-weight: bold;
    text-align: right;
    border-right: 1px solid var(--gk-border-color, #e0e0e0);
    vertical-align: top;
}

.gk-product-column {
    width: 300px;
    min-width: 300px;
    padding: 0;
    vertical-align: top;
    border-left: 1px solid var(--gk-border-color, #e0e0e0);
}

.gk-product-header {
    padding: 20px;
    text-align: center;
    position: relative;
    transition: all var(--gk-duration, 0.3s) ease;
}

.gk-compare-table-header.is-sticky .gk-product-header {
    padding: 10px;
}

.gk-remove-product {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: var(--gk-radius-round, 50%);
    border: none;
    background: var(--gk-danger, #dc3545);
    color: var(--gk-white, #fff);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--gk-duration, 0.3s);
    z-index: 10;
}

.gk-product-header:hover .gk-remove-product {
    opacity: 1;
}

.product-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: var(--gk-radius-md, 8px);
    overflow: hidden;
    transition: all var(--gk-duration, 0.3s) ease;
}

.gk-compare-table-header.is-sticky .product-image {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--gk-text, #333);
    line-height: 1.4;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all var(--gk-duration, 0.3s) ease;
}

.gk-compare-table-header.is-sticky .product-name {
    font-size: 14px;
    min-height: 34px;
    margin-bottom: 5px;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--gk-success, #28a745);
    margin: 0 0 10px;
    transition: all var(--gk-duration, 0.3s) ease;
}

.gk-compare-table-header.is-sticky .product-price {
    font-size: 16px;
    margin-bottom: 5px;
}

.product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0 0 15px;
    font-size: 14px;
    transition: all var(--gk-duration, 0.3s) ease;
}

.gk-compare-table-header.is-sticky .product-rating {
    font-size: 12px;
    margin-bottom: 8px;
}

.product-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--gk-primary, #007bff);
    color: var(--gk-white, #fff);
    text-decoration: none;
    border-radius: var(--gk-radius-sm, 4px);
    font-size: 14px;
    transition: all var(--gk-duration, 0.3s);
}

.product-link:hover {
    background: var(--gk-primary-600, #0056b3);
}

/* Empty Slot */
.gk-empty-slot {
    background: var(--gk-neutral-100, #f9f9f9);
}

.gk-empty-slot-content {
    padding: 40px 20px;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gk-add-product {
    background: none;
    border: 2px dashed var(--gk-neutral-500, #6c757d);
    border-radius: var(--gk-radius-md, 8px);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--gk-neutral-500, #6c757d);
    transition: all var(--gk-duration, 0.3s);
    padding: 30px;
    width: 100%;
    height: 100%;
}

.gk-add-product:hover {
    border-color: var(--gk-primary, #007bff);
    color: var(--gk-primary, #007bff);
    background: rgba(0, 123, 255, 0.05);
}

.gk-add-product .icon {
    font-size: 48px;
    line-height: 1;
}

.gk-add-product .text {
    font-size: 16px;
    font-weight: 500;
}

/* Table Body */
.gk-compare-table tbody tr {
    border-bottom: 1px solid var(--gk-border-color, #e0e0e0);
    transition: background var(--gk-duration, 0.3s);
}

.gk-compare-table tbody tr:hover {
    background: var(--gk-neutral-50, #f8f9fa);
}

.gk-compare-table tbody tr.hidden-row {
    display: none;
}

.gk-compare-table td {
    padding: 15px;
    text-align: center;
    border-left: 1px solid var(--gk-border-color, #e0e0e0);
}

.gk-compare-table td:first-child {
    text-align: right;
    font-weight: 500;
    background: var(--gk-neutral-50, #f8f9fa);
}

.section-header td {
    background: var(--gk-primary, #007bff);
    color: var(--gk-white, #fff);
    padding: 15px;
    text-align: right;
    font-size: 18px;
    font-weight: bold;
    border: none;
}

.empty-cell {
    background: var(--gk-neutral-100, #f9f9f9);
    color: var(--gk-neutral-500, #999);
}

/* Modal */
.gk-compare-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--gk-z-modal, 9999);
}

.gk-compare-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gk-surface, #fff);
    border-radius: var(--gk-radius-lg, 12px);
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: var(--gk-danger, #dc3545);
    color: var(--gk-white, #fff);
    font-size: 24px;
    border-radius: var(--gk-radius-round, 50%);
    cursor: pointer;
}

.modal-content h2 {
    margin: 0 0 20px;
    font-size: 24px;
    text-align: center;
}

.modal-search input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--gk-border-color, #e0e0e0);
    border-radius: var(--gk-radius-md, 8px);
    font-size: 16px;
    transition: border-color var(--gk-duration, 0.3s);
}

.modal-search input:focus {
    outline: none;
    border-color: var(--gk-primary, #007bff);
}

.modal-results {
    margin-top: 20px;
}

.modal-results .loading {
    text-align: center;
    padding: 40px;
    color: var(--gk-neutral-500, #6c757d);
}

.modal-results .no-results {
    text-align: center;
    padding: 40px;
    color: var(--gk-neutral-500, #6c757d);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--gk-border-color, #e0e0e0);
    border-radius: var(--gk-radius-md, 8px);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--gk-duration, 0.3s);
}

.search-result-item:hover {
    border-color: var(--gk-primary, #007bff);
    background: var(--gk-neutral-50, #f8f9fa);
}

.search-result-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--gk-radius-sm, 4px);
}

.search-result-info {
    flex: 1;
    text-align: right;
}

.search-result-info h4 {
    margin: 0 0 5px;
    font-size: 16px;
}

.search-result-info .price {
    color: var(--gk-success, #28a745);
    font-weight: bold;
}

.search-result-info .stock {
    font-size: 12px;
    color: var(--gk-neutral-500, #6c757d);
}

/* Empty State */
.gk-compare-empty {
    padding: 80px 0;
}

.empty-state {
    text-align: center;
    background: var(--gk-surface, #fff);
    padding: 60px 40px;
    border-radius: var(--gk-radius-lg, 12px);
    box-shadow: var(--gk-shadow, 0 2px 8px rgba(0,0,0,0.1));
}

.empty-state .icon {
    font-size: 80px;
    display: block;
    margin-bottom: 20px;
}

.empty-state h2 {
    margin: 0 0 15px;
    font-size: 24px;
}

.empty-state p {
    color: var(--gk-neutral-500, #6c757d);
    margin-bottom: 30px;
}

.empty-state .button {
    display: inline-block;
    padding: 12px 30px;
    background: var(--gk-primary, #007bff);
    color: var(--gk-white, #fff);
    text-decoration: none;
    border-radius: var(--gk-radius-md, 6px);
    transition: background var(--gk-duration, 0.3s);
}

.empty-state .button:hover {
    background: var(--gk-primary-600, #0056b3);
}

/* Responsive */
@media (max-width: 1200px) {
    .gk-feature-label {
        width: 200px;
        min-width: 200px;
    }

    .gk-product-column {
        width: 250px;
        min-width: 250px;
    }
}

@media (max-width: 992px) {
    .gk-compare-table-header {
        top: 130px;
    }

    .gk-compare-table-header.is-sticky {
        top: 70px;
    }

    .product-image {
        width: 120px;
        height: 120px;
    }

    .gk-compare-table-header.is-sticky .product-image {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .gk-compare-header {
        padding: 20px 0;
    }

    .gk-compare-header h1 {
        font-size: 24px;
    }

    .gk-compare-actions {
        flex-direction: column;
        align-items: center;
    }

    .gk-compare-actions button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .gk-compare-table-header {
        top: 120px;
    }

    .gk-compare-table-header.is-sticky {
        top: 60px;
    }

    .gk-feature-label {
        width: 150px;
        min-width: 150px;
        padding: 12px;
        font-size: 14px;
    }

    .gk-product-column {
        width: 200px;
        min-width: 200px;
    }

    .gk-product-header {
        padding: 15px;
    }

    .product-image {
        width: 100px;
        height: 100px;
    }

    .gk-compare-table-header.is-sticky .product-image {
        width: 50px;
        height: 50px;
    }

    .product-name {
        font-size: 14px;
        min-height: 38px;
    }

    .gk-compare-table-header.is-sticky .product-name {
        font-size: 12px;
        min-height: 28px;
    }

    .product-price {
        font-size: 16px;
    }

    .product-link {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .gk-compare-table-header {
        top: 110px;
    }

    .gk-compare-table-header.is-sticky {
        top: 50px;
    }

    .gk-feature-label {
        width: 120px;
        min-width: 120px;
        padding: 10px;
        font-size: 13px;
    }

    .gk-product-column {
        width: 180px;
        min-width: 180px;
    }

    .gk-product-header {
        padding: 10px;
    }

    .product-image {
        width: 80px;
        height: 80px;
    }

    .gk-compare-table-header.is-sticky .product-image {
        width: 40px;
        height: 40px;
    }

    .product-name {
        font-size: 13px;
        min-height: 32px;
    }

    .gk-compare-table-header.is-sticky .product-name {
        font-size: 11px;
        min-height: 22px;
    }

    .product-price {
        font-size: 14px;
    }

    .product-rating {
        font-size: 12px;
    }

    .gk-compare-table td {
        padding: 10px;
        font-size: 13px;
    }
}
