/*
============================================================
   TehranWallet Custom Header — v13 FINAL
============================================================ 
*/

@font-face {
    font-family: 'IYRegular';
    src: url('https://tehranwallet.store/wp-content/uploads/2026/02/iy-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --tws-gray: #444444;
    --tws-gold: #e2b02b;
    --tws-gold-light: #f5d06a;
    --tws-gold-deep: #b8860b;
    --tws-gold-ink: #8a6a10;
    --tws-text: #1a1408;
    --tws-text-muted: #2a2a2a;
    --tws-glass-border: rgba(226, 176, 43, 0.22);
}

/* ============================================================
   HEADER
   ============================================================ */
.tws-header {
    position: fixed !important;
    top: 5vh !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    width: 100% !important;
    background: transparent !important;
    padding: 0 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    font-family: 'IYRegular', Tahoma, sans-serif;
    direction: rtl;
    transition: top .3s ease;
    pointer-events: none;
}
.tws-header > * { pointer-events: auto; }

.tws-header__inner {
    display: flex !important;
    align-items: center !important;
    gap: 0;
    padding: 8px 22px !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
    border: 1px solid rgba(226, 176, 43, 0.18) !important;
    background: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 8px 28px rgba(226, 176, 43, 0.10) !important;
    backdrop-filter: blur(5px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(160%) !important;
    transition: padding .3s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease !important;
    position: relative;
}

.tws-desktop-only { display: flex; }
.tws-mobile-only { display: none; }
@media (max-width: 1024px) {
    .tws-desktop-only { display: none !important; }
    .tws-mobile-only { display: flex !important; }
}

/* ============================================================
   LOGO
   ============================================================ */
.tws-header__logo { padding-left: 20px; display: flex; align-items: center; flex-shrink: 0; }
.tws-header__logo a { display: flex; align-items: center; }
.tws-header__logo-img {
    height: 36px;
    width: auto;
    display: block;
    transition: height .3s ease;
}

/* ============================================================
   DIVIDERS
   ============================================================ */
.tws-header__divider {
    width: 1px;
    height: 30px;
    background: linear-gradient(180deg, transparent, var(--tws-gold) 50%, transparent);
    flex-shrink: 0;
    transition: height .3s ease, opacity .3s ease;
}

/* ============================================================
   NAV (desktop)
   ============================================================ */
.tws-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.tws-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    gap: 2px !important;
    align-items: center !important;
}
.tws-menu-item {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.tws-menu-item::before,
.tws-menu-item::marker { content: none !important; display: none !important; }

.tws-menu-link {
    display: inline-flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    color: var(--tws-text-muted);
    text-decoration: none !important;
    font-size: 15px !important;
    font-family: inherit !important;
    transition: color .2s ease;
    white-space: nowrap;
    position: relative;
    background: transparent !important;
    line-height: 1 !important;
    border: none !important;
}
.tws-menu-link span { display: inline-block; line-height: 1; }
.tws-menu-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 50%; left: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--tws-gold) 50%, transparent);
    border-radius: 99px;
    transition: right .25s ease, left .25s ease, opacity .25s ease;
    opacity: 0;
}
.tws-menu-item:hover .tws-menu-link { color: var(--tws-gray); }
.tws-menu-item:hover .tws-menu-link::after,
.tws-menu-item.is-active .tws-menu-link::after { right: 14px; left: 14px; opacity: 1; }
.tws-menu-item.is-active .tws-menu-link { color: var(--tws-gray); font-weight:bold; }

.tws-menu .sub-menu {
    position: absolute;
    top: 100%; right: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--tws-glass-border);
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    padding: 8px;
    list-style: none;
    margin: 14px 0 0;
    opacity: 0; visibility: hidden;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    z-index: 1000;
}
.tws-menu-item:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.tws-menu .sub-menu a {
    display: block; padding: 10px 14px;
    color: var(--tws-text-muted); text-decoration: none;
    border-radius: 999px; font-size: 14px;
    transition: background-color .2s ease, color .2s ease;
}
.tws-menu .sub-menu a:hover { background: rgba(226,176,43,0.1); color: var(--tws-gold-ink); }

/* ============================================================
   ACTIONS
   ============================================================ */
.tws-header__actions {
    display: flex; align-items: center; gap: 3px;
    padding-right: 20px; flex-shrink: 0;
}

.tws-icon-btn {
    width: 38px; height: 38px;
    border-radius: 50% !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center; justify-content: center;
    position: relative;
    transition: background-color .2s ease;
    text-decoration: none;
    padding: 0;
    font-family: inherit;
    overflow: visible;
    box-shadow: none !important;
}
.tws-icon-btn:hover { background: rgba(60,60,60,0.06) !important; }
.tws-icon-btn:hover .tws-icon-img {
    filter: invert(40%) sepia(85%) saturate(500%) hue-rotate(15deg) brightness(80%);
}
.tws-icon-btn:focus,
.tws-icon-btn:focus-visible,
.tws-icon-btn:active { background: rgba(60,60,60,0.06) !important; outline: none; }

.tws-icon-img {
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    object-fit: contain;
    pointer-events: none;
    transition: filter .2s ease;
    min-width: 20px;
    min-height: 20px;
}

.tws-cart-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    background: var(--tws-gold);
    color: #fff;
    font-size: 11px;
    font-family: 'IYRegular', Tahoma, sans-serif;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}
.tws-cart-badge[hidden] { display: none; }

/* ============================================================
   DROPDOWNS (desktop)
   ============================================================ */
.tws-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tws-dropdown-panel {
    position: absolute;
    top: calc(100% + 14px);
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--tws-glass-border);
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    z-index: 99999;
    overflow: hidden;
}
.tws-dropdown.is-open .tws-dropdown-panel { opacity: 1; visibility: visible; }
.tws-dropdown-panel[hidden] { display: none; }
.tws-dropdown-panel::before {
    content: '';
    position: absolute;
    top: -6px;
    width: 12px; height: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-left: 1px solid var(--tws-glass-border);
    border-top: 1px solid var(--tws-glass-border);
    transform: rotate(45deg);
}

.tws-dropdown--search .tws-dropdown-panel {
    width: 320px;
    padding: 5px;
    left: 0;
    right: auto;
    transform: translateY(-6px);
}
.tws-dropdown--search.is-open .tws-dropdown-panel { transform: translateY(0); }
.tws-dropdown--search .tws-dropdown-panel::before { right: auto; left: 14px; }

/* Compact search form — shorter height */
.tws-ajax-form {
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    position: relative;
}
.tws-ajax-input {
    flex: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 1px solid var(--tws-glass-border) !important;
    outline: none !important;
    padding: 7px 16px !important;
    font-size: 13px !important;
    font-family: inherit !important;
    background: rgba(255, 255, 255, 0.5) !important;
    color: var(--tws-text) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    height: 36px !important;
    line-height: 1 !important;
}
.tws-ajax-input::placeholder { color: #888; font-size: 13px; }
.tws-ajax-input:focus {
    border-color: rgba(226, 176, 43, 0.5) !important;
    background: rgba(255, 255, 255, 0.75) !important;
}
.tws-ajax-input::-webkit-search-decoration,
.tws-ajax-input::-webkit-search-cancel-button,
.tws-ajax-input::-webkit-search-results-button,
.tws-ajax-input::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }

.tws-ajax-results {
    margin-top: 10px;
    max-height: 360px;
    overflow-y: auto;
    display: none;
}
.tws-ajax-results.is-open { display: block; }
.tws-ajax-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    text-decoration: none;
    color: var(--tws-text);
    border-radius: 999px;
    transition: background-color .15s ease;
}
.tws-ajax-item:hover { background: rgba(226, 176, 43, 0.12); }
.tws-ajax-item img {
    width: 44px; height: 44px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255,255,255,0.5);
}
.tws-ajax-item-info { flex: 1; min-width: 0; }
.tws-ajax-item-title {
    font-size: 13px; margin: 0 0 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tws-ajax-item-price {
    font-size: 12px;
    color: var(--tws-gold-ink);
    font-family: 'IYRegular', Tahoma, sans-serif;
}
.tws-ajax-empty, .tws-ajax-loading {
    padding: 14px; text-align: center;
    color: #777; font-size: 13px;
}

/* Cart panel */
.tws-dropdown--cart .tws-dropdown-panel {
    width: 340px;
    padding: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
}
.tws-dropdown--cart.is-open .tws-dropdown-panel { transform: translateX(-50%) translateY(0); }
.tws-dropdown--cart .tws-dropdown-panel::before { left: 50%; transform: translateX(-50%) rotate(45deg); }

.tws-cart-items { max-height: 300px; overflow-y: auto; margin-bottom: 10px; }
.tws-cart-item {
    display: flex;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(226, 176, 43, 0.12);
    position: relative;
}
.tws-cart-item:last-child { border-bottom: none; }
.tws-cart-item-thumb img,
.tws-cart-item-thumb {
    width: 54px; height: 54px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.5);
    flex-shrink: 0;
}
.tws-cart-item-info { flex: 1; min-width: 0; padding-left: 20px; }
.tws-cart-item-title {
    display: -webkit-box;
    font-size: 13px;
    color: var(--tws-text);
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.4;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.tws-cart-item-meta {
    font-size: 12px;
    color: var(--tws-gold-ink);
    font-family: 'IYRegular', Tahoma, sans-serif;
}
.tws-cart-item-qty { opacity: .75; }
.tws-cart-item-remove {
    position: absolute;
    top: 6px; left: 4px;
    width: 22px; height: 22px;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 18px;
    color: #999;
    text-decoration: none;
    border-radius: 50%;
    transition: all .2s ease;
    line-height: 1;
}
.tws-cart-item-remove:hover { background: rgba(226, 75, 75, 0.12); color: #c62828; }

.tws-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    border-top: 1px solid rgba(226, 176, 43, 0.2);
    border-bottom: 1px solid rgba(226, 176, 43, 0.2);
    margin-bottom: 12px;
    font-size: 14px;
}
.tws-cart-total strong {
    color: var(--tws-gold-ink);
    font-family: 'IYRegular', Tahoma, sans-serif;
}
.tws-cart-actions { display: flex; flex-direction: column; gap: 8px; }
.tws-cart-empty { text-align: center; padding: 20px 10px; }
.tws-cart-empty p { color: var(--tws-text-muted); margin: 0 0 14px; font-size: 14px; }

.tws-btn {
    display: block;
    text-align: center;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-family: inherit;
    transition: all .2s ease;
    cursor: pointer;
    border: none;
}
.tws-btn-gold {
    background: linear-gradient(135deg, var(--tws-gold-light), var(--tws-gold-deep));
    color: var(--tws-text);
    box-shadow: 0 4px 14px rgba(226, 176, 43, 0.3);
}
.tws-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(226, 176, 43, 0.4); }
.tws-btn-outline {
    background: rgba(255, 255, 255, 0.6);
    color: var(--tws-text);
    border: 1px solid rgba(226, 176, 43, 0.25);
}
.tws-btn-outline:hover { background: rgba(255, 255, 255, 0.85); }

/* Account panel */
.tws-dropdown--account .tws-dropdown-panel {
    width: 200px;
    padding: 6px;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
}
.tws-dropdown--account.is-open .tws-dropdown-panel { transform: translateX(-50%) translateY(0); }
.tws-dropdown--account .tws-dropdown-panel::before { left: 50%; transform: translateX(-50%) rotate(45deg); }

.tws-account-menu { list-style: none; margin: 0; padding: 0; }
.tws-account-menu li a {
    display: block; padding: 8px 14px;
    color: var(--tws-text); text-decoration: none;
    font-size: 13px; border-radius: 999px;
    transition: all .18s ease;
}
.tws-account-menu li a:hover { background: rgba(226, 176, 43, 0.12); color: var(--tws-gold-ink); }
.tws-account-menu__logout { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(226, 176, 43, 0.15); }
.tws-account-menu__logout a { color: #c62828 !important; }
.tws-account-menu__logout a:hover { background: rgba(226, 75, 75, 0.1) !important; }

.tws-account-guest { text-align: center; padding: 14px 8px; }
.tws-account-guest p { margin: 0 0 12px; color: var(--tws-text-muted); font-size: 13px; }

/* ============================================================
   MOBILE ACTIONS
   ============================================================ */
.tws-header__mobile-actions {
    display: none;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Scrolled state */
body.tws-scrolled .tws-header { top: 15px !important; }
body.tws-scrolled .tws-header__inner {
    background: rgba(255, 255, 255, 0.55) !important;
    border-color: rgba(226, 176, 43, 0.28) !important;
    box-shadow: 0 10px 32px rgba(226, 176, 43, 0.14) !important;
    padding: 5px 22px !important;
}
body.tws-scrolled .tws-header__logo-img { height: 32px; }
body.tws-scrolled .tws-header__divider { height: 26px; opacity: .5; }

/* Spacer */
body.tws-needs-spacer .tws-header-spacer {
    display: block;
    width: 100%;
    height: 140px;
}
.tws-header-spacer { display: none; }

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.tws-mobile-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 20, 8, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99997;
    opacity: 0;
    transition: opacity .3s ease;
}
.tws-mobile-backdrop:not([hidden]) { opacity: 1; }

.tws-mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 78%;
    max-width: 340px;
    min-width: 260px;
    height: 100%;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-left: 1px solid var(--tws-glass-border);
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    z-index: 99998;
    padding: 0;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    font-family: 'IYRegular', Tahoma, sans-serif;
    direction: rtl;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tws-mobile-nav:not([hidden]) { transform: translateX(0); }

/* Drawer header */
.tws-mobile-nav__head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid rgba(226, 176, 43, 0.15);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.6);
}
.tws-mobile-nav__title {
    font-size: 16px;
    color: var(--tws-gold-ink);
    font-family: inherit;
}
.tws-mobile-close {
    width: 38px; height: 38px;
    border-radius: 50% !important;
    background: rgba(60, 60, 60, 0.08) !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color .2s ease;
    flex-shrink: 0;
    color: var(--tws-text-muted);
}
.tws-mobile-close:hover { background: rgba(60, 60, 60, 0.14) !important; }
.tws-mobile-close svg { display: block; }

/* Drawer body */
.tws-mobile-nav__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mobile search — shorter height */
.tws-mobile-search { position: relative; }
.tws-mobile-ajax-form {
    display: flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid var(--tws-glass-border) !important;
    border-radius: 999px !important;
    padding: 2px 14px !important;
    margin: 0 !important;
    box-shadow: none !important;
    height: 40px;
}
.tws-mobile-search-icon {
    width: 16px !important;
    height: 16px !important;
    opacity: 0.6;
    flex-shrink: 0;
    margin-left: 8px;
}
.tws-mobile-ajax-input {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    padding: 6px !important;
    font-size: 13px !important;
    font-family: inherit !important;
    background: transparent !important;
    color: var(--tws-text) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    height: auto;
    line-height: 1 !important;
}
.tws-mobile-ajax-input::placeholder { color: #888; font-size: 13px; }
.tws-mobile-ajax-results {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--tws-glass-border);
    border-radius: 18px;
    max-height: 260px;
    overflow-y: auto;
    display: none;
}
.tws-mobile-ajax-results.is-open { display: block; }

/* Account link — pill shape */
.tws-mobile-account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(226, 176, 43, 0.08);
    border: 1px solid rgba(226, 176, 43, 0.2);
    border-radius: 999px;
    color: var(--tws-text);
    text-decoration: none;
    font-size: 14px;
    transition: background-color .2s ease;
}
.tws-mobile-account:hover { background: rgba(226, 176, 43, 0.15); }
.tws-mobile-account-icon {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}

/* Mobile menu — pill items */
.tws-mobile-menu {
    list-style: none;
    padding: 4px 0;
    margin: 0;
}
.tws-mobile-menu li {
    list-style: none;
    margin: 0 0 4px 0;
}
.tws-mobile-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--tws-text);
    text-decoration: none;
    font-size: 15px;
    border-radius: 999px;
    transition: all .2s ease;
}
.tws-mobile-menu a:hover,
.tws-mobile-menu .current-menu-item > a,
.tws-mobile-menu .current_page_item > a {
    background: rgba(226, 176, 43, 0.1);
    color: var(--tws-gold-ink);
}
.tws-mobile-menu .sub-menu { list-style: none; padding: 0 14px; margin: 0; }
.tws-mobile-menu .sub-menu a { font-size: 14px; padding: 10px 14px; color: var(--tws-text-muted); }

.tws-mobile-logout {
    display: block;
    text-align: center;
    padding: 11px 14px;
    margin-top: 12px;
    background: rgba(226, 75, 75, 0.08);
    border: 1px solid rgba(226, 75, 75, 0.25);
    border-radius: 999px;
    color: #c62828;
    text-decoration: none;
    font-size: 14px;
    transition: background-color .2s ease;
}
.tws-mobile-logout:hover { background: rgba(226, 75, 75, 0.15); }

/* ============================================================
   RESPONSIVE — MOBILE HEADER LAYOUT
   Structure: logo first (right in RTL), then auto-margin push, then actions (left)
   ============================================================ */
@media (max-width: 1024px) {
    .tws-header { padding: 0 12px !important; }
    .tws-header__inner {
        padding: 6px 14px !important;
        gap: 0;
    }

    /* Logo is first child → naturally on the right in RTL */
    .tws-header__logo {
        padding-left: 0;
        margin: 0;
        order: 1;
    }

    /* Mobile actions — push to far left via margin-left: auto */
    .tws-header__mobile-actions {
        display: flex !important;
        order: 2;
        margin-right: auto;
    }

    /* Order inside mobile actions: cart (right of two) | hamburger (left of two) */
    .tws-header__mobile-actions .tws-cart-btn-mobile { order: 1; }
    .tws-header__mobile-actions .tws-mobile-toggle  { order: 2; }

    body.tws-needs-spacer .tws-header-spacer { height: 120px; }
}

@media (max-width: 540px) {
    .tws-header { top: 12px !important; }
    body.tws-scrolled .tws-header { top: 8px !important; }
    .tws-header__inner { padding: 5px 12px !important; }
    .tws-header__logo-img { height: 26px; }
    body.tws-scrolled .tws-header__logo-img { height: 24px; }
    .tws-icon-btn { width: 34px; height: 34px; }
    .tws-icon-img { width: 17px !important; height: 17px !important; min-width: 17px; min-height: 17px; }
    body.tws-needs-spacer .tws-header-spacer { height: 60px; }
}

/* ============================================================
   HIDE WOODMART HEADER
   ============================================================ */
.whb-header, .website-header,
header.whb-header, .whb-main-header,
.whb-top-bar, .whb-general-header,
.site-header:not(.tws-header) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
}
/*
 * ================================================================
 * TehranWallet Header — PATCH فایل
 * این کدها رو در انتهای custom-header.css اضافه کن
 * (بعد از آخرین خط فایل، قبل از EOF)
 * ================================================================
 */

/* ================================================================
   FIX 1: دراپ‌داون‌ها در همه سایزها داخل viewport بمونن
   ================================================================ */

/* --- سرچ: همیشه از لبه راست آیکون شروع می‌شه --- */
.tws-dropdown--search .tws-dropdown-panel {
    left: 0 !important;
    right: auto !important;
    transform: translateY(-6px) !important;
    max-width: calc(100vw - 24px);
}
.tws-dropdown--search.is-open .tws-dropdown-panel {
    transform: translateY(0) !important;
}

/* --- سبد: اگه فضا باشه وسط‌چین، وگرنه از راست --- */
.tws-dropdown--cart .tws-dropdown-panel {
    left: auto !important;
    right: 0 !important;
    transform: translateY(-6px) !important;
    max-width: calc(100vw - 24px);
}
.tws-dropdown--cart.is-open .tws-dropdown-panel {
    transform: translateY(0) !important;
}
.tws-dropdown--cart .tws-dropdown-panel::before {
    left: auto !important;
    right: 14px !important;
    transform: rotate(45deg) !important;
}

/* --- حساب کاربری: از راست آیکون --- */
.tws-dropdown--account .tws-dropdown-panel {
    left: auto !important;
    right: 0 !important;
    transform: translateY(-6px) !important;
    max-width: calc(100vw - 24px);
}
.tws-dropdown--account.is-open .tws-dropdown-panel {
    transform: translateY(0) !important;
}
.tws-dropdown--account .tws-dropdown-panel::before {
    left: auto !important;
    right: 14px !important;
    transform: rotate(45deg) !important;
}

/* --- روی دسکتاپ بزرگ: سبد و حساب وسط‌چین بمونن --- */
@media (min-width: 1025px) {
    .tws-dropdown--cart .tws-dropdown-panel {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-24%) translateY(-6px) !important;
    }
    .tws-dropdown--cart.is-open .tws-dropdown-panel {
        transform: translateX(-24%) translateY(0) !important;
    }
    .tws-dropdown--cart .tws-dropdown-panel::before {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-24%) rotate(45deg) !important;
    }

    .tws-dropdown--account .tws-dropdown-panel {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-24%) translateY(-6px) !important;
    }
    .tws-dropdown--account.is-open .tws-dropdown-panel {
        transform: translateX(-24%) translateY(0) !important;
    }
    .tws-dropdown--account .tws-dropdown-panel::before {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-24%) rotate(45deg) !important;
    }
}

/* --- عرض پنل‌ها در سایزهای مختلف --- */
@media (max-width: 1200px) {
    .tws-dropdown--cart .tws-dropdown-panel { width: 300px; }
    .tws-dropdown--search .tws-dropdown-panel { width: 280px; }
}

@media (max-width: 900px) {
    .tws-dropdown--cart .tws-dropdown-panel { width: 260px; }
    .tws-dropdown--search .tws-dropdown-panel { width: 240px; }
    .tws-dropdown--account .tws-dropdown-panel { width: 180px; }
    .tws-cart-item-thumb,
    .tws-cart-item-thumb img { width: 42px; height: 42px; }
}

@media (max-width: 600px) {
    .tws-dropdown--cart .tws-dropdown-panel,
    .tws-dropdown--search .tws-dropdown-panel {
        width: calc(100vw - 24px);
        left: 0 !important;
        right: auto !important;
    }
    .tws-dropdown--account .tws-dropdown-panel {
        width: calc(100vw - 24px);
        left: 0 !important;
        right: auto !important;
    }
}

/* ================================================================
   FIX 2: آیکون بستن منوی موبایل — تصویر SVG جدید
   ================================================================ */
.tws-mobile-close {
    background-image: url('https://tehranwallet.store/wp-content/uploads/2026/04/svgviewer-output.svg') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 28px 28px !important;
}
/* مخفی کردن SVG inline که در PHP هست */
.tws-mobile-close svg { display: none !important; }