/* =============================================================
   WC Quick Select Popup - Professional Modern CSS
   ============================================================= */

:root {
    --wcqsp-primary:      #e91e8c;
    --wcqsp-primary-dark: #c0156f;
    --wcqsp-secondary:    #1a1a2e;
    --wcqsp-accent:       #ff6b35;
    --wcqsp-buy:          #16213e;
    --wcqsp-buy-dark:     #0f3460;
    --wcqsp-success:      #00c48c;
    --wcqsp-danger:       #ff4757;
    --wcqsp-text:         #1a1a2e;
    --wcqsp-text-light:   #6b7280;
    --wcqsp-border:       #e5e7eb;
    --wcqsp-bg:           #ffffff;
    --wcqsp-bg-soft:      #f8f9ff;
    --wcqsp-shadow:       0 25px 60px rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.10);
    --wcqsp-radius:       20px;
    --wcqsp-transition:   all .25s cubic-bezier(.4,0,.2,1);
}

/* ── Overlay ──────────────────────────────────────────────── */
.wcqsp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    visibility: hidden;
    pointer-events: none;
    background: rgba(15, 20, 40, 0);
    transition: background .35s ease, visibility .35s ease;
}

.wcqsp-overlay.wcqsp-open {
    visibility: visible;
    pointer-events: all;
    background: rgba(15, 20, 40, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Modal ────────────────────────────────────────────────── */
.wcqsp-modal {
    position: relative;
    background: var(--wcqsp-bg);
    border-radius: var(--wcqsp-radius);
    box-shadow: var(--wcqsp-shadow);
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    overflow: hidden;
    transform: scale(.88) translateY(24px);
    opacity: 0;
    transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
    will-change: transform, opacity;
}

.wcqsp-overlay.wcqsp-open .wcqsp-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Close Button ─────────────────────────────────────────── */
.wcqsp-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(4px);
    color: var(--wcqsp-text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: var(--wcqsp-transition);
}

.wcqsp-close:hover {
    background: var(--wcqsp-primary);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
}

/* ── Modal Inner Layout ───────────────────────────────────── */
.wcqsp-modal-inner {
    display: grid;
    grid-template-columns: 42% 58%;
    max-height: 92vh;
}

/* ── Image Column ─────────────────────────────────────────── */
.wcqsp-image-col {
    background: var(--wcqsp-bg-soft);
    padding: 28px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: var(--wcqsp-radius) 0 0 var(--wcqsp-radius);
    overflow: hidden;
    position: relative;
}

.wcqsp-image-col::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(233,30,140,.1) 0%, transparent 70%);
    pointer-events: none;
}

.wcqsp-main-image-wrap {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 1;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.wcqsp-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
    display: block;
}

.wcqsp-main-image-wrap:hover .wcqsp-main-img {
    transform: scale(1.04);
}

.wcqsp-img-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.wcqsp-img-badge.in-stock {
    background: linear-gradient(135deg, var(--wcqsp-success), #00a878);
    color: #fff;
}

.wcqsp-img-badge.out-stock {
    background: var(--wcqsp-danger);
    color: #fff;
}

.wcqsp-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wcqsp-thumb {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2.5px solid transparent;
    transition: var(--wcqsp-transition);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.wcqsp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcqsp-thumb:hover,
.wcqsp-thumb.active {
    border-color: var(--wcqsp-primary);
    transform: scale(1.06);
}

/* ── Details Column ───────────────────────────────────────── */
.wcqsp-details-col {
    padding: 32px 28px 28px;
    overflow-y: auto;
    max-height: 92vh;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--wcqsp-border) transparent;
}

.wcqsp-details-col::-webkit-scrollbar { width: 4px; }
.wcqsp-details-col::-webkit-scrollbar-track { background: transparent; }
.wcqsp-details-col::-webkit-scrollbar-thumb {
    background: var(--wcqsp-border);
    border-radius: 2px;
}

/* ── Loader ───────────────────────────────────────────────── */
.wcqsp-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}

.wcqsp-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid var(--wcqsp-border);
    border-top-color: var(--wcqsp-primary);
    border-radius: 50%;
    animation: wcqsp-spin .7s linear infinite;
}

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

/* ── Content ──────────────────────────────────────────────── */
.wcqsp-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--wcqsp-text);
    line-height: 1.35;
    margin: 0 0 10px;
    font-family: inherit;
}

.wcqsp-price {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
}

.wcqsp-price ins,
.wcqsp-price .woocommerce-Price-amount {
    text-decoration: none !important;
    color: var(--wcqsp-primary);
}

.wcqsp-price del {
    color: var(--wcqsp-text-light);
    font-size: 14px;
    margin-right: 6px;
    font-weight: 400;
}

.wcqsp-desc {
    font-size: 13.5px;
    color: var(--wcqsp-text-light);
    line-height: 1.6;
    margin: 0 0 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--wcqsp-border);
}

/* ── Attributes ───────────────────────────────────────────── */
.wcqsp-attributes {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
}

.wcqsp-attr-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wcqsp-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--wcqsp-text);
    text-transform: uppercase;
    letter-spacing: .6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcqsp-label-selected {
    font-weight: 400;
    color: var(--wcqsp-primary);
    text-transform: none;
    letter-spacing: 0;
}

/* Size / Button swatches */
.wcqsp-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcqsp-swatch {
    padding: 7px 16px;
    border-radius: 8px;
    border: 2px solid var(--wcqsp-border);
    background: #fff;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--wcqsp-text);
    transition: var(--wcqsp-transition);
    position: relative;
    user-select: none;
    min-width: 44px;
    text-align: center;
}

.wcqsp-swatch:hover {
    border-color: var(--wcqsp-primary);
    color: var(--wcqsp-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233,30,140,.15);
}

.wcqsp-swatch.selected {
    border-color: var(--wcqsp-primary);
    background: var(--wcqsp-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(233,30,140,.3);
}

.wcqsp-swatch.selected::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: var(--wcqsp-success);
    border-radius: 50%;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
}

/* Color swatches */
.wcqsp-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: var(--wcqsp-transition);
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    outline-offset: 3px;
}

.wcqsp-color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.wcqsp-color-swatch.selected {
    border-color: var(--wcqsp-primary);
    outline: 2.5px solid var(--wcqsp-primary);
    transform: scale(1.15);
}

.wcqsp-color-swatch.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

.wcqsp-color-swatch[data-bg="light"].selected::after,
.wcqsp-color-swatch.light-bg.selected::after {
    color: #333;
    text-shadow: none;
}

/* ── Quantity ─────────────────────────────────────────────── */
.wcqsp-quantity-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.wcqsp-qty-control {
    display: flex;
    align-items: center;
    background: var(--wcqsp-bg-soft);
    border: 2px solid var(--wcqsp-border);
    border-radius: 10px;
    overflow: hidden;
}

.wcqsp-qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--wcqsp-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wcqsp-transition);
    font-weight: 300;
}

.wcqsp-qty-btn:hover {
    background: var(--wcqsp-primary);
    color: #fff;
}

.wcqsp-qty-input {
    width: 48px;
    height: 38px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--wcqsp-text);
    outline: none;
    -moz-appearance: textfield;
}

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

.wcqsp-stock-text {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 196, 140, .12);
    color: var(--wcqsp-success);
}

.wcqsp-stock-text.low {
    background: rgba(255,107,53,.12);
    color: var(--wcqsp-accent);
}

/* ── Notice ───────────────────────────────────────────────── */
.wcqsp-notice {
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease, margin .3s ease;
}

.wcqsp-notice.show {
    max-height: 60px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(255,71,87,.1);
    color: var(--wcqsp-danger);
    border-left: 3px solid var(--wcqsp-danger);
}

/* ── Action Buttons ───────────────────────────────────────── */
.wcqsp-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.wcqsp-btn {
    padding: 13px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: var(--wcqsp-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    letter-spacing: .3px;
}

.wcqsp-btn svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.wcqsp-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background .2s ease;
}

.wcqsp-btn:hover::before {
    background: rgba(255,255,255,.12);
}

.wcqsp-btn-cart {
    background: linear-gradient(135deg, var(--wcqsp-primary), var(--wcqsp-primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(233,30,140,.35);
}

.wcqsp-btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233,30,140,.45);
}

.wcqsp-btn-buy {
    background: linear-gradient(135deg, var(--wcqsp-buy), var(--wcqsp-buy-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(22,33,62,.3);
}

.wcqsp-btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(22,33,62,.4);
}

.wcqsp-btn-outline {
    background: transparent;
    border: 2px solid var(--wcqsp-primary);
    color: var(--wcqsp-primary);
}

.wcqsp-btn-outline:hover {
    background: var(--wcqsp-primary);
    color: #fff;
}

.wcqsp-btn-ghost {
    background: var(--wcqsp-bg-soft);
    color: var(--wcqsp-text);
    border: 2px solid var(--wcqsp-border);
}

.wcqsp-btn-ghost:hover {
    border-color: var(--wcqsp-text);
}

.wcqsp-btn.loading {
    pointer-events: none;
    opacity: .8;
}

.wcqsp-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcqsp-spin .6s linear infinite;
    margin-left: 6px;
}

/* ── Success State ────────────────────────────────────────── */
.wcqsp-success {
    text-align: center;
    padding: 24px 0 8px;
    animation: wcqsp-fadeIn .4s ease;
}

.wcqsp-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wcqsp-success), #00a878);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,196,140,.35);
}

.wcqsp-success-icon svg {
    width: 36px;
    height: 36px;
}

.wcqsp-success-icon circle {
    stroke: rgba(255,255,255,.5);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: wcqsp-circle .6s ease forwards;
}

.wcqsp-success-icon path {
    stroke: #fff;
    stroke-width: 3;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: wcqsp-check .4s .5s ease forwards;
}

@keyframes wcqsp-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes wcqsp-check {
    to { stroke-dashoffset: 0; }
}

.wcqsp-success-msg {
    font-size: 17px;
    font-weight: 700;
    color: var(--wcqsp-text);
    margin: 0 0 16px;
}

.wcqsp-success-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@keyframes wcqsp-fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Ripple effect on buttons ─────────────────────────────── */
.wcqsp-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: wcqsp-ripple .5s linear;
    background: rgba(255,255,255,.3);
    pointer-events: none;
}

@keyframes wcqsp-ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 660px) {
    .wcqsp-modal-inner {
        grid-template-columns: 1fr;
        max-height: 92vh;
        overflow-y: auto;
    }

    .wcqsp-image-col {
        padding: 20px 16px 14px;
        border-radius: var(--wcqsp-radius) var(--wcqsp-radius) 0 0;
    }

    .wcqsp-main-image-wrap {
        max-height: 220px;
    }

    .wcqsp-details-col {
        padding: 20px 16px 24px;
        max-height: none;
    }

    .wcqsp-modal {
        max-width: 100%;
        border-radius: 18px;
    }

    .wcqsp-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .wcqsp-title { font-size: 17px; }
    .wcqsp-btn   { font-size: 13px; padding: 11px 14px; }
}
