/* ==========================================================================
   Professional Single Product Page — webramz / AMTEX
   RTL · Bootstrap 5 · WooCommerce
   Loaded only on is_product() pages (see inc/enqueue.php)
   ========================================================================== */

.single-product-container {
    padding-top: 1rem;
    padding-bottom: 2.5rem;
}

.wr-single-product .wr-product-main {
    margin-bottom: 2.5rem;
}

/* --------------------------------------------------------------------------
   0. Neutralise WooCommerce core layout
   Core stylesheet floats .images / .summary and forces width:48%.
   We drive the columns with the Bootstrap grid instead, so reset them
   to fill their column completely.
   -------------------------------------------------------------------------- */
.wr-single-product div.images,
.wr-single-product .woocommerce-product-gallery,
.wr-single-product div.summary,
.wr-single-product div.summary.entry-summary {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
}

/* باکس خرید هم کلاس summary دارد، پس padding:0 بالا پدینگ کارتش را صفر
   می‌کرد؛ فقط summaryهای دیگر پدینگ‌شان صفر می‌شود. */
.wr-single-product div.summary:not(.wr-purchase-box) {
    padding: 0;
}

/* --------------------------------------------------------------------------
   0.5 Purchase box + brand
   ستون خرید تا اینجا هیچ استایلی نداشت و به‌صورت یک بلوک لخت کنار گالری
   می‌نشست؛ حالا مثل بقیه‌ی کارت‌های قالب قاب می‌گیرد.
   -------------------------------------------------------------------------- */
.wr-purchase-box {
    padding: 16px;
    border: 1px solid var(--g5);
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(13, 17, 23, .05);
}

@media (min-width: 992px) {
    .wr-product-purchase-col .wr-purchase-box {
        position: sticky;
        top: 1rem;
    }
}

/* کادر برند — بالای .wr-purchase-note */
.wr-product-brand {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--g5);
    border-radius: 16px;
    background: var(--g6);
}

.wr-product-brand__label {
    display: block;
    margin-bottom: 8px;
    color: var(--g3);
    font-size: 12px;
}

.wr-product-brand__body {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--black);
    text-decoration: none;
}

a.wr-product-brand__body:hover {
    color: var(--primary);
}

.wr-product-brand__logo {
    width: 54px;
    height: 40px;
    flex: 0 0 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: var(--white);
    border: 1px solid var(--g5);
}

.wr-product-brand__logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* برندِ بدون لوگو: حرف اول نام */
.wr-product-brand__logo.is-empty {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}

.wr-product-brand__name {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
}

.wr-product-brand__body i {
    flex: 0 0 auto;
    color: var(--g3);
    transition: transform .2s ease;
}

a.wr-product-brand__body:hover i {
    color: var(--primary);
    transform: translateX(-3px);
}

/* ستون خرید حدود ۲۴۰px عرض دارد، اما .single_add_to_cart_button پایه‌ی
   فلکس ۲۴۰px می‌خواهد؛ کنار جعبه‌ی تعداد تا ۱۱۰px فشرده می‌شد و متن دکمه سه
   خط می‌شکست. اینجا تعداد و دکمه روی هم می‌نشینند. */
.wr-product-purchase-col .wr-qty-cart {
    flex-wrap: wrap;
    gap: 10px;
}

.wr-product-purchase-col form.cart .quantity {
    width: 100%;
    justify-content: space-between;
    border: 1px solid var(--g5);
}

.wr-product-purchase-col .single_add_to_cart_button {
    flex: 1 1 100%;
    width: 100%;
}

/* --------------------------------------------------------------------------
   0.6 Details block (specs, description, related, reviews)
   -------------------------------------------------------------------------- */
.wr-product-details > .row + .row {
    margin-top: 2rem;
}

@media (max-width: 767.98px) {
    .wr-purchase-box {
        padding: 14px;
        border-radius: 16px;
    }

    .wr-product-details > .row + .row {
        margin-top: 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   1. Gallery
   -------------------------------------------------------------------------- */
.wr-product-gallery-col {
    position: relative;
}

/* keep the gallery a balanced size instead of filling the whole half-column */
.wr-product-gallery-col .woocommerce-product-gallery {
    margin-inline: auto !important;
}

@media (min-width: 992px) {
    .wr-product-gallery-col .woocommerce-product-gallery {
        position: sticky;
        top: 1rem;
    }
}

.wr-single-product .woocommerce-product-gallery {
    position: relative;
    margin: 0;
}

/* main stage */
.wr-single-product .woocommerce-product-gallery .flex-viewport,
.wr-single-product .woocommerce-product-gallery__wrapper {
    border: 1px solid var(--g4);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.wr-single-product .woocommerce-product-gallery__image,
.wr-single-product .woocommerce-product-gallery__image a {
    display: block;
}

.wr-single-product .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 14px;
    transition: transform .35s ease;
}

.wr-single-product .woocommerce-product-gallery:hover .woocommerce-product-gallery__image img {
    cursor: zoom-in;
}

/* sale badge on gallery (kept hidden on single by theme, but styled for safety) */
.wr-single-product .onsale {
    position: absolute;
    z-index: 6;
    top: 14px;
    inset-inline-start: 14px;
    margin: 0;
    min-width: auto;
    min-height: auto;
    padding: 4px 14px;
    border-radius: 999px;
    background: #E9322A;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.8;
}

/* zoom trigger fallback (when JS doesn't move it into action buttons) */
.wr-single-product .woocommerce-product-gallery__trigger {
    position: absolute;
    z-index: 5;
    top: 14px;
    inset-inline-end: 14px;
}

/* thumbnails strip — forced into a single scrollable row (overrides WC defaults) */
.wr-single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    margin: 12px 0 0 !important;
    padding: 2px !important;
    list-style: none !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.wr-single-product .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar {
    height: 4px;
}

.wr-single-product .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-thumb {
    background: var(--g3);
    border-radius: 4px;
}

.wr-single-product .woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 78px !important;
    width: 78px !important;
    margin: 0 !important;
    float: none !important;
}

.wr-single-product .woocommerce-product-gallery .flex-control-thumbs img {
    width: 78px;
    height: 78px;
    object-fit: cover;
    border: 1.5px solid var(--g4);
    border-radius: 12px;
    padding: 4px;
    background: #fff;
    cursor: pointer;
    opacity: .75;
    transition: border-color .2s ease, opacity .2s ease;
}

.wr-single-product .woocommerce-product-gallery .flex-control-thumbs img:hover {
    opacity: 1;
    border-color: var(--g2);
}

.wr-single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.wr-single-product .woocommerce-product-gallery .flex-control-thumbs .flex-active img {
    opacity: 1;
    border-color: var(--primary);
}

/* prev / next navigation arrows (injected by single-product.js) */
.wr-gallery-arrow {
    position: absolute;
    top: 40%;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--g4);
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    transform: translateY(-50%);
    transition: color .2s ease, background .2s ease, opacity .2s ease;
}

.wr-gallery-arrow:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.wr-gallery-prev {
    inset-inline-start: 12px;
}

.wr-gallery-next {
    inset-inline-end: 12px;
}

@media (max-width: 575.98px) {
    .wr-gallery-arrow {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }
}

/* --------------------------------------------------------------------------
   2. Summary
   -------------------------------------------------------------------------- */
.wr-product-summary-col .summary {
    margin: 0;
}

.wr-single-product .product_title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.7;
    margin: 0 0 .75rem;
}

@media (max-width: 575.98px) {
    .wr-single-product .product_title {
        font-size: 21px;
    }
}

/* rating */
.wr-single-product .woocommerce-product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 1rem;
    font-size: 13px;
    color: var(--g1);
}

.wr-single-product .woocommerce-product-rating .star-rating {
    color: #f5a623;
    font-size: 14px;
}

/* price */
.wr-single-product .summary .price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 1.25rem;
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
}

.wr-single-product .summary .price .woocommerce-Price-amount {
    font-weight: 800;
}

.wr-single-product .summary .price del {
    color: var(--g2);
    font-size: 14px;
    font-weight: 600;
    opacity: 1;
}

.wr-single-product .summary .price ins, .wrwi-product-price-amount {
    text-decoration: none;
    color: var(--black);
    font-size: 17px;
    font-weight: normal !important;


}

.wr-single-product .summary .price .woocommerce-Price-currencySymbol {
    font-size: .6em;
    font-weight: 600;
    margin-inline-start: 4px;
}

/* custom price layout: label on the right, prices on the left */
.wr-single-product p.price:not(.wrwi-product-price--installment-total) {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    width: 100%;
    margin: 0 0 .75rem;
    column-gap: 10px;
    row-gap: 3px !important;
    color: var(--black);
    font-size: 18px;
    line-height: 1.5 !important;
    direction: ltr;
}

.wr-single-product p.price > .custom-price-label {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    font-weight: 400;
    white-space: nowrap;
    direction: rtl;
    color: var(--black);
}

.wr-single-product p.price > del,
.wr-single-product p.price > ins {
    grid-column: 1;
    justify-self: start;
    align-self: center;
    margin: 0;
    direction: rtl;
}

.wr-single-product p.price > del {
    grid-row: 1;
}

.wr-single-product p.price > ins {
    grid-row: 2;
    text-decoration: none;
}

.wr-single-product p.price > .screen-reader-text {
    position: absolute !important;
}

/* short description */
.wr-single-product .woocommerce-product-details__short-description {
    margin: 0 0 1.25rem;
    border-radius: 14px;
    color: var(--g1);
    font-size: 15px;
    line-height: 2.1;
}

.wr-single-product .woocommerce-product-details__short-description p:last-child {
    margin-bottom: 0;
}

.wr-single-product .woocommerce-product-details__short-description ul li::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-inline-end: .5rem;
    border-radius: 50%;
    background: var(--primary);
}

/* --------------------------------------------------------------------------
   2.b Buy box (price + quantity + add to cart + trust badges)
   -------------------------------------------------------------------------- */
.wr-single-product .wr-price-cart-wrapper {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: var(--primary-2);
}

.wr-single-product .wr-discount-badge {
    display: inline-block;
    margin-bottom: .85rem;
    padding: 5px 14px;
    border-radius: 999px;
    background: #fdecec;
    color: #E9322A;
    font-size: 13px;
    font-weight: 800;
}

.wr-single-product .wr-price-cart-wrapper form.cart {
    margin: 0;
}

/* --------------------------------------------------------------------------
   3. Variations / attribute swatches
   -------------------------------------------------------------------------- */
.wr-single-product .variations {
    width: 100%;
    margin: 0 0 1rem;
    border: 0;
}

.wr-single-product .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: .9rem;
}

.wr-single-product .variations th.label {
    padding: 0 0 .4rem;
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary);
    text-align: start;
    vertical-align: middle;
}

.wr-single-product .variations td.value {
    padding: 0;
    position: relative;
}

.wr-single-product .variations select {
    width: 100%;
    max-width: 320px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--g3);
    border-radius: 12px;
    background-color: #fff;
    color: var(--secondary);
    font-size: 14px;
    outline: none;
    transition: border-color .2s ease;
}

.wr-single-product .variations select:focus {
    border-color: var(--primary);
}

.wr-single-product .reset_variations {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--g1);
}

/* --------------------------------------------------------------------------
   4. Quantity + Add to cart
   -------------------------------------------------------------------------- */
/* simple product: quantity + button on one row.
   variable products keep block flow so the variations table stays full-width
   (the qty + button row is handled by .woocommerce-variation-add-to-cart). */
.wr-single-product form.cart:not(.variations_form) {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0 12px;
    margin: 0 !important;
}

.wr-single-product form.cart {
    margin: 1.25rem 0 1.5rem;
}

.wr-qty-cart {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
}

.wr-single-product form.cart .quantity {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto; /* جلوگیری از کوچک شدن quantity */
    min-width: max-content; /* نمایش کامل منفی، input و مثبت */
    border-radius: 12px;
    overflow: hidden;
    gap: 0.3rem;
    background: #fff;
    padding: 0.3rem;
    margin: 0 !important;
}

.wr-single-product form.cart .quantity .minus,
.wr-single-product form.cart .quantity .plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.wr-single-product form.cart .quantity input.qty {
    flex: 0 0 2.5em;
    width: 2rem;
    min-width: 2.5em;
    border: 0;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

.wr-single-product form.cart .quantity input.qty::-webkit-outer-spin-button,
.wr-single-product form.cart .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* theme quantity +/- buttons (inc/quantity.php — same markup as cart) */
.wr-single-product form.cart .quantity .minus,
.wr-single-product form.cart .quantity .plus,
.wr-single-product form.cart .quantity .qty-btn,
.wr-single-product form.cart .quantity button {
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    transition: background .2s ease, color .2s ease;
    font-size: 24px;
}

.wr-single-product form.cart .quantity .minus:hover,
.wr-single-product form.cart .quantity .plus:hover,
.wr-single-product form.cart .quantity .qty-btn:hover,
.wr-single-product form.cart .quantity button:hover {
    color: var(--primary);
}

.wr-single-product .single_add_to_cart_button {
    flex: 1 1 240px;
    min-width: 0;
    min-height: 52px;
    padding: 0 28px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 52px;
    text-align: center;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.wr-single-product .single_add_to_cart_button:hover {
    background: #00484b;
    box-shadow: 0 8px 22px rgba(0, 94, 98, .25);
    transform: translateY(-1px);
}

.wr-single-product .single_add_to_cart_button.disabled,
.wr-single-product .single_add_to_cart_button:disabled {
    background: var(--g3);
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* out of stock notice */
.wr-single-product .stock.out-of-stock {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 10px;
    background: #fdecec;
    color: #E9322A;
    font-size: 14px;
    font-weight: 700;
}

.wr-single-product .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
    width: 100%;
}

.wr-single-product .woocommerce-variation-price {
    width: 100%;
    margin-bottom: .5rem;
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
}

/* --------------------------------------------------------------------------
   5. Trust badges (hooked in inc/woo.php)
   -------------------------------------------------------------------------- */
.wr-product-trust {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 1.5rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--g4);
    list-style: none;
}

.wr-product-trust li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--g1);
}

.wr-product-trust li i {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eef5f5;
    color: var(--primary);
    font-size: 20px;
}

/* product meta */
.wr-single-product .product_meta {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--g4);
    font-size: 13px;
    color: var(--g1);
    line-height: 2.2;
}

.wr-single-product .product_meta > span {
    display: block;
}

.wr-single-product .product_meta a {
    color: var(--secondary);
}

.wr-single-product .product_meta a:hover {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   6. Tabs (description / additional info / reviews)
   Scoped to body.single-product + !important so WooCommerce core defaults
   (float, ::before/::after borders) are fully neutralised.
   -------------------------------------------------------------------------- */
.single-product .woocommerce-tabs {
    margin: 2.5rem 0;
    clear: both;
}

.single-product .woocommerce-tabs ul.tabs,
.single-product .woocommerce-tabs ul.wc-tabs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border-bottom: 2px solid var(--g4);
    overflow: visible;
}

.single-product .woocommerce-tabs ul.tabs::before,
.single-product .woocommerce-tabs ul.tabs::after {
    display: none !important;
    content: none !important;
}

.single-product .woocommerce-tabs ul.tabs li {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.single-product .woocommerce-tabs ul.tabs li::before,
.single-product .woocommerce-tabs ul.tabs li::after {
    display: none !important;
    content: none !important;
}

.single-product .woocommerce-tabs ul.tabs li a {
    display: inline-block;
    padding: 13px 22px !important;
    color: var(--g1) !important;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .2s ease, border-color .2s ease;
}

.single-product .woocommerce-tabs ul.tabs li.active a,
.single-product .woocommerce-tabs ul.tabs li a:hover {
    color: var(--primary) !important;
    border-bottom-color: var(--primary);
}

.single-product .woocommerce-tabs .panel,
.single-product .woocommerce-tabs .woocommerce-Tabs-panel {
    margin: 0 !important;
    padding: 1.75rem .25rem !important;
    font-size: 15px;
    line-height: 2.2;
    color: var(--g1);
}

.single-product .woocommerce-tabs .panel > h2:first-child {
    font-size: 19px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.single-product .woocommerce-tabs table.shop_attributes {
    width: 100%;
    border-collapse: collapse;
}

.single-product .woocommerce-tabs table.shop_attributes th,
.single-product .woocommerce-tabs table.shop_attributes td {
    padding: 12px 14px;
    border: 1px solid var(--g4);
    font-size: 14px;
    text-align: start;
}

.single-product .woocommerce-tabs table.shop_attributes th {
    width: 220px;
    background: #f7f9f9;
    font-weight: 700;
    color: var(--secondary);
}

/* --------------------------------------------------------------------------
   7. Related / up-sell products
   -------------------------------------------------------------------------- */
.single-product .related,
.single-product .upsells {
    clear: both;
    margin-top: 3rem;
}

.single-product .related > h2,
.single-product .upsells > h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
    text-align: center;
}


.single-product .related ul.products,
.single-product .upsells ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.single-product .related ul.products::before,
.single-product .related ul.products::after,
.single-product .upsells ul.products::before,
.single-product .upsells ul.products::after {
    display: none !important;
    content: none !important;
}

@media (min-width: 768px) {

    .single-product .related ul.products,
    .single-product .upsells ul.products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.single-product .related ul.products li.product,
.single-product .upsells ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    padding: 14px;
    border: 1px solid var(--g4);
    border-radius: 16px;
    background: #fff;
    transition: box-shadow .2s ease, transform .2s ease;
}

.single-product .related ul.products li.product:hover,
.single-product .upsells ul.products li.product:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .07);
    transform: translateY(-3px);
}

.single-product .related li.product a img,
.single-product .upsells li.product a img {
    border-radius: 10px;
    margin: 0 0 10px !important;
}

.single-product .related li.product .woocommerce-loop-product__title,
.single-product .upsells li.product .woocommerce-loop-product__title {
    padding: 0 !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.9;
    color: var(--secondary);
    min-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.single-product .related li.product .price,
.single-product .upsells li.product .price {
    color: var(--primary) !important;
    font-weight: 800;
    font-size: 16px;
}

.single-product .related li.product .price del,
.single-product .upsells li.product .price del {
    color: var(--g2) !important;
    font-size: 13px;
    font-weight: 600;
}

/* related / up-sell add-to-cart links */
.single-product .related li.product .add_to_cart_button,
.single-product .related li.product .added_to_cart,
.single-product .upsells li.product .add_to_cart_button,
.single-product .upsells li.product .added_to_cart {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   8. Notices
   -------------------------------------------------------------------------- */
.wr-single-product .woocommerce-variation.single_variation .woocommerce-variation-availability {
    margin-bottom: .5rem;
}

.wr-single-product button.single_add_to_cart_button.button.alt {
    background: var(--primary) !important;
    font-size: 14px;
    border-radius: 14px;

}


/* --------------------------------------------------------------------------
   9. وضعیت موجودی (ناموجود) + شمارش معکوس فروش ویژه
   -------------------------------------------------------------------------- */

/* برچسب واضح ناموجودی (محصول ساده/متغیر و واریِیشن انتخاب‌شده) */
.wr-single-product .wr-stock-notice {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    padding: 10px 16px;
    border-radius: 12px;
    background: #fdecec;
    border: 1px solid #f7c6c4;
    color: #E9322A;
    font-size: 14px;
    font-weight: 700;
}

.wr-single-product .wr-stock-notice.is-visible {
    display: flex;
}

.wr-single-product .wr-stock-notice--out .wr-stock-notice__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #E9322A;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(233, 50, 42, .18);
}

/* شمارش معکوس پایان فروش ویژه */
.wr-single-product .wr-sale-countdown {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 1rem;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 94, 98, .07), rgba(0, 94, 98, .02));
    border: 1px dashed rgba(0, 94, 98, .35);
}

.wr-single-product .wr-sale-countdown.is-visible {
    display: flex;
}

.wr-single-product .wr-sale-countdown__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.wr-single-product .wr-sale-countdown__label svg {
    flex-shrink: 0;
}

.wr-single-product .wr-sale-countdown__timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
}

.wr-single-product .wr-cd-seg {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
    padding: 4px 6px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--g4);
    line-height: 1.2;
}

.wr-single-product .wr-cd-seg b {
    font-size: 17px;
    font-weight: 800;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.wr-single-product .wr-cd-seg i {
    font-size: 10px;
    font-style: normal;
    color: var(--g1);
}

.wr-single-product .wr-cd-colon {
    font-size: 16px;
    font-weight: 700;
    color: var(--g2);
    align-self: flex-start;
    margin-top: 6px;
}

@media (max-width: 575.98px) {
    .wr-single-product .wr-sale-countdown__timer {
        margin-inline-start: 0;
        width: 100%;
        justify-content: space-between;
    }

    .wr-single-product .wr-cd-seg {
        min-width: 0;
        flex: 1;
    }
}

.pr-action {
    text-align: center;
    background: #F08B000F;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid #F08B0080;
}

.wr-after-short-description {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.wr-attributes-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
    padding: 0;
    margin: 0;
    list-style: none;
    direction: rtl;
}

section.wr-product-section.wr-product-attributes, section.wr-product-section.wr-product-description {
    padding: 1rem;
    border: 1px solid var(--g4);
    border-radius: 16px;
    margin-bottom: 2rem;
}

li.wr-attribute-row {
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--g4);
    padding: 0.5rem;
    border-radius: 12px;
    font-size: 14px;
}

span.wr-attribute-label {
    color: var(--g2);
}

/* --------------------------------------------------------------------------
   7. Product reviews  —  چیدمان سفارشی نظرات کاربران
   -------------------------------------------------------------------------- */
.wr-reviews {
    margin-top: 2.5rem;
}

.wr-reviews-head {
    text-align: center;
    margin-bottom: 2rem;
}

.wr-reviews-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--g1);
    margin: 0 0 .5rem;
}

.wr-reviews-sub {
    font-size: 15px;
    color: var(--g3);
    margin: 0;
}

/* لیست نظرات ثبت‌شده */
.wr-commentlist {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.wr-commentlist .comment_container {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--g4);
    border-radius: 16px;
    margin-bottom: 1rem;
}

.wr-commentlist .comment-text {
    flex: 1;
}

.wr-commentlist .comment_container img.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.wr-comment-pagination {
    margin-bottom: 2rem;
}

/* فرم ثبت نظر */
.wr-review-form-wrapper {
    margin-top: 1rem;
}

.wr-comment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
}

/* دو ستون: نام و نام خانوادگی + ایمیل */
.wr-comment-form .comment-form-author,
.wr-comment-form .comment-form-email {
    flex: 1 1 calc(50% - .75rem);
    min-width: 0;
    margin: 0 0 1.25rem;
}

/* متن نظر و ردیف پایانی تمام‌عرض */
.wr-comment-form .comment-form-comment,
.wr-comment-form .form-submit {
    flex: 1 1 100%;
}

.wr-comment-form .wr-field {
    margin-bottom: 1.25rem;
}

.wr-comment-form .wr-field label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--g1);
    margin-bottom: .6rem;
}

.wr-comment-form .wr-field .required {
    color: #E9322A;
}

.wr-comment-form .wr-field input[type="text"],
.wr-comment-form .wr-field input[type="email"],
.wr-comment-form .wr-field textarea {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--g4);
    border-radius: 12px;
    padding: .85rem 1rem;
    font-size: 14px;
    color: var(--g1);
    font-family: inherit;
    transition: border-color .2s ease;
}

.wr-comment-form .wr-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.9;
}

.wr-comment-form .wr-field input::placeholder,
.wr-comment-form .wr-field textarea::placeholder {
    color: var(--g3);
}

.wr-comment-form .wr-field input:focus,
.wr-comment-form .wr-field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ردیف پایانی: دکمه ثبت + امتیاز */
.wr-review-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: .5rem;
    flex-direction: row-reverse;
}

.wr-review-submit {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: .85rem 2rem;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s ease;
}

.wr-review-submit:hover {
    background: #007564;
}

/* امتیاز ستاره‌ای */
.wr-rating {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
}

.wr-rating label {
    font-size: 15px;
    font-weight: 600;
    color: var(--g1);
    margin: 0;
}

/* اسکریپت ووکامرس select را به ستاره تبدیل می‌کند */
.wr-rating p.stars {
    margin: 0;
    display: inline-flex;
}

.wr-rating p.stars a {
    color: var(--secondary);
}

.wr-rating p.stars a::before {
    color: var(--secondary);
}

@media (max-width: 767px) {
    .wr-comment-form .comment-form-author,
    .wr-comment-form .comment-form-email {
        flex: 1 1 100%;
    }

    .wr-review-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wr-review-submit {
        justify-content: center;
    }
}

p.stars span {
    line-height: 1;
}

.woocommerce #review_form #respond p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   7.b Review cards  —  کارت نظرات و پاسخ‌ها
   -------------------------------------------------------------------------- */
.wr-commentlist,
.wr-commentlist .children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wr-commentlist .wr-review-card {
    margin: 0 0 1.25rem;
}

/* پاسخ‌ها با تورفتگی از دو طرف */
.wr-commentlist .children {
    margin-top: 1.25rem;
    padding-inline-start: 2.5rem;
}

.wr-review-inner {
    background: var(--g5);
    border-radius: 16px;
    overflow: hidden;
}

/* سربرگ کارت: نام (راست) + تاریخ (چپ) */
.wr-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.25rem;
    width: 90%;
    margin: auto;
    background: var(--g1);
    color: white;
    border-radius: 0 0 1rem 1rem;
}

.wr-review-author {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: 15px;
    font-weight: 700;
    flex-direction: row-reverse;
}

.wr-review-date {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: 13px;
}

.wr-review-head .wr-ic {
    flex: 0 0 auto;
}

/* بدنه متن نظر */
.wr-review-body {
    padding: 1.25rem;
    font-size: 14px;
    line-height: 2.1;
    color: var(--g2);
}

.wr-review-body p {
    margin: 0;
}

.wr-review-pending {
    margin: 0;
    padding: .75rem 1.25rem 0;
    font-size: 13px;
    color: var(--secondary);
}

/* دکمه پاسخ */
.wr-review-foot {
    padding: 0 1.25rem 1.1rem;
    text-align: left;
}


.wr-review-foot .comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--g1);
    text-decoration: none;
    transition: color .2s ease;
}

.wr-review-foot .comment-reply-link:hover {
    color: var(--primary);
}

/* نظرِ مدیر سایت: سربرگ و کارت سبز */
.wr-review-card--admin > .wr-review-inner {
    background: var(--primary);
}

.wr-review-card--admin .wr-review-head {
    background: #007564;
}

.wr-review-card--admin .wr-review-author,
.wr-review-card--admin .wr-review-date,
.wr-review-card--admin .wr-review-body,
.wr-review-card--admin .wr-review-foot .comment-reply-link {
    color: var(--white);
}

.wr-review-card--admin .wr-review-foot .comment-reply-link:hover {
    color: var(--g5);
}

@media (max-width: 767px) {
    .wr-commentlist .children {
        padding-inline-start: 1rem;
    }

    .wr-review-head {
        flex-wrap: wrap;
        gap: .4rem .75rem;
    }
}
.wr-commentlist .children .wr-review-inner{
    background: #008F781F;
}
.wr-commentlist .children .wr-review-head{
    background: var(--primary);
}

/* --------------------------------------------------------------------------
   موبایل: نمایش تک‌ستونه در صفحه محصول
   pr-action ها، ویژگی‌ها و محصولات مشابه در هر سطر یکی نمایش داده شوند
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    /* دکمه‌های اکشن (دانلود کاتالوگ / محاسبه ظرفیت / نمونه نصب) */
    .wr-after-short-description {
        grid-template-columns: 1fr !important;
    }

    /* ردیف‌های مشخصات محصول */
    .wr-attributes-list {
        grid-template-columns: 1fr !important;
    }

    /* محصولات مشابه و مکمل */
    .single-product .related ul.products,
    .single-product .upsells ul.products {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .wr-attributes-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}