
/* ===== بنر بالا ===== */

.top-header-banner {
    background: #ef394e;
    color: #fff;
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.top-banner-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
/* ===== Header Base ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
}

.header-bg {
    background: #8b7355;
    border-bottom: 1px solid #e5e5e5;
    width: 100%;
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 90px 180px minmax(320px, 1fr) 180px;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
}

/* ===== Category Button ===== */
.header-categories {
    display: flex;
    align-items: center;
}

.category-btn {
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: IRANSans, sans-serif;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: #ef394e;
}

.category-icon {
    font-size: 18px;
    line-height: 1;
}

.category-label {
    font-size: 14px;
}

/* ===== Logo ===== */
.header-logo {
    display: flex;
    align-items: center;
    margin: 0 14px 0 0;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo img {
    max-height: 80px;
    width: auto;
    display: block;
}

.site-name {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* ===== Search ===== */
.header-search {
    width: 100%;
}

/* ===== Actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.header-cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
}

.cart-count {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 20px;
    background: #ef394e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-family: IRANSans, sans-serif;
}

.login-button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    background: #4a7c59;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    font-family: IRANSans, sans-serif;
}

.login-button:hover {
    color: #fff;
}

/* ===== اکشن‌ها ===== */

/* ===== جستجو ===== */

.adv-search-wrap {
    position: relative;
    width: 100%;
}

.adv-search-wrap input[type="text"] {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    height: 44px;
    background: #fff;
    font-family: IRANSans, sans-serif;
    box-sizing: border-box;
}

.adv-search-wrap input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.15);
}

#advanced-search-results,
#advanced-search-results-mobile {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 999;
    max-height: 360px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== جستجوی موبایل (پیش‌فرض مخفی) ===== */
.header-mobile-search { display: none; }

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

    .header-inner {
        grid-template-columns: 48px 1fr auto;
        gap: 10px;
        padding: 10px 12px;
    }

    /* Column Positions */
    .header-categories {
        grid-column: 1;
    }

    .header-logo {
        grid-column: 2;
        justify-content: center;
    }

    .header-actions {
        grid-column: 3;
        gap: 8px;
    }

    /* Hide Desktop Search */
    .desktop-search {
        display: none;
    }

    /* Show Mobile Search */
    .header-mobile-search {
        display: block;
        max-width: 1300px;
        margin: 0 auto;
        padding: 0 12px 12px;
    }

    /* Hide Text Labels */
    .category-label,
    .login-label {
        display: none;
    }

    /* Compact Buttons */
    .category-btn,
    .login-button {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
    }

    .header-logo img {
        max-height: 52px;
    }
}

/* =========================
   Desktop Mega Menu
========================= */

.mega-menu-shell {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 9999;
    display: none;
}

.mega-menu-panel {
    max-width: 1300px;
    margin: 10px auto 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.12);
    display: grid;
    grid-template-columns: 260px 1fr;
    overflow: hidden;
    min-height: 500px;
}

/* ستون راست */
.mega-menu-sidebar {
    background: #f8f8f8;
    border-left: 1px solid #eee;
    max-height: 500px;
    overflow-y: auto;
}

.mega-menu-category {
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    padding: 16px 20px;
    cursor: pointer;
    font-family: IRANSans, sans-serif;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.mega-menu-category:hover {
    background: #fff;
    color: #ef394e;
}

.mega-menu-category.is-active {
    background: #f3f4f6;
    font-weight: 700;
}

/* ستون چپ */
.mega-menu-content {
    padding: 30px;
    background: #fff;
}

.mega-menu-placeholder {
    color: #777;
    font-size: 14px;
}

/* =========================
   Mega Menu Submenu Content
========================= */

.mega-submenu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
}

.mega-submenu-column {
    min-width: 0;
}

.mega-level2-title {
    display: block;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    transition: color .2s ease;
}

.mega-level2-title:hover {
    color: #ef394e;
}

.mega-level3-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-level3-list li {
    margin-bottom: 10px;
}

.mega-level3-list a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.9;
    transition: color .2s ease;
}

.mega-level3-list a:hover {
    color: #ef394e;
}

.mega-menu-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #777;
    font-size: 14px;
}
/* =========================
   Mobile Drawer
========================= */

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    max-width: 90%;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    transition: right .25s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    font-weight: 700;
}

.mobile-menu-close {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
}

.mobile-menu-category {
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 1px solid #eee;
    background: #fff;
    text-align: right;
    font-family: IRANSans, sans-serif;
    cursor: pointer;
}

/* Active States */
.mega-menu-shell.active {
    display: block;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer.active {
    right: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .mega-menu-shell {
        display: none !important;
    }
}

.mobile-submenu {
    background: #fafafa;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.mobile-submenu .mega-submenu-grid {
    display: block;
}

.mobile-submenu .mega-submenu-column {
    margin-bottom: 20px;
}

.mobile-submenu .mega-level2-title {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}

.mobile-submenu .mega-level3-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-submenu .mega-level3-list li {
    margin-bottom: 8px;
}

.mobile-submenu .mega-level3-list a {
    text-decoration: none;
    color: #666;
    font-size: 14px;
}

.mega-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
}

.mega-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.mega-skeleton {
    padding: 20px;
}

.skeleton-title,
.skeleton-line {
    border-radius: 8px;
    animation: skeleton-loading 1.2s infinite ease-in-out;
}

.skeleton-title {
    width: 180px;
    height: 24px;
    margin-bottom: 20px;
}

.skeleton-line {
    width: 100%;
    height: 18px;
    margin-bottom: 12px;
}

.skeleton-line.short {
    width: 65%;
}

@keyframes skeleton-loading {
    0% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.55;
    }
}

.mobile-loading,
.mobile-error {
    padding: 14px 16px;
    font-size: 14px;
    color: #666;
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.28s ease,
        opacity 0.22s ease,
        padding 0.22s ease;
}

.mobile-submenu.is-open {
    max-height: 1200px;
    opacity: 1;
}

/* ===============================
   فوتر سایت
================================ */

.site-footer {
    font-size: 14px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* Top */

.footer-top {
    background: #999;
    color: #fff;
    border-bottom: 1px solid #ddd;
}

.footer-top .footer-container {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 30px;
}

.footer-col h4 {
    margin-bottom: 22px;
    font-size: 17px;
}

/* ===== Footer Top Menus ===== */

.site-footer .footer-top .footer-menu {
    list-style: none;      /* حذف بولت */
    padding: 0;
    margin: 0;
}

.site-footer .footer-top .footer-menu li {
    margin-bottom: 8px;
}

.site-footer .footer-top .footer-menu li a {
    color: #fff;           /* متن سفید */
    text-decoration: none; /* بدون underline */
    font-size: 14px;       /* سایز متناسب */
    transition: color 0.2s ease;
}

.site-footer .footer-top .footer-menu li a:hover {
    color: #0073aa;        /* هاور آبی */
}


/* Social */

.footer-social {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-social img {
    width: 28px;
}

/* Bottom */
.footer-bottom {
    background: #f8f8f8;
    color: #444;
}
.footer-bottom-inner {
    display: flex;
    gap: 30px;
    align-items: center;
}

.footer-about {
    flex: 3;
}

.footer-enamad {
    flex: 1;
    text-align: center;
}

.footer-copy {
    text-align: center;
    padding: 15px;
    background: #eee;
    font-size: 13px;
}

/* Footer Menus */

.site-footer .footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer .footer-menu li {
    margin-bottom: 8px;
}

.site-footer .footer-menu li a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.site-footer .footer-menu li a:hover {
    color: #ef394e; 
    padding-right: 5px;
}

/* ===== Footer Discount AJAX Form ===== */

.footer-discount-form {
    background: rgba(255,255,255,0.08);
    padding: 18px;
    border-radius: 14px;
}

.footer-discount-form .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-discount-form input {
    flex: 1;
    padding: 11px 14px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
}

.footer-discount-form input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.4);
}

.footer-discount-form button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg,#0073aa,#005177);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.footer-discount-form .success-msg {
    margin-top: 10px;
    background: #2ecc71;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
}

.footer-discount-form .error-msg {
    margin-top: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
}

/* فوتر */

@media (max-width: 992px) {

    .footer-top .footer-container {
        grid-template-columns: repeat(2,1fr);
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }

}

@media (max-width: 576px) {

    .footer-top .footer-container {
        grid-template-columns: 1fr;
    }

}
/* فرم فوتر */
@media (max-width: 768px) {
    .footer-discount-form .form-row {
        flex-direction: column;
    }
}

/* فاصله عرض بدنه */

.single-book { 
    padding: 0 1px; 
}

/* مخفی کردن شمارنده سبد خرید وقتی خالیه */
.cart-count.is-hidden{
    display:none;
}

