/* rx-vimgs.css — the variant pictures row under the product photo (rx-vimgs.js).
 * Sits with the app's own gallery (shape and radius follow it), scrolls
 * sideways on a phone, and never covers anything: no fixed position, no z-index
 * war with the cart sheet. */

.rx-vimgs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 2px;
    padding: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.rx-vimgs::-webkit-scrollbar {
    display: none;
}

.rx-vimg {
    position: relative;
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #f4f1f7;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .09);
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow .18s ease, transform .18s ease;
}

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

.rx-vimg:hover {
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .22);
}

.rx-vimg.is-on {
    box-shadow: 0 0 0 2px var(--acc-fill, #880290), 0 0 0 4px rgba(255, 255, 255, .9) inset;
}

.rx-vimg.is-on::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 0 2px #fff;
    pointer-events: none;
}

.rx-vimg:active {
    transform: scale(.96);
}

@media (max-width: 640px) {
    .rx-vimgs {
        gap: 8px;
        margin: 8px 0 0;
    }

    .rx-vimg {
        width: 62px;
        height: 62px;
        border-radius: 10px;
    }

    .rx-vimg.is-on::after {
        border-radius: 10px;
    }
}

/* ---- the product form: one square per variant value -----------------------
 * (rx-vtools.js). Tap it and pick صورة / لون / مسح. The row is a 6-column
 * grid; the square takes the first cell, so nothing else in the form moves. */
#ms-pv-rows .ms-pv-row {
    grid-template-columns: 42px minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, .7fr) minmax(0, 1.2fr) 32px;
}

.rx-vt-hint {
    margin: 2px 0 6px;
    font: 400 12px/1.6 Poppins, system-ui, sans-serif;
    color: #6b6277;
}

.rx-vt {
    position: relative;
    display: flex;
    align-items: center;
    transition: opacity .15s ease;
}

.rx-vt.is-busy {
    opacity: .45;
    pointer-events: none;
}

.rx-vt-file,
.rx-vt-picker {
    display: none;
}

.rx-vt-slot {
    position: relative;
    display: block;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    background: #f4f1f7;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.rx-vt-slot:hover {
    box-shadow: inset 0 0 0 1.5px rgba(136, 2, 144, .5);
}

/* empty: a small plus, so it says "you can put something here" */
.rx-vt:not(.has-img):not(.has-col) .rx-vt-slot::after {
    content: "";
    position: absolute;
    inset: 9px;
    background:
        linear-gradient(#a99cb8, #a99cb8) center / 100% 1.5px no-repeat,
        linear-gradient(#a99cb8, #a99cb8) center / 1.5px 100% no-repeat;
}

.rx-vt-i {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.rx-vt-c {
    position: absolute;
    inset: 0;
}

/* a colour and a picture together: the colour stays as a corner dot */
.rx-vt.has-img.has-col .rx-vt-c {
    inset: auto -2px -2px auto;
    width: 13px;
    height: 13px;
    border-radius: 999px;
    box-shadow: 0 0 0 1.5px #fff;
}

.rx-vt-menu {
    position: absolute;
    top: 36px;
    inset-inline-start: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    min-width: 104px;
    padding: 5px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(35, 26, 46, .18), 0 0 0 1px rgba(0, 0, 0, .06);
}

.rx-vt-menu.is-up {
    top: auto;
    bottom: 36px;
}

.rx-vt-menu[hidden] {
    display: none;
}

.rx-vt-menu button {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #231a2e;
    font: 500 13px/1.2 Poppins, system-ui, sans-serif;
    text-align: start;
    cursor: pointer;
}

.rx-vt-menu button:hover {
    background: #f6f2fa;
}

.rx-vt-menu button[data-do="clear"] {
    color: #b3261e;
}

@media (max-width: 719px) {
    #ms-pv-rows .ms-pv-row {
        grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr);
    }

    .rx-vt-slot {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }

    .rx-vt-menu {
        top: 38px;
    }

    .rx-vt-menu.is-up {
        top: auto;
        bottom: 38px;
    }
}

/* ---- every picture on the product page fills the square ------------------
 * the product's own photo (the default one) and the value pictures alike, so
 * no grey bars above and below. */
.sf-prod-media img.sf-prod-img,
.sf-prod-media.rx-vfit img.sf-prod-img {
    object-fit: cover;
}

/* the picture can be swiped left / right between the product photo and the
 * value pictures: keep vertical scrolling, hand the sideways drag to us */
.sf-prod-media.rx-vswipe {
    touch-action: pan-y pinch-zoom;
}

.sf-prod-media.rx-vswipe img {
    -webkit-user-drag: none;
    user-select: none;
}

/* ---- the variants block on the product page: small and quiet -------------
 * no white card, a tiny label, compact pills, so the pictures and the price
 * stay the thing the shopper looks at. */
.sf-variants {
    margin: 14px 0 2px;
    gap: 10px;
}

.sf-vgroup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    gap: 0;
}

.sf-vg-h {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    margin: 0 0 6px;
    color: #9c9193;
}

.sf-vg-vals {
    gap: 7px;
    flex-wrap: wrap;
}

.sf-vval {
    height: 27px;
    min-height: 0;
    padding: 0 11px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    box-shadow: none;
    transition: transform .12s ease, box-shadow .12s ease;
}

.sf-vval.is-on {
    box-shadow: 0 2px 7px rgba(23, 16, 26, .16);
}

.sf-vval:active {
    transform: scale(.96);
}

/* the little colour dot inside a pill, a touch smaller */
.sf-vval .sf-sw.rx-sw {
    width: 10px;
    height: 10px;
}

@media (max-width: 640px) {
    .sf-variants {
        margin: 12px 0 0;
    }

    .sf-vval {
        height: 26px;
        padding: 0 10px;
        font-size: 10.5px;
    }
}
