/* Variant selector on product pages (Views/Shared/_VariantPicker.cshtml) */

.vp {
    --vp-blue: #0078D4;
    --vp-blue-soft: #EAF3FC;
    --vp-border: #DADADA;
    --vp-text: #1F1F1F;
    --vp-muted: #8A8A8A;

    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
    direction: rtl;
}

.vp-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--vp-muted);
}

.vp-selected {
    color: var(--vp-text);
    font-weight: bold;
}

.vp-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vp-opt {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 6px 14px;
    border: 1.5px solid var(--vp-border);
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    color: var(--vp-text);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vp-opt:hover:not(:disabled) {
    border-color: var(--vp-blue);
}

.vp-opt:focus-visible {
    outline: 2px solid var(--vp-blue);
    outline-offset: 2px;
}

.vp-opt.is-selected {
    border-color: var(--vp-blue);
    background: var(--vp-blue-soft);
    color: var(--vp-blue);
    font-weight: bold;
    box-shadow: 0 0 0 1px var(--vp-blue) inset;
}

/* Exists but out of stock: still selectable to see it, shown struck through */
.vp-opt.is-soldout .vp-opt-text {
    text-decoration: line-through;
    color: var(--vp-muted);
}

.vp-opt.is-soldout {
    border-style: dashed;
}

/* Not offered together with the options chosen above */
.vp-opt.is-none,
.vp-opt:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-style: dashed;
}

@media only screen and (max-width: 700px) {
    .vp-opt {
        min-height: 36px;
        padding: 5px 12px;
    }
}

/* Loading state of the price / add-to-cart box while another option's price loads */
#AddToCart {
    position: relative;
}

#AddToCart.is-loading > * {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

#AddToCart.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid #D6E6F5;
    border-top-color: #0078D4;
    border-radius: 50%;
    animation: vp-spin 0.7s linear infinite;
}

@keyframes vp-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    #AddToCart.is-loading::after {
        animation-duration: 2s;
    }
}
