/**
 * KKTC Product Comparison Styles
 */

/* ==========================================================================
   Compare Page
   ========================================================================== */

.kktc-compare-page {
    margin: 2rem 0;
}

.kktc-compare-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #ff6000;
    display: inline-block;
}

/* Empty state */
.kktc-compare-empty {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #fff9f5 0%, #ffffff 50%, #f5f8ff 100%);
    border-radius: 12px;
    border: 1px solid #f0ece8;
}

.kktc-compare-empty-icon {
    margin-bottom: 16px;
}

.kktc-compare-empty p {
    margin: 0 0 8px;
    font-size: 16px;
    color: #666;
}

.kktc-compare-empty-hint {
    font-size: 13px !important;
    color: #999 !important;
}

/* Loading */
.kktc-compare-loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
    display: none;
}

.kktc-compare-loading.active {
    display: block;
}

.kktc-compare-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #FF6B35;
    border-radius: 50%;
    animation: kktc-compare-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes kktc-compare-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Comparison Table
   ========================================================================== */

.kktc-compare-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.kktc-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.kktc-compare-table th,
.kktc-compare-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0ece8;
    vertical-align: top;
    text-align: left;
}

.kktc-compare-table th {
    background: #f8f6f3;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    width: 140px;
    min-width: 140px;
}

.kktc-compare-table td {
    font-size: 14px;
    color: #333;
    min-width: 180px;
}

/* Product header row */
.kktc-compare-table .kktc-compare-product-header {
    text-align: center;
    padding: 20px 16px;
    position: relative;
}

.kktc-compare-table .kktc-compare-product-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.kktc-compare-table .kktc-compare-product-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
}

.kktc-compare-table .kktc-compare-product-name:hover {
    color: #FF6B35;
}

.kktc-compare-table .kktc-compare-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #1e1e1e;
}

.kktc-compare-table .kktc-compare-product-price del {
    color: #999;
    font-size: 13px;
    font-weight: 400;
}

.kktc-compare-table .kktc-compare-product-price ins {
    text-decoration: none;
    color: #008A0A;
}

/* WooCommerce price color inheritance */
.kktc-compare-table .kktc-compare-product-price .woocommerce-Price-amount,
.kktc-compare-table .kktc-compare-product-price bdi {
    color: inherit !important;
}

/* Remove button on product header */
.kktc-compare-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.kktc-compare-remove-btn:hover {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}

/* List items in cells */
.kktc-compare-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kktc-compare-list li {
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.kktc-compare-list li:before {
    content: "\2713";
    color: #27ae60;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 11px;
    margin-top: 2px;
}

/* Tags in cells */
.kktc-compare-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.kktc-compare-tags li {
    padding: 0;
}

.kktc-compare-tags li:before {
    display: none;
}

.kktc-compare-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f4ff;
    color: #4a6fa5;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
}

/* No data placeholder */
.kktc-compare-no-data {
    color: #ccc;
    font-style: italic;
}

/* Highlight best value (used by JS) */
.kktc-compare-highlight {
    background: rgba(39, 174, 96, 0.06);
}

/* ==========================================================================
   "Karsilastir" Toggle Button (on product cards)
   ========================================================================== */

.kktc-compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.kktc-compare-toggle:hover {
    background: #eee;
    border-color: #ccc;
}

.kktc-compare-toggle.active {
    background: #FF6B35;
    border-color: #FF6B35;
    color: #fff;
}

.kktc-compare-toggle svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   Sticky Comparison Bar
   ========================================================================== */

.kktc-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.kktc-compare-bar.visible {
    transform: translateY(0);
}

.kktc-compare-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.kktc-compare-bar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.kktc-compare-bar-icon {
    color: #FF6B35;
    display: flex;
}

.kktc-compare-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.kktc-compare-bar-thumbs {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
}

.kktc-compare-bar-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #f8f9fa;
}

.kktc-compare-bar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kktc-compare-bar-thumb-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.kktc-compare-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kktc-compare-bar-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #FF6B35;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.kktc-compare-bar-btn:hover {
    background: #e55a28;
    color: #fff !important;
}

.kktc-compare-bar-clear {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kktc-compare-bar-clear:hover {
    border-color: #dc3545;
    color: #dc3545;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.kktc-compare-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.kktc-compare-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .kktc-compare-bar-inner {
        padding: 10px 12px;
        gap: 10px;
    }

    .kktc-compare-bar-label {
        font-size: 12px;
    }

    .kktc-compare-bar-thumb {
        width: 40px;
        height: 40px;
    }

    .kktc-compare-bar-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .kktc-compare-table th {
        width: 100px;
        min-width: 100px;
        font-size: 12px;
        padding: 10px 8px;
    }

    .kktc-compare-table td {
        min-width: 150px;
        font-size: 13px;
        padding: 10px 8px;
    }

    .kktc-compare-table .kktc-compare-product-img {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .kktc-compare-bar-thumbs {
        display: none;
    }

    .kktc-compare-page-title {
        font-size: 20px;
    }
}
