/* ===== Skeleton (بدون تغییر) ===== */
.pd-info {
    position: relative;
}

.pi-content {
    display: none;
}

.pd-info.is-loading .pi-content {
    display: none;
}

.pd-info.is-loading .pi-skeleton {
    display: grid;
    gap: .6rem;
}

.pd-info.ready .pi-content {
    display: block;
}

.pd-info.ready .pi-skeleton {
    display: none;
}

.skel {
    position: relative;
    border-radius: 12px;
    height: 16px;
    overflow: hidden;
    background: #eee;
}

.skel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
    transform: translateX(-100%);
    animation: skel-shimmer 1.2s infinite;
}

.skel--rating {
    height: 20px;
    width: 65%;
}

.skel--title {
    height: 28px;
    width: 90%;
}

.skel--meta {
    height: 18px;
    width: 40%;
}

.skel--price1 {
    height: 20px;
    width: 60%;
}

.skel--price2 {
    height: 24px;
    width: 70%;
}

.skel--select {
    height: 44px;
    width: 100%;
    border-radius: 12px;
}

.skel--btn {
    height: 48px;
    width: 60%;
    border-radius: 14px;
}

@keyframes skel-shimmer {
    to {
        transform: translateX(100%);
    }
}

/* ===== Rating ===== */
.pi-ratingbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.pi-ratingbar__left, .pi-ratingbar__right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.pi-ratingbar__label {
    color: #777;
    white-space: nowrap;
}

.pi-stars {
    display: flex;
    flex-direction: row-reverse;
    gap: .25rem;
}

.pi-stars input {
    display: none;
}

.pi-stars label {
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: #ccc;
    transition: transform .15s ease, color .15s ease;
}

.pi-stars input:checked ~ label,
.pi-stars label:hover,
.pi-stars label:hover ~ label {
    color: #f5b301;
    transform: translateY(-1px);
}

.pi-rating-avg {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.pi-rating-avg__bar {
    width: 120px;
    height: 8px;
    background: #eee;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .06);
}

.pi-rating-avg__fill {
    display: block;
    height: 100%;
    background: var(--color-rosegold, #B76E79);
}

.pi-rating-avg__num {
    color: #444;
    font-variant-numeric: tabular-nums;
}

/* ===== Category pill ===== */
.pi-row {
    display: flex;
    gap: .5rem;
    margin: .25rem 0 1rem;
    align-items: center;
}

.pi-row__label {
    color: #777;
}

.pi-catpill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    background: #F5F1E9;
    color: var(--color-black, #1C1C1C);
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .06);
    transition: transform .15s, box-shadow .15s, background .15s, color .15s;
    text-decoration: none;
}

.pi-catpill:hover {
    background: var(--color-rosegold, #B76E79);
    color: #fff;
    box-shadow: 0 8px 24px rgba(183, 110, 121, .25);
    transform: translateY(-1px);
}

/* ===== Price & Variants & CTA ===== */
.pi-pricebox {
    padding: .75rem;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 1rem;
}

.pi-pricebox__line {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .25rem 0;
}

.pi-pricebox__label {
    color: #777;
}

.pi-price {
    font-size: 1.25rem;
    font-weight: 800;
}

.pi-price--final {
    color: var(--color-rosegold, #B76E79);
}

.pi-price--strike {
    opacity: .7;
}

.pi-variants {
    display: grid;
    gap: .75rem;
}

.pi-variant {
    display: grid;
    gap: .35rem;
}

.pi-variant__label {
    font-weight: 700;
}

.pi-variant__select {
    height: 44px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 0 .75rem;
    outline: none;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.pi-variant__select:focus {
    border-color: var(--color-rosegold, #B76E79);
    box-shadow: 0 8px 24px rgba(183, 110, 121, .18);
}

/* دکمه افزودن بیرون مودال */
.pd-btn.pd-btn--primary.pi-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 48px;
    border-radius: 14px;
    background: var(--color-black, #1C1C1C);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
    transition: transform .15s, box-shadow .15s, opacity .2s;
}

.pd-btn.pd-btn--primary.pi-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .16);
}

.pd-btn.pd-btn--primary.pi-add:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.pi-add .pi-spinner {
    margin-inline-start: .35rem;
}

.pi-add.is-loading {
    pointer-events: none;
    opacity: .9;
}

.pi-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    display: none;
    animation: pi-spin .7s linear infinite;
}

.pd-btn.pd-btn--primary.pi-add.is-loading .pi-spinner {
    display: inline-block;
}

@keyframes pi-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Modal (بزرگ‌تر و لاکچری‌تر) ===== */
.pi-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1100;
}

.pi-modal.is-open {
    display: block;
}

.pi-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(2px);
}

.pi-modal__dialog {
    position: relative;
    margin: 6vh auto 0;
    width: min(680px, 94%);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.pi-modal--lg {
    width: min(760px, 96%);
}

.pi-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem .5rem;
    border-bottom: 1px solid #f1f1f1;
}

.pi-modal__close {
    border: none;
    background: transparent;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.pi-modal__body {
    padding: 1rem 1.25rem;
    display: grid;
    gap: 1rem;
}

.pi-modal__row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.pi-modal__label {
    color: #777;
    min-width: 110px;
}

.pi-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .75rem 1.25rem 1.1rem;
    background: #fafafa;
    border-top: 1px solid #f1f1f1;
}

.pi-btn--wide {
    min-width: 160px;
}

/* ===== Qty field ===== */
.pi-qty {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.pi-qty__btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.pi-qty__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
    border-color: var(--color-rosegold, #B76E79);
}

.pi-qty__btn[disabled] {
    opacity: .5;
    pointer-events: none;
}

.pi-qty__input {
    width: 110px;
    height: 44px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
}

.pi-qty__input:focus {
    outline: none;
    border-color: var(--color-rosegold, #B76E79);
    box-shadow: 0 8px 20px rgba(183, 110, 121, .15);
}

/* پیام زیر فیلد تعداد */
.pi-qty__hint {
    margin: .35rem 0 0;
    font-size: .92rem;
    min-height: 1.2em;
}

.pi-qty__hint.is-error {
    color: #e11d48;
}

/* قرمز */
.pi-qty__hint.is-warn {
    color: #b45309;
}

/* کهربایی */
.pi-qty__hint.is-muted {
    color: #6b7280;
}

/* خاکستری */

/* ===== دکمه‌های مودال (استایل قشنگ‌تر) ===== */
.pi-btn--outline {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: var(--color-black, #1C1C1C);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .06);
    border-radius: 14px;
    transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}

.pi-btn--outline:hover {
    transform: translateY(-1px);
    border-color: #d1d5db;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .10);
}

.pi-btn--outline:focus-visible {
    outline: 2px solid rgba(183, 110, 121, .35);
    outline-offset: 2px;
}

.pi-confirm {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: linear-gradient(180deg, var(--color-black, #1C1C1C), #111);
    color: #fff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
    transition: transform .15s, box-shadow .15s, opacity .2s;
}

.pi-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .22);
}

.pi-confirm:focus-visible {
    outline: 2px solid rgba(183, 110, 121, .45);
    outline-offset: 2px;
}

.pi-confirm .pi-spinner {
    margin-inline-start: .4rem;
}

.pi-confirm.is-loading .pi-spinner {
    display: inline-block;
}

.pi-confirm.is-loading {
    opacity: .85;
    pointer-events: none;
}

/* ===== SweetAlert2 (هماهنگی با تم) ===== */
.swal2-popup {
    font-family: inherit;
    border-radius: 20px;
}

.swal2-title {
    font-weight: 800;
}

.swal2-confirm {
    background: var(--color-rosegold, #B76E79) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 24px rgba(183, 110, 121, .25);
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(183, 110, 121, .35) !important;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 480px) {
    .pi-stars label {
        font-size: 1.1rem;
    }

    .pi-price {
        font-size: 1.1rem;
    }

    .pi-rating-avg__bar {
        width: 100px;
    }
}

/* ===== SweetAlert Animated Checkmark ===== */
.swal-success-anim {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
}

.swal-success-circle {
    position: absolute;
    inset: 0;
    border: 4px solid #22c55e;
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    transition: transform .5s cubic-bezier(.25, .8, .25, 1), opacity .3s ease;
}

.swal-success-circle.drawn {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .15);
}

.swal-success-check {
    position: absolute;
    left: 24px;
    top: 40px;
    width: 28px;
    height: 14px;
    border-left: 4px solid #22c55e;
    border-bottom: 4px solid #22c55e;
    transform: scale(0) rotate(-45deg);
    opacity: 0;
    transform-origin: center;
    transition: all .4s cubic-bezier(.23, 1, .32, 1);
}

.swal-success-check.visible {
    opacity: 1;
    transform: scale(1) rotate(-45deg);
}

/* ورود/خروج نرم‌تر SweetAlert */
.swal2-show-anim {
    animation: swalPop .4s cubic-bezier(.25, .8, .25, 1);
}

.swal2-hide-anim {
    animation: swalFade .3s ease-in both;
}

@keyframes swalPop {
    0% {
        transform: scale(.7);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes swalFade {
    to {
        transform: scale(.9);
        opacity: 0;
    }
}

/* فاصله‌ی Toast از پایین صفحه */
.swal2-container.td-toast-bottom {
    padding: 0 12px 22px; /* فاصله از پایین */
}

/* ورود/خروج نرم SweetAlert (مشترک Toast/Dialog) */
.swal2-show-anim {
    animation: swalPop .35s cubic-bezier(.25, .8, .25, 1);
}

.swal2-hide-anim {
    animation: swalFade .25s ease-in both;
}

@keyframes swalPop {
    0% {
        transform: translateY(6px) scale(.98);
        opacity: 0;
    }
    100% {
        transform: none;
        opacity: 1;
    }
}

@keyframes swalFade {
    to {
        transform: translateY(4px) scale(.98);
        opacity: 0;
    }
}

.pi-outofstock {
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .06);
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .05);
}

.pi-outofstock__text {
    font-weight: 700;
    color: var(--color-rosegold, #B76E79);
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    justify-content: center;
}
