﻿/* ============================================================
   RAHPEYMAN HEADER
   مستقل از بخش‌های دیگر سایت
   ============================================================ */


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    position: sticky;

    top: 0;

    z-index: 1000;

    background: rgba(255, 255, 255, .97);

    border-bottom:
        1px solid rgba(231, 235, 240, .9);

    backdrop-filter: blur(15px);

    -webkit-backdrop-filter: blur(15px);
}


.site-header .header-inner {
    min-height: 88px;

    display: flex;

    align-items: center;

    gap: 25px;

    direction: rtl;
}


/* ============================================================
   BRAND
   ============================================================ */

.site-header .text-brand {
    flex-shrink: 0;

    display: inline-flex;

    align-items: center;

    gap: 7px;

    color: inherit;

    text-decoration: none;

    transform-origin: center center;
}


/* ============================================================
   BRAND LOGO
   ============================================================ */

.site-header .brand-logo-wrapper {
    width: 68px;

    height: 68px;

    flex: 0 0 68px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    border-radius: 16px;

    background: #FFFFFF;

    transform-origin: center center;

    animation:
        header-logo-enter .7s cubic-bezier(.22, .61, .36, 1) both,
        header-logo-breathe 6s ease-in-out 2s infinite;
}


.site-header .brand-logo {
    width: 100%;

    height: 100%;

    display: block;

    object-fit: contain;

    transition:
        transform .35s ease,
        filter .35s ease;
}


.site-header .text-brand:hover .brand-logo {
    transform:
        scale(1.08)
        rotate(-2deg);

    filter:
        drop-shadow(
            0 8px 14px rgba(13, 71, 161, .17)
        );
}


@keyframes header-logo-enter {

    0% {
        opacity: 0;

        transform:
            translateY(-10px)
            scale(.82)
            rotate(-5deg);
    }

    55% {
        opacity: 1;

        transform:
            translateY(2px)
            scale(1.05)
            rotate(1.5deg);
    }

    100% {
        opacity: 1;

        transform:
            translateY(0)
            scale(1)
            rotate(0);
    }
}


@keyframes header-logo-breathe {

    0%,
    72%,
    100% {
        transform:
            scale(1)
            rotate(0deg);
    }

    76% {
        transform:
            scale(1.04)
            rotate(-1.5deg);
    }

    80% {
        transform:
            scale(1.01)
            rotate(1deg);
    }

    84% {
        transform:
            scale(1.03)
            rotate(-.6deg);
    }

    88% {
        transform:
            scale(1)
            rotate(0deg);
    }
}


/* ============================================================
   BRAND TEXT
   ============================================================ */

.site-header .brand-text {
    display: flex;

    flex-direction: column;

    align-items: flex-start;

    justify-content: center;

    line-height: 1;

    transform-origin: right center;
}


.site-header .brand-persian {
    display: block;

    font-family:
        "RahpeymanDima",
        sans-serif !important;

    font-size: 37px;

    font-weight: normal !important;

    line-height: 1.02;

    color: #0D47A1;

    white-space: nowrap;

    letter-spacing: 0;

    text-shadow:
        0 2px 8px rgba(13, 71, 161, .10);

    transform-origin: right center;

    animation:
        header-brand-text-motion 6s ease-in-out 2s infinite;
}


@keyframes header-brand-text-motion {

    0%,
    72%,
    100% {
        transform:
            translateX(0)
            scale(1);
    }

    76% {
        transform:
            translateX(-1px)
            scale(1.015);
    }

    80% {
        transform:
            translateX(0)
            scale(1);
    }

    84% {
        transform:
            translateX(1px)
            scale(1.01);
    }

    88% {
        transform:
            translateX(0)
            scale(1);
    }
}


.site-header .brand-english {
    display: block;

    margin-top: 6px;

    font-family:
        "RahpeymanEthnocen",
        sans-serif !important;

    font-size: 16px;

    font-weight: normal !important;

    letter-spacing: 2px;

    line-height: 1;

    direction: ltr;

    color: #00A896;

    white-space: nowrap;

    text-align: left;
}


/* ============================================================
   MAIN NAVIGATION
   ============================================================ */

.site-header .main-nav { 
    flex: 1; 
 
    display: flex; 
 
    align-items: center; 
 
    justify-content: center; 
 
    gap: 22px; 
 
    direction: rtl;

    transform: translateX(-24px);
}


.site-header .main-nav > a,
.site-header .nav-dropdown-toggle {
    color: #3F4757;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 15px;

    font-weight: 400;

    line-height: 1.6;

    text-decoration: none;

    transition:
        color .2s ease,
        transform .2s ease;
}


.site-header .main-nav > a:hover,
.site-header .nav-dropdown-toggle:hover {
    color: #0D47A1;
}


/* ============================================================
   DROPDOWN
   ============================================================ */

.site-header .nav-dropdown {
    position: relative;
}


/*
|-------------------------------------------------------------------------- 
| پل نامرئی بین عنوان و Dropdown
|-------------------------------------------------------------------------- 
*/

.site-header .nav-dropdown::after {
    content: "";

    position: absolute;

    top: 100%;

    right: 50%;

    width: 290px;

    height: 18px;

    transform:
        translateX(50%);

    background: transparent;
}


.site-header .nav-dropdown-toggle {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 0;

    border: 0;

    background: transparent;

    cursor: pointer;
}


.site-header .nav-chevron {
    width: 15px;

    height: 15px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    font-size: 15px;

    line-height: 1;

    transition:
        transform .2s ease;

    flex: 0 0 15px;
}


.site-header .nav-dropdown:hover .nav-chevron,
.site-header .nav-dropdown.is-open .nav-chevron {
    transform: rotate(180deg);
}


.site-header .nav-dropdown-menu {
    width: 290px;

    position: absolute;

    top: calc(100% + 18px);

    right: 50%;

    padding: 10px;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translate(50%, -8px);

    border:
        1px solid #E7EBF0;

    border-radius: 18px;

    background: rgba(255, 255, 255, .99);

    box-shadow:
        0 25px 60px rgba(18, 35, 60, .14);

    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease;
}


.site-header .nav-dropdown-menu::before {
    content: "";

    position: absolute;

    top: -7px;

    right: 50%;

    width: 13px;

    height: 13px;

    transform:
        translateX(50%)
        rotate(45deg);

    border-left:
        1px solid #E7EBF0;

    border-top:
        1px solid #E7EBF0;

    background: #FFFFFF;
}


.site-header .nav-dropdown:hover .nav-dropdown-menu,
.site-header .nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translate(50%, 0);
}


/* ============================================================
   DROPDOWN ITEMS
   ============================================================ */

.site-header .nav-dropdown-menu a {
    display: flex;

    align-items: center;

    gap: 11px;

    padding: 11px;

    border-radius: 12px;

    text-decoration: none;

    transition:
        background .2s ease,
        transform .2s ease;
}


.site-header .nav-dropdown-menu a:hover {
    background: #F5F8FC;

    transform: translateY(-1px);
}


.site-header .nav-dropdown-menu a > span:last-child {
    min-width: 0;

    display: flex;

    flex-direction: column;
}


.site-header .nav-dropdown-menu strong {
    color: #172033;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 13px;

    font-weight: 700;

    line-height: 1.6;
}


.site-header .nav-dropdown-menu small {
    margin-top: 2px;

    color: #6B7280;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 10px;

    font-weight: 400;

    line-height: 1.5;
}


.site-header .dropdown-icon {
    width: 41px;

    height: 41px;

    flex: 0 0 41px;

    display: grid;

    place-items: center;

    border-radius: 12px;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 17px;

    font-weight: 700;

    line-height: 1;
}


.site-header .dropdown-icon.blue {
    color: #0D47A1;

    background: #EAF1FB;
}


.site-header .dropdown-icon.teal {
    color: #008C79;

    background: #E6F8F4;
}


.site-header .dropdown-icon.orange {
    color: #D97706;

    background: #FFF2DF;
}


.site-header .dropdown-icon.purple {
    color: #7C3AED;

    background: #F1EAFE;
}


/* ============================================================
   HEADER ACTIONS
   ============================================================ */

.site-header .header-actions {
    display: flex;

    align-items: center;

    gap: 9px;

    flex-shrink: 0;
}


/* ============================================================
   CART
   ============================================================ */

.site-header .cart-button {
    width: 44px;

    height: 44px;

    position: relative;

    display: grid;

    place-items: center;

    border:
        1px solid #DDE5EF;

    border-radius: 13px;

    background: #FFFFFF;

    color: #38516B;

    text-decoration: none;

    transition:
        border-color .2s ease,
        background .2s ease,
        color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}


.site-header .cart-button:hover {
    border-color: #BCD0E8;

    background: #F7FAFD;

    color: #0D47A1;

    transform: translateY(-1px);

    box-shadow:
        0 8px 22px rgba(20, 35, 60, .07);
}


.site-header .cart-icon {
    width: 21px;

    height: 21px;

    display: block;
}


.site-header .cart-count {
    min-width: 17px;

    height: 17px;

    position: absolute;

    top: -5px;

    left: -4px;

    display: grid;

    place-items: center;

    padding: 0 4px;

    border:
        2px solid #FFFFFF;

    border-radius: 50px;

    background: #0D47A1;

    color: #FFFFFF;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 8px;

    font-weight: 700;

    line-height: 1;
}


/* ============================================================
   LOGIN
   ============================================================ */

.site-header .login-link {
    min-height: 42px;

    padding:
        0 10px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    border-radius: 11px;

    color: #394150;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 13px;

    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;

    transition:
        background .2s ease,
        color .2s ease;
}


.site-header .login-link:hover {
    color: #0D47A1;

    background: #F5F8FC;
}


.site-header .login-icon {
    width: 19px;

    height: 19px;

    display: grid;

    place-items: center;
}


.site-header .login-icon svg {
    width: 19px;

    height: 19px;

    display: block;
}


/* ============================================================
   REGISTER
   ============================================================ */

.site-header .register-button {
    min-height: 42px;

    padding:
        0 15px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    border:
        1px solid #0D47A1;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #0D47A1,
            #1976D2
        );

    color: #FFFFFF;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 13px;

    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;

    box-shadow:
        0 7px 19px rgba(13, 71, 161, .18);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease;
}


.site-header .register-button:hover {
    transform: translateY(-1px);

    filter: brightness(1.03);

    box-shadow:
        0 10px 24px rgba(13, 71, 161, .24);
}


.site-header .register-icon {
    width: 19px;

    height: 19px;

    display: grid;

    place-items: center;
}


/* ============================================================
   AUTHENTICATED USER
   ============================================================ */

.site-header .header-user {
    position: relative;
}


.site-header .header-user::after {
    content: "";

    position: absolute;

    top: 100%;

    left: -25px;

    right: auto;

    width: 245px;

    height: 16px;

    background: transparent;
}


/* ============================================================
   USER BUTTON
   ============================================================ */

.site-header .header-user-button {
    width: 44px;

    height: 44px;

    padding: 0;

    display: grid;

    place-items: center;

    border:
        1px solid #DDE5EF;

    border-radius: 13px;

    background: #FFFFFF;

    color: #38516B;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}


.site-header .header-user-button:hover {
    border-color: #BCD0E8;

    background: #F7FAFD;

    color: #0D47A1;

    transform: translateY(-1px);
}


.site-header .header-user-icon {
    width: 22px;

    height: 22px;

    display: block;
}


/* ============================================================
   USER MENU
   ============================================================ */

.site-header .header-user-menu {
    width: 245px;

    position: absolute;

    top: calc(100% + 12px);

    left: -165px;

    right: auto;

    z-index: 1100;

    padding: 9px;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(-7px);

    border:
        1px solid #E0E6ED;

    border-radius: 17px;

    background: #FFFFFF;

    box-shadow:
        0 24px 55px rgba(20, 35, 60, .14);

    transition:
        opacity .18s ease,
        visibility .18s ease,
        transform .18s ease;
}


.site-header .header-user:hover .header-user-menu,
.site-header .header-user:focus-within .header-user-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0);
}


/* ============================================================
   USER INFO
   ============================================================ */

.site-header .header-user-info {
    padding:
        12px 11px;

    margin-bottom: 5px;

    display: flex;

    align-items: center;

    gap: 10px;

    border-bottom:
        1px solid #EDF0F4;
}


.site-header .header-user-info-avatar {
    width: 39px;

    height: 39px;

    flex: 0 0 39px;

    display: grid;

    place-items: center;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #0D47A1,
            #00A896
        );

    color: #FFFFFF;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 15px;

    font-weight: 700;
}


.site-header .header-user-info-text {
    min-width: 0;

    display: flex;

    flex-direction: column;

    align-items: flex-start;

    gap: 0;
}


.site-header .header-user-name {
    max-width: 190px;

    overflow: hidden;

    color: #172033;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 14px;

    font-weight: 700;

    line-height: 1.7;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ============================================================
   USER LINKS
   ============================================================ */

.site-header .header-user-link {
    width: 100%;

    min-height: 43px;

    padding:
        0 9px;

    display: flex;

    align-items: center;

    gap: 10px;

    border: 0;

    border-radius: 10px;

    background: transparent;

    color: #596474;

    font-family:
        "IRANSansWeb",
        sans-serif !important;

    font-size: 13px;

    font-weight: 400;

    line-height: 1.7;

    text-align: right;

    text-decoration: none;

    cursor: pointer;

    transition:
        background .18s ease,
        color .18s ease;
}


.site-header .header-user-link:hover {
    background: #F4F7FB;

    color: #0D47A1;
}


.site-header .header-user-link-icon {
    width: 31px;

    height: 31px;

    flex: 0 0 31px;

    display: grid;

    place-items: center;

    border-radius: 9px;

    background: #F1F4F8;

    color: #607086;

    transition:
        background .18s ease,
        color .18s ease;
}


.site-header .header-user-link-icon svg {
    width: 17px;

    height: 17px;

    display: block;
}


.site-header .header-user-link:hover
.header-user-link-icon {
    background: #EAF1FB;

    color: #0D47A1;
}


.site-header .header-user-divider {
    height: 1px;

    margin:
        7px 3px;

    background: #EDF0F4;
}


.site-header .header-user-logout {
    color: #C62828;
}


.site-header .header-user-logout:hover {
    background: #FFF5F5;

    color: #B71C1C;
}


.site-header .header-user-logout
.header-user-link-icon {
    background: #FFF0F0;

    color: #C62828;
}


/* ============================================================
   MOBILE MENU
   ============================================================ */

.site-header .mobile-menu-button {
    display: none;

    width: 42px;

    height: 42px;

    padding: 9px;

    border:
        1px solid #E7EBF0;

    background: #FFFFFF;

    border-radius: 12px;

    cursor: pointer;
}


.site-header .mobile-menu-button span {
    height: 2px;

    margin: 4px 0;

    display: block;

    background: #263243;

    border-radius: 5px;

    transition:
        transform .2s ease,
        opacity .2s ease;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1050px) {

    .site-header .main-nav {
        gap: 13px;
    }


    .site-header .main-nav > a,
    .site-header .nav-dropdown-toggle {
        font-size: 12px;
    }


    .site-header .header-inner {
        gap: 15px;
    }


    .site-header .brand-logo-wrapper {
        width: 59px;

        height: 59px;

        flex-basis: 59px;

        border-radius: 14px;
    }


    .site-header .brand-persian {
        font-size: 32px;
    }


    .site-header .brand-english {
        font-size: 14px;
    }


    .site-header .header-actions {
        gap: 6px;
    }


    .site-header .login-link {
        padding:
            0 8px;

        font-size: 12px;
    }


    .site-header .register-button {
        padding:
            0 12px;

        font-size: 12px;
    }

}


@media (max-width: 820px) {

    .site-header .header-inner {
        min-height: 78px;

        gap: 8px;
    }


    /* منوی اصلی فقط با همبرگر باز می‌شود،
       اما سبد خرید و احراز هویت همیشه دیده می‌شوند. */

    .site-header .main-nav {
        display: none;
    }


    .site-header .header-actions {
        display: flex;

        align-items: center;

        gap: 5px;

        flex-shrink: 1;

        min-width: 0;
    }


    .site-header .brand-logo-wrapper {
        width: 54px;

        height: 54px;

        flex-basis: 54px;

        border-radius: 12px;
    }


    .site-header .brand-persian {
        font-size: 30px;
    }


    .site-header .brand-english {
        font-size: 13px;

        letter-spacing: 1.5px;
    }


    .site-header .cart-button {
        width: 40px;

        height: 40px;

        flex: 0 0 40px;

        border-radius: 11px;
    }


    .site-header .cart-icon {
        width: 19px;

        height: 19px;
    }


    .site-header .cart-count {
        min-width: 16px;

        height: 16px;

        top: -4px;

        left: -3px;

        font-size: 8px;
    }


    .site-header .register-button {
        min-height: 40px;

        padding:
            0 8px;

        border-radius: 10px;

        font-size: 11px;

        gap: 4px;
    }


    .site-header .register-icon,
    .site-header .login-icon {
        width: 16px;

        height: 16px;
    }


    .site-header .mobile-menu-button {
        display: block;

        margin-right: auto;

        flex: 0 0 42px;
    }


    .site-header .header-inner.mobile-open {
        position: relative;
    }


    .site-header .header-inner.mobile-open .main-nav {
        position: absolute;

        top: 78px;

        right: 0;

        left: 0;

        transform: none;

        padding: 17px;

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 0;

        border:
            1px solid #E7EBF0;

        border-radius: 17px;

        background: #FFFFFF;

        box-shadow:
            0 20px 50px rgba(20, 35, 60, .12);
    }


    .site-header .header-inner.mobile-open .main-nav > a {
        padding:
            12px 10px;

        border-bottom:
            1px solid #F0F2F5;

        font-size: 14px;
    }


    .site-header .nav-dropdown {
        width: 100%;
    }


    .site-header .nav-dropdown::after {
        display: none;
    }


    .site-header .nav-dropdown-toggle {
        width: 100%;

        padding:
            12px 10px;

        justify-content: space-between;

        font-size: 14px;
    }


    .site-header .nav-dropdown-menu {
        position: static;

        width: 100%;

        padding: 5px;

        opacity: 1;

        visibility: visible;

        pointer-events: auto;

        display: none;

        transform: none;

        border: 0;

        border-radius: 14px;

        box-shadow: none;

        background: #F7F9FC;
    }


    .site-header .nav-dropdown-menu::before {
        display: none;
    }


    .site-header .nav-dropdown.is-open .nav-dropdown-menu {
        display: block;

        transform: none;
    }


    /* جلوگیری از مخفی‌شدن اکشن‌ها هنگام باز بودن منوی موبایل */

    .site-header .header-inner.mobile-open
    .header-actions {
        display: flex;

        align-items: center;
    }


    .site-header .header-user-menu {
        display: none;
    }


    .site-header .header-user:focus-within .header-user-menu {
        display: block;

        opacity: 1;

        visibility: visible;

        pointer-events: auto;

        transform:
            translateY(0);
    }


    .site-header .header-user::after {
        display: none;
    }

}


@media (max-width: 540px) {

    .site-header .header-inner {
        gap: 6px;
    }


    .site-header .text-brand {
        gap: 4px;

        min-width: 0;
    }


    .site-header .brand-logo-wrapper {
        width: 44px;

        height: 44px;

        flex-basis: 44px;

        border-radius: 10px;
    }


    .site-header .brand-persian {
        font-size: 24px;
    }


    .site-header .brand-english {
        margin-top: 4px;

        font-size: 10px;

        letter-spacing: 1px;
    }


    .site-header .header-actions {
        gap: 3px;

        min-width: 0;
    }


    .site-header .cart-button {
        width: 38px;

        height: 38px;

        flex-basis: 38px;

        border-radius: 10px;
    }


    .site-header .cart-icon {
        width: 18px;

        height: 18px;
    }


    .site-header .register-button {
        min-height: 38px;

        padding:
            0 6px;

        border-radius: 9px;

        font-size: 10px;

        gap: 3px;
    }


    .site-header .register-icon,
    .site-header .login-icon {
        display: none;
    }


    .site-header .mobile-menu-button {
        width: 39px;

        height: 39px;

        flex-basis: 39px;

        padding: 8px;

        border-radius: 10px;
    }

}


@media (max-width: 380px) {

    .site-header .header-inner {
        gap: 4px;
    }


    .site-header .brand-logo-wrapper {
        width: 40px;

        height: 40px;

        flex-basis: 40px;

        border-radius: 9px;
    }


    .site-header .brand-persian {
        font-size: 22px;
    }


    .site-header .brand-english {
        display: none;
    }


    .site-header .header-actions {
        gap: 2px;
    }


    .site-header .cart-button {
        width: 36px;

        height: 36px;

        flex-basis: 36px;
    }


    .site-header .register-button {
        min-height: 36px;

        padding:
            0 5px;

        font-size: 9px;
    }


    .site-header .mobile-menu-button {
        width: 37px;

        height: 37px;

        flex-basis: 37px;

        padding: 7px;
    }

}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .site-header .brand-logo-wrapper,
    .site-header .brand-persian {
        animation: none;
    }

    .site-header .brand-logo,
    .site-header .text-brand {
        transition: none;
    }
}