/* ==============================================================
   نوار بالای موبایل (جایگزین هدر دسکتاپ) + منوی کشویی همبرگری
   بر اساس طرح مرجع اسکرین‌شات‌های موبایل (خانه + صفحه محصول)
   این فایل هم در home.php و هم در products/show.php (از طریق
   site-header.php) لود می‌شود تا ظاهر یکسان بماند.
   ============================================================== */

:root {
    --hk-mobile-bp: 860px; /* هم‌راستا با بریک‌پوینت hk-dock */
}

.hk-mtopbar { display: none; }

@media (max-width: 860px) {
    /* هدر و فوتر دسکتاپ در موبایل مخفی می‌شوند؛ نوار پایین (hk-dock) و
       نوار بالای فشرده (hk-mtopbar) جایگزین آن‌ها می‌شوند */
    .header,
    .footer,
    .hk-page-frame > .header,
    .hk-page-frame > .footer { display: none !important; }

    .hk-mtopbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 950;
        background: var(--surface, #fff);
        padding: 12px 14px;
        box-shadow: 0 2px 14px rgba(0,0,0,.05);
    }
}

.hk-mtopbar-icons { display: flex; align-items: center; gap: 8px; }

.hk-mtopbar-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg, #F3F1FB);
    color: var(--primary, #4C2FE4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition, all .3s);
}
.hk-mtopbar-icon:hover { background: var(--primary-light, #EDE9FE); }
.hk-mtopbar-icon.active i { color: var(--accent, #F41860); }

.hk-mtopbar-badge {
    position: absolute;
    top: -3px; left: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 3px;
    border-radius: 50%;
    background: var(--accent, #F41860);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.hk-mtopbar-badge:empty,
.hk-mtopbar-badge[data-count="0"] { display: none; }

.hk-mtopbar-logo {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 17px;
    font-weight: 900;
    color: var(--primary, #4C2FE4);
    white-space: nowrap;
}
.hk-mtopbar-logo img {
    height: 34px;
    width: auto;
    display: block;
}

/* ===== منوی کشویی همبرگری ===== */
.hk-mdrawer-overlay {
    position: fixed; inset: 0; z-index: 9600;
    background: rgba(17,17,34,.5);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
}
.hk-mdrawer-overlay.open {
    opacity: 1; visibility: visible;
    transition: opacity .25s ease, visibility 0s;
}
.hk-mdrawer {
    position: fixed; top: 0; bottom: 0; right: 0;
    width: 82%; max-width: 320px;
    background: var(--surface, #fff);
    z-index: 9601;
    box-shadow: -8px 0 30px rgba(0,0,0,.15);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    padding: 18px 18px 24px;
    overflow-y: auto;
}
.hk-mdrawer-overlay.open .hk-mdrawer { transform: translateX(0); }
.hk-mdrawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 14px; margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #EAE7F8);
}
.hk-mdrawer-head .hk-mtopbar-logo { font-size: 16px; }
.hk-mdrawer-close {
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: var(--bg, #F3F1FB); color: var(--text-secondary, #6B6785);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.hk-mdrawer-links { display: flex; flex-direction: column; margin-top: 8px; }
.hk-mdrawer-links a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 4px;
    font-size: 14.5px; font-weight: 700;
    color: var(--text-primary, #1A1A2E);
    border-bottom: 1px solid var(--border-color, #EAE7F8);
}
.hk-mdrawer-links a i { width: 20px; color: var(--primary, #4C2FE4); font-size: 15px; }
.hk-mdrawer-links a:last-child { border-bottom: none; }
.hk-mdrawer-account {
    margin-top: auto;
    padding-top: 16px;
}
.hk-mdrawer-account a {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent-gradient, linear-gradient(135deg,#6D3FE0,#F41860));
    color: #fff; font-weight: 800; font-size: 14px;
    padding: 13px; border-radius: 50px;
}

@media (min-width: 861px) {
    .hk-mdrawer-overlay { display: none !important; }
}
