:root{
    --pgco-brand:#19284F;
    --pgco-accent:#EF4444;
    --pgco-muted:#6E7A90;
    --pgco-bg:#F7F8FA;
    --pgco-card:#FFFFFF;
    --pgco-text:#1B2748;
    --pgco-chip:#EAEDEF;
    --pgco-border:#E5E8EF;
    --container:1200px;
    --sp-img-maxh-desktop:360px;
    --sp-img-maxh-mobile:260px;
}

/* فونت سراسری */
.pg-sp,
.pg-sp *{
    font-family:"Vazirmatn",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

/* آیکون‌ها */
.fa,
.fa-solid,
.fa-regular{ font-family:"Font Awesome 6 Free"; }
.fa-solid{ font-weight:900; }
.fa-regular{ font-weight:400; }
.fa-brands{ font-family:"Font Awesome 6 Brands"; font-weight:400; }

/* ساختار کلی صفحه تک‌محصول */
.pg-sp{
    width:100%;
    max-width:var(--container);
    margin:0 auto;
    padding:16px 12px 80px;
    box-sizing:border-box;
}

/* روی موبایل کاملاً وسط و فول‌عرض */
@media (max-width:991px){
    .pg-sp{
        max-width:100%;
        padding-right:16px;
        padding-left:16px;
    }
}

/* جلوگیری از اسکرول افقی در صفحه تک‌محصول */
body.single-product{
    overflow-x:hidden;
}

/* گرید اصلی */
.pg-sp-grid{
    display:grid;
    gap:20px;
    align-items:stretch;
    grid-template-columns:1fr;
}

/* اجازه نده ستون‌ها از عرض گرید بزنن بیرون */
.pg-sp-grid > *{
    min-width:0;
}

@media (min-width:992px){
    .pg-sp-grid{
        grid-template-columns:minmax(0,560px) 1fr;
        gap:40px; /* فاصله گالری و اتریبیوت بیشتر */
    }
}

/* ستون چپ */
.pg-left{
    background:var(--pgco-card);
    border:1px solid var(--pgco-border);
    border-radius:18px;
    padding:12px;
    margin-top:30px; /* این فاصله خوبه */
}

.pg-title{
    font-weight:900;
    font-size:22px;
    margin:0 0 10px;
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.pg-sku{
    background:var(--pgco-chip);
    color:var(--pgco-text);
    padding:4px 10px;
    border-radius:10px;
    font-weight:800;
    font-size:12px;
}

/* تصویر اصلی */
.pg-img-main{
    background:#fff;
    border:1px solid color-mix(in srgb, var(--pgco-border), #000 8%);
    border-radius:14px;
    padding:8px;
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.02);
}

.pg-img-main img{
    width:100%;
    height:auto;
    display:block;
    object-fit:contain;
    max-height:var(--sp-img-maxh-mobile);
}

@media (min-width:992px){
    .pg-img-main img{
        max-height:var(--sp-img-maxh-desktop);
    }
}

/* تامب‌ها */
.pg-thumbs{
    display:flex;
    gap:10px;
    margin-top:12px;
    flex-wrap:wrap;
}

.pg-thumb{
    border:1px solid var(--pgco-border);
    background:#fff;
    border-radius:12px;
    padding:6px;
    width:72px;
    height:72px;
    display:grid;
    place-items:center;
    cursor:pointer;
    box-shadow:0 8px 18px rgba(0,0,0,.06);
}

.pg-thumb img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    display:block;
}

.pg-thumb.active{
    outline:2px solid color-mix(in srgb, var(--pgco-brand), transparent 70%);
}

/* ستون راست */
.pg-right{
    margin-top:30px; /* ✅ هم‌تراز با گالری (pg-left) */
    display:flex;
    flex-direction:column;
    gap:12px;
}

/* باکس خرید */
.pg-buy{
    background:var(--pgco-card);
    border:1px solid var(--pgco-border);
    border-radius:16px;
    padding:12px;
    box-shadow:0 10px 18px rgba(0,0,0,.06);
}

.buy-row{
    display:grid;
    gap:12px;
    grid-template-columns:1fr 1fr;
    align-items:end;
}

@media (max-width:420px){
    .buy-row{
        grid-template-columns:1fr;
    }
}

.buy-label{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-weight:900;
    font-size:13px;
    color:var(--pgco-text);
}

.buy-label i{
    font-size:12px;
    color:var(--pgco-accent);
}

.qty-wrap{
    display:flex;
    align-items:center;
    gap:8px;
}

.qty .input-text,
.qty input[type="number"],
.quantity input[type="number"]{
    background:#fff;
    border:1px solid var(--pgco-border);
    border-radius:12px;
    padding:10px 12px;
    width:110px;
    font-weight:800;
    text-align:center;
}

/* دکمه‌های + / − تعداد */
.qty-btn{
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    border:1px solid var(--pgco-border);
    background:#fff;
    color:var(--pgco-text);
    border-radius:50px;
    font-weight:900;
    line-height:1;
    cursor:pointer;
    transition:background .12s, border-color .12s, transform .08s;
}

.qty-btn:hover{
    background:var(--pgco-chip);
    border-color:color-mix(in srgb, var(--pgco-border), var(--pgco-brand) 25%);
}

/* جعبه قیمت */
.buy-price .price-html{
    background:#fff;
    border:1px solid var(--pgco-border);
    border-radius:12px;
    padding:10px 12px;
    font-weight:900;
    display:flex;
    align-items:center;
    min-height:42px;
    width:100%;
    box-sizing:border-box;
    justify-content:flex-start;
    gap:8px;
    direction:rtl;
    text-align:right;
    overflow:hidden;
}

/* چیدمان داخلی قیمت */
.price{
    display:flex;
    align-items:baseline;
    gap:6px;
    line-height:1.15;
    flex-wrap:wrap;
    max-width:100%;
}

.pg-sp .buy-price .price-html .price del{
    color:var(--pgco-muted);
    font-size:.85em;
    opacity:.9;
    text-decoration:line-through;
}

.pg-sp .buy-price .price-html .price ins{
    color:var(--pgco-accent);
    font-size:1.15em;
    font-weight:900;
    text-decoration:none;
}

.pg-sp .buy-price .price-html .price ins *,
.pg-sp .buy-price .price-html .woocommerce-Price-amount,
.pg-sp .buy-price .price-html bdi{
    text-decoration:none;
}

.pg-sp .buy-price .price-html .price,
.pg-sp .buy-price .price-html .price *{
    white-space:normal !important;
}

.woocommerce div.product .pg-sp .buy-price .price-html .price ins{
    color:var(--pgco-accent);
}

.woocommerce div.product .pg-sp .buy-price .price-html .price del{
    font-size:.85em;
    color:var(--pgco-muted);
}

@media (min-width:992px){
    .price del{ transform:translateY(-2px); }
    .price ins{ transform:translateY(1px); }
}

/* دکمه افزودن به سبد */
.buy-actions{ margin-top:12px; }

.pg-btn-add{
    width:100%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    background:var(--pgco-accent);
    color:#fff;
    border:0;
    border-radius:12px;
    padding:12px 14px;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 10px 20px rgba(239,68,68,.18);
    transition:transform .12s, box-shadow .12s, opacity .12s;
}

.pg-btn-add i{ font-size:14px; }

.pg-btn-add:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 24px rgba(239,68,68,.24);
}

.pg-btn-add:disabled{
    opacity:.5;
    cursor:not-allowed;
}

/* دکمه مشاهده سبد خرید */
.pg-btn-view-cart{
    margin-top:12px;
    width:40%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    background:var(--pgco-brand);
    color:#fff;
    border-radius:12px;
    padding:8px 7px;
    font-weight:900;
    text-decoration:none;
    box-shadow:0 10px 20px rgba(25,40,79,.14);
    transition:transform .1s, box-shadow .1s, opacity .1s;
    font-size:14px;
}

.pg-btn-view-cart:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 26px rgba(25,40,79,.18);
}

/* ===== اتریبیوت‌ها کنار گالری ===== */
.pg-attrsbox{
    background:var(--pgco-card);
    border:1px solid var(--pgco-border);
    border-radius:16px;
    padding:12px;
    box-shadow:0 10px 18px rgba(0,0,0,.06);
}

.pg-attrsbox-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    margin-bottom:10px;
    flex-wrap:wrap;
}

.pg-attrsbox-title{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-weight:900;
    color:var(--pgco-text);
}
.pg-attrsbox-title i{
    color:var(--pgco-accent);
    font-size:14px;
}

.pg-attrsbox-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

/* ✅ دکمه‌های زیر گالری: باریک‌تر + بلندتر */
.pg-jump{
    border:1px solid var(--pgco-border);
    background:#fff;
    color:var(--pgco-text);
    border-radius:12px;
    font-weight:900;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:8px;
    transition:transform .12s, background .12s, border-color .12s, color .12s;

    min-width:88px;        /* عرض کمتر */
    max-width:110px;
    justify-content:center;

    height:44px;           /* ارتفاع بیشتر */
    padding:12px 10px;
    font-size:12px;
    line-height:1;
}

.pg-jump i{ font-size:12px; }

.pg-jump:hover{
    background:var(--pgco-accent);
    border-color:var(--pgco-accent);
    color:#fff;
    transform:translateY(-1px);
}

@media (max-width:480px){
    .pg-jump{
        min-width:80px;
        max-width:96px;
        height:40px;
        padding:10px 8px;
        font-size:11px;
    }
}

.pg-attrsbullets{
    list-style:none;
    padding:0;
    margin:0;
    display:grid;
    gap:8px;
}

.pg-attritem{
    display:grid;
    grid-template-columns:140px 1fr;
    gap:10px;
    background:linear-gradient(180deg,#fff,#f7f8fa);
    border:1px solid var(--pgco-border);
    border-radius:12px;
    padding:10px 12px;
}

@media (max-width:420px){
    .pg-attritem{ grid-template-columns:1fr; }
}

.pg-attritem .k{
    font-weight:900;
    color:var(--pgco-muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.pg-attritem .v{
    font-weight:900;
    color:var(--pgco-text);
    line-height:1.6;
}

.pg-attrs-empty{
    margin:0;
    color:var(--pgco-muted);
    font-weight:800;
}

/* ===== بخش جزئیات (تمام عرض زیر گرید) ===== */
.pg-details{
    width:100%;
    margin-top:32px; /* فاصله بین بخش بالا و تب‌ها بیشتر */
}

@media (min-width:992px){
    .pg-details{
        margin-top:40px;
    }
}

/* تب‌ها */
.pg-tabs{
    display:flex;
    gap:10px;
    flex-wrap:nowrap;
    margin-top:0;          /* چون تو pg-details هست */
    margin-bottom:12px;
}

.pg-tabs .tab-btn{
    flex:1 1 0;
    min-width:0;
    justify-content:center;
    white-space:nowrap;
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:#fff;
    color:var(--pgco-text);
    border:1px solid var(--pgco-border);
    border-radius:12px;
    padding:9px 10px;
    font-weight:900;
    font-size:13px;
    cursor:pointer;
    transition:transform .12s, border-color .12s, color .12s, background .12s;
}

.pg-tabs .tab-btn i{ font-size:13px; }

.pg-tabs .tab-btn:hover{
    color:#fff;
    background:var(--pgco-accent);
    border-color:var(--pgco-accent);
}

.pg-tabs .tab-btn.active{
    color:#fff;
    background:var(--pgco-accent);
    border-color:transparent;
    box-shadow:0 10px 20px rgba(239,68,68,.18);
}

/* پنل تب‌ها */
.pg-tab-panel-wrap{
    background:var(--pgco-card);
    border:1px solid var(--pgco-border);
    border-radius:16px;
    overflow:hidden;
    margin-top:10px;
}

.pg-tab-panel{
    transition:height .26s ease;
    background:linear-gradient(180deg,#fff,#f7f8fa);
}

.pg-tab-panel .panel-inner{
    padding:14px 16px;
    line-height:1.9;
    color:var(--pgco-text);
    opacity:1;
    transform:translateY(0);
    transition:opacity .22s, transform .22s;

    max-width:100%;
    overflow-x:auto;
}

.pg-tab-panel.switching .panel-inner{
    opacity:.25;
    transform:translateY(6px);
}

/* جدول مشخصات */
.pg-tab-panel .panel-inner table.shop_attributes{
    width:100%;
}

.pg-tab-panel .panel-inner table.shop_attributes th,
.pg-tab-panel .panel-inner table.shop_attributes td{
    border-color:var(--pgco-border);
}

.pg-tab-panel .panel-inner table{
    max-width:100%;
    width:100%;
    border-collapse:collapse;
}

/* دکمه‌های کاتالوگ */
.catalog-list{
    list-style:none;
    padding:0;
    margin:0;
    display:grid;
    gap:10px;
}

.btn-catalog{
    display:inline-flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    font-weight:900;
    background:#fff;
    border:1px solid var(--pgco-border);
    padding:10px 14px;
    border-radius:12px;
    transition:transform .1s;
}

.btn-catalog:hover{
    transform:translateY(-1px);
}

/* ===== محصولات مرتبط (اسلایدر اسکرولی بدون دکمه) ===== */
.pg-related{
    width:100%;
    max-width:var(--container);
    margin:16px auto 40px;
    padding:0 12px;
}

.pg-rel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin:0 0 10px;
}

.pg-rel-title{
    font-size:18px;
    font-weight:900;
    color:var(--pgco-text);
    margin:0;
}

.pg-rel-sub{
    font-size:12px;
    font-weight:800;
    color:var(--pgco-muted);
    background:var(--pgco-chip);
    padding:4px 10px;
    border-radius:10px;
}

.pg-rel-track{
    display:flex;
    gap:12px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:4px 2px 8px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
}

.pg-rel-track::-webkit-scrollbar{
    display:none;
}

.pg-rel-item{
    flex:0 0 auto;
    width:240px;
    scroll-snap-align:start;
}

.pg-rel-item .pg-card{
    height:100%;
}

html[dir="rtl"] .pg-rel-track{
    direction:rtl;
}

html[dir="rtl"] .pg-rel-item{
    margin-inline-start:0;
}

/* ===== Tabs (پایین صفحه) — بزرگ‌تر + فاصله بیشتر ===== */
.pg-details .pg-tabs{
    display:flex;
    gap:32px;              /* فاصله بین دکمه‌ها بیشتر */
    flex-wrap:nowrap;
    margin:0 0 14px;
}

/* هر دکمه 1/3 عرض کامل */
.pg-details .pg-tabs .tab-btn{
    flex:1 1 0;
    min-width:0;
    justify-content:center;

    height:50px;           /* ارتفاع بیشتر */
    padding:0 12px;        /* عرض داخلی کمتر/تمیز */
    border-radius:14px;

    font-size:13px;
    font-weight:900;
    line-height:1;

    gap:10px;              /* فاصله آیکون و متن کمی بیشتر */
}

/* موبایل: اگر متن جا نشد، کمی کوچیک‌تر */
@media (max-width:420px){
    .pg-details .pg-tabs{
        gap:10px;
        margin-bottom:12px;
    }
    .pg-details .pg-tabs .tab-btn{
        height:48px;
        padding:0 10px;
        font-size:12px;
        gap:8px;
    }
}
