/*
 * Furnicom Stability & Polish v6
 * Fixes regressions observed in local QA without changing Bootstrap/grid sizing.
 * Loads after palette-refresh.css and before child-theme CSS.
 */

/* ==========================================================================
   Typography — Persian-first, reliable fallback
   ========================================================================== */
html,
body,
button,
input,
select,
textarea,
.woocommerce,
.header,
.footer,
.primary-menu,
.sidebar,
.products-content,
.item-content,
.block-popup-login {
  font-family: Vazirmatn, "WebYekan", Tahoma, Arial, sans-serif !important;
}

body {
  font-weight: 400;
  letter-spacing: 0;
}

h1, h2, h3, h4, h5, h6,
.button,
button,
input[type="submit"],
.primary-menu .nav > li > a {
  font-family: Vazirmatn, "WebYekan", Tahoma, Arial, sans-serif !important;
}

/* ==========================================================================
   Top utility bar — force a single desktop row
   ========================================================================== */
@media (min-width: 992px) {
  .header-style1 .header-msg {
    min-height: 40px;
    line-height: normal;
  }

  .header-style1 .header-msg > .container {
    min-height: 40px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px;
  }

  .header-style1 .header-msg .top-header-sidebar,
  .header-style1 .header-msg .top-header-right,
  .header-style1 .header-msg #top-header-right,
  .header-style1 .header-msg #sidebar-top,
  .header-style1 .header-msg .top-header-sidebar-menu,
  .header-style1 .header-msg .sidebar-top,
  .header-style1 .header-msg .widget,
  .header-style1 .header-msg ul {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .header-style1 .header-msg .top-header-sidebar,
  .header-style1 .header-msg .top-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 18px;
    white-space: nowrap;
  }

  .header-style1 .header-msg .top-header-sidebar > *,
  .header-style1 .header-msg .top-header-right > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .header-style1 .header-msg li,
  .header-style1 .header-msg a,
  .header-style1 .header-msg .my-account,
  .header-style1 .header-msg span {
    line-height: 40px;
  }
}

/* ==========================================================================
   Desktop navigation — CSS fallback + JS state
   ========================================================================== */
@media (min-width: 992px) {
  .header-style1 #main-menu,
  .header-style1 .main-menu {
    overflow: visible !important;
  }

  .header-style1 .primary-menu,
  .header-style1 .primary-menu .container,
  .header-style1 .primary-menu .navbar-inner,
  .header-style1 .primary-menu .nav.nav-mega,
  .header-style1 .primary-menu .nav.nav-mega > li {
    overflow: visible !important;
  }

  /* JS state is preferred, :hover is a resilient fallback if a legacy option
     prevents the script from running. */
  .primary-menu .navbar-inner .nav.nav-mega > li.furnicom-mega-menu:hover > .dropdown-menu,
  .primary-menu .navbar-inner .nav.nav-mega > li.furnicom-mega-menu.fm-menu-open > .dropdown-menu {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .primary-menu .navbar-inner .nav.nav-mega > li.furnicom-menu-custom:hover > .dropdown-menu,
  .primary-menu .navbar-inner .nav.nav-mega > li.furnicom-menu-custom.fm-menu-open > .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .primary-menu .navbar-inner .nav.nav-mega > li.furnicom-mega-menu > .dropdown-menu,
  .primary-menu .navbar-inner .nav.nav-mega > li.furnicom-menu-custom > .dropdown-menu {
    top: calc(100% - 1px) !important;
  }
}

/* ==========================================================================
   Page canvas — remove remaining cold-grey product sections
   ========================================================================== */
.single-product .tabs,
.single-product .related,
.single-product .related-products,
.single-product .upsells,
.single-product .up-sells,
.single-product .bottom-single-product,
.single-product .bottom-single-product .sw_related_upsell_widget,
.single-product .bottom-single-product .tab-content,
.single-product .bottom-single-product .tab-pane,
.single-product .bottom-single-product .sw-woo-container-slider,
.single-product .bottom-single-product .resp-slider-container,
.single-product #contents-detail,
.single-product #contents-detail > .single-product {
  background: transparent !important;
}

.single-product .bottom-single-product,
.single-product .related,
.single-product .related-products,
.single-product .upsells,
.single-product .up-sells {
  padding-left: 0;
  padding-right: 0;
}

/* ==========================================================================
   Product action row — compare / main action / wishlist
   ========================================================================== */
.item-bottom {
  box-sizing: border-box;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 62px;
  padding: 10px 12px !important;
  border-top: 1px solid var(--fm-line) !important;
  background: var(--fm-surface) !important;
  text-align: center;
}

.item-bottom > .button,
.item-bottom > a.button,
.item-bottom .button.add_to_cart_button,
.item-bottom .button.product_type_simple,
.item-bottom .button.product_type_variable,
.item-bottom .button.product_type_grouped,
.item-bottom .button.product_type_external {
  order: 2;
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--fm-primary) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 42px !important;
  text-indent: 0 !important;
  overflow: hidden;
  white-space: nowrap;
}

.item-bottom > .button:hover,
.item-bottom > a.button:hover,
.item-bottom .button.add_to_cart_button:hover,
.item-bottom .button.product_type_simple:hover,
.item-bottom .button.product_type_variable:hover,
.item-bottom .button.product_type_grouped:hover,
.item-bottom .button.product_type_external:hover {
  background: var(--fm-primary-hover) !important;
  color: #fff !important;
}

.item-bottom .button:before,
.item-bottom .compare-button:before,
.item-bottom .yith-wcwl-add-to-wishlist:before {
  display: none !important;
}

.item-bottom .compare-button,
.item-bottom .yith-wcwl-add-to-wishlist {
  position: relative;
  float: none !important;
  flex: 0 0 42px;
  width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--fm-line) !important;
  border-radius: 10px;
  background: var(--fm-surface-warm) !important;
  overflow: hidden;
}

.item-bottom .compare-button {
  order: 1;
}

.item-bottom .yith-wcwl-add-to-wishlist {
  order: 3;
}

.item-bottom .compare-button:hover,
.item-bottom .yith-wcwl-add-to-wishlist:hover {
  border-color: #bfd7d1 !important;
  background: var(--fm-primary-soft) !important;
}

.item-bottom .compare-button > a.compare,
.item-bottom .compare-button a,
.item-bottom .yith-wcwl-add-to-wishlist a,
.item-bottom .yith-wcwl-add-to-wishlist .add_to_wishlist,
.item-bottom .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse > a,
.item-bottom .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse > a,
.item-bottom .show a {
  position: relative;
  display: block !important;
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 42px !important;
  text-indent: 0 !important;
  box-shadow: none !important;
}

.item-bottom .compare-button > a.compare:after,
.item-bottom .compare-button a:after {
  content: "\f0ec";
  position: absolute;
  inset: 0;
  display: block;
  color: #667772;
  font-family: FontAwesome;
  font-size: 14px;
  line-height: 42px;
  text-align: center;
}

.item-bottom .yith-wcwl-add-to-wishlist a:before,
.item-bottom .yith-wcwl-add-to-wishlist .add_to_wishlist:before,
.item-bottom .show a:before {
  content: "\f004" !important;
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  background: none !important;
  color: #74827f !important;
  font-family: FontAwesome !important;
  font-size: 14px !important;
  line-height: 42px !important;
  text-align: center !important;
  text-indent: 0 !important;
}

.item-bottom .compare-button:hover a:after,
.item-bottom .yith-wcwl-add-to-wishlist:hover a:before,
.item-bottom .show:hover a:before {
  color: var(--fm-primary) !important;
}

.item-bottom .yith-wcwl-add-to-wishlist .ajax-loading {
  z-index: 5;
}

/* Do not let old pseudo-elements create duplicated icons. */
.item-bottom .compare-button a:before,
.item-bottom .button:after,
.item-bottom .compare-button:after,
.item-bottom .yith-wcwl-add-to-wishlist:after {
  display: none !important;
}

/* ==========================================================================
   Account dropdown
   ========================================================================== */
.top-header-sidebar-menu {
  position: relative;
}

.sidebar-login-top {
  top: calc(100% + 8px) !important;
  width: 210px !important;
  padding: 8px !important;
  border: 1px solid var(--fm-line) !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: 0 16px 38px rgba(22, 61, 57, .14) !important;
}

.rtl .sidebar-login-top {
  right: 0 !important;
  left: auto !important;
}

.sidebar-login-top:before {
  content: "";
  position: absolute;
  top: -9px;
  right: 0;
  left: 0;
  height: 10px;
  background: transparent;
}

.sidebar-login-top .widget.widget_nav_menu ul.menu > li > a,
.sidebar-login-top .top-login ul li a,
.sidebar-login-top .top-login .div-logined a {
  display: flex !important;
  align-items: center;
  min-height: 42px;
  padding: 0 13px !important;
  border-radius: 9px;
  color: var(--fm-text) !important;
  font-size: 12.5px !important;
  line-height: 42px !important;
}

.sidebar-login-top .widget.widget_nav_menu ul.menu > li > a:hover,
.sidebar-login-top .top-login ul li a:hover,
.sidebar-login-top .top-login .div-logined a:hover {
  background: var(--fm-primary-soft) !important;
  color: var(--fm-primary) !important;
}

/* ==========================================================================
   Login modal
   ========================================================================== */
#login_form .modal-dialog.block-popup-login,
#login_form_4 .modal-dialog.block-popup-login,
.block-popup-login {
  box-sizing: border-box;
  width: 660px;
  max-width: calc(100vw - 30px);
  margin: 10vh auto 30px;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(14, 36, 34, .26) !important;
}

.block-popup-login .tt_popup_login {
  display: flex;
  align-items: center;
  min-height: 62px;
  height: auto !important;
  margin: 0 !important;
  padding: 0 24px !important;
  background: var(--fm-primary-deep) !important;
}

.block-popup-login .tt_popup_login strong {
  padding: 0 !important;
  background: none !important;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.7;
  text-transform: none;
}

.block-popup-login .close-login {
  z-index: 10;
  top: 14px !important;
  left: 16px !important;
  right: auto !important;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  background: rgba(255,255,255,.12) !important;
  color: transparent !important;
  font-size: 0;
  opacity: 1;
}

.block-popup-login .close-login:before {
  content: "\00d7";
  display: block;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 25px;
  font-weight: 300;
  line-height: 31px;
  text-align: center;
}

.rtl .block-popup-login .close-login {
  right: auto !important;
  left: 16px !important;
}

.block-popup-login form.login,
.block-popup-login form.register {
  text-align: right;
}

.block-popup-login .block-content {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 28px !important;
}

.block-popup-login .block-content .col-reg {
  box-sizing: border-box;
  float: none !important;
  width: 50% !important;
  min-height: 230px;
}

.block-popup-login .block-content .col-reg.registered-account,
.rtl .block-popup-login .block-content .col-reg.registered-account {
  padding: 0 0 0 26px !important;
  border: 0 !important;
  border-left: 1px solid var(--fm-line) !important;
}

.block-popup-login .block-content .col-reg.login-customer,
.rtl .block-popup-login .block-content .col-reg.login-customer {
  padding: 2px 26px 0 0 !important;
  border: 0 !important;
}

.block-popup-login .email-input,
.block-popup-login .pass-input {
  position: relative;
}

.block-popup-login .email-input:before,
.block-popup-login .pass-input:before {
  z-index: 2;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  width: 46px !important;
  height: 46px !important;
  background: transparent !important;
  color: var(--fm-muted);
  font-family: FontAwesome;
  font-size: 15px;
  line-height: 46px;
  text-align: center;
}

.block-popup-login .email-input:before {
  content: "\f007" !important;
}

.block-popup-login .pass-input:before {
  content: "\f023" !important;
}

.block-popup-login .input-text,
.rtl .block-popup-login .input-text {
  height: 46px !important;
  margin-bottom: 14px;
  padding: 0 46px 0 14px !important;
  border: 1px solid var(--fm-line) !important;
  border-radius: 11px !important;
  background: var(--fm-surface-warm) !important;
  color: var(--fm-text);
  font-size: 13px;
  box-shadow: none !important;
}

.block-popup-login .input-text:focus {
  border-color: #a8d1c8 !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px var(--fm-primary-soft) !important;
}

.block-popup-login .ft-link-p {
  margin: 2px 0 10px;
}

.block-popup-login .ft-link-p a {
  color: var(--fm-muted) !important;
  font-size: 12px;
}

.block-popup-login .block-content .col-reg.registered-account .submit-login,
.rtl .block-popup-login .block-content .col-reg.registered-account .submit-login {
  float: none !important;
  margin-top: 12px;
}

.block-popup-login .block-content .col-reg.registered-account .submit-login:before {
  display: none !important;
}

.block-popup-login .block-content .col-reg.registered-account .submit-login .btn-submit-login,
.rtl .block-popup-login .block-content .col-reg.registered-account .submit-login .btn-submit-login,
.block-popup-login .block-content .btn-reg-popup {
  height: 44px !important;
  min-height: 44px;
  padding: 0 20px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--fm-primary) !important;
  color: #fff !important;
  font-size: 12.5px !important;
  font-weight: 700;
  line-height: 44px !important;
  text-transform: none;
  box-shadow: none;
}

.block-popup-login .block-content .btn-reg-popup {
  display: inline-block;
  margin-top: 14px;
}

.block-popup-login .block-content .col-reg.registered-account .submit-login .btn-submit-login:hover,
.block-popup-login .block-content .btn-reg-popup:hover {
  background: var(--fm-primary-hover) !important;
}

.block-popup-login .block-content .col-reg.login-customer h2 {
  margin: 0 0 5px;
  color: var(--fm-heading);
  font-size: 17px;
  font-weight: 800;
  text-transform: none;
}

.block-popup-login .block-content .note-reg {
  color: var(--fm-muted);
  font-size: 12.5px;
}

.block-popup-login .block-content .list-log {
  margin-top: 12px;
}

.block-popup-login .block-content .list-log li,
.rtl .block-popup-login .block-content .list-log li {
  padding: 5px 20px 5px 0;
  color: #556965;
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.8;
}

.block-popup-login .block-content .list-log li:before,
.rtl .block-popup-login .block-content .list-log li:before {
  top: 13px;
  right: 3px;
  left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fm-primary);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination.nav-pag,
.woocommerce nav.woocommerce-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: 28px 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.pagination.nav-pag .count-item-perpage {
  float: none !important;
  color: var(--fm-muted);
  font-size: 12px;
}

.pagination.nav-pag ul,
.woocommerce nav.woocommerce-pagination ul {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.pagination.nav-pag ul li,
.woocommerce nav.woocommerce-pagination ul li {
  float: none !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.pagination.nav-pag ul li a,
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 11px !important;
  border: 1px solid var(--fm-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #536762 !important;
  font-size: 12.5px;
  line-height: 38px !important;
  box-shadow: 0 3px 10px rgba(27, 69, 64, .035);
}

.pagination.nav-pag ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li a:hover {
  border-color: #b7d5ce !important;
  background: var(--fm-primary-soft) !important;
  color: var(--fm-primary) !important;
}

.pagination.nav-pag ul li.disabled a,
.pagination.nav-pag ul li.active a,
.woocommerce nav.woocommerce-pagination ul li span.current {
  border-color: var(--fm-primary) !important;
  background: var(--fm-primary) !important;
  color: #fff !important;
}

.pagination.nav-pag ul li.disabled.prev a,
.pagination.nav-pag ul li.disabled.next a {
  border-color: var(--fm-line) !important;
  background: var(--fm-surface-soft) !important;
  color: #a0aaa7 !important;
}

/* ==========================================================================
   Footer — restore the cleaner legacy composition, keep only palette accent
   ========================================================================== */
.footer {
  background: url('../assets/img/bg-footer.png') center center / cover no-repeat !important;
  color: #fff;
}

.footer:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(7, 16, 20, .24) !important;
  pointer-events: none;
}

.footer:after {
  display: none !important;
}

.footer .container,
.footer .copyright {
  position: relative;
  z-index: 1;
}

.footer .footer-top {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.footer .footer-top .widget,
.footer .footer-bottom .widget,
.footer .footer-top .widget_text {
  margin-bottom: 0 !important;
  padding-top: 35px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.footer .footer-top .widget .button-ver-menu {
  margin-bottom: 28px !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
}

.footer .footer-top .widget .button-ver-menu:after {
  bottom: -16px !important;
  width: 40px !important;
  border-radius: 0 !important;
  background: #64c3b6 !important;
}

/* The old footer had one emphasized contact panel rather than every widget
   being a floating card. Keep the emphasis inside the contact content only. */
.footer .footer-top .contact-footer {
  padding: 14px 18px 16px;
  background: rgba(22, 120, 111, .50);
}

.footer .footer-top .widget_nav_menu .menu li a,
.footer .footer-top .contact-footer ul li,
.footer .footer-top .contact-footer ul li span,
.footer .footer-top .contact-footer ul li a {
  color: rgba(255,255,255,.90) !important;
}

.footer .footer-bottom {
  padding-top: 19px !important;
  padding-bottom: 0 !important;
  border-top: 0 !important;
}

.footer .copyright {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(0,0,0,.12) !important;
}

.footer .copyright-text p {
  color: rgba(255,255,255,.74) !important;
}

/* ==========================================================================
   Responsive login/action safeguards
   ========================================================================== */
@media (max-width: 767px) {
  .block-popup-login .block-content {
    display: block;
    padding: 20px !important;
  }

  .block-popup-login .block-content .col-reg {
    width: 100% !important;
    min-height: 0;
  }

  .block-popup-login .block-content .col-reg.registered-account,
  .rtl .block-popup-login .block-content .col-reg.registered-account {
    padding: 0 0 20px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--fm-line) !important;
  }

  .block-popup-login .block-content .col-reg.login-customer,
  .rtl .block-popup-login .block-content .col-reg.login-customer {
    padding: 20px 0 0 !important;
  }

  .item-bottom {
    gap: 6px;
    padding: 9px 10px !important;
  }

  .item-bottom .compare-button,
  .item-bottom .yith-wcwl-add-to-wishlist {
    flex-basis: 40px;
    width: 40px !important;
  }

  .pagination.nav-pag {
    flex-direction: column;
  }
}
