/* Desktop PDP — aligned with marketplace homepage (mk-*) */
:root {
    --pd-bg: #F7F8FC;
    --pd-surface: #ffffff;
    --pd-primary: #5146E5;
    --pd-primary-2: #7C5CFF;
    --pd-accent: #2563EB;
    --pd-green: #16B981;
    --pd-danger: #EF4444;
    --pd-text: #171A2B;
    --pd-muted: #697386;
    --pd-border: #E8EAF0;
    --pd-radius: 16px;
    --pd-radius-sm: 12px;
    --pd-shadow: 0 4px 18px rgba(23, 26, 43, 0.06);
    --pd-shadow-hover: 0 12px 28px rgba(23, 26, 43, 0.1);
    --pd-max: 1680px;
}

body.product-seo-page {
    background: var(--pd-bg) !important;
}

.desktop-container.pd-store {
    max-width: var(--pd-max);
    margin: 0 auto;
    padding: 20px 24px 0;
    width: 100%;
    box-sizing: border-box;
}

.pd-store__shell {
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    box-shadow: var(--pd-shadow);
    overflow: hidden;
}

.pd-store__grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 0.9fr);
    gap: 0;
    align-items: stretch;
}

.pd-store__media {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    border-inline-end: 1px solid var(--pd-border);
    position: sticky;
    top: 0;
    align-self: start;
    min-width: 0;
    background: linear-gradient(180deg, #fafbff 0%, #fff 40%);
}

/* اسلایدر تصویر / ویدئو */
.pd-media-slider {
    position: relative;
    width: 100%;
    border-radius: var(--pd-radius-sm);
    border: 1px solid var(--pd-border);
    background: #f3f4f8;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.pd-media-slider__viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    direction: ltr;
    --pd-slide-count: 1;
}
.pd-media-slider__track {
    display: flex;
    height: 100%;
    width: calc(100% * var(--pd-slide-count));
    transition: transform 0.35s ease;
    will-change: transform;
}
.pd-media-slider__slide {
    position: relative;
    flex: 0 0 calc(100% / var(--pd-slide-count));
    width: calc(100% / var(--pd-slide-count));
    max-width: calc(100% / var(--pd-slide-count));
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #f3f4f8;
}
.pd-media-slider__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    display: block;
}
.pd-media-slider__video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    background: #111827;
}
.pd-video-poster-gate {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.pd-video-poster-gate img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.pd-video-poster-gate.is-hiding {
    opacity: 0;
}
.pd-media-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--pd-border);
    background: rgba(255, 255, 255, 0.95);
    color: var(--pd-text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--pd-shadow);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pd-media-slider__nav:hover {
    background: #fff;
    border-color: var(--pd-primary);
    color: var(--pd-primary);
}
.pd-media-slider__nav--prev { left: 10px; }
.pd-media-slider__nav--next { right: 10px; }
@media (max-width: 520px) {
    .pd-media-slider__nav { width: 32px; height: 32px; font-size: 16px; }
}

.pd-gallery {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.pd-gallery::-webkit-scrollbar { height: 6px; }
.pd-gallery::-webkit-scrollbar-thumb {
    background: #c8cce0;
    border-radius: 999px;
}

.desktop-thumb-item {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    outline: 1px solid var(--pd-border);
    outline-offset: -1px;
    transition: border-color .15s ease, box-shadow .15s ease, outline-color .15s ease;
    background: #fff;
    position: relative;
    scroll-snap-align: start;
}
.desktop-thumb-item:hover {
    outline-color: #c7c9e0;
    box-shadow: var(--pd-shadow);
}
.desktop-thumb-item.active {
    border-color: var(--pd-primary);
    outline-color: transparent;
    box-shadow: 0 0 0 3px rgba(81, 70, 229, 0.18);
}
.desktop-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.desktop-thumb-video-badge {
    position: absolute;
    bottom: 4px;
    inset-inline-start: 4px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--pd-primary);
    border: 1px solid var(--pd-border);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
}

.pd-store__aside {
    padding: 24px 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.handmade-prep-badge {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--pd-radius-sm);
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}
.handmade-prep-badge i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 15px;
}
.handmade-prep-badge--desktop {
    margin-top: -4px;
}

.desktop-shop-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--pd-border);
}
.desktop-shop-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--pd-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.desktop-shop-name:hover { color: var(--pd-primary); }
.desktop-shop-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f1ff;
    border: 1px solid var(--pd-border);
    flex-shrink: 0;
}
.desktop-shop-header-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
}
.desktop-like-share-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}
.desktop-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--pd-border);
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--pd-muted);
    transition: .2s;
    padding: 0;
    line-height: 0;
}
.desktop-icon-btn:hover {
    background: #f3f1ff;
    border-color: #c7c9e8;
    color: var(--pd-primary);
}
.desktop-like-btn.liked {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--pd-danger);
}
.desktop-share-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.desktop-follow-btn,
.desktop-unfollow-btn {
    padding: 9px 16px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.desktop-follow-btn {
    background: var(--pd-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(81, 70, 229, 0.28);
}
.desktop-unfollow-btn { background: var(--pd-green); color: #fff; }
.desktop-follow-btn:hover,
.desktop-unfollow-btn:hover { opacity: 0.92; }

.hidden { display: none !important; }

.pd-store__title {
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    font-weight: 800;
    color: var(--pd-text);
    line-height: 1.4;
    margin: 0;
    letter-spacing: -0.02em;
}

.pd-desc-block {
    background: #f7f8fc;
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius-sm);
    padding: 14px 16px;
}
.pd-desc-block__label {
    font-size: 11px;
    font-weight: 800;
    color: var(--pd-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 8px;
}
.pd-desc-block__body {
    position: relative;
}
.pd-desc-block.is-collapsed .pd-desc-block__body {
    max-height: calc(1.75em * 5);
    overflow: hidden;
}
.pd-desc-block.is-collapsed.is-clamped .pd-desc-block__body::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2.4em;
    background: linear-gradient(to top, #f7f8fc 12%, transparent);
    pointer-events: none;
}
.pd-desc-block.is-collapsed .desktop-description img,
.pd-desc-block.is-collapsed .desktop-description video,
.pd-desc-block.is-collapsed .desktop-description iframe {
    display: none;
}
.pd-desc-block__more {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pd-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.3;
}
.pd-desc-block__more:hover {
    color: #3d35c7;
    text-decoration: underline;
}
.pd-desc-block__more[hidden] {
    display: none !important;
}
.desktop-description {
    font-size: 14px;
    color: #3d4258;
    line-height: 1.75;
    word-break: break-word;
}
.desktop-description > :first-child { margin-top: 0; }
.desktop-description > :last-child { margin-bottom: 0; }
.desktop-description p { margin: 0 0 0.75em; }
.desktop-description ul,
.desktop-description ol { margin: 0 0 0.75em; padding-inline-start: 1.25em; }
.desktop-description img { max-width: 100%; height: auto; border-radius: 10px; }
.desktop-description a { color: var(--pd-accent); text-decoration: underline; }
.desktop-description h1,
.desktop-description h2,
.desktop-description h3 { font-size: 1.05em; margin: 0.75em 0 0.35em; color: var(--pd-text); }

.pd-actions .buy-btn {
    background: linear-gradient(135deg, var(--pd-primary), var(--pd-primary-2));
    border: none;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 6px 20px rgba(81, 70, 229, 0.35);
    transition: 0.2s;
    flex: 1;
    min-width: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pd-actions .buy-btn .buy-icon {
    width: 16px;
    height: 16px;
    display: block;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.pd-actions .buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(81, 70, 229, 0.45);
}
.pd-actions .buy-btn:disabled {
    opacity: 0.68;
    cursor: wait;
    pointer-events: none;
    transform: none;
    box-shadow: 0 4px 14px rgba(81, 70, 229, 0.2);
}
.pd-actions .buy-btn.buy-btn--oos,
.pd-actions .buy-btn.buy-btn--oos:disabled {
    opacity: 0.9;
    cursor: not-allowed;
    pointer-events: none;
    background: #94a3b8;
    box-shadow: none;
    transform: none;
}
.pd-actions .buy-btn.buy-btn--oos:hover {
    transform: none;
    box-shadow: none;
}

.pd-info > .rewall-pdp-installment-offer {
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 12px 10px;
    border-radius: 12px;
    border: 1px solid #e8eaf0;
    background: #fafbff;
}

.pd-price-card {
    background: linear-gradient(180deg, #fafbff 0%, #f3f1ff 100%);
    border: 1px solid #e0ddf7;
    border-radius: var(--pd-radius-sm);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pd-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 14px;
}
.pd-price-label {
    width: 100%;
    font-size: 11px;
    font-weight: 800;
    color: var(--pd-muted);
    letter-spacing: 0.03em;
}
.desktop-price-current {
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    font-weight: 800;
    color: var(--pd-text);
}
.desktop-price-original {
    font-size: 14px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 700;
}
.desktop-discount-badge {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--pd-danger);
    border: none;
    padding: 4px 9px;
    border-radius: 8px;
}

.pd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
    align-items: stretch;
}
.pd-btn-detail {
    flex: 0 1 auto;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--pd-border);
    background: #fff;
    color: var(--pd-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.pd-btn-detail:hover {
    border-color: var(--pd-primary);
    color: var(--pd-primary);
    background: #f3f1ff;
}

.modal-close {
    position: absolute;
    top: 20px;
    inset-inline-end: 20px;
    background: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.modal-close:hover { background: #f1f5f9; }

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(90vw, 1400px);
    max-height: 90vh;
    object-fit: contain;
    object-position: center;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}

.rewall-like-burst-fixed {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100000;
    width: min(38vw, 160px);
    height: min(38vw, 160px);
    color: var(--pd-danger);
    filter: drop-shadow(0 6px 28px rgba(0, 0, 0, 0.45));
}
.rewall-like-burst-fixed__inner {
    width: 100%;
    height: 100%;
    animation: rewall-like-burst-pop 0.95s cubic-bezier(0.2, 0.9, 0.35, 1.15) forwards;
}
.rewall-like-burst-fixed svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}
@keyframes rewall-like-burst-pop {
    0% { transform: scale(0); opacity: 0; }
    14% { transform: scale(1.18); opacity: 1; }
    26% { transform: scale(0.92); opacity: 1; }
    38% { transform: scale(1); opacity: 1; }
    72% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.12); opacity: 0; }
}

@media (max-width: 1040px) {
    .pd-store__grid {
        grid-template-columns: 1fr;
    }
    .pd-store__media {
        border-inline-end: none;
        border-bottom: 1px solid var(--pd-border);
        position: relative;
        background: #fff;
    }
    .desktop-container.pd-store {
        padding: 16px 16px 0;
    }
}
