/* منوی دسته‌بندی — جلوگیری از بیرون‌زدگی از کادر (دسکتاپ) */
@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 .summary-specs-body {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    font-variant-numeric: lining-nums;
    -webkit-font-feature-settings: "locl" 0;
    font-feature-settings: "locl" 0;
}

.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;
}

/* تایمر تخفیف محدود روی صفحه محصول */
.product-flash-deal {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 60%);
    border: 1px solid #f5c2c2;
    border-radius: 8px;
    padding: 14px 16px;
}

.product-flash-deal__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.product-flash-deal__badge {
    display: inline-block;
    background: #e11d48;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
}

.product-flash-deal__title {
    font-weight: 700;
    color: #333;
}

.product-flash-deal__off {
    color: #e11d48;
    font-weight: 600;
    font-size: 13px;
}

.product-flash-deal__timer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.product-flash-deal__label {
    font-size: 13px;
    color: #666;
}

.product-flash-deal .countdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-flash-deal .countdown .countdown-item {
    background: #1f2937;
    color: #fff;
    border-radius: 6px;
    min-width: 52px;
    text-align: center;
    padding: 6px 4px;
    margin: 0 !important;
}

.product-flash-deal .countdown .countdown-digit {
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.product-flash-deal .countdown .countdown-label {
    display: block;
    font-size: 10px;
    opacity: 0.85;
}

.product-flash-deal .countdown .countdown-separator {
    display: none;
}

/* بنر اطلاعات زیر تصویر محصول */
.product-info-banner {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 16px 12px 12px;
    text-align: center;
}

.product-info-banner__img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

.product-info-banner__text {
    font-size: 13px;
    color: #555;
    line-height: 1.8;
    margin-top: 8px;
}

.product-info-banner__img + .product-info-banner__text {
    margin-top: 10px;
}

/* فوتر — پیام‌رسان‌ها */
.footer-messengers.social-nav a.telegram {
    background: #229ED9;
    color: #fff;
}
.footer-messengers.social-nav a.whatsapp {
    background: #25D366;
    color: #fff;
}
.footer-messengers.social-nav a.bale {
    background: #00AEEF;
    color: #fff;
}
.footer-messengers.social-nav a .footer-bale-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.footer-messengers.social-nav a:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* روش‌های ارسال — نمایش کامل توضیحات */
.shipping-method-list {
    width: 100%;
}

.shipping-method-item {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
}

.shipping-method-item__content {
    flex: 1 1 auto;
    min-width: 0;
    height: auto !important;
    overflow: visible !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.shipping-method-item__name,
.shipping-method-item__desc,
.shipping-method-item__cost {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    -webkit-line-clamp: unset !important;
    max-height: none !important;
    height: auto !important;
}

.shipping-method-item__desc {
    font-size: 13px;
    line-height: 1.7;
}

/* لوگو درگاه پرداخت — واضح و فعال (نه کمرنگ) */
label.payment_option span {
    background: #fff !important;
    border: 2px solid #e5e7eb;
    padding: 10px 14px;
    min-height: 90px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

label.payment_option span img {
    max-height: 72px !important;
    width: auto !important;
    opacity: 1 !important;
    filter: none !important;
}

/* حذف لایه سفید که لوگو را کمرنگ می‌کرد */
label.payment_option input:checked + span:before {
    background: transparent !important;
    content: none !important;
}

label.payment_option input:checked + span {
    border-color: #6c2bd9;
    box-shadow: 0 0 0 2px rgba(108, 43, 217, 0.2);
}

label.payment_option input:checked + span:after {
    left: auto !important;
    right: 8px !important;
    top: 8px !important;
    width: 18px !important;
    height: 18px !important;
    border: none !important;
    border-radius: 50%;
    background: #6c2bd9;
    box-shadow: inset 0 0 0 2px #fff;
    transform: none !important;
}

/* عنوان کامل محصول در لیست‌ها (بدون بریدن ظرفیت و ...) */
.card-product .product-title,
.product-box-1 .product-title,
.product-box-2 .product-title,
.shop-cards .product-title,
.product-card-2 .product-title {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    white-space: normal !important;
    line-height: 1.55 !important;
    margin-top: 6px;
}

.card-product .product-title a,
.product-box-1 .product-title a,
.product-box-2 .product-title a,
.shop-cards .product-title a,
.product-card-2 .product-title a,
.card-product .product-title a.text-truncate,
.product-box-1 .product-title a.text-truncate,
.product-box-2 .product-title a.text-truncate,
.shop-cards .product-title a.text-truncate,
.product-card-2 .product-title a.text-truncate,
.card-product h2.text-truncate-2,
.product-box-2 h2.text-truncate-2 {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    max-height: none !important;
    height: auto !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

