/* WC Variations Table Pro - Modern Frontend Styles */

/* CSS variables are set dynamically via inline style from PHP admin settings */

/* Main Wrapper */
.wcvtp-variations-table-wrapper {
    margin: 30px 0;
    clear: both;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Search Wrapper - for standalone search at top */
.wcvtp-search-wrapper {
    position: relative;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
    max-width: 350px;
}

.wcvtp-search-wrapper .wcvtp-search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--wcvtp-border);
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: var(--wcvtp-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wcvtp-search-wrapper .wcvtp-search-input:focus {
    outline: none;
    border-color: var(--wcvtp-header-bg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.wcvtp-search-wrapper .wcvtp-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    pointer-events: none;
}

/* Filters Section */
.wcvtp-filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.wcvtp-filter-left,
.wcvtp-filter-right {
    display: flex;
    align-items: center;
}

/* Category Dropdown */
.wcvtp-category-dropdown {
    min-width: 200px;
    padding: 8px 35px 8px 12px;
    border: 1px solid var(--wcvtp-border);
    border-radius: 4px;
    background-color: #fff;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M1 1l5 5 5-5"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    font-size: 14px;
    color: var(--wcvtp-text-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.wcvtp-category-dropdown:focus {
    outline: none;
    border-color: var(--wcvtp-header-bg);
}

/* Search Input */
.wcvtp-search-filter {
    position: relative;
    display: inline-block;
}

.wcvtp-search-input {
    min-width: 250px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--wcvtp-border);
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: var(--wcvtp-text-primary);
}

.wcvtp-search-input::placeholder {
    color: #999;
}

.wcvtp-search-input:focus {
    outline: none;
    border-color: var(--wcvtp-header-bg);
}

.wcvtp-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    pointer-events: none;
}

/* Table Wrapper */
.wcvtp-table-wrapper {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow-x: auto;
    /* overflow-y: visible so emoji icons are not clipped */
    overflow-y: visible;
    border-radius: 0px;
    /* Premium scrollbar - Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--wcvtp-header-bg) transparent;
}

/* Premium Scrollbar - Webkit (Chrome, Safari, Edge) */
.wcvtp-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.wcvtp-table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0 0 8px 8px;
}

.wcvtp-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--wcvtp-header-bg);
    border-radius: 10px;
}

.wcvtp-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--wcvtp-header-text);
    cursor: pointer;
}

/* Device-specific tables */
.wcvtp-tablet-table,
.wcvtp-mobile-table {
    display: none;
}

@media (min-width: 1025px) {
    .wcvtp-desktop-table { display: block; }
    .wcvtp-tablet-table,
    .wcvtp-mobile-table { display: none; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .wcvtp-desktop-table,
    .wcvtp-mobile-table { display: none; }
    .wcvtp-tablet-table { display: block; }
}

@media (max-width: 767px) {
    .wcvtp-desktop-table,
    .wcvtp-tablet-table { display: none; }
    .wcvtp-mobile-table { display: block; }
}

/* Table Container */
.wcvtp-table-container {
    background: var(--wcvtp-table-bg);
    border-radius: 8px;
    /* overflow:hidden removed - was clipping emoji icons in stock column */
    overflow: visible;
    border: 1px solid var(--wcvtp-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Keep border-radius on table wrapper via clip trick */
.wcvtp-variations-table-wrapper {
    border-radius: 0;
    overflow: hidden;
}

/* Table */
.wcvtp-modern-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* columns auto-size to content */
}

/* Table Header */
.wcvtp-header-row {
    background-color: var(--wcvtp-header-bg);
}

.wcvtp-column-header {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--wcvtp-header-text);
    text-transform: capitalize;
    border-bottom: 1px solid var(--wcvtp-border);
    border-left: none;
    border-right: none;
    white-space: nowrap;
}

/* Table Body */
.wcvtp-data-row {
    background-color: var(--wcvtp-row-bg);
    transition: background-color 0.2s ease;
}

.wcvtp-data-row:nth-child(even) {
    background-color: var(--wcvtp-row-bg-alt);
}

.wcvtp-table-cell {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    color: var(--wcvtp-text-primary);
    border-bottom: 1px solid var(--wcvtp-border);
    border-left: none;
    border-right: none;
    vertical-align: middle;
}

.wcvtp-data-row:last-child .wcvtp-table-cell {
    border-bottom: none;
}

/* Image Column */
.wcvtp-cell-image {
    width: 80px;
    text-align: center;
}

.wcvtp-variation-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--wcvtp-border);
}

.wcvtp-no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    color: #999;
    font-size: 18px;
}

/* Name Column - wraps at spaces only, never breaks inside a word */
.wcvtp-cell-name {
    min-width: 220px;
    max-width: 320px;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.wcvtp-variation-name {
    font-weight: 500;
    color: var(--wcvtp-text-primary);
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Categories / Tags Column - shrink to fit content, no word break */
.wcvtp-cell-categories,
.wcvtp-cell-tags {
    width: 1%;
    white-space: nowrap;
}

.wcvtp-categories,
.wcvtp-tags {
    color: var(--wcvtp-text-secondary);
    /* font-size inherited from parent cell */
}

/* Reviews Column */
.wcvtp-cell-reviews {
    width: 1%;
    white-space: nowrap;
}

.wcvtp-rating-wrapper,
.wcvtp-no-reviews {
    display: flex;
    gap: 2px;
}

.wcvtp-star {
    font-size: 16px;
    line-height: 1;
}

.wcvtp-star-filled {
    color: #ffa500;
}

.wcvtp-star-empty {
    color: #ddd;
}

.wcvtp-star-half {
    color: #ffa500;
    opacity: 0.5;
}

/* Stock Column - fits content only */
.wcvtp-cell-stock {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.wcvtp-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
    /* font-size inherited from parent cell */
}

.wcvtp-in-stock {
    background-color: transparent;
    color: #155724;
}

.wcvtp-out-of-stock {
    background-color: transparent;
    color: #721c24;
}

.wcvtp-stock-icon {
    /* Emoji size - must be explicit so it never shrinks */
    font-size: 1em;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
    /* Prevent emoji from being clipped */
    overflow: visible;
    min-width: 1.1em;
}

/* Price Column - fits content only */
.wcvtp-cell-price {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.wcvtp-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.wcvtp-regular-price {
    font-size: 0.85em; /* Relative to cell font size */
    color: #999;
    text-decoration: line-through;
}

.wcvtp-sale-price {
    font-size: 1.1em; /* Relative to cell font size */
    font-weight: 600;
    color: #dc3545;
    text-decoration: none;
}

.wcvtp-price {
    font-size: 1.1em; /* Relative to cell font size */
    font-weight: 600;
    color: var(--wcvtp-price-text);
}

/* Total Column - fits content only */
.wcvtp-cell-total {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.wcvtp-total-display {
    font-size: 1.1em; /* Relative to cell font size */
    font-weight: 600;
    color: var(--wcvtp-text-primary);
}

/* Buy Column - tight fit, quantity input only */
.wcvtp-cell-buy {
    width: 1%;
    white-space: nowrap;
}

.wcvtp-buy-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcvtp-quantity-input {
    width: 50px !important;
    max-width: 50px !important;
    height: 32px !important;
    padding: 4px 6px !important;
    border: 1px solid var(--wcvtp-border);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: var(--wcvtp-text-primary);
    background-color: #fff;
    box-sizing: border-box;
}

.wcvtp-quantity-input:focus {
    outline: none;
    border-color: var(--wcvtp-header-bg);
}

.wcvtp-add-to-cart-btn {
    flex: 1;
    height: 36px;
    padding: 0 16px;
    background-color: var(--wcvtp-button-bg);
    color: var(--wcvtp-button-text);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wcvtp-add-to-cart-btn:hover {
    background-color: var(--wcvtp-button-hover);
}

.wcvtp-add-to-cart-btn:active {
    transform: scale(0.98);
}

.wcvtp-add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bulk Actions */
.wcvtp-bulk-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Collapsed state (no items selected) ── */
.wcvtp-total-collapsed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}
.wcvtp-total-price-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}
.wcvtp-total-price-amount-collapsed {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

/* ── Order breakdown card (shown when items selected) ── */
.wcvtp-order-breakdown {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    overflow: hidden;
    animation: wcvtpBreakdownIn .2s ease;
}
@keyframes wcvtpBreakdownIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.wcvtp-breakdown-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    padding: 10px 16px 6px;
    border-bottom: 1px solid #e5e7eb;
}
.wcvtp-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}
.wcvtp-breakdown-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 16px;
    font-size: 13px;
    color: #374151;
    gap: 12px;
}
.wcvtp-breakdown-list li:hover {
    background: #f3f4f6;
}
.wcvtp-breakdown-item-label {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
}
.wcvtp-breakdown-item-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    background: var(--wcvtp-header-bg, #17a2b8);
    color: var(--wcvtp-header-text, #fff);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    flex-shrink: 0;
}
.wcvtp-breakdown-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.wcvtp-breakdown-item-price {
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    flex-shrink: 0;
}
.wcvtp-breakdown-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 16px;
    border-top: 1.5px solid #e5e7eb;
    background: #fff;
}
.wcvtp-breakdown-total-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.wcvtp-total-price-amount {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

/* ── Buy Now button ── */
.wcvtp-bulk-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 32px;
    background-color: var(--wcvtp-button-bg);
    color: var(--wcvtp-button-text);
    border: none;
    border-radius: 0 0 8px 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s, transform .1s;
    letter-spacing: .02em;
}
.wcvtp-bulk-add-btn:hover {
    background-color: var(--wcvtp-button-hover);
}
.wcvtp-bulk-add-btn:active {
    transform: scale(0.99);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .wcvtp-filters-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wcvtp-filter-left,
    .wcvtp-filter-right {
        width: 100%;
    }
    
    .wcvtp-category-dropdown,
    .wcvtp-search-input {
        width: 100%;
        min-width: auto;
    }
    
    .wcvtp-table-container {
        overflow: visible;
    }
    
    /* Desktop/tablet only: min-width for many columns
       Mobile overrides this below with !important */
    .wcvtp-desktop-table,
    .wcvtp-tablet-table {
        min-width: 800px;
    }
}

@media (max-width: 767px) {
    .wcvtp-column-header,
    .wcvtp-table-cell {
        padding: 10px 8px;
        font-size: 12px;
    }

    .wcvtp-variation-image {
        width: 50px;
        height: 50px;
    }

    /* ---- MOBILE TABLE: content-based column widths ---- */

    /* Table: auto layout so each column sizes to its content
       wrapper handles scroll only when total exceeds screen */
    .wcvtp-mobile-table {
        min-width: 0 !important;
        width: auto !important;
        table-layout: auto !important;
    }

    /* Wrapper scrolls only when table is wider than screen */
    .wcvtp-table-wrapper {
        overflow-x: auto;
        width: 100%;
    }

    /* Remove all forced min/max widths from mobile cells
       so each column naturally sizes to its content */
    .wcvtp-mobile-table th,
    .wcvtp-mobile-table td {
        min-width: 0 !important;
        max-width: none !important;
        white-space: nowrap !important;
    }

    /* Name column: allow wrapping (can be long) */
    .wcvtp-mobile-table .wcvtp-cell-name,
    .wcvtp-mobile-table .wcvtp-header-name {
        min-width: 0 !important;
        max-width: none !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    /* Compact inputs on mobile */
    .wcvtp-quantity-input {
        width: 45px !important;
        max-width: 45px !important;
        height: 30px !important;
        padding: 2px 4px !important;
        font-size: 13px;
    }

    .wcvtp-add-to-cart-btn {
        font-size: 12px;
        padding: 0 10px;
    }
}

/* Loading State */
.wcvtp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wcvtp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--wcvtp-border);
    border-top-color: var(--wcvtp-header-bg);
    border-radius: 50%;
    animation: wcvtp-spin 0.6s linear infinite;
}

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

/* Success/Error Messages */
.wcvtp-message {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.wcvtp-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wcvtp-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Hide default WooCommerce variation form when our table is present */
/* JS adds .wcvtp-table-active class to .product div when table is rendered */
.wcvtp-table-active .variations_form,
.wcvtp-table-active .woocommerce-variation-add-to-cart,
.wcvtp-table-active .single_variation_wrap,
.wcvtp-table-active .variations_button {
    display: none !important;
}

/* ===== CONTENT-BASED COLUMN SIZING ===========================
   All columns shrink to their content width by default.
   Only the Name column is allowed to wrap (at spaces, never mid-word).
   Every other column stays on a single line.
   ============================================================ */

/* All cells: shrink to content, no wrap by default */
.wcvtp-modern-table th,
.wcvtp-modern-table td {
    white-space: nowrap;
}

/* Name column exception: allow wrapping at word boundaries */
.wcvtp-modern-table .wcvtp-cell-name,
.wcvtp-modern-table .wcvtp-header-name {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* Quantity-only column (no add-to-cart button) - ultra compact */
.wcvtp-cell-quantity {
    width: 1%;
    white-space: nowrap;
}


.wcvtp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding: 15px;
    background-color: var(--wcvtp-table-bg);
    border-radius: 6px;
    border: 1px solid var(--wcvtp-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wcvtp-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--wcvtp-button-bg);
    color: var(--wcvtp-button-text);
    border: 1px solid var(--wcvtp-border);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wcvtp-page-btn:hover:not(:disabled) {
    background-color: var(--wcvtp-button-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wcvtp-page-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.wcvtp-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
    color: #999;
}

.wcvtp-page-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.wcvtp-page-info {
    font-size: 14px;
    color: var(--wcvtp-pagination-text);
    font-weight: 500;
    padding: 0 10px;
}

.wcvtp-current-page,
.wcvtp-total-pages {
    font-weight: 600;
    color: var(--wcvtp-pagination-text);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .wcvtp-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .wcvtp-page-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .wcvtp-page-info {
        font-size: 13px;
        width: 100%;
        text-align: center;
        order: -1;
    }
}


/* ============================================================
   NOTIFY ME — STOCK ALERT WIDGET
   ============================================================ */
/* Notify Me — trigger button (stays inside table cell) */
.wcvtp-notify-wrap { display: inline-block; }

.wcvtp-notify-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1.5px solid #6b7280;
    color: #374151;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
    flex-shrink: 0;
}
.wcvtp-notify-trigger:hover {
    background: #374151;
    border-color: #374151;
    color: #fff;
}
.wcvtp-notify-trigger svg { display: block; pointer-events: none; }

/* Floating popup — appended to body, positioned via JS */
.wcvtp-notify-popup {
    position: fixed;
    z-index: 999999;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    width: 290px;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    animation: wcvtpNotifyIn .18s ease;
}
/* Arrow pointing down (popup is above button) */
.wcvtp-notify-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.08));
}
/* Arrow pointing up (popup is below button) */
.wcvtp-notify-popup.arrow-below::after {
    bottom: auto;
    top: -8px;
    border-top: none;
    border-bottom: 8px solid #fff;
}
@keyframes wcvtpNotifyIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Transparent backdrop to close popup on outside click */
.wcvtp-notify-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: transparent;
}

.wcvtp-notify-headline {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    margin: 0 0 10px;
    line-height: 1.4;
}
.wcvtp-notify-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.wcvtp-notify-email {
    flex: 1;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 13px;
    color: #111827;
    outline: none;
    transition: border-color .2s;
    min-width: 0;
}
.wcvtp-notify-email:focus { border-color: #2563eb; }

.wcvtp-notify-submit {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.wcvtp-notify-submit:hover    { background: #1d4ed8; }
.wcvtp-notify-submit:disabled { background: #93c5fd; cursor: default; }

.wcvtp-notify-feedback {
    font-size: 12px;
    min-height: 16px;
    margin: 0 0 6px;
    color: #374151;
}
.wcvtp-notify-feedback.is-success { color: #15803d; font-weight: 600; }
.wcvtp-notify-feedback.is-error   { color: #dc2626; }

.wcvtp-notify-cancel {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color .2s;
}
.wcvtp-notify-cancel:hover { color: #374151; }

/* Disabled OOS button (when Notify Me is off) */
.wcvtp-btn-oos {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: .8;
}

/* ============================================================
   VARIATION COMPARISON MODE
   ============================================================ */

/* Compare checkbox in table cell */
.wcvtp-cell-compare { text-align: center !important; padding: 0 10px !important; }

.wcvtp-compare-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}
.wcvtp-compare-checkbox { display: none; }

.wcvtp-compare-check-ui {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border: 2px solid #bbb;
    border-radius: 6px;
    background: #fff;
    transition: all .18s;
    font-size: 13px;
    color: transparent;
}
.wcvtp-compare-checkbox:checked + .wcvtp-compare-check-ui {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.wcvtp-compare-check-ui::after { content: '✓'; font-weight: 700; }

/* Row highlight when selected for compare */
.wcvtp-data-row.wcvtp-compare-selected {
    outline: 2px solid #2563eb !important;
    outline-offset: -2px;
    background: #eff6ff !important;
}

/* ── Floating Compare Bar ── */
.wcvtp-compare-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #1e293b;
    color: #f8fafc;
    padding: 12px 20px;
    border-radius: 14px;
    margin-top: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
    animation: wcvtp-bar-in .22s ease;
}
@keyframes wcvtp-bar-in {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}
.wcvtp-compare-bar[hidden] { display: none !important; }

.wcvtp-compare-bar-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.wcvtp-compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #334155;
    border-radius: 999px;
    padding: 4px 10px 4px 8px;
    font-size: 13px;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wcvtp-compare-chip img {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.wcvtp-compare-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wcvtp-compare-chip-remove {
    background: none; border: none;
    color: #94a3b8; cursor: pointer;
    padding: 0; font-size: 14px; line-height: 1;
    flex-shrink: 0;
}
.wcvtp-compare-chip-remove:hover { color: #f87171; }

.wcvtp-compare-now-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s;
    flex-shrink: 0;
}
.wcvtp-compare-now-btn:hover { background: #1d4ed8; }

.wcvtp-compare-clear-btn {
    background: none; border: none;
    color: #64748b; cursor: pointer;
    font-size: 18px; padding: 4px 6px;
    border-radius: 6px;
    transition: color .15s;
    flex-shrink: 0;
}
.wcvtp-compare-clear-btn:hover { color: #f87171; }

/* ── Compare Drawer ── */
.wcvtp-compare-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
}
.wcvtp-compare-drawer[hidden] { display: none !important; }

.wcvtp-compare-drawer-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.wcvtp-compare-drawer-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0,0,0,.22);
    animation: wcvtp-drawer-in .28s cubic-bezier(.4,0,.2,1);
    box-sizing: border-box;
    overflow: hidden;
}
@keyframes wcvtp-drawer-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.wcvtp-compare-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    box-sizing: border-box;
}
.wcvtp-compare-drawer-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}
.wcvtp-compare-drawer-close {
    background: red;
    border: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.wcvtp-compare-drawer-body {
    overflow-y: auto;
    overflow-x: auto;
    padding: 16px 16px 24px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* Compare Table inside drawer */
.wcvtp-compare-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
    table-layout: auto;
}
.wcvtp-compare-table th,
.wcvtp-compare-table td {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
    min-width: 90px;
}
.wcvtp-compare-table .wcvtp-cmp-label-col {
    text-align: left;
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    min-width: 80px;
    width: 90px;
}
.wcvtp-compare-table thead th {
    background: #f1f5f9;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
}
.wcvtp-compare-table .wcvtp-cmp-img {
    width: 56px; height: 56px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 6px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.wcvtp-compare-table .wcvtp-cmp-no-img {
    width: 56px; height: 56px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 22px;
    margin: 0 auto 6px;
}
.wcvtp-cmp-instock  { color: #16a34a; font-weight: 600; }
.wcvtp-cmp-outstock { color: #dc2626; font-weight: 600; }
.wcvtp-cmp-backorder{ color: #d97706; font-weight: 600; }

.wcvtp-cmp-atc-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background .18s;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}
.wcvtp-cmp-atc-btn:hover { background: #1d4ed8; }
.wcvtp-cmp-atc-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Highlight differences */
.wcvtp-cmp-best { background: #f0fdf4 !important; }
.wcvtp-cmp-worst { background: #fff7ed !important; }

/* Mobile responsive drawer */
@media (max-width: 600px) {
    .wcvtp-compare-drawer-panel {
        max-height: 90vh;
        border-radius: 14px 14px 0 0;
    }
    .wcvtp-compare-drawer-body {
        padding: 12px 10px 20px;
    }
    .wcvtp-compare-table {
        font-size: 11px;
    }
    .wcvtp-compare-table th,
    .wcvtp-compare-table td {
        padding: 7px 8px;
        min-width: 70px;
    }
    .wcvtp-compare-table .wcvtp-cmp-label-col {
        min-width: 60px;
        width: 65px;
        font-size: 10px;
    }
    .wcvtp-compare-table .wcvtp-cmp-img,
    .wcvtp-compare-table .wcvtp-cmp-no-img {
        width: 40px; height: 40px;
    }
    .wcvtp-cmp-atc-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    .wcvtp-compare-drawer-head h2 {
        font-size: 15px;
    }
    /* Compare bar mobile */
    .wcvtp-compare-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 14px;
    }
    .wcvtp-compare-now-btn {
        width: 100%;
        text-align: center;
    }
}

body.wcvtp-no-scroll { overflow: hidden !important; }
