/* ========================================
   SH Header Widget - Language & Country Popup
======================================== */
.sh-lang-country-menu {
    display: inline-block;
    margin-right: -20px;
    position: relative;
}

.sh-lang-country-menu img {
    width: 33px;
    height: 33px;
    display: block;
    cursor: pointer;
    object-fit: contain;
}

.sh-lang-country-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ccc;
    padding: 25px;
    z-index: 10001;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border-radius: 10px;
    text-align: center;
}

.sh-lang-country-popup h2 {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
}

.sh-lang-country-popup label {
    display: block;
    margin-bottom: 5px;
}

.sh-lang-country-popup select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
}

.lang-popup-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.lang-popup-buttons button {
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
}

.lang-popup-buttons .save-btn {
    background-color: #0073aa;
    color: #fff;
}

/* ========================================
   Overlay for Popups
======================================== */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
}

/* ===========================
   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-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;
}

/* ===========================
   Account Menu
=========================== */
/* موبایل فقط آیکون نمایش داده شود */
@media (max-width: 767px) {
    .sh-login-text {
        display: none !important;
    }
}

.sh-account-menu {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.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;
}

/* ===========================
   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;
}

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

.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;
    box-sizing: border-box;
}

/* Scroll only on mini-cart items */
.widget_shopping_cart_content .woocommerce-mini-cart {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* WooCommerce mini-cart items */
.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;
}

/* Total and buttons stay outside scroll */
.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;
}

/* Scrollbar Styling */
.widget_shopping_cart_content .woocommerce-mini-cart::-webkit-scrollbar {
    width: 4px; /* باریک‌تر */
}

.widget_shopping_cart_content .woocommerce-mini-cart::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.3); /* رنگ ملایم‌تر */
    border-radius: 4px;
}

.widget_shopping_cart_content .woocommerce-mini-cart::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05); /* روشن و ملایم */
}

/* ===========================
   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: 170px !important;
    }

    .sh-cart-account-wrapper {
        flex: unset !important;
        padding: 0 !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;
    }

    .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;
    }

    .sh-icon-img {
    width: 25px !important;
    height: 25px !important;
    }
    .sh-cart-icon img {
    width: 25px !important;
    height: 25px !important;
    }
}

/* ===========================
   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;
}

/* ===========================
   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%;
    }
}


.hide-desktop { display: none !important; }
.hide-tablet { display: none !important; }

/* موبایل */
@media (max-width: 768px) {
    .hide-desktop.hide-tablet { display: block !important; }
}


/* ===========================
   Popup
=========================== */

/* Important Menu Popup */
.important-menu-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    z-index: 9999;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 90%;
}

.important-menu-popup a {
    display: block;
    margin-bottom: 10px;
    border-bottom: 1px solid gray;
    padding-bottom: 10px;
}

.important-menu-close {
    margin-top: 10px;
    border-radius: 25px;
}

/* Important Menu Wrapper (Mobile Only) */
.sh-important-menu {
    margin-right: -20px;
}

/* User Logged Menu */
.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 Text */
.sh-account-menu .sh-login-text {
    text-decoration: none;
    color: inherit;
    padding-left: 10px;
}
