/* ==========================================================================
   Variables & Theme Config
   ========================================================================== */
:root {
    --emerald: #038c65;
    --orange: #f27b13;
    --amber: #d95204;
    --maroon: #730909;
    --danger: #ef4056; /* قرمز استاندارد برای تخفیف */

    --bg: #f6f6f4;
    --surface: #ffffff;
    --surface-soft: #fafafa;
    --border: #e8e5df;

    --text: #171717;
    --muted: #757575;
    --muted-2: #9a9a9a;

    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;

    --shadow-soft: 0 18px 45px rgba(17, 24, 39, 0.06);
    --shadow-card: 0 8px 28px rgba(17, 24, 39, 0.05);
}

/* ==========================================================================
   General Styles
   ========================================================================== */
body {
    font-family: "Vazirmatn", sans-serif;
    background:
        radial-gradient(
            circle at top right,
            rgba(3, 140, 101, 0.06),
            transparent 360px
        ),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.pd-page {
    padding-top: 28px;
    padding-bottom: 110px;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.pd-breadcrumb {
    font-size: 0.82rem;
    color: var(--muted);
}
.pd-breadcrumb a {
    color: var(--muted);
    transition: color 0.2s ease;
}
.pd-breadcrumb a:hover {
    color: var(--emerald);
}

/* ==========================================================================
   Product Shell Container
   ========================================================================== */
.pd-shell {
    overflow: hidden;
    padding: 22px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(232, 229, 223, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Product Gallery
   ========================================================================== */
.pd-gallery {
    position: sticky;
    top: 24px;
}
.pd-main-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, #ffffff, #fafafa);
    border: 1px solid var(--border);
    border-radius: 24px;
}
.pd-main-image img {
    width: 100%;
    height: 100%;
    padding: 18px;
    object-fit: contain;
    transition: transform 0.35s ease, opacity 0.25s ease;
}
.pd-main-image:hover img {
    transform: scale(1.035);
}
.pd-image-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    padding: 7px 12px;
    color: var(--emerald);
    font-size: 0.76rem;
    font-weight: 800;
    background: rgba(3, 140, 101, 0.1);
    border: 1px solid rgba(3, 140, 101, 0.16);
    border-radius: 999px;
}
.pd-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-top: 14px;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.pd-thumbs::-webkit-scrollbar { 
    display: none; 
}
.pd-thumb {
    flex: 0 0 76px;
    padding: 5px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.2s ease;
}
.pd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}
.pd-thumb.active {
    border-color: var(--amber);
    box-shadow: 0 8px 22px rgba(217, 82, 4, 0.16);
}
.pd-thumb:hover { 
    transform: translateY(-2px); 
}

/* ==========================================================================
   Product Summary / Info
   ========================================================================== */
.pd-brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    color: var(--emerald);
    font-size: 0.78rem;
    font-weight: 850;
    background: rgba(3, 140, 101, 0.08);
    border: 1px solid rgba(3, 140, 101, 0.14);
    border-radius: 999px;
}
.pd-title {
    margin: 18px 0 12px;
    color: var(--maroon);
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    font-weight: 950;
    line-height: 1.55;
}
.pd-short-desc {
    max-width: 720px;
    color: #555555;
    font-size: 0.96rem;
    line-height: 2.05;
}

/* ==========================================================================
   Product Variants Selector
   ========================================================================== */
.pd-section-label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.86rem;
    font-weight: 900;
}
.pd-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pd-variant input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.pd-variant label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 11px 16px;
    color: #333333;
    font-size: 0.88rem;
    font-weight: 850;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all 0.2s ease;
}
.pd-variant input:checked + label {
    color: #ffffff;
    background: var(--maroon);
    border-color: var(--maroon);
    box-shadow: 0 12px 24px rgba(115, 9, 9, 0.16);
}

/* ==========================================================================
   Meta Row
   ========================================================================== */
.pd-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
}
.pd-meta-item {
    display: flex;
    flex-direction: column;
    flex: 1 1 100px;
    align-items: center;
    text-align: center;
}
.pd-meta-item i {
    font-size: 1.5rem;
    color: var(--emerald);
    margin-bottom: 5px;
}
.pd-meta-title {
    font-size: 0.8rem;
    font-weight: 800;
}
.pd-meta-text {
    font-size: 0.72rem;
    color: var(--muted);
}

/* ==========================================================================
   Buy Card & Price Section (هماهنگ با HTML جدید)
   ========================================================================== */
.pd-buy-card {
    margin-top: 26px;
    padding: 22px;
    background: 
        linear-gradient(180deg, rgba(242, 123, 19, 0.035), transparent), 
        #ffffff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-card);
}

.pd-price-label {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

/* کانتینر نگه‌دارنده قیمت اصلی */
.display-old-price-wrapper,
.pd-original-price-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 26px;
    margin-bottom: 5px;
}

.display-old-price-wrapper.d-none,
.pd-original-price-wrapper.d-none {
    display: none !important;
}

.pd-original-price-label {
    color: var(--muted-2);
    font-size: 0.75rem;
    font-weight: 700;
}

/* قیمت اصلی خط‌خورده قرمز مورب */
.pd-old-price {
    position: relative !important;
    display: inline-block !important;
    color: #81858b !important;
    font-size: 1.15rem !important;
    font-weight: 750 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap;
    isolation: isolate;
}

.pd-old-price::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: -3px !important;
    right: -3px !important;
    height: 2px !important; /* ضخامت خط */
    background: #ef4056 !important; /* رنگ قرمز دیجی‌کالایی */
    border-radius: 999px !important;
    transform: translateY(-50%) rotate(-6deg) !important; /* اعمال خط کج */
    transform-origin: center !important;
    z-index: 10 !important;
    pointer-events: none !important;
}

.pd-old-price-unit {
    color: #81858b;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

/* قیمت نهایی */
.pd-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.pd-price strong,
.pd-discount-price {
    color: var(--text);
    font-size: clamp(1.85rem, 4vw, 2.4rem);
    font-weight: 950;
    line-height: 1.45;
}

.pd-price span:not(.pd-discount-price) {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

/* دکمه افزودن به سبد خرید */
.pd-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 18px;
    color: #ffffff;
    font-weight: 950;
    cursor: pointer;
    background: linear-gradient(135deg, var(--orange), var(--amber));
    border: 0;
    border-radius: 16px;
    transition: all 0.2s ease;
}
.pd-buy-btn:hover:not(:disabled) {
    box-shadow: 0 14px 28px rgba(217, 82, 4, 0.22);
    transform: translateY(-2px);
}
.pd-buy-btn.disabled, 
.pd-buy-btn:disabled {
    background: #d4d0c9 !important;
    color: #8b8882 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

/* ==========================================================================
   Tabs, Information Cards & Comments
   ========================================================================== */
.pd-content-card {
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}
.pd-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
    padding-bottom: 12px;
}
.pd-tabs .nav-link {
    padding: 10px 18px;
    color: #404040;
    font-weight: 900;
    border-radius: 999px;
    border: 0;
    background: var(--surface-soft);
    transition: all 0.2s ease;
}
.pd-tabs .nav-link.active {
    color: #ffffff;
    background: var(--emerald);
}

.pd-tab-body {
    line-height: 1.95;
    color: #333333;
    font-size: 0.94rem;
}

/* استایل‌های کامنت‌ها */
.pd-comment-form {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.pd-submit-comment {
    background-color: var(--emerald);
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.pd-submit-comment:hover {
    background-color: var(--maroon);
}
.pd-comment {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}
.pd-avatar {
    width: 48px;
    height: 48px;
    background: var(--maroon);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.pd-comment-name {
    font-weight: 800;
    font-size: 0.9rem;
}
.pd-comment-date {
    font-size: 0.75rem;
    color: var(--muted);
}
.pd-comment-text {
    font-size: 0.88rem;
    margin-top: 8px;
    line-height: 1.7;
    color: #444444;
}

/* سایدبار خدمات */
.pd-side-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pd-service {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.pd-service i {
    font-size: 1.8rem;
    color: var(--amber);
}
.pd-service strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 900;
}
.pd-service span {
    font-size: 0.76rem;
    color: var(--muted);
}

/* ==========================================================================
   Mobile Bottom Navigation & Responsiveness
   ========================================================================== */
.pd-mobile-bar {
    display: none;
}

@media (max-width: 991.98px) {
    .pd-gallery {
        position: relative;
        top: 0;
    }
}

@media (max-width: 767.98px) {
    .pd-mobile-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--border);
        backdrop-filter: blur(12px);
    }
    
    .pd-mobile-price-label {
        font-size: 0.7rem;
        color: var(--muted);
        font-weight: 700;
    }
    .pd-mobile-price {
        color: var(--text);
        font-size: 1.3rem;
        font-weight: 950;
    }
    .pd-mobile-price-unit {
        font-size: 0.75rem;
        color: var(--muted);
        font-weight: 700;
    }
    .pd-mobile-bar form {
        width: 60%;
    }
}






.pd-main-image {
    position: relative;
}

.pd-image-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
}

.pd-discount-image-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
    background: #ef4056;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
