/* منوی دسته‌بندی — جلوگیری از بیرون‌زدگی از کادر (دسکتاپ) */
@media (min-width: 992px) {
    .category-sidebar {
        overflow: hidden;
    }

    .category-sidebar .categories {
        overflow-x: hidden;
        overflow-y: auto;
        height: calc(100% - 49px);
        max-height: 351px;
        margin: 0;
        padding: 0;
    }

    .category-sidebar .categories .category-nav-element {
        margin-bottom: 2px;
        padding: 0;
        width: 100%;
    }

    .category-sidebar .categories > li {
        width: 100%;
    }

    .category-sidebar .categories > li > a {
        display: flex;
        align-items: center;
        flex-direction: row;
        justify-content: flex-start;
        overflow: hidden;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px 12px !important;
    }

    .category-sidebar .categories > li > a .cat-image {
        flex-shrink: 0;
        width: 22px !important;
        height: 22px;
        object-fit: contain;
        margin-left: 8px !important;
        margin-right: 0 !important;
    }

    .category-sidebar .categories > li > a .cat-name {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: right;
        display: block;
        line-height: 1.4;
    }

    .category-sidebar .all-category {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px !important;
        overflow: hidden;
    }
}

/* هدر سایدبار دسته‌بندی — دکمه «همه دسته‌ها» */
.category-sidebar .all-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
}

.category-sidebar .all-category-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    flex-shrink: 0;
}

.category-sidebar .all-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff !important;
    background: linear-gradient(135deg, #e62e04 0%, #c52703 100%);
    border-radius: 20px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(230, 46, 4, 0.25);
}

.category-sidebar .all-category-btn:hover,
.category-sidebar .all-category-btn:focus {
    opacity: 0.92;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(230, 46, 4, 0.35);
}

.category-sidebar .all-category-btn i {
    font-size: 14px;
    line-height: 1;
}

/* فاصله بیشتر در زیرمنوی دسته‌ها (mega menu) */
.sub-cat-items li {
    margin-bottom: 10px;
    padding: 4px 0;
    line-height: 1.6;
}

.sub-cat-items .sub-cat-name {
    margin-bottom: 12px;
    padding-bottom: 6px;
}

.sub-cat-items .sub-cat-name a {
    font-weight: 700;
}

.card-columns .card {
    margin-bottom: 1.5rem;
}

/* باکس مشخصات خلاصه کالا */
.product-summary-specs {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.product-summary-specs h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

.product-summary-specs ul {
    margin: 0;
    padding-right: 18px;
}

.product-summary-specs li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.product-price-label-call {
    color: #e62e04;
    font-weight: 700;
}

.product-price-label-out {
    color: #666;
    font-weight: 700;
}

.page-home-link-bar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
    font-size: 14px;
}

/* بنر اطلاع‌رسانی بالای سایت */
.site-announcement-bar {
    background: #232933;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.site-announcement-bar__inner {
    padding: 10px 16px;
}

.site-announcement-bar__link {
    display: block;
    color: #fff;
    text-decoration: none;
}

.site-announcement-bar__link:hover {
    color: #fff;
    opacity: 0.92;
}

.site-announcement-bar__image-wrap {
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.site-announcement-bar__image {
    display: block;
    width: 100%;
    max-height: 56px;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 767px) {
    .site-announcement-bar__image {
        max-height: 44px;
    }
}

/* صفحه تماس با ما */
.contact-page-content,
.contact-page-sidebar {
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.contact-page-content img {
    max-width: 100%;
    height: auto;
}

/* نقشه پایین صفحه */
.footer-map-section {
    background: #fff;
    padding: 32px 0 24px;
    border-top: 1px solid #eee;
}

.footer-map-wrap {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.footer-map-wrap iframe {
    display: block;
    width: 100%;
    min-height: 320px;
}

/* گالری محصول — چیدمان درست (تصویر اصلی + thumbnail کنار هم) */
.product-gallery {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    padding: 16px;
    position: sticky;
    top: 12px;
    box-sizing: border-box;
}

.product-gallery__thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 72px;
    width: 72px;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
}

.product-gallery__thumb {
    display: block;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
    border-color: #e62e04;
    box-shadow: 0 0 0 1px #e62e04;
}

.product-gallery__stage {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    min-height: 360px;
    max-height: 520px;
    padding: 12px;
}

.product-gallery__main {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 496px;
    object-fit: contain;
    object-position: center;
}

@media (max-width: 991px) {
    .product-gallery {
        flex-direction: column-reverse;
        position: static;
        padding: 12px;
    }

    .product-gallery__thumbs {
        flex-direction: row;
        flex: none;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }

    .product-gallery__thumb {
        width: 64px;
        height: 64px;
        flex: 0 0 64px;
    }

    .product-gallery__stage {
        min-height: 280px;
        max-height: 400px;
    }
}

/* سازگاری با کلاس‌های قدیمی (در صورت باقی‌ماندن) */
.product-gallery-simple .product-gallery-main {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.product-thumb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-thumb-item {
    border: 2px solid transparent;
    padding: 0;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.product-thumb-item.active,
.product-thumb-item:hover {
    border-color: var(--primary, #3490dc);
}

.product-thumb-item img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
}
