/* =========================================================
   KhodroSUP Header
   ========================================================= */

.site-header {
    width: 100%;
    background: #ffffff;
    position: relative;
    z-index: 1000;
}


/* =========================================================
   HEADER MAIN
   ========================================================= */

.header-main {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
}

.header-row {
    min-height: 92px;

    display: flex;
    align-items: center;

    gap: 28px;
}


/* =========================================================
   LOGO
   ========================================================= */

.header-logo {
    flex: 0 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;

    text-decoration: none;
}

.header-logo img {
    display: block;

    max-width: 170px;
    max-height: 72px;

    width: auto;
    height: auto;

    object-fit: contain;
}


/* =========================================================
   SEARCH
   ========================================================= */

.header-search {
    flex: 1;
    min-width: 0;
}

.search-form {
    width: 100%;

    display: flex;
    align-items: center;

    background: #f7f7f7;

    border: 1px solid #e5e5e5;
    border-radius: 12px;

    overflow: hidden;

    transition: 0.2s ease;
}

.search-form:focus-within {
    border-color: #d71920;
    box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.08);
}

.search-form input {
    flex: 1;

    min-width: 0;

    height: 48px;

    padding: 0 18px;

    border: 0;
    outline: 0;

    background: transparent;

    font-family: inherit;
    font-size: 14px;

    color: #333333;
}

.search-form input::placeholder {
    color: #999999;
}

.search-form button {
    height: 48px;

    padding: 0 20px;

    border: 0;

    background: #d71920;
    color: #ffffff;

    font-family: inherit;
    font-size: 14px;

    cursor: pointer;

    transition: 0.2s ease;
}

.search-form button:hover {
    background: #b9141a;
}


/* =========================================================
   HEADER ACTIONS & BADGES (اعلان‌ها و سبد خرید)
   ========================================================= */

.header-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 8px;
}

.header-action {
    min-width: 64px;

    padding: 7px 9px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3px;

    border-radius: 10px;

    text-decoration: none;

    color: #333333;

    transition: 0.2s ease;
    position: relative;
}

.header-action:hover {
    color: #d71920;
    background: #fff3f3;
}

.action-icon {
    font-size: 21px;
    line-height: 1;
    position: relative;
    display: inline-block;
}

.action-text {
    font-size: 11px;
    white-space: nowrap;
}

/* استایل نشانگر عددی قرمز (بج) */
.badge-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #d71920;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    line-height: 1;
}


/* =========================================================
   USER DROPDOWN (منوی بازشونده نام کاربری)
   ========================================================= */

.header-user-dropdown {
    position: relative;
    display: inline-block;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 10px 14px;
    border-right: 1px solid #eeeeee;

    text-decoration: none;
    color: #333333;

    transition: 0.2s ease;
    cursor: pointer;
}

.header-user:hover {
    color: #d71920;
}

.user-name {
    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 8px;
    transition: transform 0.2s ease;
    color: #777777;
}

.header-user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: #d71920;
}

/* منوی بازشونده کشویی */
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 170px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #eeeeee;
    padding: 6px 0;
    z-index: 1050;
    margin-top: 4px;
}

/* نمایش منو هنگام هاور */
.header-user-dropdown:hover .user-dropdown-menu {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: #fff3f3;
    color: #d71920;
}

.user-dropdown-item.logout-btn:hover {
    background-color: #fff0f0;
    color: #dc3545;
}

.logout-form {
    margin: 0;
    padding: 0;
}


/* =========================================================
   LOGIN / REGISTER
   ========================================================= */

.header-login,
.header-register {
    padding: 10px 16px;

    border-radius: 9px;

    text-decoration: none;

    font-size: 13px;

    transition: 0.2s ease;
}

.header-login {
    color: #d71920;
    border: 1px solid #d71920;
}

.header-login:hover {
    background: #fff1f1;
}

.header-register {
    background: #d71920;
    color: #ffffff;
}

.header-register:hover {
    background: #b9141a;
}

/* =========================================================
   MAIN MENU WITH RED-GOLDEN CIRCLE HOVER EFFECT
   ========================================================= */

.main-menu {
    width: 100%;
    background: #d71920;
    position: relative;
    z-index: 100;
}

.main-menu-list {
    min-height: 58px;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.main-menu-list .menu-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-menu-list .menu-item a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 1;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* شکل دایره‌ای/کپسولی قرمز-طلایی دور نوشته هنگام هاور و اکتیو */
.main-menu-list .menu-item a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(0.82);
    border-radius: 50px; /* شکل دایره‌ای/بیضی نرم */
    border: 2px solid #ffd700; /* حاشیه طلایی درخشان */
    background: radial-gradient(circle, rgba(215, 25, 32, 0.95) 0%, rgba(150, 10, 15, 0.98) 100%); /* مرکز قرمز-طلایی */
    box-shadow: 
        0 0 12px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 0 10px rgba(255, 215, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    pointer-events: none;
}

/* حالت هاور در دسکتاپ و آیتم فعال */
.main-menu-list .menu-item a:hover::before,
.main-menu-list .menu-item.active a::before {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.main-menu-list .menu-item a:hover,
.main-menu-list .menu-item.active a {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 14px rgba(255, 215, 0, 0.9);
}


/* =========================================================
   MOBILE & RESPONSIVE STYLES
   ========================================================= */

@media (max-width: 991px) {

    .header-row {
        min-height: auto;
        padding: 15px 0;
        flex-wrap: wrap;
        gap: 14px;
    }

    .header-logo {
        width: auto;
    }

    .header-logo img {
        max-width: 135px;
        max-height: 58px;
    }

    .header-search {
        order: 3;
        flex-basis: 100%;
    }

    .header-actions {
        margin-right: auto;
    }

    .header-user-dropdown {
        display: none;
    }

    .main-menu-list {
        justify-content: center;
        overflow-x: auto;
        padding: 6px 10px;
        gap: 6px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .main-menu-list::-webkit-scrollbar {
        display: none;
    }

    .main-menu-list .menu-item a {
        padding: 8px 16px;
        font-size: 13px;
    }
}


@media (max-width: 576px) {

    .action-text {
        display: none;
    }

    .header-action {
        min-width: 42px;
        padding: 8px;
    }

    .action-icon {
        font-size: 20px;
    }

    .header-login,
    .header-register {
        padding: 8px 10px;
        font-size: 12px;
    }

    .search-form input {
        height: 44px;
    }

    .search-form button {
        height: 44px;
        padding: 0 14px;
    }

    .search-form button span {
        display: none;
    }

    .main-menu-list {
        justify-content: flex-start;
    }
}