/* ================================================
   WC PRODUCT COMPARISON - PREMIUM STYLES (OPTIMIZED)
   ================================================ */

:root {
    --wpc-primary: #283F80;
    --wpc-accent: #283F80;
    --wpc-bg-glass: rgba(255, 255, 255, 0.95);
    --wpc-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --wpc-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Global Toggle */
.wpc-global-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.wpc-toggle-label {
    font-weight: 700;
    color: #444;
    font-size: 14px;
}

.wpc-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.wpc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wpc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 50px !important;
}

.wpc-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked~.wpc-slider {
    background-color: var(--wpc-primary);
}

input:checked~.wpc-slider:before {
    transform: translateX(22px);
}

/* Product Interaction */
.wpc-product-checkbox-wrapper {
    margin: 10px 0;
    display: none !important;
}

body.wpc-comparison-active .wpc-product-checkbox-wrapper {
    display: block !important;
}

.wpc-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    position: relative;
}

.wpc-checkbox-container input {
    visibility: hidden;
    width: 0;
    height: 0;
    position: absolute;
}

.wpc-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: var(--wpc-transition);
}

.wpc-checkbox-container input:checked~.wpc-checkmark {
    background-color: var(--wpc-primary);
    border-color: var(--wpc-primary);
}

/* Sticky Action Bar */
.wpc-sticky-bar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--wpc-primary);
    color: white;
    padding: 15px 10px;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    writing-mode: vertical-lr;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: var(--wpc-transition);
}

.wpc-sticky-bar:hover {
    padding-right: 15px;
}

/* Side Drawer */
.wpc-side-drawer {
    position: fixed;
    right: -420px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.wpc-side-drawer.open {
    right: 0;
}

.wpc-drawer-header {
    padding: 0px 30px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpc-drawer-header h3 {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--wpc-primary) !important;
    letter-spacing: -0.5px;
}

#wpc-close-drawer {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 5px;
    transition: var(--wpc-transition);
    margin-bottom: 0px;
    margin-right: 0px;
}

.wpc-image-wrapper {
    display: flex;
    justify-content: center;
}

#wpc-close-drawer:hover {
    color: #333;
    transform: rotate(90deg);
}

.wpc-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;

}

.wpc-drawer-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8f8f8;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: var(--wpc-transition);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.wpc-drawer-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.wpc-drawer-img-wrapper {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.wpc-drawer-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.wpc-item-info {
    flex: 1;
    min-width: 0;
    /* Important for long text truncation if needed */
}

.wpc-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.wpc-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--wpc-primary);
}

.wpc-remove-item-drawer {
    background: none;
    border: none;
    font-size: 20px;
    color: #ccc;
    cursor: pointer;
    padding: 5px;
    transition: var(--wpc-transition);
}

.wpc-remove-item-drawer:hover {
    color: #ff4d4d;
}

.wpc-drawer-actions {
    display: inline-grid;
    padding: 30px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.02);
}

#wpc-open-modal {
    width: 100%;
    margin-bottom: 15px;
}

#wpc-clear-all {
    display: block;
    text-align: center;
    color: #999;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--wpc-transition);
}

#wpc-clear-all:hover {
    color: #666;
    text-decoration: underline;
}

/* Comparison Modal (Stacked Layout) */
.wpc-modal {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.wpc-modal.open {
    opacity: 1;
    visibility: visible;
}

.wpc-modal-content {
    max-width: 100% !important;
    padding: 40px !important;
    background: #fff;
    height: 100vh;
    overflow: auto !important;
}

.wpc-modal-close {
    position: fixed;
    top: 0;
    right: 10px;
    z-index: 100001;
    background: none;
    border: none;
    font-size: 30px;
    color: #333;
    cursor: pointer;
    font-weight: 200;
    transition: var(--wpc-transition);
}

.wpc-modal-close:hover {
    transform: scale(1.2);
    color: #000;
}

/* Table Elements */
.wpc-compare-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: auto;
}

.wpc-compare-table tr {
    border-bottom: 1px dotted #ddd;
}

.wpc-compare-table tr:last-child {
    border-bottom: none;
}

.wpc-product-col {
    width: 280px;
    min-width: 280px;
    padding: 15px !important;
    text-align: left;
    vertical-align: top;
}

.wpc-product-col:hover {
    background: #fafbff;
}

.wpc-cell-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.wpc-meta-value {
    color: #656464;
    font-size: 13px;
    line-height: 1.5;
}

.wpc-long-text {
    line-height: 1.6;
    text-align: left;
}

.price-tag {
    font-weight: 700;
    color: #222;
    font-size: 16px;
}

/* Product Info */
.wpc-brand-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wpc-product-name {
    font-weight: 500;
    font-size: 17px;
    color: #444;
    line-height: 1.2;
    margin-bottom: 20px;
}

.wpc-button-primary {
    margin-right: 0px;
    margin-bottom: 0px;
    background-color: var(--wpc-primary) !important;
    color: #fff !important;
}

.wpc-row-price .price-tag {
    font-size: 20px;
    font-weight: 800;
    color: var(--wpc-primary);
}

/* Action Section */
.wpc-row-action td {
    padding: 30px 25px !important;
    border-top: 1px solid #f5f5f5;
}

.wpc-compare-btn {
    display: inline-block;
    background: var(--wpc-primary);
    color: white !important;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    transition: var(--wpc-transition);
    box-shadow: 0 8px 20px rgba(40, 63, 128, 0.2);
    text-transform: uppercase;
}

.wpc-compare-btn:hover {
    background: #1a2a5a;
    transform: translateY(-2px);
}

/* Overlay */
.wpc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1500;
    display: none;
    backdrop-filter: blur(4px);
}

.wpc-overlay.show {
    display: block;
}