/* =============================================
   WL: Product Variants Widget — Complete
   Variant selector + Price + Qty + Add to Cart
   ============================================= */

.wl-product-variants-wrapper {
    --wl-v-accent: #6366f1;
    --wl-v-radius: 50px;
    --wl-v-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ---- Section Title ---- */
.wl-variants-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 12px 0;
    padding: 0;
    color: #94a3b8;
}

/* ---- PILLS Layout (default) ---- */
.wl-variants-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---- CARDS GRID Layout ---- */
.wl-variants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* ---- LIST Layout ---- */
.wl-variants-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---- Variant Item ---- */
.wl-variant-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: var(--wl-v-radius);
    cursor: pointer;
    transition: var(--wl-v-transition);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.wl-variant-item:hover {
    background: #eef2ff;
    border-color: var(--wl-v-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.wl-variant-item:active {
    transform: translateY(0);
}

.wl-variant-item.wl-variant-selected {
    background: #eef2ff;
    border-color: var(--wl-v-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.wl-variant-item.wl-variant-out-of-stock {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- Checkmark ---- */
.wl-variant-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #cbd5e1;
    transition: var(--wl-v-transition);
    flex-shrink: 0;
}

.wl-variant-check svg {
    opacity: 0;
    transition: opacity 0.15s ease;
    color: #fff;
}

.wl-variant-item.wl-variant-selected .wl-variant-check {
    background: var(--wl-v-accent);
    border-color: var(--wl-v-accent);
}

.wl-variant-item.wl-variant-selected .wl-variant-check svg {
    opacity: 1;
}

/* ---- Variant Name ---- */
.wl-variant-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

/* ---- Variant Inline Price ---- */
.wl-variant-price {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.3;
    margin-left: auto;
}

.wl-variant-price del {
    opacity: 0.5;
    font-weight: 400;
    font-size: 11px;
    margin-right: 4px;
}

.wl-variant-price ins {
    text-decoration: none;
}

/* ---- Stock Badge ---- */
.wl-variant-stock {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.wl-variant-stock.wl-in-stock {
    color: #10b981;
    background: #ecfdf5;
}

.wl-variant-stock.wl-out-of-stock {
    color: #ef4444;
    background: #fef2f2;
}

/* ---- Selected Price Display ---- */
.wl-selected-price-wrap {
    margin: 20px 0;
}

.wl-selected-price {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    display: block;
}

.wl-selected-price del {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.5;
    margin-right: 8px;
}

.wl-selected-price ins {
    text-decoration: none;
}

/* ---- Cart Row (Qty + Button) ---- */
.wl-variant-cart-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

/* ---- Quantity Selector ---- */
.wl-variant-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 4px 6px;
    height: 48px;
    box-sizing: border-box;
}

.wl-variant-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    color: #94a3b8;
    transition: var(--wl-v-transition);
    flex-shrink: 0;
    padding: 0;
}

.wl-variant-qty-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.wl-variant-qty-input {
    width: 36px;
    text-align: center;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
    margin: 0;
}

.wl-variant-qty-input::-webkit-outer-spin-button,
.wl-variant-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- Add to Cart Button ---- */
.wl-variant-add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 48px;
    padding: 14px 32px;
    background: var(--wl-v-accent);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--wl-v-transition);
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-transform: none;
    box-sizing: border-box;
}

.wl-variant-add-to-cart-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.wl-variant-add-to-cart-btn:active {
    transform: translateY(0);
}

.wl-variant-add-to-cart-btn.wl-adding {
    opacity: 0.7;
    pointer-events: none;
}

.wl-variant-add-to-cart-btn.wl-added {
    background: #10b981;
}

/* ---- Cards layout overrides ---- */
.wl-variants-grid .wl-variant-item {
    border-radius: 12px;
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    white-space: normal;
}

.wl-variants-grid .wl-variant-check {
    position: absolute;
    top: 10px;
    right: 10px;
}

.wl-variants-grid .wl-variant-price {
    margin-left: 0;
}

/* ---- List layout overrides ---- */
.wl-variants-list .wl-variant-item {
    border-radius: 12px;
    padding: 14px 18px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .wl-variants-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .wl-variants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .wl-variant-item {
        padding: 8px 14px;
        gap: 8px;
    }

    .wl-variant-name {
        font-size: 13px;
    }

    .wl-selected-price {
        font-size: 24px;
    }

    .wl-variant-cart-row {
        flex-direction: column;
        gap: 10px;
    }

    .wl-variant-qty-wrap {
        width: 100%;
        justify-content: center;
    }

    .wl-variant-add-to-cart-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wl-variants-grid {
        grid-template-columns: 1fr;
    }

    .wl-variants-pills {
        gap: 8px;
    }

    .wl-variant-cart-row {
        flex-direction: row;
    }
}

/* ---- Animation ---- */
@keyframes wl-variant-pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.wl-variant-item.wl-variant-pulse {
    animation: wl-variant-pulse 0.4s ease-out;
}

@keyframes wl-price-fade {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

.wl-selected-price.wl-price-animate {
    animation: wl-price-fade 0.3s ease-out;
}