/* ===========================
   RTL Styles
=========================== */

[dir="rtl"] .sh-cart-count {
    right: auto;
    left: -10px;
}

[dir="rtl"] .sh-account-menu .user-logged-menu {
    right: auto;
    left: 0;
    text-align: right;
}

[dir="rtl"] .sh-account-menu .login-register {
    padding-left: 0;
    padding-right: 10px;
}

[dir="rtl"] .icon_subheading {
    direction: ltr;
}

[dir="rtl"] .sh-cart-wrapper:hover .widget_shopping_cart_content {
    left: 0 !important;
    right: auto !important;
}

[dir="rtl"] .user-logged-menu {
    left: 0 !important;
    right: auto !important;
}

/* ===========================
   Header Wrapper & Logo
=========================== */

.sh-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-height: 68px;
    flex-wrap: wrap; /* برای موبایل و ریسپانسیو */
    margin-top: 0;
}

.sh-header-image {
    display: block;
    width: 240px;
    height: 45px;
    max-width: 100%;
    height: auto;
}

/* ===========================
   Header Icons & Boxes
=========================== */

.sh-header-icon-box {
    display: flex;
    align-items: center;
    gap: 10px;
    color: black;
}

.sh-header-icon-box img,
.sh-header-icon-box i {
    display: inline-block;
    width: 33px;
    height: 33px;
}

.icon-telephone {
    color: black;
}

/* ===========================
   Cart Styles
=========================== */

.sh-cart-wrapper {
    position: relative;
    display: inline-block;
}

.sh-cart-icon {
    position: relative;
    display: inline-block;
    width: auto;
    cursor: pointer;
}

.sh-cart-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.sh-cart-count {
    position: absolute;
    bottom: 0px;
    right: -17px;
    background: black;
    color: #fff;
    border-radius: 100%;
    font-size: 12px;
    padding: 0px 9px;
    font-weight: bold;
}

/* ===========================
   Account Menu
=========================== */

.sh-account-menu {
    position: relative;
    cursor: pointer;
}

.sh-account-menu .account-icon {
    position: relative;
    display: inline-block;
}

.sh-account-menu .account-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.sh-account-menu:hover .account-icon img {
    transform: scale(1.05);
}

.sh-account-menu .login-register {
    flex-direction: column;
    padding-left: 10px;
    justify-content: center;
}

.sh-account-menu .login-register span {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

.sh-account-menu .user-logged-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 999;
    min-width: 200px;
    display: none;
}

.sh-account-menu:hover .user-logged-menu {
    display: block;
}

.sh-account-menu .user-logged-menu a {
    display: block;
    padding: 7px 20px;
    font-size: 14px;
    color: #222;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.3s ease;
}

.sh-account-menu .user-logged-menu a:hover {
    background: #f9f9f9;
    color: #0073e6;
}

/* ===========================
   WooCommerce Mini Cart
=========================== */

.woocommerce-mini-cart__empty-message {
    text-align: center;
    padding-top: 20px;
}

.widget_shopping_cart_content {
    display: none !important;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 380px;
    z-index: 999;
    border-radius: 12px;
    padding: 15px;
}

.widget_shopping_cart_content .woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget_shopping_cart_content .woocommerce-mini-cart li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.widget_shopping_cart_content .woocommerce-mini-cart li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.widget_shopping_cart_content .woocommerce-mini-cart img {
    width: 100px;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.widget_shopping_cart_content .woocommerce-mini-cart__total {
    padding-top: 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    color: #333;
    font-size: 15px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a {
    background: #fcb800;
    color: black;
    padding: 10px 16px;
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: background 0.3s ease;
    flex: 1;
    text-align: center;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a:hover {
    background: #444;
}

.widget_shopping_cart_content .woocommerce-mini-cart.cart_list.product_list_widget {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons .button {
    height: 0 !important;
    line-height: 0 !important;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Scrollbar Styling */
.widget_shopping_cart_content .woocommerce-mini-cart.cart_list.product_list_widget::-webkit-scrollbar {
    width: 6px;
}

.widget_shopping_cart_content .woocommerce-mini-cart.cart_list.product_list_widget::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.widget_shopping_cart_content .woocommerce-mini-cart.cart_list.product_list_widget::-webkit-scrollbar-track {
    background: #f5f5f5;
}

/* ===========================
   Responsive Behavior
=========================== */

/* Hover فقط برای دسکتاپ */
@media (min-width: 768px) {
    .sh-cart-wrapper:hover .widget_shopping_cart_content {
        display: block !important;
    }
}

/* روی موبایل hover غیرفعال شود */
@media (max-width: 767px) {
    .sh-cart-wrapper:hover .widget_shopping_cart_content {
        display: none !important;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .sh-header-icon-box {
        display: none !important;
        flex: 0;
    }

    .sh-header-image {
        max-width: 186px !important;
    }

    .sh-cart-account-wrapper {
        flex: unset !important;
        padding: 0 !important;
    }

    .login-register {
        display: none !important;
    }

    .sh-header-wrapper {
        margin-top: 0px;
        margin-bottom: 5px;
        margin-right: -10px !important;
        margin-left: -10px !important;
    }

    .user-logged-menu,
    .sh-cart-scroll-wrapper,
    .widget_shopping_cart_content {
        display: none !important;
        pointer-events: none;
        visibility: hidden;
    }

    .sh-header-second-column {
        display: flex !important;
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }

    .sh-search-box {
        flex: 1;
    }
}

/* ===========================
   Header Second Column & Search
=========================== */

.sh-header-second-column {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sh-search-box {
    flex: 1;
}

/* ===========================
   More Responsive Tweaks
=========================== */

@media (max-width: 767px) {
    .sh-header-wrapper {
        flex-wrap: wrap;
    }

    .sh-header-icons {
        order: 1;
        justify-content: flex-end;
        gap: 15px;
    }

    .sh-header-second-column {
        order: 2;
        flex: 1 1 100% !important;
        max-width: 100% !important;
        display: flex !important;
        align-items: center;
        gap: 10px;
        margin-top: 5px;
    }

    .sh-search-box {
        flex: 1;
    }
}

/* ===========================
   Header Layout
=========================== */

.sh-header-logo {
    flex: 0 0 20%;
    padding-bottom: 5px;
}

.sh-header-second-column {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 55%;
}

.sh-icon-img {
    width: 33px;
    height: 33px;
}

.sh-search-box {
    flex: 1;
}

.sh-header-icons {
    display: flex;
    align-items: center;
    gap: 30px;
}

.sh-icon-text {
    display: flex;
    flex-direction: column;
}

.sh-icon-heading {
    font-size: 14px;
}

.sh-icon-subheading {
    font-weight: bold;
    font-size: 16px;
    margin: 0;
}

/* ===========================
   Dropdowns
=========================== */

.sh-cart-wrapper {
    position: relative;
}

.sh-cart-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    display: none;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-radius: 12px;
    z-index: 999;
}

.user-logged-menu {
    display: none;
    position: absolute;
    right: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 280px;
    z-index: 999;
    border-radius: 12px;
    padding: 12px 0;
}

.login-register a {
    text-decoration: none;
    color: inherit;
}

/* ===========================
   New Menu Icon
=========================== */

.sh-new-menu-icon {
    display: none;
    cursor: pointer;
    width: 33px;
    height: 33px;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s ease;
}

.sh-new-menu-icon:hover {
    transform: scale(1.05);
}

.sh-new-menu-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sh-new-menu-icon.hide-desktop { display: none !important; }
.sh-new-menu-icon.hide-tablet { display: none !important; }
.sh-new-menu-icon.hide-mobile { display: none !important; }

@media (min-width: 1025px) {
    .sh-new-menu-icon:not(.hide-desktop) { display: inline-block !important; }
}

@media (max-width: 1024px) and (min-width: 768px) {
    .sh-new-menu-icon:not(.hide-tablet) { display: inline-block !important; }
}

@media (max-width: 767px) {
    .sh-new-menu-icon:not(.hide-mobile) { display: inline-block !important; }
    .sh-new-menu-icon-img {
        margin-top: 35%;
    }
}