/* Buy from Nakhl Market with a Digikala account: product card, mobile chip and story guide */

:root {
    --nm-dk-red: #EF4056;
    --nm-dk-red-dark: #D32F45;
    --nm-dk-red-soft: #FFF0F2;
    --nm-dk-ink: #23254E;
}

/* ---------- Product page card ---------- */
.nm-dk-guide-section {
    width: 100%;
    position: relative;
    z-index: 2;
}

.nm-dk-guide-widget {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: var(--nm-dk-red-soft);
    color: var(--nm-dk-red-dark);
    font: inherit;
    text-align: right;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease;
}

.nm-dk-guide-widget:hover {
    background: #FFE4E8;
}

.nm-dk-guide-widget:focus-visible {
    outline: 2px solid var(--nm-dk-red);
    outline-offset: 2px;
}

.nm-dk-guide-widget__ring {
    position: relative;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(from 210deg, #EF4056, #FF8A3D, #FFC53D, #EF4056);
    padding: 2px;
}

.nm-dk-guide-widget__ring::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #fff;
}

.nm-dk-guide-widget__ring img {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.nm-dk-guide-widget:not(.is-seen) .nm-dk-guide-widget__ring {
    animation: nm-dk-ring-pulse 2.4s ease-in-out infinite;
}

.nm-dk-guide-widget.is-seen .nm-dk-guide-widget__ring {
    background: #E0E0E2;
}

.nm-dk-guide-widget__text {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 13px;
    line-height: 20px;
    color: var(--nm-dk-red-dark);
}

.nm-dk-guide-widget__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--nm-dk-red);
}

@keyframes nm-dk-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 64, 86, .35); }
    50% { box-shadow: 0 0 0 5px rgba(239, 64, 86, 0); }
}

/* ---------- Mobile chip under product title ---------- */
@media (max-width: 767px) {
    .nm-product-credit-chip--digikala {
        border: 0;
        margin: 0;
        font-family: inherit;
        background: var(--nm-dk-red-soft);
        color: var(--nm-dk-red-dark);
        cursor: pointer;
    }

    .nm-product-credit-chip--digikala span {
        color: var(--nm-dk-red-dark);
    }

    .nm-product-credit-chip--digikala img {
        border-radius: 50%;
    }
}

/* ---------- Story dialog ---------- */
html.nm-dk-story-open,
html.nm-dk-story-open body {
    overflow: hidden !important;
}

.nm-dk-story[hidden] {
    display: none !important;
}

.nm-dk-story {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    direction: rtl;
    font-family: 'YekanBakhFaNum', Tahoma, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.nm-dk-story__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 20, .82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: nm-dk-fade .25s ease both;
}

.nm-dk-story__card {
    position: relative;
    width: min(400px, 100vw);
    height: min(720px, calc(100vh - 48px));
    height: min(720px, calc(100dvh - 48px));
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(165deg, #FF5A6E 0%, #EF4056 45%, #B71F3A 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
    animation: nm-dk-pop .3s cubic-bezier(.2, .9, .3, 1.2) both;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .2s ease, opacity .2s ease;
}

.nm-dk-story__card::before {
    content: "";
    position: absolute;
    inset: -30% -40% auto auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.nm-dk-story__progress {
    position: relative;
    display: flex;
    gap: 4px;
    padding: 12px 12px 0;
    direction: rtl;
}

.nm-dk-story__bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .35);
    overflow: hidden;
}

.nm-dk-story__bar i {
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: right center;
}

.nm-dk-story__bar.is-done i {
    transform: scaleX(1);
}

.nm-dk-story__bar.is-active i {
    animation: nm-dk-progress var(--nm-dk-slide-ms, 6500ms) linear forwards;
}

.nm-dk-story.is-paused .nm-dk-story__bar.is-active i {
    animation-play-state: paused;
}

.nm-dk-story__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 0;
}

.nm-dk-story__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nm-dk-story__avatars {
    display: flex;
    flex-shrink: 0;
}

.nm-dk-story__avatars img {
    width: 30px;
    height: 30px;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #fff;
    object-fit: contain;
}

.nm-dk-story__avatars img + img {
    margin-right: -10px;
    padding: 0;
    object-fit: cover;
}

.nm-dk-story__brand-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nm-dk-story__actions {
    display: flex;
    gap: 2px;
}

.nm-dk-story__icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nm-dk-story__icon-btn:hover,
.nm-dk-story__icon-btn:focus-visible {
    background: rgba(255, 255, 255, .18);
    outline: none;
}

.nm-dk-story__icon-btn .nm-dk-icon-play,
.nm-dk-story.is-paused .nm-dk-story__icon-btn .nm-dk-icon-pause {
    display: none;
}

.nm-dk-story.is-paused .nm-dk-story__icon-btn .nm-dk-icon-play {
    display: block;
}

.nm-dk-story__slides {
    position: relative;
    flex: 1;
    min-height: 0;
}

.nm-dk-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 20px 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-24px);
    transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

.nm-dk-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .3s ease, transform .3s ease, visibility 0s;
}

.nm-dk-slide__visual {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nm-dk-slide__text {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.nm-dk-slide__eyebrow,
.nm-dk-slide__step {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .2);
    font-size: 12px;
    font-weight: 700;
}

.nm-dk-slide__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.5;
    color: #fff;
    text-wrap: balance;
}

.nm-dk-slide__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .92);
}

.nm-dk-slide__cta {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.nm-dk-btn {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease;
}

.nm-dk-btn:active {
    transform: scale(.97);
}

.nm-dk-btn--primary {
    width: 100%;
    background: #fff;
    color: var(--nm-dk-red-dark);
}

.nm-dk-btn--primary:hover,
.nm-dk-btn--primary:focus {
    color: var(--nm-dk-red-dark);
    background: #FFF5F6;
}

.nm-dk-btn--ghost {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

.nm-dk-slide__cta .nm-dk-btn--ghost {
    width: 100%;
}

.nm-dk-btn--ghost:hover,
.nm-dk-btn--ghost:focus {
    color: #fff;
    background: rgba(255, 255, 255, .26);
}

.nm-dk-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Slide 1: logos */
.nm-dk-intro {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nm-dk-intro__logo {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

.nm-dk-intro__logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.nm-dk-intro__logo--dk {
    overflow: hidden;
    background: #EE2B47;
}

.nm-dk-intro__logo--dk img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nm-dk-slide.is-active .nm-dk-intro__logo--nakhl {
    animation: nm-dk-slide-in-right .6s cubic-bezier(.2, .9, .3, 1.2) both;
}

.nm-dk-slide.is-active .nm-dk-intro__logo--dk {
    animation: nm-dk-slide-in-left .6s cubic-bezier(.2, .9, .3, 1.2) both;
}

.nm-dk-intro__link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nm-dk-slide.is-active .nm-dk-intro__link {
    animation: nm-dk-pop .5s .35s cubic-bezier(.2, .9, .3, 1.4) both;
}

/* Slides 2-3: phone mockup */
.nm-dk-phone {
    width: 200px;
    height: 100%;
    max-height: 300px;
    padding: 10px;
    border-radius: 30px;
    background: #15162B;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}

.nm-dk-slide.is-active .nm-dk-phone {
    animation: nm-dk-rise .5s ease both;
}

.nm-dk-phone__screen {
    height: 100%;
    border-radius: 22px;
    background: #fff;
    color: var(--nm-dk-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 12px;
    overflow: hidden;
}

.nm-dk-phone__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.nm-dk-phone__label {
    font-size: 13px;
    font-weight: 700;
}

.nm-dk-phone__input {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--nm-dk-red);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    direction: ltr;
    font-size: 12px;
    font-weight: 600;
}

.nm-dk-phone__btn {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    background: var(--nm-dk-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nm-dk-slide.is-active .nm-dk-phone__btn {
    animation: nm-dk-tap 1.1s 2s ease both;
}

.nm-dk-phone__screen--search {
    justify-content: flex-start;
    align-items: stretch;
}

.nm-dk-search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    background: #F0F0F1;
    color: #81858B;
    font-size: 12px;
    font-weight: 600;
}

.nm-dk-search .nm-dk-type {
    color: var(--nm-dk-ink);
}

.nm-dk-result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    background: var(--nm-dk-red-soft);
    box-shadow: inset 0 0 0 1.5px var(--nm-dk-red);
    opacity: 0;
}

.nm-dk-slide.is-active .nm-dk-result {
    animation: nm-dk-rise .4s 1.8s ease both;
}

.nm-dk-result img {
    width: 32px;
    height: 32px;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
}

.nm-dk-result__meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.nm-dk-result__meta strong {
    font-size: 12px;
}

.nm-dk-result__meta small {
    font-size: 10px;
    color: #62666D;
}

.nm-dk-skeleton {
    height: 44px;
    border-radius: 10px;
    background: #F0F0F1;
}

.nm-dk-skeleton--short {
    width: 70%;
}

/* typing effect */
.nm-dk-type {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    max-width: 0;
    vertical-align: bottom;
    border-inline-end: 1.5px solid transparent;
}

.nm-dk-slide.is-active .nm-dk-type {
    animation:
        nm-dk-typing 1.2s .5s steps(12, end) forwards,
        nm-dk-caret .8s step-end 4;
}

/* Slide 4: product card */
.nm-dk-product {
    width: 220px;
    padding: 14px;
    border-radius: 18px;
    background: #fff;
    color: var(--nm-dk-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
}

.nm-dk-slide.is-active .nm-dk-product {
    animation: nm-dk-rise .5s ease both;
}

.nm-dk-product__img {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nm-dk-product__img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.nm-dk-product__name {
    width: 100%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.8;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nm-dk-product__seller {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #62666D;
}

.nm-dk-product__seller img {
    width: 16px;
    height: 16px;
}

.nm-dk-product__btn {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    background: var(--nm-dk-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nm-dk-slide.is-active .nm-dk-product__btn {
    animation: nm-dk-tap 1.1s 1.2s ease both;
}

/* Desktop side arrows */
.nm-dk-story__nav {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--nm-dk-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .2s ease, transform .15s ease;
}

.nm-dk-story__nav:hover {
    transform: scale(1.06);
}

.nm-dk-story__nav[disabled] {
    opacity: 0;
    pointer-events: none;
}

.nm-dk-story__toast {
    position: absolute;
    left: 50%;
    bottom: 20px;
    z-index: 5;
    transform: translate(-50%, 12px);
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(20, 20, 30, .9);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.nm-dk-story__toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 767px) {
    .nm-dk-story__card {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .nm-dk-story__progress {
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .nm-dk-slide {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .nm-dk-story__nav {
        display: none;
    }
}

@media (max-height: 640px) {
    .nm-dk-phone {
        max-height: 230px;
    }

    .nm-dk-intro__logo {
        width: 76px;
        height: 76px;
    }

    .nm-dk-product__img {
        width: 80px;
        height: 80px;
    }

    .nm-dk-slide__title {
        font-size: 19px;
    }
}

@keyframes nm-dk-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes nm-dk-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nm-dk-pop {
    from { opacity: 0; transform: scale(.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes nm-dk-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

@keyframes nm-dk-slide-in-right {
    from { opacity: 0; transform: translateX(40px) rotate(8deg); }
    to { opacity: 1; transform: none; }
}

@keyframes nm-dk-slide-in-left {
    from { opacity: 0; transform: translateX(-40px) rotate(-8deg); }
    to { opacity: 1; transform: none; }
}

@keyframes nm-dk-typing {
    from { max-width: 0; }
    to { max-width: 12em; }
}

@keyframes nm-dk-caret {
    50% { border-color: currentColor; }
}

@keyframes nm-dk-tap {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(.92); box-shadow: 0 0 0 6px rgba(239, 64, 86, .25); }
}

@media (prefers-reduced-motion: reduce) {
    .nm-dk-story *,
    .nm-dk-story *::before,
    .nm-dk-guide-widget__ring {
        transition: none !important;
    }

    .nm-dk-slide.is-active *,
    .nm-dk-guide-widget__ring {
        animation: none !important;
    }

    .nm-dk-type {
        max-width: none;
    }

    .nm-dk-result {
        opacity: 1;
    }
}
