/* =========================
شروع برگه محصولات تکی
========================= */

.woocommerce div.product {
    margin: 0px 5% !important;
}

.woocommerce div.product div.images img {
    display: block;
    width: auto !important;
    height: auto;
}

.woocommerce-breadcrumb a {
  color: #fff !important;
}

nav.woocommerce-breadcrumb {
    margin: 1% !important;
    padding: 20px !important;
    background-color: #b80303;
    border-radius: 10px;
    width: 80%;
    color: white !important;
}

@media (max-width: 600px) {
 nav.woocommerce-breadcrumb {
  margin: 5% !important;

}}

h1.product_title.entry-title {
    font-size: 22px;
    margin-top: 60px !important;
}

button.single_add_to_cart_button.button.alt {
    background-color: #0058b5;
    border-radius: 10px;
}

button.single_add_to_cart_button.button.alt:hover {
    background-color: red;
    border-radius: 10px;
}

.woocommerce .quantity .qty {
    padding: 10px 0px !important;
    border: 0px !important;
    background-color: #b80303 !important;
    border-radius: 10px !important;
    color: white !important;
}

.single_add_to_cart_button.button.alt {
  font-family: iranyekan;
}

.attribute_value {
  padding-right: 20px !important;
}

.shop_attributes.woocommerce-group-attributes-layout-1 {
  font-family: iranyekan !important;
}

/* استایل‌های کلی برای بخش محصولات مشابه */
.related.products{
 margin: 0px 5% !important;
}
.related.products ul.products {
    display: flex;
  flex-wrap: nowrap;
    padding: 0;
    list-style: none;
}

.related.products ul.products li.product {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.related.products ul.products li.product:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.related.products ul.products li.product img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.related.products ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    margin-bottom: 10px;
    min-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.related.products ul.products li.product .price {
    font-size: 1.2em;
    font-weight: bold;
    color: #d32f2f;
    margin-top: auto;
    margin-bottom: 10px;
    display: block;
}

.related.products ul.products li.product .button {
    display: inline-block;
    background-color: #4CAF50;
    color: white !important;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 0 auto;
    max-width: 80%;
    line-height: 1.4;
}

.related.products ul.products li.product .button:hover {
    background-color: #45a049;
}

/* ==========================================
   اصلاح فاصله و اندازه عکس محصولات مرتبط (موبایل)
========================================== */
@media (max-width: 768px) {
    .related.products {
        margin: 30px 15px !important; /* ایجاد فاصله از چپ و راست کل بخش */
        padding: 0 !important;
    }

    .related.products ul.products {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important; /* فاصله مناسب بین کارت‌ها */
        padding: 0 !important;
        margin: 0 !important;
    }

    .related.products ul.products li.product {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    /* بزرگتر شدن تصویر محصول و پر کردن عرض کارت */
    .related.products ul.products li.product img {
        width: 100% !important;
        height: auto !important;
        max-height: 320px !important; /* افزایش ارتفاع برای بزرگتر شدن عکس */
        object-fit: contain !important;
        margin: 0 auto 15px auto !important;
    }

    .related.products ul.products li.product .woocommerce-loop-product__title {
        font-size: 15px !important;
        line-height: 1.5 !important;
        margin-bottom: 10px !important;
    }

    .related.products ul.products li.product .price {
        font-size: 1.1em !important;
        margin-bottom: 12px !important;
    }

    .related.products ul.products li.product .button {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 0 !important;
        font-size: 0.95em !important;
        border-radius: 8px !important;
    }
}
/* ==========================================
   استایل‌های چیدمان گالری جدید (۶ تایی)
========================================== */

.custom-single-product .product {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
}

.custom-product-gallery {
    flex: 0 0 45%;
    max-width: 45%;
}

.custom-single-product .summary.entry-summary {
    flex: 0 0 50%;
    max-width: 50%;
}

/* قاب تصویر اصلی با پشتیبانی از Zoom */
.main-image-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #fff;
    cursor: zoom-in;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    position: relative;
}

.main-image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
    transition: transform 0.1s ease-out;
}

/* آلبوم ۶ تایی Thumbnails */
.custom-gallery-thumbs {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

.custom-gallery-thumbs .thumb-box {
    width: calc((100% - 50px) / 6);
    aspect-ratio: 1 / 1;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    position: relative;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-gallery-thumbs .thumb-box.active {
    border-color: #ab0000;
    border-width: 2px;
}

.custom-gallery-thumbs .thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* افکت ماتی و سه نقطه برای عکس ششم */
.custom-gallery-thumbs .thumb-box.has-dots img {
    filter: blur(2px);
    opacity: 0.6;
}

.dots-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.dots-overlay span {
    width: 5px;
    height: 5px;
    background-color: #333;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

/* ==========================================
   استایل‌های مودال بزرگنمایی (LightBox)
========================================== */

.product-gallery-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px 0;
    box-sizing: border-box;
}

.product-gallery-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-close {
    position: absolute;
    top: 20px; left: 25px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
}

.modal-header-badge {
    background: #1e1e1e;
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #333;
    margin-top: 10px;
}

.modal-main-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
}

.modal-main-stage img {
    max-width: 90%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

/* نوار Thumbnails پایینی مودال */
.modal-thumbs-strip {
    display: flex;
    gap: 12px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: none;
}

.modal-thumbs-strip::-webkit-scrollbar {
    display: none;
}

.modal-thumb-item {
    width: 65px;
    height: 65px;
    flex: 0 0 65px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: #fff;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.modal-thumb-item.active {
    border-color: #ff0000;
    opacity: 1;
}

.modal-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .custom-product-gallery,
    .custom-single-product .summary.entry-summary {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ==============================
   WooCommerce Additional Information
============================== */

.woocommerce table.shop_attributes {
    width: 100%;
    border: none;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    margin: 0;
}

.woocommerce table.shop_attributes tr {
    border-bottom: 1px solid #ececec;
}

.woocommerce table.shop_attributes tr:last-child {
    border-bottom: none;
}

.woocommerce table.shop_attributes th,
.woocommerce table.shop_attributes td {
    padding: 16px 22px;
    font-size: 15px;
    line-height: 1.9;
    vertical-align: top;
}

.woocommerce table.shop_attributes th {
    width: 32%;
    background: #f7f7f7;
    color: #111;
    font-weight: 700;
    text-align: right;
    border: none;
}

.woocommerce table.shop_attributes td {
    width: 68%;
    background: #fff;
    color: #444;
    border: none;
    text-align: right;
}

.woocommerce table.shop_attributes td p {
    margin: 0;
}

.woocommerce table.shop_attributes td ul,
.woocommerce table.shop_attributes td ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce table.shop_attributes tr:nth-child(even) td {
    background: #fcfcfc;
}

.woocommerce table.shop_attributes tr:hover td,
.woocommerce table.shop_attributes tr:hover th {
    background: #fafafa;
}

.woocommerce .woocommerce-Tabs-panel--additional_information h2 {
    display: none;
}
.woocommerce-Tabs-panel--additional_information {
    background: #fff;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,.04);
}

@media (max-width:767px){

    .woocommerce table.shop_attributes{
        width:100%;
        display:table !important;
        border-collapse:collapse;
        table-layout:fixed;
        border:none;
        background:#fff;
    }

    .woocommerce table.shop_attributes tbody{
        display:table-row-group !important;
    }

    .woocommerce table.shop_attributes tr{
        display:table-row !important;
    }

    .woocommerce table.shop_attributes th,
    .woocommerce table.shop_attributes td{
        display: table-cell !important;
        vertical-align: middle;
        padding: 10px 8px;
        border-bottom: 1px solid #ececec;
        text-align: center !important;
        font-size: 13px !important;
        line-height: 1.7;
    }

    .woocommerce table.shop_attributes th{
        width: 38%;
        background: #f5f5f5;
        font-weight: 700;
    }

    .woocommerce table.shop_attributes td{
        width: 62%;
        font-weight: 400;
    }

    .woocommerce table.shop_attributes td p{
        margin: 0;
        text-align: center !important;
    }

    .woocommerce table.shop_attributes td ul,
    .woocommerce table.shop_attributes td ol{
        margin: 0;
        padding: 0;
        list-style: none;
        text-align: center !important;
    }

}
/* ==========================================
   استایل دکمه‌های علاقه‌مندی و مقایسه
========================================== */
.single-product-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    width: 100%;
}

.single-product-actions .hover-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #f7f7f7;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    flex: 1;
}

/* آیکون داخل دکمه‌ها */
.single-product-actions .hover-action-btn .action-icon {
    width: 18px;
    height: 18px;
    stroke: #555;
    transition: stroke 0.25s ease, transform 0.25s ease;
}

/* افکت هوور (موس روی دکمه‌ها) */
.single-product-actions .hover-action-btn:hover {
    background-color: #fff;
    border-color: #0058b5;
    color: #0058b5;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.single-product-actions .hover-action-btn:hover .action-icon {
    stroke: #0058b5;
    transform: scale(1.1);
}

/* افکت دکمه علاقه‌مندی در حالت هوور (رنگ قرمز) */
.single-product-actions .my-wishlist-btn:hover {
    border-color: #d32f2f;
    color: #d32f2f;
}

.single-product-actions .my-wishlist-btn:hover .heart-icon {
    stroke: #d32f2f;
}

/* ریسپانسیو برای حالت موبایل */
@media (max-width: 480px) {
    .single-product-actions {
        flex-direction: column;
        gap: 10px;
    }

    .single-product-actions .hover-action-btn {
        width: 100%;
    }
}
/* ==========================================
   فلش‌های قبلی / بعدی گالری
========================================== */

.modal-main-stage {
    position: relative;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    
    width: 48px;
    height: 48px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    border: none;
    border-radius: 50%;
    
    background: rgba(255, 255, 255, 0.9);
    color: #222;
    
    font-size: 28px;
    line-height: 1;
    
    cursor: pointer;
    z-index: 20;
    
    transition: all 0.25s ease;
    
    padding: 0;
    margin: 0;
}

.gallery-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gallery-prev {
    left: 25px;
}

.gallery-next {
    right: 25px;
}

/* موبایل */
@media (max-width: 768px) {

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 23px;
    }

    .gallery-prev {
        left: 10px;
    }

    .gallery-next {
        right: 10px;
    }

}
/* ==========================================
   فلش‌های گالری روی عکس اصلی
========================================== */

.main-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 42px;
    height: 42px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.92);
    color: #333;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 25px;
    line-height: 1;

    padding: 0;
    margin: 0;

    cursor: pointer;

    z-index: 10;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);

    opacity: 0;
    transition: all 0.25s ease;
}

/* نمایش فلش‌ها هنگام رفتن موس روی عکس */
.main-image-wrapper:hover .main-gallery-arrow {
    opacity: 1;
}

/* فلش قبلی - سمت چپ */
.main-gallery-prev {
    left: 15px;
}

/* فلش بعدی - سمت راست */
.main-gallery-next {
    right: 15px;
}

/* Hover */
.main-gallery-arrow:hover {
    background: #ffffff;
    color: #b80303;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


/* موبایل */
@media (max-width: 768px) {

    .main-gallery-arrow {
        width: 36px;
        height: 36px;
        font-size: 21px;
        opacity: 1;
    }

    .main-gallery-prev {
        left: 8px;
    }

    .main-gallery-next {
        right: 8px;
    }
}
/* ==========================================
   اصلاح نهایی صفحه محصول تکی
   1- حذف اسکرول افقی
   2- اصلاح تب‌ها
   3- رنگی کردن دکمه محصولات مرتبط
========================================== */

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

body.single-product .site,
body.single-product #page,
body.single-product #content,
body.single-product .site-content {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* جلوگیری از بیرون زدن محتوای صفحه محصول */
body.single-product .woocommerce,
body.single-product .custom-single-product,
body.single-product .custom-single-product .product {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* اصلاح عرض و چیدمان تب‌ها */
body.single-product .woocommerce-tabs {
    clear: both;
    float: none;
    width: 90%;
    max-width: 1200px;
    min-width: 0;
    margin: 30px auto !important;
    box-sizing: border-box;
    overflow: hidden;
}

/* نوار تب‌ها */
body.single-product .woocommerce-tabs ul.tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 0 0 5px !important;
    border-bottom: 1px solid #dedede !important;
    box-sizing: border-box;
}

body.single-product .woocommerce-tabs ul.tabs::before,
body.single-product .woocommerce-tabs ul.tabs::after {
    display: none !important;
}

/* هر تب */
body.single-product .woocommerce-tabs ul.tabs li {
    float: none !important;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #dedede !important;
    border-bottom: 0 !important;
    border-radius: 6px 6px 0 0 !important;
    background: #f1f1f4 !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

body.single-product .woocommerce-tabs ul.tabs li::before,
body.single-product .woocommerce-tabs ul.tabs li::after {
    display: none !important;
}

body.single-product .woocommerce-tabs ul.tabs li.active {
    background: #fff !important;
    border-color: #dedede !important;
}

body.single-product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 10px 15px !important;
    color: #333 !important;
    font-family: iranyekan, sans-serif;
    font-size: 13px;
    line-height: 1.8;
    white-space: normal;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

body.single-product .woocommerce-tabs ul.tabs li.active a {
    color: #b80303 !important;
    font-weight: 700;
}

/* محتوای تب توضیحات و دیدگاه‌ها */
body.single-product .woocommerce-tabs .panel {
    float: none !important;
    clear: both;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    padding: 24px 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

body.single-product .woocommerce-tabs .panel img,
body.single-product .woocommerce-tabs .panel video,
body.single-product .woocommerce-tabs .panel iframe {
    max-width: 100% !important;
    height: auto;
}

body.single-product .woocommerce-tabs .panel table {
    max-width: 100%;
}

/* اصلاح بخش محصولات مرتبط */
body.single-product .related.products {
    clear: both;
    float: none !important;
    width: 90%;
    max-width: 1200px;
    min-width: 0;
    margin: 30px auto !important;
    box-sizing: border-box;
}

body.single-product .related.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

body.single-product .related.products ul.products::before,
body.single-product .related.products ul.products::after {
    display: none !important;
}

body.single-product .related.products ul.products li.product {
    float: none !important;
    width: auto !important;
    min-width: 0;
    max-width: 100%;
    margin: 0 !important;
    padding: 12px !important;
    background: #f8f8f8 !important;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-sizing: border-box;
}

body.single-product .related.products ul.products li.product img {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 160px !important;
    object-fit: contain !important;
    box-sizing: border-box;
}

/* دکمه اطلاعات محصول مرتبط */
body.single-product .related.products ul.products li.product .button,
body.single-product .related.products ul.products li.product a.button {
    display: inline-block !important;
    width: auto !important;
    max-width: 100%;
    margin: 10px auto 0 !important;
    padding: 9px 15px !important;
    background: #fd2524 !important;
    background-color: #fd2524 !important;
    color: #fff !important;
    border: 1px solid #fd2524 !important;
    border-radius: 5px !important;
    font-family: iranyekan, sans-serif;
    font-size: 12px !important;
    line-height: 1.7;
    text-align: center;
    white-space: normal;
    box-shadow: none !important;
}

body.single-product .related.products ul.products li.product .button:hover,
body.single-product .related.products ul.products li.product a.button:hover {
    background: #b80303 !important;
    background-color: #b80303 !important;
    border-color: #b80303 !important;
    color: #fff !important;
}

/* تبلت */
@media (min-width: 600px) and (max-width: 900px) {
    body.single-product .related.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* موبایل */
@media (max-width: 599px) {
    body.single-product .woocommerce-tabs {
        width: auto;
        margin: 22px 12px !important;
    }

    body.single-product .woocommerce-tabs ul.tabs {
        gap: 5px;
        padding: 0 !important;
    }

    body.single-product .woocommerce-tabs ul.tabs li a {
        padding: 8px 10px !important;
        font-size: 12px;
    }

    body.single-product .woocommerce-tabs .panel {
        padding: 18px 0 !important;
    }

    body.single-product .related.products {
        width: auto;
        margin: 25px 12px !important;
    }

    body.single-product .related.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.single-product .related.products ul.products li.product {
        padding: 8px !important;
    }

    body.single-product .related.products ul.products li.product img {
        height: 125px !important;
    }

    body.single-product .related.products ul.products li.product .button {
        padding: 7px 9px !important;
        font-size: 11px !important;
    }
}