/* --------------------- عمومی --------------------- */
body {
    background-color: #f8f9fa;
}

.shop-title {
    text-align: center;
    margin-bottom: 0.5rem !important;

}

.category-seo-box p {
    text-align: justify;
}

/* --------------------- گرید محصولات --------------------- */
.custom-grid-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 0;
    margin: 0;
    width: 100%;
}

@media (max-width: 1199px) {
    .custom-grid-products { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 768px) {
    .custom-grid-products { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 576px) {
    .custom-grid-products { grid-template-columns: repeat(2,1fr); }
}

/* --------------------- کارت محصولات --------------------- */
.custom-product-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    position: relative;
}

.custom-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.custom-product-card .woocommerce-loop-product__title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin: .75rem 0;
    color: #333;
}

.custom-product-card .price {
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    margin-bottom: .5rem;
}

.custom-product-card .price del {
    color: #dc3545;
}

.custom-product-card .price ins {
    color: #28a745;
    text-decoration: none;
}

.custom-product-card .button {
    background-color: #28a745 !important;
    color: #e9ecef !important;
    padding: .6rem 1rem !important;
    border-radius: 6px !important;
    font-size: .78rem !important;
    transition: background-color 0.3s ease !important;
    margin-top: 15px !important;
    border: 1px solid #f8f9fa !important;
}

.custom-product-card .button:hover {
    background-color: #0047b3 !important;
}

.custom-product-card .onsale {
    position: absolute;
    top: 10px !important;
    right: 5px !important;
    background-color: #dc3545 !important;
    border-radius: 30px !important;
    color: #fff !important;
    padding: 4px 10px !important;
    height: 35px;
    width: 50px;
    font-size: .75rem !important;
    font-weight: bold !important;
    z-index: 10;
}

.woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

/* --------------------- مگا منو --------------------- */
.mega-menu {
    margin-bottom: 2rem;
    position: relative;
}

.mega-menu-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.mega-menu-track::-webkit-scrollbar { display: none; }

.mega-item {
    flex: 0 0 auto;
    width: 110px;
    text-align: center;
    position: relative;
    cursor: pointer;
    scroll-snap-align: start;
}

.mega-item a {
    text-decoration: none;
    color: #333;
}

.mega-thumb {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto 8px;
    background: #f1f1f1;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.mega-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mega-item span {
    font-size: 14px;
    white-space: nowrap;
}

/* --------------------- موبایل --------------------- */
@media (max-width: 991px) {
    .shop-sidebar { display: none; }
    #offcanvasMenu,#offcanvasFilter { width: 80vw; max-width: 320px; }
    .offcanvas-header { border-bottom: 1px solid #ddd; }
    .offcanvas-body { padding: 1rem 1rem 2rem 1rem; }
    .offcanvas-menu-list { list-style: none; padding: 0; margin: 0; }
    .offcanvas-menu-list>li { border-bottom: 1px solid #eee; }
    .offcanvas-menu-list a { display: flex; justify-content: space-between; align-items: center; padding: .75rem 0; color: #444; font-weight: 600; text-decoration: none; cursor: pointer; }
    .offcanvas-menu-list a:hover { color: #0047b3; }

    .submenu-toggle { display: inline-block; width: 8px; height: 8px; border-right: 2px solid #6c757d; border-bottom: 2px solid #6c757d; transform: rotate(45deg); transition: transform 0.3s ease; margin-left: 8px; }
    .submenu-open>.submenu-toggle { transform: rotate(-135deg); }
    .submenu-list { list-style: none; padding-left: 1rem; margin: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
    .submenu-open+.submenu-list { max-height: 1000px; }
    .submenu-list li a { font-weight: 500; color: #0a58ca; padding: .5rem 0; display: block; }
    .submenu-list li a:hover { color: #063d99; }

    .offcanvas-body .shop-sidebar { display: block !important; max-height: none; overflow: visible; }
}
/* مگا منو اسکرولی استاندارد */
.mega-menu {
    width: 100%;
    overflow: hidden;
    padding: 1rem 0;
    background-color: #fff;
}

.mega-menu-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    margin: 0;
}
.mega-menu-track::-webkit-scrollbar {
    display: none;
}

.mega-item {
    flex: 0 0 auto;
    width: 110px;
    text-align: center;
    scroll-snap-align: start;
}

.mega-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.mega-thumb {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 8px;
    background: #f1f1f1;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.mega-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mega-item span {
    font-size: 14px;
    white-space: nowrap;
}

/* دسکتاپ: جلوگیری از تداخل با سایر flex ها */
@media (min-width: 992px) {
    .mega-menu-track {
        display: flex !important;
    }
    .mega-item {
        flex-shrink: 0;
    }
}

.custom-pagination-wrapper {
    text-align: center;
    margin: 2rem 0;
}

.custom-pagination {
    display: inline-flex;
    list-style: none;
    padding: 0;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.custom-pagination-item a {
    display: block;
    min-width: 36px;
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #0d6efd;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.custom-pagination-item a:hover {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.custom-pagination-item .active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    pointer-events: none; /* غیرقابل کلیک */
        min-width: 36px;
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.custom-pagination-item .dots {
    color: #6c757d;
    border: none;
    background: none;
    cursor: default;
}
.shop-container .offcanvas-end {
    width: 80vw;
}
.submenu-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0; /* padding 0 وقتی بسته است */
}

.submenu-visible {
    max-height: 1000px; /* یا ارتفاع کافی برای محتوای بیشتر */
    padding: 0.5rem 0; /* padding وقتی باز است */
}

/* فلش کوچک کنار لینک‌ها */
.submenu-toggle {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6c757d;
    border-bottom: 2px solid #6c757d;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.submenu-open > .submenu-toggle {
    transform: rotate(-135deg);
}
.shop-header {
    border-right: 4px solid #28a745;
}

.shop-title {
    line-height: 1.4;
}

.shop-subtitle {
    font-size: 0.95rem;
}

/* موبایل */
@media (max-width: 768px) {
    .shop-header {
        text-align: center;
        border-right: none;
        border-bottom: 3px solid #28a745;
    }
}
.category-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ddd;
    transition: transform 0.3s ease,border-color 0.3s ease;
}