/* ========================================================
   🎨 HEADER PRO — hpro-* Classes
   Professional E-commerce Header
   Supports: Desktop + Mobile (RTL)
   ======================================================== */

/* ── Reset & Base ── */
.site-header-pro {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    direction: rtl;
}

/* ══════════════════════════════
   TOP BAR
══════════════════════════════ */
.hpro-topbar {
    background: #1a1a2e;
    color: #fff;
    font-size: .82rem;
    padding: 6px 0;
}

.hpro-topbar .hpro-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hpro-topbar-start,
.hpro-topbar-end {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hpro-topbar-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    opacity: .85;
    transition: opacity .2s;
}
.hpro-topbar-link:hover { opacity: 1; }

.hpro-topbar-sep { opacity: .35; }

.hpro-switcher-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    opacity: .85;
    background: none;
    border: none;
    font-family: inherit;
    font-size: .82rem;
    cursor: pointer;
    transition: opacity .2s;
    padding: 0;
}
.hpro-switcher-btn:hover { opacity: 1; }

.hpro-chevron { transition: transform .2s; }

/* ── Topbar Dropdown ── */
.hpro-topbar-end .dropdown-menu {
    top: calc(100% + 6px);
    min-width: 140px;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* ══════════════════════════════
   CONTAINER
══════════════════════════════ */
.hpro-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ══════════════════════════════
   MAIN BAR
══════════════════════════════ */
.hpro-mainbar {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 0;
}

.hpro-mainbar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ── Logo ── */
.hpro-logo { flex-shrink: 0; }

.hpro-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hpro-logo-img {
    height: 52px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.hpro-logo-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary, #E8541A);
}

/* ── Search ── */
.hpro-search {
    flex: 1;
    max-width: 580px;
}

.hpro-search-form {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #f9fafb;
    transition: border-color .25s, box-shadow .25s;
}

.hpro-search-form:focus-within {
    border-color: var(--primary, #E8541A);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(232,84,26,.12);
}

.hpro-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 13px 18px;
    font-size: .97rem;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    color: #1a1a2e;
    outline: none;
}

.hpro-search-input::placeholder { color: #aaa; }

.hpro-search-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary, #E8541A);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.hpro-search-btn:hover { background: var(--primary-dark, #C94414); }

/* ── Actions ── */
.hpro-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hpro-icon-btn {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #f5f5f5;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    transition: all .2s;
}
.hpro-icon-btn:hover {
    background: var(--primary, #E8541A);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232,84,26,.25);
}

.hpro-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #ef4444;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.hpro-actions-sep {
    width: 1px;
    height: 32px;
    background: #e5e7eb;
    margin: 0 4px;
}

/* ── Auth Buttons ── */
.hpro-btn-login {
    padding: 9px 20px;
    border: 2px solid var(--primary, #E8541A);
    border-radius: 12px;
    color: var(--primary, #E8541A);
    font-weight: 700;
    font-size: .9rem;
    transition: all .2s;
    white-space: nowrap;
}
.hpro-btn-login:hover {
    background: var(--primary, #E8541A);
    color: #fff;
}

.hpro-btn-register {
    padding: 9px 20px;
    background: var(--primary, #E8541A);
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    transition: all .2s;
    white-space: nowrap;
    border: 2px solid transparent;
}
.hpro-btn-register:hover {
    background: var(--primary-dark, #C94414);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232,84,26,.35);
}

/* ── User Button ── */
.hpro-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all .2s;
}
.hpro-user-btn:hover {
    border-color: var(--primary, #E8541A);
    background: #fff9f7;
}

.hpro-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.hpro-user-name {
    font-size: .88rem;
    font-weight: 600;
    color: #374151;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── User Dropdown ── */
.hpro-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.14);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    z-index: 200;
}

.hpro-dropdown-header {
    padding: 14px 16px;
    background: #fdf4f0;
    border-bottom: 1px solid #f0f0f0;
}
.hpro-dropdown-name {
    display: block;
    font-weight: 700;
    color: #1a1a2e;
    font-size: .95rem;
}
.hpro-dropdown-email {
    display: block;
    font-size: .78rem;
    color: #9ca3af;
    margin-top: 2px;
}

.hpro-dropdown-body { padding: 6px; }

.hpro-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #374151;
    font-size: .9rem;
    transition: background .15s;
}
.hpro-dropdown-item:hover {
    background: #f9fafb;
    color: var(--primary, #E8541A);
}

.hpro-dropdown-footer {
    padding: 6px;
    border-top: 1px solid #f0f0f0;
}

.hpro-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: none;
    border: none;
    font-family: 'Cairo', sans-serif;
    font-size: .9rem;
    color: #ef4444;
    cursor: pointer;
    transition: background .15s;
    text-align: right;
}
.hpro-logout-btn:hover { background: #fff0f0; }

/* ══════════════════════════════
   NAV BAR
══════════════════════════════ */
.hpro-navbar {
    background: var(--primary, #E8541A);
}

.hpro-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.hpro-nav-list::-webkit-scrollbar { display: none; }

.hpro-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 13px 18px;
    color: rgba(255,255,255,.88);
    font-weight: 600;
    font-size: .92rem;
    white-space: nowrap;
    border-radius: 0;
    transition: background .2s, color .2s;
}
.hpro-nav-link:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.hpro-nav-active {
    background: rgba(255,255,255,.18);
    color: #fff;
    font-weight: 800;
}

/* ══════════════════════════════
   ICON SIZE GUARD
══════════════════════════════ */
.site-header-pro svg.icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}

/* ══════════════════════════════
   MOBILE — Search Bar Toggle
══════════════════════════════ */
.hpro-mobile-search-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #f5f5f5;
    border: 1px solid #eee;
    align-items: center;
    justify-content: center;
    color: #444;
    cursor: pointer;
    transition: all .2s;
}
.hpro-mobile-search-toggle:hover {
    background: var(--primary, #E8541A);
    color: #fff;
    border-color: transparent;
}

/* Mobile search overlay */
.hpro-search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #fff;
    z-index: 1100;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    align-items: center;
    gap: 10px;
}
.hpro-search-overlay.active {
    display: flex;
}
.hpro-search-overlay .hpro-search-form {
    flex: 1;
}
.hpro-search-overlay-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f5f5f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #555;
    flex-shrink: 0;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .hpro-search { max-width: 400px; }
    .hpro-user-name { display: none; }
}

/* Mobile */
@media (max-width: 768px) {
    /* Hide desktop search, show toggle icon */
    .hpro-search { display: none; }
    .hpro-mobile-search-toggle { display: flex; }

    .hpro-mainbar { padding: 8px 0; }

    .hpro-logo-img { height: 40px; }

    .hpro-icon-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .hpro-btn-login,
    .hpro-btn-register {
        padding: 7px 14px;
        font-size: .82rem;
    }

    .hpro-actions { gap: 6px; }

    .hpro-nav-link {
        padding: 11px 14px;
        font-size: .85rem;
    }

    /* Topbar: hide start on small screens */
    .hpro-topbar-start { display: none; }
}

@media (max-width: 480px) {
    .hpro-container { padding: 0 14px; }

    .hpro-btn-login { display: none; } /* save space, keep register only */

    .hpro-actions-sep { display: none; }
}
