/* public/css/header.css */
/* ===================================================== */
/* أنماط الهيدر والنافبار */
/* ===================================================== */

/* ===== الهيدر الرئيسي اللاصق ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-primary);
    height: var(--header-height);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
}

/* ===== اللوجو ===== */
.header-logo {
    flex-shrink: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
}
.header-logo:hover {
    border-color: #fff;
}

.logo-container {
    display: flex;
    align-items: baseline;
}

.logo-text {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-suffix {
    color: var(--color-accent);
    font-size: 16px;
    font-weight: 700;
    margin-right: 2px;
}

/* ===== موقع التوصيل ===== */
.header-delivery {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    color: #fff;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 3px;
    flex-shrink: 0;
}
.header-delivery:hover {
    border-color: #fff;
}

.header-delivery i {
    font-size: 18px;
    color: #fff;
}

.delivery-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.delivery-label {
    font-size: 11px;
    color: #ccc;
}

.delivery-city {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

/* ===== شريط البحث الكبير ===== */
.header-search {
    flex: 1;
    position: relative;
    margin: 0 5px;
}

.search-form {
    display: flex;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.search-form:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.3);
}

.search-category-dropdown {
    background: var(--bg-light);
    border-left: 1px solid var(--border-color);
    flex-shrink: 0;
}

.search-category-dropdown select {
    height: 100%;
    padding: 0 25px 0 10px;
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--color-text-secondary);
    cursor: pointer;
    min-width: 80px;
}

.search-input {
    flex: 1;
    padding: 0 15px;
    border: none;
    font-size: 15px;
    background: #fff;
}

.search-btn {
    width: 50px;
    background: var(--color-accent);
    color: var(--color-primary);
    font-size: 18px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--color-accent-hover);
}

/* اقتراحات البحث */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.search-suggestions .suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.15s;
}
.search-suggestions .suggestion-item:hover {
    background: #f0f0f0;
}

/* ===== حساب المستخدم ===== */
.header-account {
    position: relative;
    flex-shrink: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    color: #fff;
}
.header-account:hover {
    border-color: #fff;
}

.account-greeting {
    display: block;
    font-size: 11px;
    color: #ccc;
    line-height: 1.2;
}

.account-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.account-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: #fff;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    padding: 15px;
    z-index: 200;
    border: 1px solid var(--border-color);
}

.header-account:hover .account-dropdown-menu {
    display: block;
}

.account-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 5px;
    color: var(--color-text);
    font-size: 13px;
    border-radius: 4px;
}
.account-dropdown-menu a:hover {
    background: #f0f0f0;
}

.account-dropdown-menu .btn-signin {
    display: block;
    text-align: center;
    background: var(--color-accent);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 10px;
}
.account-dropdown-menu .btn-signin:hover {
    background: var(--color-accent-hover);
}

/* ===== اللغة ===== */
.header-lang {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    flex-shrink: 0;
    cursor: pointer;
    color: #fff;
}
.header-lang:hover { border-color: #fff; }

.lang-flag { width: 22px; height: 15px; }

.lang-select {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.lang-select option { color: #333; }

/* ===== الطلبات ===== */
.header-orders {
    flex-shrink: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #fff;
}
.header-orders:hover { border-color: #fff; }

.orders-label-top {
    display: block;
    font-size: 11px;
    color: #ccc;
    line-height: 1.2;
}
.orders-label-bottom {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

/* ===== سلة التسوق ===== */
.header-cart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}
.header-cart:hover { border-color: #fff; }

.cart-icon-wrapper {
    position: relative;
    font-size: 26px;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: 8px;
    background: var(--color-accent);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 800;
    padding: 0 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 18px;
}

.cart-label {
    font-size: 13px;
    font-weight: 700;
    align-self: flex-end;
    margin-bottom: 2px;
}

/* ===== النافبار الثانوي ===== */
.secondary-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--color-primary-light);
    height: var(--nav-height);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 10px;
    gap: 3px;
}

.nav-hamburger {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
}
.nav-hamburger:hover {
    border-color: #fff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-link {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    transition: border-color 0.15s;
}
.nav-link:hover { border-color: #fff; }

.nav-link-highlight {
    color: var(--color-accent);
    font-weight: 700;
}

.nav-promo {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    margin-right: auto;
    white-space: nowrap;
}

/* ===== القائمة الجانبية ===== */
.side-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}
.side-menu-overlay.active { display: block; }

.side-menu {
    position: fixed;
    top: 0;
    right: -380px;
    width: 365px;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    transition: right 0.3s ease;
    overflow-y: auto;
}
.side-menu.active { right: 0; }

.side-menu-header {
    background: var(--color-primary-light);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.side-menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
}
.side-menu-user i { font-size: 24px; }

.side-menu-close {
    color: #fff;
    font-size: 20px;
    padding: 5px;
}

.side-menu-body { padding: 10px 0; }

.side-menu-title {
    font-size: 16px;
    font-weight: 800;
    padding: 12px 20px 8px;
    color: var(--color-text);
}

.side-menu-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--color-text);
    transition: background 0.15s;
}
.side-menu-list li a:hover {
    background: #f0f0f0;
}

.side-menu-divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}

.side-submenu {
    display: none;
    padding-right: 20px;
    background: #fafafa;
}
.side-menu-item.has-children:hover .side-submenu {
    display: block;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .header-delivery,
    .header-lang,
    .header-orders {
        display: none;
    }

    .search-category-dropdown {
        display: none;
    }

    .account-greeting { display: none; }
    .account-label { font-size: 11px; }
    .cart-label { display: none; }

    .nav-links { gap: 0; }
    .nav-promo { display: none; }
}

@media (max-width: 600px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
        gap: 6px;
    }

    .header-search {
        order: 10;
        width: 100%;
        margin: 0;
    }

    :root {
        --header-height: 110px;
    }
}