/* ============================================
   assets/css/header.css - استایل هدر فول ریسپانسیو
   ============================================ */

:root {
    --primary: #7c3aed;
    --header-bg: rgba(255,255,255,.97);
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --header-h: 60px;
}

/* Reset */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

/* ⭐⭐⭐ هدر اصلی ⭐⭐⭐ */
.lhp-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow .3s;
    height: var(--header-h);
}
.lhp-header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

/* ⭐⭐⭐ اینر هدر ⭐⭐⭐ */
.lhp-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(8px, 2vw, 24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: clamp(4px, 1.5vw, 16px);
}

/* ⭐⭐⭐ لوگو ⭐⭐⭐ */
.lhp-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 900;
    white-space: nowrap;
    flex-shrink: 0;
}
.lhp-logo .icon {
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1;
}
.lhp-logo .text {
    background: linear-gradient(135deg, var(--primary), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ⭐⭐⭐ ناوبری دسکتاپ ⭐⭐⭐ */
.lhp-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}
.lhp-nav a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px clamp(8px, 1.5vw, 14px);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: clamp(11px, 1.5vw, 14px);
    transition: all .2s;
    white-space: nowrap;
}
.lhp-nav a:hover {
    background: #f8fafc;
    color: var(--primary);
}
.lhp-nav a.active {
    background: #faf5ff;
    color: var(--primary);
    font-weight: 700;
}

/* ⭐⭐⭐ اکشن‌ها (جستجو، کاربر، سبد) ⭐⭐⭐ */
.lhp-actions {
    display: flex;
    align-items: center;
    gap: clamp(2px, 1vw, 6px);
    flex-shrink: 0;
}
.lhp-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 5vw, 40px);
    height: clamp(32px, 5vw, 40px);
    border-radius: 10px;
    background: #f8fafc;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all .2s;
    flex-shrink: 0;
}
.lhp-action-btn:hover {
    background: #faf5ff;
}
.lhp-action-btn svg {
    width: clamp(16px, 2.5vw, 20px);
    height: clamp(16px, 2.5vw, 20px);
    flex-shrink: 0;
}

/* ⭐⭐⭐ نشان تعداد سبد خرید ⭐⭐⭐ */
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ⭐⭐⭐ دکمه کاربر لاگین ⭐⭐⭐ */
.user-menu-btn {
    width: auto !important;
    padding: 0 clamp(4px, 1vw, 10px) !important;
    gap: 4px !important;
    font-weight: 700 !important;
    font-size: clamp(10px, 1.5vw, 13px) !important;
    color: var(--text-light) !important;
}
.user-menu-btn span {
    font-size: clamp(9px, 1.2vw, 12px);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ⭐⭐⭐ دراپ‌داون کاربر ⭐⭐⭐ */
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
    z-index: 1001;
    padding: 6px;
    margin-top: 6px;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 12px;
    border-radius: 8px;
    transition: background .15s;
}
.user-dropdown a:hover {
    background: #f8fafc;
}
.user-dropdown hr {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 4px 0;
}

/* ⭐⭐⭐ سبد خرید دراپ‌داون ⭐⭐⭐ */
.cart-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: clamp(280px, 50vw, 350px);
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
    z-index: 1001;
    padding: 10px;
    margin-top: 6px;
}
.cart-empty-toast {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
    z-index: 1001;
    padding: 14px;
    margin-top: 6px;
    text-align: center;
}

/* ⭐⭐⭐ جستجو ⭐⭐⭐ */
.search-bar-container {
    display: none;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
}
.search-bar-container.open {
    display: block;
}
.search-bar-inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 clamp(12px, 2vw, 24px);
    display: flex;
    gap: 8px;
    align-items: center;
}
.search-bar-inner input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-family: inherit;
    font-size: clamp(12px, 1.5vw, 14px);
    outline: none;
}
.search-bar-inner .btn-close-search {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* ⭐⭐⭐ منوی همبرگری ⭐⭐⭐ */
.lhp-hamburger {
    display: none;
    width: clamp(32px, 5vw, 40px);
    height: clamp(32px, 5vw, 40px);
    border: none;
    background: #f8fafc;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-light);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    order: -1;
}
.lhp-hamburger svg {
    width: clamp(18px, 2.5vw, 22px);
    height: clamp(18px, 2.5vw, 22px);
}

.lhp-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
}
.lhp-mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

.lhp-mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: min(280px, 85vw);
    height: 100vh;
    background: #fff;
    z-index: 1001;
    transition: right .3s ease;
    overflow-y: auto;
    padding: 16px;
    box-shadow: -10px 0 30px rgba(0,0,0,.1);
}
.lhp-mobile-menu.open {
    right: 0;
}
.lhp-mobile-menu .close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    float: left;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lhp-mobile-menu a {
    display: block;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.lhp-mobile-menu a:hover {
    color: var(--primary);
}

/* ⭐⭐⭐ استوری‌ها ⭐⭐⭐ */
.lhp-stories-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    overflow: hidden;
}
.stories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px clamp(8px, 2vw, 16px);
}
.stories-scroll::-webkit-scrollbar {
    display: none;
}
.story-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform .2s;
}
.story-circle:hover {
    transform: scale(1.05);
}
.story-circle span {
    font-size: 9px;
    color: var(--text-light);
    font-weight: 600;
    max-width: 56px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ⭐⭐⭐ Toast ⭐⭐⭐ */
#lhpToastContainer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

/* ⭐⭐⭐⭐⭐ ریسپانسیو ⭐⭐⭐⭐⭐ */
@media (max-width: 900px) {
    .lhp-nav {
        display: none;
    }
    .lhp-hamburger {
        display: flex;
    }
    .lhp-header-inner {
        padding: 0 clamp(4px, 2vw, 12px);
        gap: 4px;
    }
    .lhp-logo .text {
        font-size: clamp(13px, 2vw, 16px);
    }
    .lhp-logo .icon {
        font-size: clamp(16px, 2.5vw, 20px);
    }
    .user-menu-btn span {
        display: none;
    }
    .lhp-action-btn {
        width: clamp(28px, 6vw, 36px);
        height: clamp(28px, 6vw, 36px);
    }
}

@media (max-width: 480px) {
    .lhp-header {
        height: 50px;
    }
    .lhp-logo .text {
        font-size: 12px;
    }
    .lhp-logo .icon {
        font-size: 16px;
    }
    .lhp-action-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }
    .cart-badge {
        min-width: 14px;
        height: 14px;
        font-size: 8px;
        top: -3px;
        right: -3px;
    }
    .search-bar-inner input {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (min-width: 901px) {
    .lhp-mobile-menu,
    .lhp-mobile-overlay {
        display: none !important;
    }
    .lhp-hamburger {
        display: none;
    }
}