/* Pictures are never dragged out of a slider (a mouse swipe would pick them up). */
.qthemy-sb-wrap img {
    -webkit-user-drag: none;
}

/* "Protect content": no text selection, and no long-press "Save image" menu on phones. */
.qthemy-sb-wrap.qsb-protect,
.qthemy-sb-wrap.qsb-protect * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.qthemy-sb-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    touch-action: pan-y;
}

/*
 * Elementor's flex containers make a widget only as wide as its content, and a slider has no width of its own,
 * so it ended up 0px wide. Take the container's width the way Elementor's own full-width widgets do; a custom
 * width set in the widget's Advanced > Size still applies.
 */
.e-con > .elementor-widget-qthemy-slider,
.e-con-inner > .elementor-widget-qthemy-slider,
.e-con > .elementor-widget-shortcode:has(.qthemy-sb-wrap),
.e-con-inner > .elementor-widget-shortcode:has(.qthemy-sb-wrap) {
    width: var(--container-widget-width, 100%);
    --flex-grow: var(--container-widget-flex-grow);
}

/* Keep Elementor's shortcode flex item as tall as the slider inside e-con containers. */
.elementor-widget-shortcode.qthemy-sb-has-slider { flex-shrink: 0 !important; }
.e-con.qthemy-sb-has-slider-container { flex-shrink: 0 !important; }

.qthemy-sb-track {
    position: relative;
    width: 100%;
    height: var(--ps-slider-height, 500px);
    overflow: hidden;
}

.ps-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    isolation: isolate;
}

.ps-slide.ps-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    position: relative;
}

.ps-slide.ps-fade-in,
.ps-slide.ps-fade-out {
    visibility: visible;
    animation-duration: var(--qsb-transition-duration, 600ms);
    animation-fill-mode: both;
}

.ps-slide.ps-fade-in {
    position: absolute;
    z-index: 3;
    animation-name: qthemy-sb-fade-in;
}

/* The previous slide stays fully visible underneath until the new one has faded in on top. */
.ps-slide.ps-fade-out {
    z-index: 2;
    pointer-events: none;
    animation: none;
    opacity: 1;
}

@keyframes qthemy-sb-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ps-slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.ps-f-layer {
    position: absolute;
    box-sizing: border-box;
}

.ps-slide > .ps-f-layer { z-index: 2; }

.ps-f-layer img {
    width: 100%;
    height: 100%;
    display: block;
}

.ps-f-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s, filter .2s;
}

/* Theme styles for links inside post content (underline, border, shadow) must not reach slider buttons. */
.qthemy-sb-wrap a.ps-f-btn {
    text-decoration: none;
    border: 0;
    box-shadow: none;
    letter-spacing: normal;
}

.ps-f-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.ps-f-btn-icon {
    display: block;
    flex: 0 0 auto;
}

.ps-f-btn-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- شريط التحكم الموحد أسفل السلايدر في المنتصف ---------- */
.ps-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    direction: ltr;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 8px 14px;
    border-radius: 999px;
}

.ps-ctrl-nav {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}

.ps-ctrl-nav:hover { background: rgba(255, 255, 255, .15); }

.ps-ctrl-nav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.ps-ctrl-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ps-ctrl-dot {
    position: relative;
    width: 26px;
    height: 4px;
    border-radius: 3px;
    background: var(--qsb-dot-color, rgba(255, 255, 255, .3));
    border: none;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: width .2s, background .2s;
}

.ps-ctrl-dot.is-active {
    width: 34px;
    background: var(--qsb-dot-active-color, #fff);
}

/* ---------- Headings inside text layers (H1-H6 / p) take the layer's styles, not the theme's ---------- */
.qthemy-sb-wrap .ps-f-text-tag {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: inherit;
    text-transform: none;
}

.qthemy-sb-wrap .ps-f-text-tag::before,
.qthemy-sb-wrap .ps-f-text-tag::after {
    content: none;
}

/* ---------- Hidden on the current device ---------- */
.qthemy-sb-wrap .ps-f-layer.ps-f-device-hidden {
    display: none !important;
}

/* ---------- Shape + star rating ---------- */
.ps-f-shape-fill {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.ps-f-rating-svg {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Arrows on the sides ---------- */
.ps-ctrl-nav.ps-side-arrow {
    position: absolute;
    top: 50%;
    z-index: 50;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transform: translateY(-50%);
}

.ps-ctrl-nav.ps-side-arrow:hover {
    background: rgba(0, 0, 0, .55);
}

.ps-ctrl-prev.ps-side-arrow { left: 16px; }
.ps-ctrl-next.ps-side-arrow { right: 16px; }

.ps-ctrl-nav.ps-side-arrow svg {
    width: 22px;
    height: 22px;
}

@media (max-width: 767px) {
    .ps-ctrl-nav.ps-side-arrow {
        width: 34px;
        height: 34px;
    }

    .ps-ctrl-prev.ps-side-arrow { left: 8px; }
    .ps-ctrl-next.ps-side-arrow { right: 8px; }
}

/* ---------- Round dots ---------- */
.ps-dots-round .ps-ctrl-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.ps-dots-round .ps-ctrl-dot.is-active {
    width: 22px;
}
.ps-f-shape-fill svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ps-f-rating-svg {
    overflow: visible;
}

/* ---------- Text editor element: paragraphs, lists and links take the element's styles, not the theme's ---------- */
.qthemy-sb-wrap .ps-f-richtext p,
.qthemy-sb-wrap .ps-f-richtext ul,
.qthemy-sb-wrap .ps-f-richtext ol {
    margin: 0 0 var(--qsb-pgap, .6em);
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: inherit;
    text-transform: inherit;
}

.qthemy-sb-wrap .ps-f-richtext ul,
.qthemy-sb-wrap .ps-f-richtext ol {
    padding-inline-start: 1.3em;
    list-style-position: outside;
}

.qthemy-sb-wrap .ps-f-richtext ul {
    list-style-type: disc;
}

.qthemy-sb-wrap .ps-f-richtext ol {
    list-style-type: decimal;
}

.qthemy-sb-wrap .ps-f-richtext li {
    margin: 0 0 .25em;
    padding: 0;
    font: inherit;
    color: inherit;
}

.qthemy-sb-wrap .ps-f-richtext li::before {
    content: none;
}

.qthemy-sb-wrap .ps-f-richtext > :last-child,
.qthemy-sb-wrap .ps-f-richtext li:last-child {
    margin-bottom: 0;
}

.qthemy-sb-wrap .ps-f-richtext a {
    color: var(--qsb-link, inherit);
    text-decoration: underline;
    text-underline-offset: .15em;
    border: 0;
    box-shadow: none;
    background: none;
}

.qthemy-sb-wrap .ps-f-richtext strong {
    font-weight: 700;
}

/* ---------- Container: the elements inside it follow its layout (Flex or Grid), not X/Y ---------- */
.qthemy-sb-wrap .ps-f-layer[data-in-container] {
    position: relative;
    max-width: 100%;
    min-width: 0;
}

.qthemy-sb-wrap .ps-f-container {
    box-sizing: border-box;
}

/* "Fill the container": a button as wide as its place, with the label in the middle. */
.qthemy-sb-wrap .ps-f-layer[data-box-fill] > .ps-f-btn {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

/* List items keep the direction of their own words, while the markers follow the list side (the alignment). */
.qthemy-sb-wrap .ps-f-richtext li {
    unicode-bidi: plaintext;
}

/* ---------- Shape dividers on the slider's top and bottom edges ---------- */
.qthemy-sb-wrap .ps-f-divider {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 30;
    line-height: 0;
    pointer-events: none;
}

.qthemy-sb-wrap .ps-f-divider svg {
    display: block;
    width: 100%;
    height: 100%;
}

.qthemy-sb-wrap .ps-f-divider-bottom {
    bottom: -1px;
}

.qthemy-sb-wrap .ps-f-divider-top {
    top: -1px;
    transform: scaleY(-1);
}

/* ---------- Star rating motion ---------- */
.qsb-stars-pulse .qsb-star-filled path,
.qsb-stars-twinkle .qsb-star-filled path {
    transform-box: fill-box;
    transform-origin: center;
    animation-delay: calc(var(--i, 0) * .14s);
    animation-iteration-count: infinite;
}

.qsb-stars-pulse .qsb-star-filled path {
    animation-name: qsb-star-pop;
    animation-duration: 2.4s;
    animation-timing-function: ease-in-out;
}

.qsb-stars-twinkle .qsb-star-filled path {
    animation-name: qsb-star-twinkle;
    animation-duration: 2.2s;
    animation-timing-function: ease-in-out;
    animation-delay: calc(var(--i, 0) * .22s);
}

@keyframes qsb-star-pop {
    0%, 55%, 100% { transform: none; }
    25% { transform: scale(1.2); }
}

@keyframes qsb-star-twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
    .qsb-stars-pulse .qsb-star-filled path,
    .qsb-stars-twinkle .qsb-star-filled path {
        animation: none;
    }

    .qsb-star-shine {
        display: none;
    }
}

/* ---------- Carousel element (carousel.js): cards placed by script, arrows and dots like the slider's ---------- */
.qthemy-sb-wrap .qsb-car {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.qthemy-sb-wrap .qsb-car-track {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
}

.qthemy-sb-wrap .qsb-car-card {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    border-radius: var(--qsb-car-r, 14px);
    background: rgba(127, 127, 127, .14);
    transform-origin: 50% 50%;
    will-change: transform;
}

.qthemy-sb-wrap .qsb-car-card > a {
    display: block;
    width: 100%;
    height: 100%;
}

.qthemy-sb-wrap .qsb-car-card img,
.qthemy-sb-wrap .qsb-car-card video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

.qthemy-sb-wrap .qsb-car-cap {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px 12px 10px;
    color: #fff;
    font-size: 14px;
    line-height: 1.35;
    background: linear-gradient(to top, rgba(0, 0, 0, .58), rgba(0, 0, 0, 0));
}

.qthemy-sb-wrap .qsb-car-arrow {
    position: absolute;
    top: 50%;
    z-index: 60;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.qthemy-sb-wrap .qsb-car-arrow:hover { background: rgba(0, 0, 0, .62); }
.qthemy-sb-wrap .qsb-car-arrow.is-prev { inset-inline-start: 10px; }
.qthemy-sb-wrap .qsb-car-arrow.is-next { inset-inline-end: 10px; }
.qthemy-sb-wrap .qsb-car-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
[dir="rtl"] .qthemy-sb-wrap .qsb-car-arrow svg { transform: scaleX(-1); }

.qthemy-sb-wrap .qsb-car-dots {
    position: absolute;
    inset: auto 0 10px 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.qthemy-sb-wrap .qsb-car-dots button {
    width: 22px;
    height: 4px;
    border-radius: 3px;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, .4);
    cursor: pointer;
    transition: width .2s, background .2s;
}

.qthemy-sb-wrap .qsb-car-dots button.is-on { width: 32px; background: #fff; }

.qthemy-sb-wrap .qsb-car-arrow:focus-visible,
.qthemy-sb-wrap .qsb-car-dots button:focus-visible,
.qthemy-sb-wrap .qsb-car-card a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
