.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;
}

.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;
}
