/**
 * WooCommerce Product Comparison Styles
 * Separate from KC Product comparison
 */

/* ===========================================
   WooCommerce Compare Buttons
   =========================================== */
.kings-woo-compare-toggle {
    position: fixed;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    border: 0;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 9999;


    background: var(--kc-white);
    border-radius: 12px 12px 0 0;
    padding: 24px 32px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 15px;
    /* color: var(--kc-white); */

}

.kings-woo-compare-toggle.bottom-right {
    bottom: 0;
    right: 15px;
}

.kings-woo-compare-toggle.bottom-left {
    bottom: 0;
    left: 15px;
    right: auto;
}

.kings-woo-compare-toggle.top-right {
    top: 15px;
    right: 15px;
    bottom: auto;
}

.kings-woo-compare-toggle.top-left {
    top: 15px;
    left: 15px;
    right: auto;
    bottom: auto;
}

.kings-woo-compare-toggle:hover:not(:disabled),
.kings-woo-compare-toggle.is-active {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(44, 62, 80, 0.22);
}

.kings-woo-compare-toggle.has-products {
    background: #2c3e50;
    color: #ffffff;
}

.kings-woo-compare-toggle:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.kings-woo-compare-toggle-icon svg {
    width: 18px;
    height: 18px;
}

.kings-woo-compare-toggle-badge {
    min-width: 24px;
    height: 24px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0;
    border-radius: 6px;
    transform: scale(0.8);
    border: none;
}

.kings-woo-compare-toggle-badge.is-visible {
    opacity: 1;
    transform: scale(1);
}

.kings-compare-btn,
.kings-compare-btn-single {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #2c3e50;
    color: #fff;
    border: 2px solid #2c3e50;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.kings-compare-btn:hover,
.kings-compare-btn-single:hover {
    background: #34495e;
    border-color: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.kings-compare-btn.added,
.kings-compare-btn-single.added {
    background: #27ae60;
    border-color: #27ae60;
}

.kings-compare-btn.added:hover,
.kings-compare-btn-single.added:hover {
    background: #229954;
    border-color: #229954;
}

.kings-compare-btn svg,
.kings-compare-btn-single svg {
    flex-shrink: 0;
}

/* Single product button wrapper */
.kings-compare-single-wrapper {
    margin: 20px 0;
}

/* ===========================================
   WooCommerce Comparison Widget (Floating)
   =========================================== */
.kings-woo-compare-widget {
    position: fixed;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 350px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.kings-woo-compare-widget.has-products.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
}

.kings-woo-compare-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.kings-woo-compare-widget.bottom-left {
    bottom: 20px;
    left: 20px;
    right: auto;
}

.kings-woo-compare-widget.top-right {
    top: 20px;
    right: 20px;
    bottom: auto;
}

.kings-woo-compare-widget.top-left {
    top: 20px;
    left: 20px;
    right: auto;
    bottom: auto;
}

.kings-woo-compare-widget-inner {
    padding: 20px;
}

.kings-woo-compare-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--kc-border);
}

.kings-woo-compare-header h3 {
    margin: 0;
    color: var(--kc-gray-800);
    font-weight: 600;

    font-size: 16px;
    flex: 1;
}

.kings-woo-compare-count {
    background: var(--kc-danger);
    color: var(--kc-white);
    border-radius: 50%;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-left: auto;
}

.kings-woo-compare-close {
    /* margin-left: 8px;
    background: rgba(44, 62, 80, 0.08);
    color: var(--kc-gray-800);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease; */
    border: none;
    color: var(--kc-white);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;

}

.kings-woo-compare-close:hover {
    opacity: .8;
}

.kings-woo-compare-close:hover svg {
    transform: rotate(90deg);
}

.kings-woo-compare-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* Product items in widget */
.kings-woo-compare-products {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.kings-woo-compare-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.kings-woo-compare-product-item:hover {
    background: #e9ecef;
}

.kings-woo-compare-product-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.kings-woo-compare-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kings-woo-compare-product-info {
    flex: 1;
    min-width: 0;
}

.kings-woo-compare-product-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kings-woo-compare-product-price {
    display: block;
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
}

.kings-woo-compare-remove {
    /* background: var(--kc-danger);
    color: var(--kc-white);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0; */


    background: rgb(0 0 0 / 28%);
    border: none;
    color: var(--kc-white);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    height: 24px;
    width: 24px;

}

/* .kings-woo-compare-product-item:hover .kings-woo-compare-remove {
 display: block;
} */

.kings-woo-compare-remove:hover {
    background: rgba(255, 87, 87, 0.8);
    /* transform: scale(1.1); */
}

.kings-woo-compare-remove svg {
    flex-shrink: 0;
}

/* Widget Actions */
.kings-woo-compare-actions {
    display: flex;
    gap: 10px;
}

.kings-woo-compare-btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kings-woo-compare-btn-primary:hover:not(:disabled) {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.kings-woo-compare-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kings-woo-compare-btn-secondary {
    padding: 12px 20px;
    background: #fff;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kings-woo-compare-btn-secondary:hover {
    background: #e74c3c;
    color: #fff;
}

/* ===========================================
   Toast Notifications
   =========================================== */
.kings-woo-compare-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #2c3e50;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
}

.kings-woo-compare-notice.show {
    transform: translateX(0);
    opacity: 1;
}

.kings-woo-compare-notice.success {
    background: #27ae60;
}

.kings-woo-compare-notice.error {
    background: #e74c3c;
}

.kings-woo-compare-notice.info {
    background: #3498db;
}

/* ===========================================
   Mobile Responsive
   =========================================== */
@media (max-width: 768px) {
    .kings-woo-compare-toggle.bottom-right,
    .kings-woo-compare-toggle.bottom-left {
        bottom: 12px;
    }

    .kings-woo-compare-toggle.top-right,
    .kings-woo-compare-toggle.top-left {
        top: 12px;
        bottom: auto;
    }

    .kings-woo-compare-toggle.bottom-right,
    .kings-woo-compare-toggle.top-right {
        right: 12px;
        left: auto;
    }

    .kings-woo-compare-toggle.bottom-left,
    .kings-woo-compare-toggle.top-left {
        left: 12px;
        right: auto;
    }
    
    .kings-compare-btn,
    .kings-compare-btn-single {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .kings-woo-compare-widget {
        width: calc(100% - 24px);
        max-width: 360px;
    }

    .kings-woo-compare-widget.bottom-right,
    .kings-woo-compare-widget.bottom-left {
        bottom: 60px;
        top: auto;
    }

    .kings-woo-compare-widget.top-right,
    .kings-woo-compare-widget.top-left {
        top: 12px;
        bottom: auto;
    }

    .kings-woo-compare-widget.bottom-right,
    .kings-woo-compare-widget.top-right {
        right: 12px;
        left: auto;
    }

    .kings-woo-compare-widget.bottom-left,
    .kings-woo-compare-widget.top-left {
        left: 12px;
        right: auto;
    }

    .kings-woo-compare-notice {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .kings-woo-compare-widget {
        width: auto;
        max-width: none;
    }

    .kings-woo-compare-widget.bottom-right,
    .kings-woo-compare-widget.top-right {
        right: 10px;
        left: auto;
    }

    .kings-woo-compare-widget.bottom-left,
    .kings-woo-compare-widget.top-left {
        left: 10px;
        right: auto;
    }

    .kings-woo-compare-widget.bottom-right,
    .kings-woo-compare-widget.bottom-left {
        bottom: 70px;
        top: auto;
    }

    .kings-woo-compare-widget.top-right,
    .kings-woo-compare-widget.top-left {
        top: 12px;
        bottom: auto;
    }
    
    .kings-woo-compare-product-title {
        font-size: 13px;
    }
    
    .kings-woo-compare-btn-primary,
    .kings-woo-compare-btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ===========================================
   Header Compare Icon (Beside Mini-Cart)
   =========================================== */
.kings-woo-header-compare-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.kings-woo-header-compare-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.kings-woo-header-compare-link:hover {
    opacity: 0.7;
}

.kings-woo-header-compare-link svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

.kings-woo-header-compare-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ensure proper spacing with mini-cart */
.wc-block-mini-cart {
    position: relative;
}
