/*
  Global styles и Widget филтър (WOOF)
  Разделих основните глобални правила от style.css тук за по-добра структура.
  Коментари и имена на секциите са на български за лесна поддръжка.
*/

/* =========================================================
   1. GLOBAL / TYPOGRAPHY / ACCESSIBILITY (част)
   (първоначални визуални настройки и widget sidebar)
========================================================= */



/* =========================================================
   8. FILTER SIDEBAR (WOOF)
========================================================= */

#secondary.widget-area {
  position: sticky;
  top: 24px;
}

#secondary .widget,
#secondary .widget-woof {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  border-radius: 18px;
  border: 1px solid rgba(0, 118, 255, 0.12);
  box-shadow: 0 18px 34px rgba(0, 78, 255, 0.08);
  padding: 18px 16px;
}

#secondary .widget-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f1f3d;
  display: flex;
  align-items: center;
  gap: 10px;
}

#secondary .widget-title::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0a6cff 0%, #ff9a00 100%);
  box-shadow: 0 6px 12px rgba(0, 118, 255, 0.2);
}

.widget-woof .woof_container_inner > h4 {
  font-size: 0.86rem;
  font-weight: 700;
  margin: 16px 0 10px;
  color: #1f2430;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-woof .woof_container_inner > h4 .woof_front_toggle {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eaf2ff;
  border: 1px solid rgba(0, 118, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0a6cff;
}

.widget-woof .woof_container {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 12px 24px rgba(31, 36, 48, 0.06);
}

.widget-woof .woof_price3_search_container .irs-line {
  background: #dfe8ff;
  border-radius: 999px;
  height: 8px;
}

.widget-woof .woof_price3_search_container .irs-bar {
  background: linear-gradient(90deg, #0a6cff, #ff9a00);
  height: 8px;
  border-radius: 999px;
}

.widget-woof .woof_price3_search_container .irs-handle {
  top: 18px;
}

.widget-woof .woof_price3_search_container .irs-handle i {
  background: #ffffff;
  border: 2px solid #0a6cff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 6px 12px rgba(0, 118, 255, 0.2);
}

.widget-woof .woof_price3_search_container .irs-from,
.widget-woof .woof_price3_search_container .irs-to {
  background: #0a6cff;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  padding: 2px 6px;
}

.widget-woof .woof_price3_search_container .irs-grid-text {
  color: #6a7384;
  font-size: 11px;
}

.widget-woof .woof_husky_txt-input {
  border-radius: 12px;
  border: 1px solid rgba(0, 118, 255, 0.2);
  background: #f7f9ff;
  padding: 10px 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

.widget-woof .woof_list li {
  padding: 8px 6px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.widget-woof .woof_list li:hover {
  background: #f3f7ff;
  transform: translateX(2px);
}

.widget-woof .woof_radio_label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #1f2430;
}

.widget-woof .woof_radio_count {
  color: #6a7384;
  font-weight: 600;
  font-size: 0.78rem;
}

/* Fix for currency symbol issues */
.woocommerce-Price-currencySymbol,
.amount-cart {
  font-family: "Source Sans Pro", "HelveticaNeue-Light", "Helvetica Neue Light",
               "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
}

/* =========================================================
   9. FILTER POPUP (ARCHIVE)
========================================================= */

body.esf-filter-popup-ready #secondary.widget-area,
body.esf-filter-popup-ready .page-grid > aside.widget-area,
body.esf-filter-popup-ready .page-grid > .widget-area {
  visibility: hidden !important;
  pointer-events: none !important;
}

.esf-filter-trigger {
  position: static;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #da2f2f;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 10001;
  margin-left: 10px;
  vertical-align: middle;
}

.esf-filter-trigger:hover {
  transform: translateY(-1px);
}

body.esf-filter-trigger-docked .esf-filter-trigger {
  position: fixed;
  left: auto;
  right: 8px;
  top: 90%;
  bottom: auto;
  margin-left: 0;
  transform: translateY(-50%);
}

body.esf-filter-trigger-docked .esf-filter-trigger:hover {
  transform: translateY(calc(-50% - 1px));
}

.esf-filter-trigger.is-active {
  background: #2f3a4a;
}

.esf-filter-trigger-icon {
  line-height: 1;
  display: inline-flex;
}

.esf-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.esf-filter-modal.is-open {
  display: block;
}

.esf-filter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 24, 0.45);
}

.esf-filter-modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(50vw, 760px);
  max-width: 92vw;
  max-height: 90vh;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}

.esf-filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.esf-filter-modal-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.esf-filter-modal-close {
  border: 0;
  background: transparent;
  color: #e11d48;
  width: auto;
  height: auto;
  border-radius: 0;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
}

.esf-filter-modal-close:hover {
  background: transparent;
  color: #be123c;
}

.esf-filter-modal-body {
  padding: 12px;
  overflow: auto;
  max-height: calc(90vh - 62px);
}

body.esf-filter-popup-enabled .esf-filter-modal-body #secondary.widget-area {
  display: block !important;
  position: static;
  top: auto;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body.esf-filter-popup-enabled .esf-filter-modal-body .widget,
body.esf-filter-popup-enabled .esf-filter-modal-body .widget-woof,
body.esf-filter-popup-enabled .esf-filter-modal-body .woof,
body.esf-filter-popup-enabled .esf-filter-modal-body .woof_sid_auto_shortcode,
body.esf-filter-popup-enabled .esf-filter-modal-body .woof_redraw_zone,
body.esf-filter-popup-enabled .esf-filter-modal-body .woof_container,
body.esf-filter-popup-enabled .esf-filter-modal-body .woof_container_inner {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  display: block !important;
}

.esf-filter-modal-body #secondary .widget,
.esf-filter-modal-body #secondary .widget-woof {
  margin-bottom: 10px;
}

body.esf-filter-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .esf-filter-modal-dialog {
    top: 1.5vh;
    left: 1.5vw;
    width: 97vw;
    max-width: none;
    max-height: 97vh;
    transform: none;
    border-radius: 10px;
  }

  .esf-filter-modal-body {
    max-height: calc(97vh - 62px);
  }
}

/* Fallback: if trigger stays outside result count wrapper, keep old floating behavior */
body.esf-filter-trigger-floating .esf-filter-trigger {
  position: fixed;
  left: 18px;
  top: 170px;
  margin-left: 0;
}

@media (max-width: 768px) {
  body.esf-filter-trigger-docked .esf-filter-trigger {
    top: auto;
    right: 54px;
    bottom: 25px;
    transform: none;
  }

  body.esf-filter-trigger-floating .esf-filter-trigger {
    top: auto;
    bottom: 18px;
    left: auto;
    right: 16px;
  }
}

/* Force dark hover/focus button theme (prevent yellow states) */
.single-product .summary.entry-summary .cart button:hover,
.single-product .summary.entry-summary .cart button:focus,
.widget .price_slider_amount button:hover,
.widget .price_slider_amount button:focus,
.woocommerce-product-search button:hover,
.woocommerce-product-search button:focus,
.woocommerce a.button:hover,
.woocommerce a.button:focus,
.woocommerce button.button:hover,
.woocommerce button.button:focus,
.summary .yith-wcwl-add-button a:hover,
.summary .yith-wcwl-add-button a:focus,
button:hover,
button:focus,
.widget.widget_block.widget_search form button:hover,
.widget.widget_block.widget_search form button:focus,
.header-search-form .search-form input[type="submit"]:hover,
.header-search-form .search-form input[type="submit"]:focus,
.tabbed_product_widget .product-tab-list .tabmenu:hover,
.tabbed_product_widget .product-tab-list .tabmenu:focus {
  background-color: #0e0e0c !important;
  color: #fff !important;
}
