.site-header {
    background-color: #f8f9fa;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    direction: rtl;
    transition: width 1s ease, top 1s ease, border-radius 1s ease, box-shadow 1s ease;
    box-shadow: 0px 2px 5px rgba(0, 0, 255, 0.2);
}

.site-header.scrolled {
    top: 10px;
    border-radius: 50px;
    box-shadow: 0px 4px 10px rgba(0, 0, 255, 0.5);
    width: 98%;
    max-width: 100rem;
    box-sizing: border-box;
    justify-content: center;
    left: 0;
    right: 0;
    margin: 0 auto;
    position: fixed;
    transition: width 1s ease, top 1s ease, border-radius 1s ease, box-shadow 1s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 100rem;
    box-sizing: border-box;
    justify-content: center;
}

.site-branding {
    display: flex;
    align-items: center;
    text-align: right;
    flex: 1;
}

.logo-container {
    height: 34px;
    width: 34px;
    background: rgb(7 125 234);
    background: linear-gradient(220deg, rgb(22 159 248) 0%, rgb(5 107 227) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container:hover {
    background: linear-gradient(-220deg, rgb(22 159 248) 0%, rgb(5 107 227) 100%);
}

.site-logo {
    height: 34px;
    width: 34px;
    display: block;
}

.chat-search-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 650px;
    height: 650px;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.5);
    border-radius: 25px;
    overflow: hidden;
    z-index: 2;
}

.quick-search-buttons {
    display: flex;
    justify-content: space-evenly;
    padding: 10px 0 10px 20px;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    white-space: nowrap;
    margin-right: 3em;
    height: 40px;
    flex-shrink: 0;
    background-color: #fff;
    z-index: 10;
    scrollbar-width: none;
    -ms-overflow-style: none; 
}

.quick-search-buttons::-webkit-scrollbar {
    display: none;
}

.quick-search-button {
    background-color: #ffffff;
    border: 1px solid #e6e8ee;
    color: #767676;
    padding: 7px 15px;
    margin: 0 3px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.quick-search-button:hover {
    border: 1px solid #b6bac5;
    color: #000;
}

@media (min-width: 1025px) {
    .page-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
        display: none;
        z-index: 2;
    }
}

.chat-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    direction: rtl;
    text-align: right;
}

.chat-messages {
    padding: 20px;
    flex-grow: 1;
    direction: rtl;
    text-align: right;
    overflow-y: auto;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCA4MDAgNDAwIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj4KICA8cGF0aCBkPSJNMCAxMDAgUTQwMCAyMDAgODAwIDEwMCBUMTYwMCAxMDAgVjQwMCBIMCBaIiBmaWxsPSIjY2NlN2ZmIi8+Cjwvc3ZnPg==');
    background-size: cover;
    background-color: #90caf9;
}

.bot-message {
    text-align: right;
}

.user-message {
    text-align: right;
    background: rgb(0,116,255);
    background: linear-gradient(0deg, rgba(0, 116, 255, 1) 0%, rgb(0 110 255) 100%);
    border-radius: 20px 20px 0px 20px;
    padding: 3px 20px;
    margin: 10px 0 10px 30px;
    color: #fff;
}

.chat-options {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 15px; 
    padding-top: 10px;
    direction: rtl;
    margin: 0 auto; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
}

.chat-options-title {
    font-size: 40px;
    margin: 0;
    font-weight: bold;
    color: #ffffffb3;
}

.chat-option-button {
    background: rgb(0 123 255 / 9%);
    border: 1px solid rgba(0, 123, 255, 0.5);
    color: rgb(0 53 182);
    padding: 15px;
    border-radius: 50px;
    cursor: pointer;
    text-align: center;
    width: 200px;
    font-size: 16px;
    font-weight: 500;
}

.chat-option-button.active {
    background: rgb(33,123,255);
    background: radial-gradient(circle, rgba(33,123,255,1) 0%, rgba(0,74,255,1) 100%);
    color: white;
}

.chat-option-button:hover {
    background: rgb(33,123,255);
    background: linear-gradient(30deg, rgba(33,123,255,0.5074623599439776) 0%, rgba(0,74,255,0.5354735644257703) 100%);
    color: white;
}

.chat-input {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    background-color: white;
    position: sticky;
    bottom: 0;
    z-index: 999;
}

.chat-input input {
    padding: 15px; 
    border: none;
    border-radius: 50px;
    box-sizing: border-box;
    background: #f2f3f6;
    color: #000;
    font-size: 16px;
    width: 100%; 
    max-width: 100%;
    min-width: 150px; 
}

.chat-input input:focus {
    outline: none;
    border: none;
}

.chat-input button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.close-chat-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    font-size: 20px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    color: #333;
    background: #fff;
    border-radius: 50px;
}
.close-chat-popup:hover {
    color: #000;
}
.search-close-icon {
    font-weight: 100;
    position: relative;
    top: 2px;
    left: 0;
}

.search-filter {
    padding: 10px 15px 10px 30px;
    margin: 0 3px;
    background: #f2f3f6;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    font-weight: 400;
    background-color: none;
    color: rgb(117 117 117);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>'); /* فلش SVG */
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 16px 16px;
}

.search-filter:focus {
    outline: none;
    border: 1px solid #007bff;
    border: none;
}

.search-filter::-ms-expand {
    display: none;
}

.search-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin: 5px 10px 0 0;
    float: left;
    border-radius: 10px;
}

.search-results {
background: rgb(243,254,255);
background: linear-gradient(0deg, rgba(243,254,255,1) 0%, rgba(230,244,255,1) 100%);
    border-radius: 20px 20px 20px 0px;
    padding: 3px 20px;
    margin: 10px 30px 0 0;
}

.search-results a {
    color: #002bff;
}

.search-result-type {
    font-size: 13px;
    color: #434d57;
    background-color: #e7f0f7;
    padding: 2px 6px;
    border-radius: 12px;
    display: table;
    margin: 5px 0 0 0;
}

#chat-send-search {
    background-color: transparent;
    border: none;
    padding: 0 3px;
    cursor: pointer;
}

#chat-send-search svg {
    width: 34px;
    height: 34px;
    fill: #fff; 
    transform: rotate(360deg);
    background: rgb(0,151,255);
    background: linear-gradient(30deg, rgba(0,151,255,0.871608018207283) 0%, rgba(59,116,255,0.8660057773109244) 100%);
    border-radius: 50px;
    padding: 5px;
    transition: all 0.3s ease;
}

#chat-send-search:hover svg {
    background: linear-gradient(-30deg, rgba(0,151,255,1) 0%, rgba(59,116,255,1) 100%);
}

#chat-send-search:focus {
    outline: none;
}

.search-icon {
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    transition: all 0.3s ease;
}

.search-icon:hover {
    background: rgb(231 234 241);
    border-radius: 50px;
}

.search-icon svg {
    width: 24px;
    height: 24px;
}


/* استایل های اصلی منو */
.main-navigation {
    position: relative;
    width: 100%;
    text-align: center;
}

.header-menu {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.header-menu > li > a.active {
    color: #0052ff;
}

.header-menu > li {
    position: relative;
}

.header-menu > li > a {
    color: #333;
    font-weight: 500;
    padding: 10px 20px;
    display: block;
    transition: color 0.3s ease;
}

.header-menu > li > .submenu-toggle::after {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    margin: 0px 5px -3px 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ccc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    transition: background-image 0.3s ease; 
}

.header-menu > li:hover > .submenu-toggle::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23007bff73" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>');
}

.header-menu > li:hover > a {
    color: #007bff;
}

.submenu-bg {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 30px;
    background-color: transparent;
}

.submenu-header {
    display: none;
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    right: 0;
    background-color: #f8f9fa;
    padding: 10px 0;
    list-style: none;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.header-menu > li:hover > .submenu-header,
.header-menu > li:hover > .submenu-bg {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.submenu-header li {
    padding: 5px 15px;
}

.submenu-header li a {
    color: #6f757b;
    display: block;
    border-radius: 4px;
    text-align: right;
    padding: 0 5px;
    transition: color 0.3s ease, background 0.3s ease;
}

.submenu-header li a:hover {
    background-color: #edf0f3;
    color: #000;
    border-radius: 4px;
}

.header-actions {
    text-align: left;
    display: flex;
    justify-content: flex-start;
    gap: 15px;
}

.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-count {
    position: absolute;
    top: 10px;
    right: -10px;
    background: rgb(2 123 255);
    box-shadow: 0 0 0 2px #fff;
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 5px;
    padding: 2px;
    line-height: 1;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-count .count-number {
    position: relative;
    top: 0;
}

.header-actions .account-link, .header-actions .cart-link {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    transition: all 0.3s ease;
}

.header-actions .account-link:hover, .header-actions .cart-link:hover {
    background: rgb(231 234 241);
    border-radius: 50px;
}

.header-actions svg {
    width: 24px;
    height: 24px;
}


.mobile-search-bar {
    display: none; 
    align-items: center;
    background-color: #f0f0f1;
    border-radius: 25px;
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.mobile-search-bar .search-text {
    color: #666;
    font-size: 14px;
    flex-grow: 1;
    font-weight: normal;
    display: flex;
    align-items: center;
    font-weight: bold;
}

.mobile-search-bar .search-brand {
    color: #005dff;
    font-weight: bold;
    padding-right: 5px;
    font-size: 18px;
}

.mobile-search-bar .search-icon-svg {
    width: 24px;
    height: 24px;
    margin-left: 5px;
}


@media (max-width: 1024px) {
    .site-header {
       padding: 10px;
    }    
    .site-logo, .logo-container {
       height: 40px !important;
       width: 40px !important;
       max-width: 40px !important;
    }    
    .site-header.scrolled {
        width: 95%;
    }
    
    .main-navigation, 
    .header-actions,
    .search-icon {
       display: none;
    }
    
   .chat-search-popup {
        width: 100%;
        max-width: 100%;
        height: 100%;
        box-shadow: none;
        border-radius: 0;
    }
    
    .mobile-search-bar {
        display: flex;
        margin-right: 10px;
    }
    
    .site-branding .search-icon {
        display: none;
    } 
}
