/* ===== Header UI polish ===== */

/* Android / iOS: فقط موبایل، همیشه کنار هم */
.install-app-btn-container {
    display: none !important;
}
@media (max-width: 768.98px) {
    .install-app-btn-container {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        white-space: nowrap;
        max-width: 100%;
    }
    .install-app-btn-container .app-store-btn {
        flex: 0 0 auto;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        border-radius: 10px !important;
        line-height: 1;
    }
    .install-app-btn-container .app-store-btn i {
        font-size: 18px;
        margin: 0;
    }
}
@media (max-width: 400px) {
    .install-app-btn-container .app-store-btn {
        width: 32px;
        height: 32px;
    }
    .install-app-btn-container .app-store-btn i {
        font-size: 16px;
    }
}

.header-top-row {
    align-items: center;
    justify-content: space-between;
}

.header-top-row .toplogo {
    max-width: 220px !important;
}

/* دسکتاپ: سرچ وسط و محدود — نه خیلی دراز، نه فضای خالی مرده */
@media (min-width: 992px) {
    .header-logo-col {
        text-align: right !important;
    }
    .header-actions-col {
        display: flex;
        justify-content: flex-start;
    }
    .header-actions-col .header-boxing {
        width: 100%;
    }
    .header-actions-col .header-actions {
        justify-content: flex-start;
        gap: 12px;
    }
    .header-search-col {
        display: flex !important;
        justify-content: center;
        align-items: center;
    }
    .header-search-col .search-panel {
        width: 100% !important;
        max-width: 560px;
        margin: 0 auto;
    }
}

@media (min-width: 1200px) {
    .header-search-col .search-panel {
        max-width: 620px;
    }
}

@media (min-width: 1400px) {
    .header-search-col .search-panel {
        max-width: 680px;
    }
}

/* Search: دکمه چسبیده به اینپوت */
.header-search-col .search-panel,
.header-search-col .search-panel > .input-group {
    width: 100% !important;
    max-width: 100%;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
}

.header-search-col .search-panel > .input-group {
    position: relative;
}

.header-search-col .search-input,
.search-panel .search-input {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 46px !important;
    font-size: 14px !important;
    background: #f5f6f8 !important;
    border: 1px solid #e6e8ee !important;
    border-left: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.header-search-col .input-group-btn,
.search-panel .input-group-btn {
    display: flex !important;
    align-items: stretch !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

.header-search-col .search-btn,
.search-panel .search-btn {
    width: 52px !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border: 1px solid transparent !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.header-search-col .clearsrch {
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

@media (max-width: 991.98px) {
    .header-search-col {
        order: 3;
        margin-top: 8px;
        margin-bottom: 6px;
    }
}

/* Basket icon */
.header-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff 0%, #f3f4f7 100%);
    border: 1px solid #e8eaef;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none !important;
    padding: 0 !important;
}

.header-cart:hover {
    transform: translateY(-1px);
    border-color: #f22d33;
    box-shadow: 0 8px 20px rgba(242, 45, 51, 0.18);
}

.header-cart__icon {
    color: #2b2f36;
    font-size: 20px;
    line-height: 1;
}

.header-cart:hover .header-cart__icon {
    color: #f22d33;
}

.header-cart .number-basket,
.header-cart__badge,
.header-cart .header-cart__badge {
    position: absolute !important;
    top: -6px !important;
    left: -6px !important;
    right: auto !important;
    margin: 0 !important;
    min-width: 20px;
    height: 20px;
    padding: 0 6px !important;
    border-radius: 999px !important;
    background: #f22d33 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    text-align: center;
    box-shadow: 0 2px 8px rgba(242, 45, 51, 0.35);
    border: 2px solid #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.header-actions .user-btn {
    white-space: nowrap;
}

/* دکمه حساب کاربری شبیه کادر سبد */
.header-actions .header-user,
.header-actions a.usermenu.header-user {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 14px !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg, #fff 0%, #f3f4f7 100%) !important;
    border: 1px solid #e8eaef !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
    color: #2b2f36 !important;
    font-size: 13px !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.header-actions .header-user:hover,
.header-actions a.usermenu.header-user:hover {
    transform: translateY(-1px);
    border-color: #f22d33 !important;
    box-shadow: 0 8px 20px rgba(242, 45, 51, 0.18) !important;
    color: #f22d33 !important;
    background: #fff !important;
}

.header-actions .header-user i {
    font-size: 16px;
    margin: 0 !important;
}

.header-actions .header-user.header-user--icon {
    width: 48px;
    padding: 0 !important;
}

@media (max-width: 1199.98px) {
    .header-actions .header-user .header-user__text {
        display: none;
    }
    .header-actions .header-user {
        width: 48px;
        padding: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .header-actions {
        justify-content: center;
    }
}

body.dark-mode .header-actions .header-user,
body.dark-mode .header-actions a.usermenu.header-user {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
    color: #eee !important;
}

/* ===== Mega menu ===== */
.navbar-nav > .nav-item.dropdown > .dropdown-menu.mega-dropdown,
.navbar-nav > .nav-item.dropdown > .dropdown-menu.minwidth400 {
    min-width: min(920px, 92vw);
    padding: 18px 16px !important;
    border: 1px solid #eceff3 !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12) !important;
    background: #fff !important;
    margin-top: 8px;
    overflow: hidden;
}

.mega-dropdown .mega-cat-item,
.mega-dropdown .h120 {
    height: auto !important;
    min-height: 118px;
    margin: 0 !important;
    padding: 10px 8px !important;
    border-radius: 14px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.mega-dropdown .mega-cat-item:hover,
.mega-dropdown .h120:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.mega-dropdown .mega-cat-item a,
.mega-dropdown .h120 a {
    display: block;
    text-decoration: none;
    color: #1f2937;
}

.mega-dropdown .mega-cat-item img,
.mega-dropdown .h120 img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
    filter: none !important;
}

.mega-dropdown .mega-cat-item h6,
.mega-dropdown .h120 h6 {
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    font-weight: 600;
}

.dropdown-menu.minwidth400 .nav-link {
    border-radius: 8px;
    padding: 8px 10px !important;
    font-size: 13px;
    color: #374151 !important;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-menu.minwidth400 .nav-link:hover {
    background: #fff1f2;
    color: #f22d33 !important;
}

.dropdown-menu.minwidth400 .col-3 img {
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.nav-item.dropdown > .nav-link.product-btn {
    border-radius: 10px;
    padding-inline: 12px;
}

.nav-item.dropdown:hover > .nav-link.product-btn {
    background: #fff1f2;
    color: #f22d33 !important;
}

/* ===== Footer desktop 4-column ===== */
.footer-main .footer-panel {
    background: transparent;
    box-shadow: none;
    border: 0;
}

.footer-col-title,
.footer-contact-card h4.footer-col-title,
.footer-contact-card #contactus {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    text-align: right;
    position: relative;
    padding-bottom: 10px;
}

.footer-col-title::after,
.footer-contact-card h4.footer-col-title::after,
.footer-contact-card #contactus::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 36px;
    height: 3px;
    border-radius: 999px;
    background: #f22d33;
}

.footer-about-col {
    text-align: right;
}

.footer-about-col .logoFooter {
    max-height: 72px;
    width: auto !important;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 10px !important;
}

.footer-site-title {
    margin-bottom: 8px;
    color: #111827;
}

.footer-about-col .caption-footer {
    margin-top: 0;
    line-height: 1.9;
    font-size: 13px !important;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list .nav-link {
    padding: 6px 0 !important;
    color: #374151 !important;
    font-size: 13px;
    transition: color 0.2s ease, padding-right 0.2s ease;
}

.footer-links-list .nav-link:hover {
    color: #f22d33 !important;
    padding-right: 4px !important;
}

.footer-links-list .h3nav {
    display: inline;
    font-size: 13px !important;
    font-weight: 500;
}

.footer-contact-card {
    background: #fff;
    border: 1px solid #e8eaef;
    border-radius: 16px;
    padding: 16px 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
    text-align: right;
    height: 100%;
}

.footer-contact-card .footer-contact-sub {
    color: #6b7280;
    font-size: 12px;
    margin: 14px 0 8px;
}

.footer-contact-card .form-control {
    border-radius: 10px !important;
    border: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
    min-height: 40px;
    font-size: 13px;
    box-shadow: none !important;
}

.footer-contact-card textarea.form-control {
    min-height: 72px;
    resize: vertical;
}

.footer-contact-card .form-control:focus {
    border-color: #f22d33 !important;
    background: #fff !important;
}

.footer-contact-card .btn-success {
    width: 100%;
    border-radius: 10px !important;
    padding: 8px 14px !important;
    font-weight: 700;
    font-size: 13px;
}

.footer-contact-meta {
    display: grid;
    gap: 8px;
    margin-top: 0;
}

.footer-social-sub {
    color: #6b7280;
    font-size: 13px;
    margin: 0 0 14px;
    text-align: right;
}

.footer-social-icons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-social-item {
    width: 100%;
}

.footer-social-btn {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8eaef;
    text-decoration: none !important;
    color: #111827 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.footer-social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    border-color: #f22d33;
    color: #111827 !important;
}

.footer-social-btn i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 18px;
    flex: 0 0 auto;
}

.footer-social-btn span {
    font-size: 13px;
    font-weight: 600;
}

.footer-social-btn--whatsapp i { background: #25d366; }
.footer-social-btn--telegram i { background: #2aabee; }
.footer-social-btn--instagram i {
    background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af);
}

@media (min-width: 992px) {
    .footer-desktop-grid {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
    }
    .footer-desktop-grid > .footer-col {
        flex: 1 1 0 !important;
        width: auto !important;
        max-width: none !important;
        text-align: right;
    }
    .footer-contact-card {
        padding: 18px 16px;
    }
    .footer-social-icons {
        gap: 12px;
    }
    .namad-footer > .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }
    .namad-footer > .row > [class*="col"] {
        flex: 0 1 auto !important;
        width: auto !important;
        max-width: 110px;
        margin-bottom: 0 !important;
    }
    .namad-footer .enamad,
    .namad-footer img.enamad,
    .namad-footer #enamad img {
        max-height: 64px;
        max-width: 100px;
        width: auto;
        height: auto;
        object-fit: contain;
        margin: 0 auto !important;
    }
}

@media (max-width: 991.98px) {
    .footer-social-icons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .footer-social-item {
        flex: 1 1 calc(33.333% - 8px);
        min-width: 110px;
    }
    .footer-social-btn {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px 8px;
    }
}

.footer-contact-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.footer-contact-meta-item i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff1f2;
    color: #f22d33;
    flex: 0 0 auto;
}

.footer-contact-meta-item strong {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 2px;
}

.footer-contact-meta-item span,
.footer-contact-meta-item a {
    color: #111827;
    font-size: 13px;
    text-decoration: none;
    word-break: break-word;
}

body.dark-mode .header-cart {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.dark-mode .header-cart__icon {
    color: #eee;
}

body.dark-mode .footer-contact-card,
body.dark-mode .footer-contact-meta-item {
    background: #242424;
    border-color: #333;
}

body.dark-mode .footer-contact-card h4,
body.dark-mode .footer-contact-meta-item a,
body.dark-mode .footer-contact-meta-item span {
    color: #f3f3f3;
}

body.dark-mode .navbar-nav > .nav-item.dropdown > .dropdown-menu.mega-dropdown,
body.dark-mode .navbar-nav > .nav-item.dropdown > .dropdown-menu.minwidth400 {
    background: #242424 !important;
    border-color: #333 !important;
}

body.dark-mode .mega-dropdown .mega-cat-item:hover,
body.dark-mode .mega-dropdown .h120:hover {
    background: #2f2f2f;
}

.header-search-col .mgr10,
.header-search-col .search-input.mgr10 {
    margin: 0 !important;
}

/* فوتر: ردیف لوگوها 100% عرض؛ با زیاد شدن لوگوها سایز کوچک می‌شود */
@media (max-width: 767.98px) {
    .namad-footer {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0;
        padding-right: 0;
    }

    .namad-footer > .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        gap: 4px;
        overflow: hidden;
    }

    .namad-footer > .row > [class*="col"] {
        flex: 1 1 0 !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        text-align: center;
    }

    .namad-footer > .row > [class*="col"] > a {
        display: block;
        width: 100%;
    }

    .namad-footer .enamad,
    .namad-footer img.enamad,
    .namad-footer #enamad img,
    .namad-footer #enamad a img {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 56px;
        margin: 0 auto !important;
        padding: 4px !important;
        object-fit: contain;
        box-sizing: border-box;
    }

    .namad-footer #enamad {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .namad-footer #enamad a {
        display: block;
        width: 100%;
        min-width: 0;
    }
}
/* ===== فاصله کناری سایت در مانیتورهای عریض / رزولوشن پایین =====
   زیر 1600px قبلاً container تقریباً لب‌به‌لب می‌شد؛
   padding بیشتر از gutter ردیف Bootstrap می‌ماند تا بنرها نچسبند. */
.container-fluid {
    max-width: 1600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 576px) {
    .container-fluid {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

@media (min-width: 768px) {
    .container-fluid {
        padding-left: 28px !important;
        padding-right: 28px !important;
    }
}

@media (min-width: 992px) {
    .container-fluid {
        padding-left: 36px !important;
        padding-right: 36px !important;
    }
}

@media (min-width: 1200px) {
    .container-fluid {
        padding-left: 40px !important;
        padding-right: 40px !important;
    }
}

/* مانیتور عریض‌تر از 1600: محتوا وسط و با حاشیه واضح */
@media (min-width: 1600px) {
    .container-fluid {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

/* صفحه خانه: اسلایدر/بنر بالا هم از لبه‌ها فاصله بگیرند */
.home-order-slider,
.home-flex-root > .container-fluid {
    padding-left: inherit;
    padding-right: inherit;
}