/**
 * Quick Buy (ARKAN-409, js/collection-quick-buy.js): the "+" on the shop page's
 * product cards and its popup (desktop box, phone bottom sheet).
 * Sizes and colours from the ARKAN-409 design; the colours are Settings → Quick
 * Buy's (the custom properties below are printed by template-collection.php).
 *
 * @package Qatarshoes
 */

:root {
    --qs-qb-ink: #2B1F1F;
    --qs-qb-ink-text: #FFFFFF;
    --qs-qb-plus-bg: #FFFFFF;
    --qs-qb-plus-icon: #5E5E5E;
    --qs-qb-plus-border: #E0E0E0;
    --qs-qb-plus-active-bg: #000000;
    --qs-qb-plus-active-icon: #FFFFFF;
    --qs-qb-dur: 450ms;
    --qs-qb-ease: cubic-bezier(.7, 0, .2, 1);
}

/* ==========================================================================
   The "+": bottom corner of the photo
   ========================================================================== */

.product-card .qs-qb-plus {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.product-card .qs-qb-plus__box {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid var(--qs-qb-plus-border);
    background: var(--qs-qb-plus-bg);
    color: var(--qs-qb-plus-icon);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.product-card .qs-qb-plus__h,
.product-card .qs-qb-plus__v {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 1.5px;
    margin: -0.75px 0 0 -7px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .3s var(--qs-qb-ease);
}

.product-card .qs-qb-plus__v {
    transform: rotate(90deg);
}

/* Popup open: black, and the "+" turns into "−" */
.product-card .qs-qb-plus.is-active .qs-qb-plus__box {
    background: var(--qs-qb-plus-active-bg);
    color: var(--qs-qb-plus-active-icon);
    border-color: var(--qs-qb-plus-active-bg);
}

.product-card .qs-qb-plus.is-active .qs-qb-plus__v {
    transform: rotate(0deg);
}

.product-card .qs-qb-plus.is-busy {
    cursor: progress;
}

.product-card .qs-qb-plus:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* The "+" always shows on the cards (mouse and touch). With a mouse on it, it turns dark */
@media (hover: hover) {
    .product-card .qs-qb-plus:hover .qs-qb-plus__box {
        background: var(--qs-qb-plus-active-bg);
        color: var(--qs-qb-plus-active-icon);
        border-color: var(--qs-qb-plus-active-bg);
    }
}

/* Phones: a 22px box in a 44px tap area */
@media (max-width: 767px) {
    /* The 44px tap area is centred on the 22px box (11px out on every side), so a
       tap just past the box's edge still opens Quick Buy instead of the product
       page; the box itself stays in the photo's corner as in the design */
    .product-card .qs-qb-plus {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        bottom: -11px;
        inset-inline-end: -11px;
    }

    .product-card .qs-qb-plus__box {
        width: 22px;
        height: 22px;
        border-radius: 5px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    .product-card .qs-qb-plus__h,
    .product-card .qs-qb-plus__v {
        width: 10px;
        margin-left: -5px;
    }
}

/* ==========================================================================
   Popup
   ========================================================================== */

html.qs-qb-locked,
html.qs-qb-locked body {
    overflow: hidden;
}

.qs-qb {
    position: fixed;
    inset: 0;
    z-index: 9000;
    font-family: var(--qs-font-body, 'Inter', 'IBM Plex Sans Arabic', sans-serif);
    color: #1A1A1A;
    text-align: start;
}

.qs-qb *,
.qs-qb *::before,
.qs-qb *::after {
    box-sizing: border-box;
}

.qs-qb button {
    font-family: inherit;
}

.qs-qb__scrim {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.qs-qb__dialog {
    position: relative;
    background: #FFFFFF;
    outline: none;
}

.qs-qb__close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #EEEEEE;
    background: #FFFFFF;
    color: #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qs-qb button:focus-visible,
.qs-qb a:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.qs-qb__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* The product's name is an h2: typography.css gives every h2 the heading face and
   section size with !important, so the design's name style needs it too */
.qs-qb .qs-qb__title {
    margin: 0;
    font-family: var(--qs-font-body, 'Inter', 'IBM Plex Sans Arabic', sans-serif) !important;
    font-size: 20px !important;
    line-height: 28px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #1A1A1A;
}

.qs-qb__price {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.qs-qb__price-now {
    font-size: 20px;
    font-weight: 400;
    color: #5E5E5E;
}

.qs-qb__price-now.is-sale {
    font-weight: 700;
    color: #C8102E;
}

.qs-qb__price-was {
    font-size: 14px;
    color: #6B6B6B;
    text-decoration: line-through;
}

/* Estimated delivery */
.qs-qb-delivery {
    position: relative;
}

.qs-qb-delivery__lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qs-qb-delivery__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    line-height: 24px;
    font-weight: 600;
}

.qs-qb-delivery__info {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
}

.qs-qb-delivery__sentence {
    font-size: 15px;
    line-height: 24px;
    color: #6B6B6B;
}

.qs-qb-delivery__sentence b {
    color: #1A1A1A;
    font-weight: 600;
}

.qs-qb-delivery__fee {
    font-size: 13px;
    line-height: 20px;
    color: #6B6B6B;
}

.qs-qb-delivery__link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: #1A1A1A;
    text-decoration: underline;
    cursor: pointer;
}

.qs-qb-delivery__link--country {
    font-weight: 600;
}

/* Choice rows */
[data-qb-rows] {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

[data-qb-rows]:empty,
[data-qb-qtybox]:empty {
    display: none;
}

.qs-qb__row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qs-qb__label {
    font-size: 14px;
    line-height: 20px;
}

.qs-qb__swatch-wrap {
    position: relative;
}

.qs-qb__swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.qs-qb__sw {
    width: 64px;
    height: 64px;
    padding: 4px;
    border-radius: 12px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E5E5;
    cursor: pointer;
    flex-shrink: 0;
}

.qs-qb__sw img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.qs-qb__chip {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E5E5;
    cursor: pointer;
    flex-shrink: 0;
}

.qs-qb__chip-dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.qs-qb__sw.is-on,
.qs-qb__chip.is-on {
    border: 1.5px solid var(--qs-qb-ink);
}

.qs-qb__sw:disabled,
.qs-qb__chip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qs-qb__sizes {
    margin: 0;
}

/* The product page's size buttons (product-size-selector.css); this page's own
   button padding would push the number down */
.qs-qb .qs-qb__sizes .size-option {
    padding: 0;
    line-height: 42px;
}

/* Quantity */
.qs-qb__qty {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qs-qb__stepper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qs-qb__step {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #E0E0E0;
    border-radius: 999px;
    background: #FFFFFF;
    font-size: 18px;
    color: #1A1A1A;
    cursor: pointer;
}

.qs-qb__step:disabled {
    cursor: default;
}

.qs-qb__qty-value {
    width: 56px;
    height: 44px;
    border: 1px solid #E0E0E0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

/* Buttons: Add to cart filled, Buy Now outlined */
.qs-qb__actions,
.qs-qb__foot {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qs-qb-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    height: 56px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--qs-qb-ink);
    font-size: 15px;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: color var(--qs-qb-dur) var(--qs-qb-ease);
}

.qs-qb-btn--primary {
    background: var(--qs-qb-ink);
    color: var(--qs-qb-ink-text);
    font-weight: 700;
}

.qs-qb-btn--secondary {
    background: #FFFFFF;
    color: var(--qs-qb-ink);
    font-weight: 600;
}

.qs-qb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qs-qb-btn.is-busy {
    cursor: progress;
}

.qs-qb__details {
    margin-top: -12px;
    font-size: 12px;
    line-height: 16px;
    color: #1A1A1A;
    text-decoration: underline;
    align-self: flex-start;
}

/* ---------- Desktop box ---------- */
.qs-qb--box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.qs-qb--box .qs-qb__dialog {
    width: 960px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    border-radius: 24px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.qs-qb--box .qs-qb__media {
    flex: 1 1 400px;
    min-width: 0;
    background: var(--qs-product-image-bg, #FFFFFF);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px;
    min-height: 480px;
}

/* The photos swipe on desktop too: trackpad, finger, or a mouse drag */
.qs-qb--box .qs-qb__slide {
    height: 320px;
}

.qs-qb--box .qs-qb__slide img {
    width: 340px;
    max-width: 100%;
    height: 320px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.qs-qb--box .qs-qb__track.is-swipe {
    cursor: grab;
}

.qs-qb__track.is-dragging {
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}

.qs-qb__pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    gap: 8px;
}

.qs-qb__pager span {
    width: 6px;
    height: 4px;
    border-radius: 999px;
    background: #CCCCCC;
}

.qs-qb__pager span.is-on {
    width: 20px;
    background: #1A1A1A;
}

.qs-qb__info {
    flex: 1 1 440px;
    min-width: 0;
    max-height: calc(100vh - 48px);
    padding: 40px 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #BDBDBD transparent;
}

.qs-qb--box .qs-qb__head {
    padding-inline-end: 40px;
}

/* Sweep (design "Popup buttons — states & specs"): the fill enters from the left on
   hover and exits to the right on mouse-out, 450ms, fill and text colour together;
   ::before scaleX with the origin swapped. Desktop only: touch keeps the static state. */
@media (hover: hover) and (min-width: 768px) {
    .qs-qb--box .qs-qb-btn::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        transform: scaleX(0);
        transform-origin: right center;
        transition: transform var(--qs-qb-dur) var(--qs-qb-ease);
    }

    .qs-qb--box .qs-qb-btn--primary::before {
        background: #FFFFFF;
    }

    .qs-qb--box .qs-qb-btn--secondary::before {
        background: var(--qs-qb-ink);
    }

    .qs-qb--box .qs-qb-btn:not(:disabled):hover::before {
        transform: scaleX(1);
        transform-origin: left center;
    }

    .qs-qb--box .qs-qb-btn--primary:not(:disabled):hover {
        color: var(--qs-qb-ink);
    }

    .qs-qb--box .qs-qb-btn--secondary:not(:disabled):hover {
        color: #FFFFFF;
    }
}

/* ---------- Phone bottom sheet ---------- */
.qs-qb--sheet {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.qs-qb--sheet .qs-qb__scrim {
    animation: qsQbFade .25s ease;
}

.qs-qb--sheet .qs-qb__dialog {
    max-height: 92%;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    animation: qsQbUp .35s cubic-bezier(.2, .8, .2, 1);
}

.qs-qb__handle {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.qs-qb__handle::before {
    content: "";
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #D4D4D4;
}

.qs-qb--sheet .qs-qb__close {
    top: 12px;
    inset-inline-end: 12px;
}

.qs-qb__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.qs-qb--sheet .qs-qb__media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
}

.qs-qb__gallery {
    position: relative;
    width: 100%;
}

.qs-qb__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.qs-qb__track::-webkit-scrollbar,
.qs-qb--sheet .qs-qb__swatches::-webkit-scrollbar {
    display: none;
}

.qs-qb__slide {
    flex: 0 0 100%;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
}

.qs-qb__slide img {
    width: 280px;
    max-width: 100%;
    height: 230px;
    object-fit: contain;
}

.qs-qb__zoom {
    position: absolute;
    inset-inline-end: 0;
    bottom: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qs-qb__zoom span {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #FFFFFF;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
    color: #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qs-qb__bar {
    position: relative;
    width: 160px;
    height: 2px;
    border-radius: 999px;
    background: #E3E3E3;
    overflow: hidden;
}

.qs-qb__bar span {
    position: absolute;
    top: 0;
    height: 2px;
    border-radius: 999px;
    background: #1A1A1A;
    transition: inset-inline-start .25s ease;
}

.qs-qb--sheet .qs-qb__title {
    font-size: 17px !important;
    line-height: 24px;
}

.qs-qb--sheet .qs-qb__price-now {
    font-size: 18px;
}

.qs-qb--sheet .qs-qb__price-was {
    font-size: 13px;
}

.qs-qb--sheet .qs-qb__details {
    margin-top: 0;
}

.qs-qb--sheet .qs-qb-delivery__lines {
    gap: 2px;
}

.qs-qb--sheet .qs-qb-delivery__title {
    gap: 6px;
    font-size: 14px;
    line-height: 22px;
}

.qs-qb--sheet .qs-qb-delivery__sentence {
    font-size: 14px;
    line-height: 22px;
}

.qs-qb--sheet .qs-qb-delivery__fee {
    font-size: 12px;
    line-height: 18px;
}

.qs-qb--sheet [data-qb-rows] {
    gap: 20px;
}

.qs-qb--sheet .qs-qb__row {
    gap: 10px;
}

.qs-qb--sheet .qs-qb__swatches {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
}

.qs-qb--sheet .qs-qb__sw {
    width: 52px;
    height: 52px;
    padding: 3px;
    border-radius: 10px;
}

.qs-qb--sheet .qs-qb__sw img {
    width: 42px;
    height: 42px;
}

.qs-qb__more {
    position: absolute;
    inset-inline-end: -6px;
    top: 50%;
    margin-top: -22px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
}

.qs-qb__more[hidden] {
    display: none;
}

.qs-qb__more span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
    color: #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[dir="rtl"] .qs-qb__more svg {
    transform: scaleX(-1);
}

.qs-qb--sheet .qs-qb__qty {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.qs-qb--sheet .qs-qb__qty-value {
    width: 48px;
}

.qs-qb__foot {
    flex-shrink: 0;
    padding: 12px 20px 20px;
    border-top: 1px solid #EEEEEE;
    gap: 8px;
}

.qs-qb--sheet .qs-qb-btn {
    height: 44px;
    font-size: 13px;
}

/* Zoomed photo (phones) */
.qs-qb__zoomed {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: qsQbFade .25s ease;
}

.qs-qb__zoomed img {
    width: 100%;
    height: 70%;
    object-fit: contain;
    transform: scale(1.15);
}

.qs-qb__close--zoom {
    width: 44px;
    height: 44px;
}

@keyframes qsQbUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes qsQbFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .qs-qb--sheet .qs-qb__dialog,
    .qs-qb--sheet .qs-qb__scrim,
    .qs-qb__zoomed {
        animation: none;
    }

    .product-card .qs-qb-plus,
    .product-card .qs-qb-plus__box,
    .product-card .qs-qb-plus__h,
    .product-card .qs-qb-plus__v,
    .qs-qb-btn,
    .qs-qb-btn::before,
    .qs-qb__bar span {
        transition: none !important;
    }
}
