/* =========================================================
   علاقه‌مندی‌ها — هم‌زبان با طراحی سایت
   ========================================================= */

/* --- دکمه قلب روی کارت محصول --- */
.sg-wish-wrap--loop {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 5;
}
ul.products li.product {
    position: relative;
}
.sg-wish-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #EAE6E1;
    border-radius: 50%;
    color: #999;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
.sg-wish-btn:hover {
    border-color: #C5A059;
    color: #C5A059;
}
.sg-wish-btn.is-active {
    color: #C0392B;
    border-color: #C0392B;
}
.sg-wish-btn.is-loading {
    opacity: 0.5;
    cursor: wait;
}
.sg-wish-btn:focus {
    outline: none;
}
.sg-wish-btn svg {
    transition: transform 0.2s ease;
}
.sg-wish-btn:active svg {
    transform: scale(0.85);
}

/* --- دکمه در صفحه محصول --- */
.sg-wish-wrap--single {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0;
}
.sg-wish-wrap--single .sg-wish-btn {
    width: 38px;
    height: 38px;
    background: #fff;
}
.sg-wish-label {
    font-size: 0.85rem;
    color: #767676;
}

/* --- صفحه علاقه‌مندی‌ها --- */
.sg-wish-page {
    padding: 1rem 0 2rem;
}
.sg-wish-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: #767676;
}
.sg-wish-empty svg {
    color: #C5A059;
    margin-bottom: 1.2rem;
}
.sg-wish-empty p {
    font-size: 0.95rem;
    margin: 0 0 1.6rem;
}
.sg-wish-empty__btn {
    display: inline-block;
    background: #2B2420;
    color: #C5A059;
    border: 1px solid #2B2420;
    border-radius: 2px;
    padding: 0.75rem 2rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
}
.sg-wish-empty__btn:hover {
    background: #C5A059;
    color: #1A1A1A;
    border-color: #C5A059;
}

@media only screen and (max-width: 768px) {
    .sg-wish-wrap--loop {
        top: 0.6rem;
        left: 0.6rem;
    }
    .sg-wish-btn {
        width: 30px;
        height: 30px;
    }
    .sg-wish-btn svg {
        width: 17px;
        height: 17px;
    }
}

/* =========================================================
   تقویت — غلبه بر استایل‌های قالب که ممکنه دکمه رو بپوشونن
   ========================================================= */
html body .sg-wish-wrap,
html body .sg-wish-wrap--loop,
html body .sg-wish-wrap--single {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
html body .sg-wish-wrap--loop {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}
html body .sg-wish-wrap--single {
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
}
html body .sg-wish-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255,255,255,0.95) !important;
    border: 1px solid #EAE6E1 !important;
    border-radius: 50% !important;
    color: #999 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
    cursor: pointer !important;
    line-height: 1 !important;
    font-size: 0 !important;
}
html body .sg-wish-btn:hover {
    border-color: #C5A059 !important;
    color: #C5A059 !important;
    background: #fff !important;
}
html body .sg-wish-btn.is-active {
    color: #C0392B !important;
    border-color: #C0392B !important;
}
html body .sg-wish-btn svg {
    display: block !important;
    width: 19px !important;
    height: 19px !important;
}
html body ul.products li.product {
    position: relative !important;
}

/* اگه به هر دلیلی دو دکمه روی یه کارت رندر شد، فقط اولی نمایش داده بشه */
html body .sg-wish-wrap--loop ~ .sg-wish-wrap--loop {
    display: none !important;
}

/* =========================================================
   موقعیت نهایی — گوشه بالا-راست عکس، همیشه ثابت
   (بج تخفیف دیگه روی عکس نیست، پس هیچ همپوشانی‌ای در کار نیست)
   ========================================================= */
html body .sg-wish-wrap--loop {
    position: absolute !important;
    top: 0.7rem !important;
    right: 0.7rem !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 10 !important;
}

/* دکمه قلب — ظریف، هم‌سبک با بج ارسال سریع */
html body .sg-wish-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid var(--sg-champagne, #EAE6E1) !important;
    box-shadow: none !important;
}
html body .sg-wish-btn svg {
    width: 16px !important;
    height: 16px !important;
}

@media only screen and (max-width: 768px) {
    html body .sg-wish-wrap--loop {
        top: 0.5rem !important;
        right: 0.5rem !important;
    }
    html body .sg-wish-btn {
        width: 27px !important;
        height: 27px !important;
        min-width: 27px !important;
    }
    html body .sg-wish-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
}

/* قلبِ فوری (wishlist.js 1.1): رنگ بدونِ تأخیر + یک «پاپ» کوتاه مثل اینستاگرام */
html body .sg-wish-btn {
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0s !important;
    touch-action: manipulation;
}
html body .sg-wish-btn.is-pop svg { animation: sg-heart-pop 0.24s cubic-bezier(.17,.89,.32,1.28); }
html body .sg-wish-btn.is-unpop svg { animation: sg-heart-unpop 0.18s ease-out; }
@keyframes sg-heart-pop {
    0%   { transform: scale(0.7); }
    60%  { transform: scale(1.22); }
    100% { transform: scale(1); }
}
@keyframes sg-heart-unpop {
    0%   { transform: scale(0.85); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    html body .sg-wish-btn.is-pop svg,
    html body .sg-wish-btn.is-unpop svg { animation: none; }
}
