/* ══════════════════════════════════════
   FLYOUT HEADER (replaces old header)
   ══════════════════════════════════════ */
@media (max-width: 1024px) {

  /* Hide FacetWP's default close button */
  .facetwp-flyout-close { display: none !important; }

  /* Header bar */
  .facetwp-flyout-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    background: inherit;
    border-bottom: 1px solid #E6E6E6;
  }

  .facetwp-flyout-header__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: #1F1F1F;
  }

  .facetwp-flyout-header__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #FAFAFA;
    border: 1px solid #E6E6E6;
    font-size: 15px;
    line-height: 1;
    color: #666;
    cursor: pointer;
  }

  .facetwp-flyout-header__btn:active {
    background: #eee;
  }

  /* ══════════════════════════════════════
     STICKY CTA BUTTON AT BOTTOM
     ══════════════════════════════════════ */
  .facetwp-flyout-cta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #E6E6E6;
    z-index: 10;
  }

  .facetwp-flyout-cta__btn {
    display: block;
    width: 100%;
    padding: 14px 0;
    background: #C8A96E;
    color: #0D0B09;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .facetwp-flyout-cta__btn:active {
    opacity: 0.85;
  }

  /* Add bottom padding to flyout inner so content
     doesn't get hidden behind the sticky CTA */
  .facetwp-flyout.has-flyout-header .facetwp-flyout-wrap {
    padding-bottom: 80px;
  }
}


/***********************
  FacetWP – Modern UI Pack
  Targets: slider, search, reset, checkboxes
  Scope: Woo product archive / product category templates
***********************/
body.post-type-archive,
body.tax-product_cat,
body.product-category {
  /* Brand tokens — dark theme */
  --facet-accent: #C8A96E;
  --facet-accent-dim: #8B7A55;
  --facet-accent-contrast: #0D0B09;
  --facet-track: #2A2520;
  --facet-bg: #0D0B09;
  --facet-bg-soft: #161311;
  --facet-text: #F0E6D3;
  --facet-muted: #8B7A55;
  --facet-border: #2A2520;
  --facet-border-light: #3A3530;
  --facet-radius: 10px;
  --facet-focus: 0 0 0 3px rgba(200, 169, 110, 0.25);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
}

/* ====== Facet containers / titles / spacing ====== */
body.post-type-archive .facetwp-facet,
body.tax-product_cat .facetwp-facet,
body.product-category .facetwp-facet { margin: 14px 0 0; }

body.post-type-archive .facetwp-facet .facetwp-facet-title,
body.tax-product_cat .facetwp-facet .facetwp-facet-title,
body.product-category .facetwp-facet .facetwp-facet-title {
  display: block;
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--facet-text);
  font-size: 0.95rem;
}

/* Optional: unify grid for facets inside sidebars/panels */
body.product-category .facet-group {
  display: grid;
  gap: 10px;
}

/* =========================================
   SLIDER facet (noUiSlider)
========================================= */
body.post-type-archive .facetwp-type-slider,
body.tax-product_cat .facetwp-type-slider,
body.product-category .facetwp-type-slider {
  --slider-h: 8px;
  --handle-size: 20px;
  --handle-ring: 2px;
  font-size: 18px;
}

body.post-type-archive .facetwp-type-slider .noUi-target,
body.tax-product_cat .facetwp-type-slider .noUi-target,
body.product-category .facetwp-type-slider .noUi-target {
  border: none; background: transparent; box-shadow: none; padding: 10px 2px;
}

body.post-type-archive .facetwp-type-slider .noUi-base,
body.tax-product_cat .facetwp-type-slider .noUi-base,
body.product-category .facetwp-type-slider .noUi-base,
body.post-type-archive .facetwp-type-slider .noUi-connects,
body.tax-product_cat .facetwp-type-slider .noUi-connects,
body.product-category .facetwp-type-slider .noUi-connects {
  height: var(--slider-h);
  border-radius: var(--facet-radius);
  background: var(--facet-track);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

body.post-type-archive .facetwp-type-slider .noUi-connect,
body.tax-product_cat .facetwp-type-slider .noUi-connect,
body.product-category .facetwp-type-slider .noUi-connect {
  background: linear-gradient(90deg, var(--facet-accent), color-mix(in srgb, var(--facet-accent), #000 12%));
  border-radius: var(--facet-radius);
}

body.post-type-archive .facetwp-type-slider .noUi-handle,
body.tax-product_cat .facetwp-type-slider .noUi-handle,
body.product-category .facetwp-type-slider .noUi-handle {
  width: var(--handle-size); height: var(--handle-size);
  top: calc((var(--slider-h) / 2) - (var(--handle-size) / 2));
  right: calc(var(--handle-size) / -2);
  border-radius: 50%;
  border: var(--handle-ring) solid var(--facet-accent);
  background: var(--facet-accent-contrast);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform .12s ease, box-shadow .12s ease;
}
body.post-type-archive .facetwp-type-slider .noUi-handle::before,
body.tax-product_cat .facetwp-type-slider .noUi-handle::before,
body.product-category .facetwp-type-slider .noUi-handle::before,
body.post-type-archive .facetwp-type-slider .noUi-handle::after,
body.tax-product_cat .facetwp-type-slider .noUi-handle::after,
body.product-category .facetwp-type-slider .noUi-handle::after { display: none; }

body.post-type-archive .facetwp-type-slider .noUi-handle:hover,
body.tax-product_cat .facetwp-type-slider .noUi-handle:hover,
body.product-category .facetwp-type-slider .noUi-handle:hover { transform: scale(1.04); }
body.post-type-archive .facetwp-type-slider .noUi-handle:focus-visible,
body.tax-product_cat .facetwp-type-slider .noUi-handle:focus-visible,
body.product-category .facetwp-type-slider .noUi-handle:focus-visible {
  outline: none; box-shadow: var(--facet-focus);
}

body.post-type-archive .facetwp-type-slider .noUi-active,
body.tax-product_cat .facetwp-type-slider .noUi-active,
body.product-category .facetwp-type-slider .noUi-active {
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--facet-accent), transparent 88%);
}

/* Labels under slider (min–max) */
body.post-type-archive .facetwp-type-slider .facetwp-slider-label,
body.tax-product_cat .facetwp-type-slider .facetwp-slider-label,
body.product-category .facetwp-type-slider .facetwp-slider-label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--facet-text);
}

/* Tooltips & pips (only if enabled) */
body.product-category .facetwp-type-slider .noUi-tooltip {
  background: #111827; color: #fff; border: 0; border-radius: 8px;
  padding: .25rem .5rem; font-size: .8rem; white-space: nowrap; box-shadow: var(--shadow-md);
}
.noUi-horizontal .noUi-tooltip { bottom: 130%; transform: translateY(-4px); }
body.product-category .facetwp-type-slider .noUi-pips { color: var(--facet-muted); }
body.product-category .facetwp-type-slider .noUi-marker { background: #cbd5e1; }
body.product-category .facetwp-type-slider .noUi-marker-large { height: 10px; }
body.product-category .facetwp-type-slider .noUi-value { font-size: .75rem; }

/* Disabled slider */
body.post-type-archive .facetwp-type-slider.facetwp-disabled,
body.tax-product_cat .facetwp-type-slider.facetwp-disabled,
body.product-category .facetwp-type-slider.facetwp-disabled { opacity: .55; cursor: not-allowed; }


/* =========================================
   SEARCH facet
========================================= */
body.post-type-archive .facetwp-type-search input[type="text"],
body.tax-product_cat .facetwp-type-search input[type="text"],
body.product-category .facetwp-type-search input[type="text"] {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--facet-border);
  border-radius: 10px;
  background: var(--facet-bg);
  color: var(--facet-text);
  font-size: .95rem;
  line-height: 1.2;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
body.product-category .facetwp-type-search input[type="text"]::placeholder { color: var(--facet-muted); }
body.product-category .facetwp-type-search input[type="text"]:focus {
  outline: none;
  border-color: var(--facet-accent);
  box-shadow: var(--facet-focus);
}

/* Optional: search with inline icon (if your theme injects one) */
body.product-category .facetwp-type-search .facetwp-input-wrap {
  position: relative;
}
body.product-category .facetwp-type-search .facetwp-input-wrap .icon {
  position: absolute; left: .6rem; top: 50%; transform: translateY(-50%);
  pointer-events: none; opacity: .6;
}

/* =========================================
   RESET facet
   (FacetWP reset is usually a link/button with .facetwp-reset)
========================================= */
body.post-type-archive .facetwp-reset,
body.tax-product_cat .facetwp-reset,
body.product-category .facetwp-reset {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .7rem;
  border-radius: 10px;
  background: var(--facet-bg-soft);
  color: var(--facet-accent-dim);
  text-decoration: none !important;
  border: 1px solid var(--facet-border);
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .05s ease, border-color .15s ease;
  cursor: pointer;
  width: 100%;
}
body.product-category .facetwp-reset:hover {
  background: #e8eef7;
  border-color: color-mix(in srgb, var(--facet-accent), #ffffff 65%);
}
body.product-category .facetwp-reset:active { transform: translateY(1px); }
body.product-category .facetwp-reset:focus-visible { outline: none; box-shadow: var(--facet-focus); }

/* =========================================
   CHECKBOX facet
========================================= */

/* Optional: scope to one facet only (replace stil with your facet name/slug) */
/* .facetwp-facet-stil .facetwp-checkbox { ... } */

/* ── Checkbox: remove FacetWP default image ── */
.facetwp-checkbox {
  background: none !important;
  position: relative;
  padding-left: 30px !important;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--facet-text);
  font-weight: 500;
  margin: 10px 0;
  cursor: pointer;
}

/* Unchecked circle */
.facetwp-checkbox::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  border: 2px solid var(--facet-border-light, #3A3530);
  border-radius: 50%;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease;
}

/* Checked: gold fill */
.facetwp-checkbox.checked::before {
  background: var(--facet-accent);
  border-color: var(--facet-accent);
}

/* Inner dot for checked state */
.facetwp-checkbox.checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--facet-accent-contrast, #0D0B09);
}

/* Hover */
.facetwp-checkbox:hover::before {
  border-color: var(--facet-accent-dim, #8B7A55);
}

.facetwp-checkbox:hover {
  color: #FAFAF8;
}

/* Hide counts */
.facetwp-counter {
  display: none !important;
}


/* 4 */
.facetwp-toggle {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--facet-accent-dim, #8B7A55);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 122, 85, 0.3);
  padding-bottom: 1px;
}

.facetwp-toggle:hover {
  color: var(--facet-accent);
  border-bottom-color: rgba(200, 169, 110, 0.4);
}

/* =========================================
   Active selections summary (chips) – optional
========================================= */
body.product-category .facetwp-selections { margin: .5rem 0 1rem; font-size: .95rem; }
body.product-category .facetwp-selections .facetwp-selection-value {
  display: inline-flex; align-items: center; gap: .4rem;
  margin: 0 .4rem .4rem 0;
  padding: .35rem .55rem;
  border-radius: 999px;
  background: var(--facet-bg-soft);
  border: 1px solid var(--facet-border);
}

/* =========================================
   Layout niceties
========================================= */
.woocommerce .widget-area .facetwp-facet { margin-bottom: 16px; }

.facetwp-input-wrap {
	width: 100%;
}

body.post-type-archive .facetwp-type-slider .noUi-target,
body.tax-product_cat .facetwp-type-slider .noUi-target,
body.product-category .facetwp-type-slider .noUi-target {
  padding: 10px 11px;
}

@media (max-width: 640px) {
  body.product-category .facetwp-type-slider { --slider-h: 10px; --handle-size: 24px; }
  body.product-category .facetwp-type-checkboxes { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .facetwp-flyout-wrap { padding: 0 10px; }
}

/* Promjena line break velicine */
body h3.facet-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--facet-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1 !important;
  margin-bottom: 10px;
}

/* Promjena margina na reset Facetu */
div.facetwp-facet.facetwp-facet-reset.facetwp-type-reset {
	margin-top: 0px;
}

/* Margine poslije svakog faceta (mobile) */
.flyout-row {
	margin-bottom: 10px;
}

/* Margine poslije svakog faceta (web) */
.wp-block-kadence-column .facetwp-filters :is(.facet-wrap, .facetwp-facet) {
	margin-bottom: 20px;
}


/* ══════════════════════════════════════
   FLYOUT – Dark Bottom Sheet Chrome
   ══════════════════════════════════════ */
@media (max-width: 1024px) {

  .facetwp-flyout { background: #0D0B09; }
  .facetwp-flyout .facetwp-flyout-wrap { background: #0D0B09; }
  .facetwp-flyout-close { display: none !important; }

  /* ── Header ── */
  .facetwp-flyout-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #0D0B09;
    border-bottom: 1px solid #2A2520;
  }

/*   .facetwp-flyout-header::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #3A3530;
  } */

  .facetwp-flyout-header__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: #FAFAF8;
  }

  .facetwp-flyout-header__right {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .facetwp-flyout-header__reset {
    background: none;
    border: none;
    padding: 0;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #8B7A55;
    cursor: pointer;
    letter-spacing: 0.02em;
  }

  .facetwp-flyout-header__reset:active { color: #C8A96E; }

  .facetwp-flyout-header__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #161311;
    border: 1px solid #2A2520;
    font-size: 15px;
    line-height: 1;
    color: #A89B8A;
    cursor: pointer;
  }

  .facetwp-flyout-header__btn:active { background: #1C1916; }

  /* ── Content area ── */
  .facetwp-flyout .facetwp-flyout-content {
    padding: 6px 20px 0;
  }

  .facetwp-flyout .flyout-row {
    padding: 14px 0;
    border-bottom: 1px solid #2A2520;
    margin-bottom: 0;
  }

  .facetwp-flyout .flyout-row:last-child { border-bottom: none; }

  /* Filter titles inside flyout */
  .facetwp-flyout .flyout-row h3 {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #8B7A55;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 4px;
    line-height: 1;
  }

  /* ── Slider title row (h3 + value side by side) ── */
  .facetwp-flyout .flyout-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
  }

  .facetwp-flyout .flyout-title-row h3 {
    margin: 0;
  }

  .facetwp-flyout .flyout-title-row .flyout-title-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: #F0E6D3;
    margin: 0;
  }

  /* Bottom padding for CTA */
  .facetwp-flyout .facetwp-flyout-wrap {
    padding-bottom: 80px;
  }

  /* Bigger slider handles for touch */
  .facetwp-flyout .facetwp-type-slider .noUi-handle {
    width: 26px !important;
    height: 26px !important;
  }

  /* ── Sticky CTA ── */
  .facetwp-flyout-cta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 20px;
    background: #0D0B09;
    border-top: 1px solid #2A2520;
    z-index: 10;
  }

  .facetwp-flyout-cta__btn {
    display: block;
    width: 100%;
    padding: 14px 0;
    background: #C8A96E;
    color: #0D0B09;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .facetwp-flyout-cta__btn:active { opacity: 0.85; }

  /* ── Overlay ── */
  .facetwp-overlay,
  .facetwp-flyout-overlay {
    background: rgba(0, 0, 0, 0.55) !important;
  }
	
  /* Hide original slider labels — our JS copies the text into flyout-title-value */
  .facetwp-flyout .flyout-item .facetwp-slider-label {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
	
  .facetwp-flyout-header__reset,
  .facetwp-flyout-header__reset:hover,
  .facetwp-flyout-header__reset:focus,
  .facetwp-flyout-header__reset:active {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #8B7A55 !important;
  }

  .facetwp-flyout-header__reset:active {
    color: #C8A96E !important;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.facetwp-flyout-header { transition: none; }
}
