/* Sepahan v2.2.2.3 - Header/search consistency on cart, checkout and product-category pages */

/* Cart/checkout CSS must not repaint WordPress admin bar. */
body.woocommerce-cart #wpadminbar,
body.woocommerce-checkout #wpadminbar,
body.tax-product_cat #wpadminbar,
body.tax-product_tag #wpadminbar{
  background:#1d2327!important;
  color:#f0f0f1!important;
}
body.woocommerce-cart #wpadminbar a,
body.woocommerce-cart #wpadminbar .ab-item,
body.woocommerce-cart #wpadminbar .ab-label,
body.woocommerce-cart #wpadminbar .ab-icon,
body.woocommerce-checkout #wpadminbar a,
body.woocommerce-checkout #wpadminbar .ab-item,
body.woocommerce-checkout #wpadminbar .ab-label,
body.woocommerce-checkout #wpadminbar .ab-icon,
body.tax-product_cat #wpadminbar a,
body.tax-product_cat #wpadminbar .ab-item,
body.tax-product_cat #wpadminbar .ab-label,
body.tax-product_cat #wpadminbar .ab-icon,
body.tax-product_tag #wpadminbar a,
body.tax-product_tag #wpadminbar .ab-item,
body.tax-product_tag #wpadminbar .ab-label,
body.tax-product_tag #wpadminbar .ab-icon{
  color:#f0f0f1!important;
  -webkit-text-fill-color:#f0f0f1!important;
}
body.woocommerce-cart #wpadminbar .ab-icon:before,
body.woocommerce-checkout #wpadminbar .ab-icon:before,
body.tax-product_cat #wpadminbar .ab-icon:before,
body.tax-product_tag #wpadminbar .ab-icon:before{
  color:#a7aaad!important;
  -webkit-text-fill-color:#a7aaad!important;
}
body.woocommerce-cart #wpadminbar .ab-item:hover,
body.woocommerce-cart #wpadminbar .ab-item:hover .ab-label,
body.woocommerce-checkout #wpadminbar .ab-item:hover,
body.woocommerce-checkout #wpadminbar .ab-item:hover .ab-label,
body.tax-product_cat #wpadminbar .ab-item:hover,
body.tax-product_cat #wpadminbar .ab-item:hover .ab-label,
body.tax-product_tag #wpadminbar .ab-item:hover,
body.tax-product_tag #wpadminbar .ab-item:hover .ab-label{
  color:#72aee6!important;
  -webkit-text-fill-color:#72aee6!important;
}

/* Keep Sepahan header identical to normal pages and protect it from cart/checkout broad selectors. */
body.woocommerce-cart #topHeader,
body.woocommerce-checkout #topHeader,
body.tax-product_cat #topHeader,
body.tax-product_tag #topHeader,
body.post-type-archive-product #topHeader,
body.woocommerce-shop #topHeader{
  background:var(--sepahan-card,#fff)!important;
  border-color:var(--sepahan-border,#e5e7eb)!important;
  color:var(--sepahan-text,#111827)!important;
  -webkit-text-fill-color:currentColor!important;
}
html.dark body.woocommerce-cart #topHeader,
html.dark body.woocommerce-checkout #topHeader,
html.dark body.tax-product_cat #topHeader,
html.dark body.tax-product_tag #topHeader,
body.dark.woocommerce-cart #topHeader,
body.dark.woocommerce-checkout #topHeader,
body.dark.tax-product_cat #topHeader,
body.dark.tax-product_tag #topHeader{
  background:var(--sepahan-card,#0f172a)!important;
  border-color:var(--sepahan-border,#334155)!important;
  color:var(--sepahan-text,#fff)!important;
}

body.woocommerce-cart #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.woocommerce-cart #topHeader button:not(.sepahan-header-phone),
body.woocommerce-checkout #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.woocommerce-checkout #topHeader button:not(.sepahan-header-phone),
body.tax-product_cat #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.tax-product_cat #topHeader button:not(.sepahan-header-phone),
body.tax-product_tag #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.tax-product_tag #topHeader button:not(.sepahan-header-phone){
  color:var(--sepahan-text,#111827)!important;
  -webkit-text-fill-color:var(--sepahan-text,#111827)!important;
  border-color:inherit;
}
html.dark body.woocommerce-cart #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
html.dark body.woocommerce-cart #topHeader button:not(.sepahan-header-phone),
html.dark body.woocommerce-checkout #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
html.dark body.woocommerce-checkout #topHeader button:not(.sepahan-header-phone),
html.dark body.tax-product_cat #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
html.dark body.tax-product_cat #topHeader button:not(.sepahan-header-phone),
html.dark body.tax-product_tag #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
html.dark body.tax-product_tag #topHeader button:not(.sepahan-header-phone),
body.dark.woocommerce-cart #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.dark.woocommerce-cart #topHeader button:not(.sepahan-header-phone),
body.dark.woocommerce-checkout #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.dark.woocommerce-checkout #topHeader button:not(.sepahan-header-phone),
body.dark.tax-product_cat #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.dark.tax-product_cat #topHeader button:not(.sepahan-header-phone),
body.dark.tax-product_tag #topHeader a:not(.sepahan-header-phone):not(.sepahan-top-notice-btn),
body.dark.tax-product_tag #topHeader button:not(.sepahan-header-phone){
  color:var(--sepahan-text,#fff)!important;
  -webkit-text-fill-color:var(--sepahan-text,#fff)!important;
}

body.woocommerce-cart #topHeader .sepahan-desktop-menu a,
body.woocommerce-cart #topHeader #mega-menu-fire,
body.woocommerce-cart #topHeader #mega-menu-fire span,
body.woocommerce-cart #topHeader .sepahan-nikan-mega > a,
body.woocommerce-checkout #topHeader .sepahan-desktop-menu a,
body.woocommerce-checkout #topHeader #mega-menu-fire,
body.woocommerce-checkout #topHeader #mega-menu-fire span,
body.woocommerce-checkout #topHeader .sepahan-nikan-mega > a,
body.tax-product_cat #topHeader .sepahan-desktop-menu a,
body.tax-product_cat #topHeader #mega-menu-fire,
body.tax-product_cat #topHeader #mega-menu-fire span,
body.tax-product_cat #topHeader .sepahan-nikan-mega > a,
body.tax-product_tag #topHeader .sepahan-desktop-menu a,
body.tax-product_tag #topHeader #mega-menu-fire,
body.tax-product_tag #topHeader #mega-menu-fire span,
body.tax-product_tag #topHeader .sepahan-nikan-mega > a{
  color:var(--sepahan-mega-text,var(--sepahan-text,#111827))!important;
  -webkit-text-fill-color:var(--sepahan-mega-text,var(--sepahan-text,#111827))!important;
}
body.woocommerce-cart #topHeader .sepahan-desktop-menu a:hover,
body.woocommerce-cart #topHeader #mega-menu-fire:hover,
body.woocommerce-cart #topHeader #mega-menu-fire:hover span,
body.woocommerce-checkout #topHeader .sepahan-desktop-menu a:hover,
body.woocommerce-checkout #topHeader #mega-menu-fire:hover,
body.woocommerce-checkout #topHeader #mega-menu-fire:hover span,
body.tax-product_cat #topHeader .sepahan-desktop-menu a:hover,
body.tax-product_cat #topHeader #mega-menu-fire:hover,
body.tax-product_cat #topHeader #mega-menu-fire:hover span,
body.tax-product_tag #topHeader .sepahan-desktop-menu a:hover,
body.tax-product_tag #topHeader #mega-menu-fire:hover,
body.tax-product_tag #topHeader #mega-menu-fire:hover span{
  color:var(--sepahan-mega-hover,var(--sepahan-primary,#2563eb))!important;
  -webkit-text-fill-color:var(--sepahan-mega-hover,var(--sepahan-primary,#2563eb))!important;
}
body.woocommerce-cart #topHeader svg,
body.woocommerce-checkout #topHeader svg,
body.tax-product_cat #topHeader svg,
body.tax-product_tag #topHeader svg{
  color:inherit!important;
  stroke:currentColor!important;
  -webkit-text-fill-color:currentColor!important;
}
body.woocommerce-cart #topHeader .sepahan-header-phone,
body.woocommerce-checkout #topHeader .sepahan-header-phone,
body.tax-product_cat #topHeader .sepahan-header-phone,
body.tax-product_tag #topHeader .sepahan-header-phone{
  background:var(--sepahan-primary,#2563eb)!important;
  border-color:var(--sepahan-primary,#2563eb)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
body.woocommerce-cart #topHeader .sepahan-cart-count,
body.woocommerce-checkout #topHeader .sepahan-cart-count,
body.tax-product_cat #topHeader .sepahan-cart-count,
body.tax-product_tag #topHeader .sepahan-cart-count{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Header search box: never lose border or search icon position on cart/checkout/category. */
body #topHeader form[role="search"]{
  position:relative!important;
}
body #topHeader #searchInput,
body #topHeader input#searchInput,
body.woocommerce-cart #topHeader #searchInput,
body.woocommerce-checkout #topHeader #searchInput,
body.tax-product_cat #topHeader #searchInput,
body.tax-product_tag #topHeader #searchInput{
  width:100%!important;
  min-width:0!important;
  height:48px!important;
  border:1px solid var(--sepahan-border,#d1d5db)!important;
  border-color:var(--sepahan-border,#d1d5db)!important;
  border-radius:14px!important;
  background:var(--sepahan-card,#fff)!important;
  color:var(--sepahan-text,#111827)!important;
  -webkit-text-fill-color:var(--sepahan-text,#111827)!important;
  box-shadow:none!important;
  outline:0!important;
  padding-inline-start:16px!important;
  padding-inline-end:52px!important;
  box-sizing:border-box!important;
}
body #topHeader #searchInput:focus,
body #topHeader input#searchInput:focus{
  border-color:var(--sepahan-primary,#2563eb)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--sepahan-primary,#2563eb) 13%,transparent)!important;
}
html.dark body #topHeader #searchInput,
body.dark #topHeader #searchInput{
  background:var(--sepahan-card,#0f172a)!important;
  color:var(--sepahan-text,#fff)!important;
  -webkit-text-fill-color:var(--sepahan-text,#fff)!important;
  border-color:var(--sepahan-border,#334155)!important;
}
body #topHeader form[role="search"] > button[type="submit"]{
  position:absolute!important;
  inset-inline-end:6px!important;
  inset-inline-start:auto!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  z-index:4!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  background:transparent!important;
  color:var(--sepahan-text,#111827)!important;
  -webkit-text-fill-color:var(--sepahan-text,#111827)!important;
  box-shadow:none!important;
}
html.dark body #topHeader form[role="search"] > button[type="submit"],
body.dark #topHeader form[role="search"] > button[type="submit"]{
  color:var(--sepahan-text,#fff)!important;
  -webkit-text-fill-color:var(--sepahan-text,#fff)!important;
}
body #topHeader form[role="search"] > button[type="submit"] svg{
  width:22px!important;
  height:22px!important;
  display:block!important;
}

/* Product-category sidebar search must match the shop archive search. */
body.tax-product_cat .sepahan-filter-search,
body.tax-product_tag .sepahan-filter-search,
body.post-type-archive-product .sepahan-filter-search,
body.woocommerce-shop .sepahan-filter-search{
  position:relative!important;
  display:block!important;
  width:100%!important;
}
body.tax-product_cat .sepahan-filter-search input[type="search"],
body.tax-product_cat .sepahan-filter-search input[type="text"],
body.tax-product_tag .sepahan-filter-search input[type="search"],
body.tax-product_tag .sepahan-filter-search input[type="text"],
body.post-type-archive-product .sepahan-filter-search input[type="search"],
body.post-type-archive-product .sepahan-filter-search input[type="text"],
body.woocommerce-shop .sepahan-filter-search input[type="search"],
body.woocommerce-shop .sepahan-filter-search input[type="text"]{
  width:100%!important;
  height:48px!important;
  min-width:0!important;
  padding-right:16px!important;
  padding-left:58px!important;
  text-align:right!important;
  direction:rtl!important;
  box-sizing:border-box!important;
  border:1px solid var(--sepahan-border,#e5e7eb)!important;
  border-radius:15px!important;
  background:var(--sepahan-card,#fff)!important;
  color:var(--sepahan-text,#111827)!important;
}
body.tax-product_cat .sepahan-filter-search button,
body.tax-product_tag .sepahan-filter-search button,
body.post-type-archive-product .sepahan-filter-search button,
body.woocommerce-shop .sepahan-filter-search button{
  position:absolute!important;
  left:10px!important;
  right:auto!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  border-radius:11px!important;
  background:var(--sepahan-primary,#2563eb)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  z-index:3!important;
  box-shadow:none!important;
}
body.tax-product_cat .sepahan-filter-search button svg,
body.tax-product_tag .sepahan-filter-search button svg,
body.post-type-archive-product .sepahan-filter-search button svg,
body.woocommerce-shop .sepahan-filter-search button svg{
  width:18px!important;
  height:18px!important;
  stroke:currentColor!important;
}

/* Sepahan v2.2.2.4 - header phone colors and cart hover readability */
#topHeader .sepahan-header-phone,
#topHeader a.sepahan-header-phone,
#topHeader .inline-flex.items-center.gap-2.bg-primary.text-white.px-4.py-2.rounded-full.shadow-sm.sepahan-header-phone{
  background:var(--sepahan-header-phone-bg,var(--sepahan-primary,#2563eb))!important;
  background-color:var(--sepahan-header-phone-bg,var(--sepahan-primary,#2563eb))!important;
  background-image:none!important;
  color:var(--sepahan-header-phone-text,#fff)!important;
  -webkit-text-fill-color:var(--sepahan-header-phone-text,#fff)!important;
  border:1px solid color-mix(in srgb,var(--sepahan-header-phone-bg,var(--sepahan-primary,#2563eb)) 72%,#fff)!important;
}
#topHeader .sepahan-header-phone *,
#topHeader .sepahan-header-phone svg,
#topHeader .sepahan-header-phone path,
#topHeader a.sepahan-header-phone *,
#topHeader a.sepahan-header-phone svg,
#topHeader a.sepahan-header-phone path{
  color:var(--sepahan-header-phone-text,#fff)!important;
  -webkit-text-fill-color:var(--sepahan-header-phone-text,#fff)!important;
  stroke:currentColor!important;
}
#topHeader .sepahan-header-phone:hover,
#topHeader a.sepahan-header-phone:hover{
  color:var(--sepahan-header-phone-text,#fff)!important;
  -webkit-text-fill-color:var(--sepahan-header-phone-text,#fff)!important;
  filter:brightness(.96);
}

/* The regular cart menu link intentionally uses the same text and hover colors as every other menu item.
   Only the standalone header cart icon keeps its dedicated icon-color controls. */
#topHeader .sepahan-header-cart-hover:hover:after,
#topHeader a.sepahan-header-cart-hover:hover:after{
  background:#111827!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
#topHeader .sepahan-header-cart-hover:hover:before,
#topHeader a.sepahan-header-cart-hover:hover:before{
  border-bottom-color:#111827!important;
}
html.dark #topHeader .sepahan-header-cart-hover:hover:after,
body.dark #topHeader .sepahan-header-cart-hover:hover:after,
html.dark #topHeader a.sepahan-header-cart-hover:hover:after,
body.dark #topHeader a.sepahan-header-cart-hover:hover:after{
  background:#f8fafc!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
}
html.dark #topHeader .sepahan-header-cart-hover:hover:before,
body.dark #topHeader .sepahan-header-cart-hover:hover:before,
html.dark #topHeader a.sepahan-header-cart-hover:hover:before,
body.dark #topHeader a.sepahan-header-cart-hover:hover:before{
  border-bottom-color:#f8fafc!important;
}
