/* ============================================================
   Nova Sticky Buy Button v4.0.0
   - فقط دکمه "قیمت و خرید"
   - بدون متن "تماس بگیرید"
   - پشتیبانی از External، Add to Cart، ناموجود
============================================================ */

/* ═══ کانتینر شناور ═══ */
.nova-sticky-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    padding: 0 16px 16px;
    pointer-events: none;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
}

.nova-sticky-buy.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ═══ لایه داخلی ═══ */
.nova-sticky-buy__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 18px;
    box-shadow:
        0 -4px 20px rgba(0, 0, 0, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.nova-sticky-buy__inner::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc2626, #ef4444, #dc2626);
    border-radius: 18px 18px 0 0;
}

/* ═══ تصویر کوچک ═══ */
.nova-sticky-buy__thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nova-sticky-buy__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

/* ═══ اطلاعات ═══ */
.nova-sticky-buy__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nova-sticky-buy__title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #171717;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
    text-align: right;
    max-width: 100%;
}

.nova-sticky-buy__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nova-sticky-buy__old {
    color: #999;
    font-size: 12px;
    font-weight: 500;
    text-decoration: line-through;
}

.nova-sticky-buy__current {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: #dc2626;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
}

.nova-sticky-buy__unit {
    color: #999;
    font-size: 11px;
    font-weight: 500;
}

/* ═══ حذف متن "تماس بگیرید" / "قیمت نامشخص" بغل دکمه ═══ */
.nova-sticky-buy__info .nova-sticky-buy__call {
    display: none !important;
}

/* ═══ دکمه — پایه مشترک ═══ */
.nova-sticky-buy__action {
    flex: 0 0 auto;
}

.nova-sticky-buy__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff !important;
    border: 0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.3);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.nova-sticky-buy__btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: 0;
}

.nova-sticky-buy__btn:hover::before {
    width: 200px;
    height: 200px;
}

.nova-sticky-buy__btn:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.4);
}

.nova-sticky-buy__btn i,
.nova-sticky-buy__btn span {
    position: relative;
    z-index: 1;
}

.nova-sticky-buy__btn i {
    font-size: 14px;
}

/* ═══ دکمه External (دیجی‌کالا / باسلام) ═══ */
.nova-sticky-buy__btn--external {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.nova-sticky-buy__btn--external:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.nova-sticky-buy__btn--external i {
    font-size: 12px;
    opacity: 0.95;
}

/* ═══ دکمه افزودن به سبد (محصول ساده) ═══ */
.nova-sticky-buy__btn--add-to-cart {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.nova-sticky-buy__btn--add-to-cart.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}

.nova-sticky-buy__btn--add-to-cart.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: novaStickySpin 0.6s linear infinite;
    z-index: 2;
}

.nova-sticky-buy__btn--add-to-cart.loading i,
.nova-sticky-buy__btn--add-to-cart.loading span {
    opacity: 0;
}

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

.nova-sticky-buy__btn--add-to-cart.added {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

/* ═══ دکمه ناموجود ═══ */
.nova-sticky-buy__btn--disabled {
    background: #9ca3af !important;
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3) !important;
    cursor: not-allowed !important;
    opacity: 0.9 !important;
}

.nova-sticky-buy__btn--disabled:hover {
    transform: none !important;
    background: #9ca3af !important;
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3) !important;
}

.nova-sticky-buy__btn--disabled::before {
    display: none !important;
}

.nova-sticky-buy__btn--disabled span {
    font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════
   ریسپانسیو
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 991px) {
    .nova-sticky-buy__btn {
        padding: 11px 18px;
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .nova-sticky-buy {
        padding: 0 10px 10px;
    }

    .nova-sticky-buy__inner {
        padding: 10px 12px;
        gap: 10px;
        border-radius: 14px;
        flex-wrap: wrap;
    }

    .nova-sticky-buy__thumb {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .nova-sticky-buy__title {
        font-size: 12.5px;
        -webkit-line-clamp: 1;
    }

    .nova-sticky-buy__current {
        font-size: 13.5px;
    }

    .nova-sticky-buy__old {
        font-size: 11px;
    }

    .nova-sticky-buy__action {
        width: 100%;
    }

    .nova-sticky-buy__btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 10px;
    }

    .nova-sticky-buy__info {
        flex: 1 1 calc(100% - 60px);
    }
}

@media (max-width: 480px) {
    .nova-sticky-buy__inner {
        padding: 8px 10px;
        gap: 8px;
    }

    .nova-sticky-buy__thumb {
        width: 40px;
        height: 40px;
    }

    .nova-sticky-buy__title {
        font-size: 12px;
    }

    .nova-sticky-buy__current {
        font-size: 13px;
    }

    .nova-sticky-buy__btn {
        padding: 10px 14px;
        font-size: 12.5px;
    }
}

/* ═══════════════════════════════════════════════════════════
   LTR Support
   ═══════════════════════════════════════════════════════════ */

html[dir="ltr"] .nova-sticky-buy__inner {
    flex-direction: row-reverse;
}

html[dir="ltr"] .nova-sticky-buy__title {
    text-align: left;
}

html[dir="ltr"] .nova-sticky-buy__price {
    justify-content: flex-start;
}

/* ═══════════════════════════════════════════════════════════
   Accessibility
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .nova-sticky-buy,
    .nova-sticky-buy__btn {
        transition: none !important;
    }

    .nova-sticky-buy__btn--add-to-cart.loading::after {
        animation: none;
    }
}

@media print {
    .nova-sticky-buy {
        display: none !important;
    }
}