/* KStory Style 1 Rewrite - RTL, animated story ring, blurred modal backdrop */
#kstory-shortcode-container.kstory-style-1,
#kstory-shortcode-container.kstory-style-1 * {
    box-sizing: border-box !important;
}

#kstory-shortcode-container.kstory-style-1 {
    direction: rtl !important;
    --kstory-bg: #ffffff;
    --kstory-text: #1f2937;
    --kstory-muted: #6b7280;
    --kstory-card: #111111;
    --kstory-ring-1: #833ab4;
    --kstory-ring-2: #fd1d1d;
    --kstory-ring-3: #fcb045;
    --kstory-shadow: 0 18px 45px rgba(15, 23, 42, .16);
    --kstory-modal-shadow: 0 28px 90px rgba(0, 0, 0, .45);
    font-family: inherit !important;
}

#kstory-shortcode-container.kstory-style-1 .swiper-story-shop,
#kstory-shortcode-container.kstory-style-1 .swiper-story-items {
    direction: rtl !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop.kstory-story-strip {
    margin: 18px 0 !important;
    padding: 10px 2px 12px !important;
    overflow: hidden !important;
}

#kstory-shortcode-container.kstory-style-1 .swiper-story-shop {
    padding: 4px 2px 8px !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop .swiper-slide {
    width: auto !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__item {
    width: 92px !important;
    align-items: center !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 4px 0 !important;
    transition: transform .25s ease, opacity .25s ease !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__item:hover {
    transform: translateY(-2px) !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__item .image {
    width: 90px !important;
    height: 90px !important;
    padding: 3px !important;
    position: relative !important;
    isolation: isolate !important;
    border-radius: 999px !important;
    background-size: 280% 280% !important;
    animation: kstoryRingFlow 4.2s ease-in-out infinite !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12) !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__item .image::before {
    content: "" !important;
    position: absolute !important;
    inset: -3px !important;
    border-radius: inherit !important;
    background: conic-gradient(from 0deg, var(--kstory-ring-1), var(--kstory-ring-2), var(--kstory-ring-3), var(--kstory-ring-1)) !important;
    z-index: -1 !important;
    opacity: .72 !important;
    filter: blur(.2px) !important;
    animation: kstoryRingSpin 4.8s linear infinite !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__item .image span {
    width: 82px !important;
    height: 82px !important;
    position: relative !important;
    z-index: 2 !important;
    background: #fff !important;
    padding: 3px !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9) !important;
}

#kstory-shortcode-container.kstory-style-1 .storyhoverimg,
#kstory-shortcode-container.kstory-style-1 .storyhoverimg img {
    width: 74px !important;
    height: 74px !important;
    border-radius: 999px !important;
}

#kstory-shortcode-container.kstory-style-1 .storyhoverimg img {
    display: block !important;
    object-fit: cover !important;
    transition: filter .22s ease, transform .22s ease !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__item:hover .storyhoverimg img {
    transform: scale(1.02) !important;
}

#kstory-shortcode-container.kstory-style-1 .storyhoverimg svg {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(.9) !important;
    width: 22px !important;
    height: 22px !important;
    transition: opacity .22s ease, transform .22s ease !important;
}

#kstory-shortcode-container.kstory-style-1 .storyhoverimg:hover svg,
#kstory-shortcode-container.kstory-style-1 .story-shop__item:hover .storyhoverimg svg {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__item .title {
    width: 90px !important;
    max-width: 90px !important;
    margin: 0 auto !important;
    color: var(--kstory-text) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.65 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    min-height: 38px !important;
}

#kstory-shortcode-container.kstory-style-1 .upperstorytitle {
    position: relative !important;
    z-index: 3 !important;
    margin-top: -18px !important;
    box-shadow: 0 5px 13px rgba(15, 23, 42, .18) !important;
}

/* Modal backdrop blur */
#kstory-shortcode-container.kstory-style-1 .modal {
    background: rgba(8, 12, 24, .58) !important;
    backdrop-filter: blur(13px) saturate(1.18) !important;
    -webkit-backdrop-filter: blur(13px) saturate(1.18) !important;
    transition: opacity .24s ease, visibility .24s ease !important;
}

body.kstory-modal-open {
    overflow: hidden !important;
}

#kstory-shortcode-container.kstory-style-1 .modal.show .modal-dialog {
    animation: kstoryModalPop .26s cubic-bezier(.2, .85, .25, 1) both !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .modal-dialog {
    max-width: 380px !important;
    width: min(380px, calc(100vw - 34px)) !important;
    height: min(720px, calc(100vh - 56px)) !important;
    min-height: auto !important;
    margin: 28px auto !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .modal-content,
#kstory-shortcode-container.kstory-style-1 .modal-story-shop .modal-body {
    height: 100% !important;
    max-height: none !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 30px !important;
    overflow: visible !important;
}

#kstory-shortcode-container.kstory-style-1 .swiper.swiper-story-items .swiper-slide {
    opacity: 0 !important;
    transition: opacity .22s ease !important;
}

#kstory-shortcode-container.kstory-style-1 .swiper.swiper-story-items .swiper-slide.swiper-slide-active {
    opacity: 1 !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__story {
    border: 0 !important;
    border-radius: 30px !important;
    overflow: hidden !important;
    background: var(--kstory-card) !important;
    box-shadow: var(--kstory-modal-shadow) !important;
}

#kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story {
    border: 2px solid transparent !important;
    background:
        linear-gradient(var(--kstory-card), var(--kstory-card)) padding-box,
        conic-gradient(from var(--kstory-ring-angle, 0deg), var(--kstory-ring-1), var(--kstory-ring-2), var(--kstory-ring-3), var(--kstory-ring-1)) border-box !important;
    background-clip: padding-box, border-box !important;
    box-shadow: var(--kstory-modal-shadow), 0 0 0 1px rgba(255,255,255,.14) !important;
    animation: kstoryStoryBorderSpin 5.5s linear infinite !important;
}

#kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story::after {
    content: none !important;
    display: none !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__story .heading::before {
    border-radius: 28px 28px 0 0 !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__story .video,
#kstory-shortcode-container.kstory-style-1 .story-shop__story .video__box,
#kstory-shortcode-container.kstory-style-1 .story-shop__story .video video,
#kstory-shortcode-container.kstory-style-1 .story-shop__story .video img {
    border-radius: 30px !important;
}

#kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story .video,
#kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story .video__box,
#kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story .video video,
#kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story .video img {
    border-radius: 28px !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-story-close-btn {
    position: fixed !important;
    top: 18px !important;
    right: 18px !important;
    z-index: 10050 !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border: 1px solid rgba(255,255,255,.52) !important;
    border-radius: 999px !important;
    background: rgba(17, 24, 39, .52) !important;
    color: #fff !important;
    box-shadow: 0 16px 34px rgba(0,0,0,.24) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    backdrop-filter: blur(12px) saturate(1.1) !important;
    -webkit-backdrop-filter: blur(12px) saturate(1.1) !important;
    transition: transform .2s ease, background .2s ease, border-color .2s ease !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-story-close-btn:hover {
    transform: scale(1.05) !important;
    background: rgba(17, 24, 39, .72) !important;
    border-color: rgba(255,255,255,.72) !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-story-close-btn svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__story .heading .modal-close {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    margin: 12px !important;
    border: 1px solid rgba(255,255,255,.42) !important;
    border-radius: 999px !important;
    background: rgba(0,0,0,.30) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

#kstory-shortcode-container.kstory-style-1 .story-shop__story .heading .modal-close svg {
    width: 21px !important;
    height: 21px !important;
}

/* RTL story navigation */
#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-btn {
    position: fixed !important;
    top: 50% !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    border: 1px solid rgba(255, 255, 255, .72) !important;
    background: rgba(255, 255, 255, .88) !important;
    color: #111827 !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22) !important;
    transform: translateY(-50%) !important;
    z-index: 10030 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-next {
    left: max(16px, calc(50% - 270px)) !important;
    right: auto !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-prev {
    right: max(16px, calc(50% - 270px)) !important;
    left: auto !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-btn svg {
    width: 22px !important;
    height: 22px !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-btn:hover {
    transform: translateY(-50%) scale(1.04) !important;
    background: rgba(255, 255, 255, .98) !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-btn.swiper-button-disabled,
#kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-btn.swiper-button-lock {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#kstory-shortcode-container.kstory-style-1 .modal-comments-story .modal-content,
#kstory-shortcode-container.kstory-style-1 .modal-product-story .modal-content {
    border-radius: 22px !important;
    box-shadow: var(--kstory-shadow) !important;
}

@media only screen and (max-width: 767px) {
    #kstory-shortcode-container.kstory-style-1 .story-shop.kstory-story-strip {
        padding-inline: 8px !important;
    }

    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        margin: 0 !important;
    }

    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .modal-content,
    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .modal-body,
    #kstory-shortcode-container.kstory-style-1 .story-shop__story,
    #kstory-shortcode-container.kstory-style-1 .story-shop__story .video,
    #kstory-shortcode-container.kstory-style-1 .story-shop__story .video__box,
    #kstory-shortcode-container.kstory-style-1 .story-shop__story .video video,
    #kstory-shortcode-container.kstory-style-1 .story-shop__story .video img {
        border-radius: 0 !important;
    }

    #kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story {
        border: 0 !important;
        background: var(--kstory-card) !important;
        animation: none !important;
    }

    #kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story::after {
        content: none !important;
        display: none !important;
    }

    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-story-close-btn {
        top: 14px !important;
        right: 14px !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
    }

    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-btn {
        top: auto !important;
        bottom: 22px !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        transform: none !important;
        background: rgba(255, 255, 255, .82) !important;
    }

    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-btn:hover {
        transform: none !important;
    }

    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-next {
        left: 14px !important;
        right: auto !important;
    }

    #kstory-shortcode-container.kstory-style-1 .modal-story-shop .kstory-nav-prev {
        right: 14px !important;
        left: auto !important;
    }
}

@property --kstory-ring-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes kstoryStoryBorderSpin {
    to { --kstory-ring-angle: 360deg; }
}

@keyframes kstoryRingFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes kstoryRingSpin {
    to { transform: rotate(360deg); }
}

@keyframes kstoryModalPop {
    from { opacity: 0; transform: translateY(14px) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    #kstory-shortcode-container.kstory-style-1 .story-shop__item .image,
    #kstory-shortcode-container.kstory-style-1 .story-shop__item .image::before,
    #kstory-shortcode-container.kstory-style-1 .swiper-slide-active .story-shop__story,
    #kstory-shortcode-container.kstory-style-1 .modal.show .modal-dialog {
        animation: none !important;
    }
}
