
.vmf-wrap {
  --vmf-blue: #00bcf1;
  --vmf-blue-dark: #009fcd;
  --vmf-dark: #102033;
  --vmf-muted: #64748b;
  --vmf-muted-2: #94a3b8;
  --vmf-border: rgba(15, 23, 42, .10);
  --vmf-soft: #f8fafc;
  --vmf-soft-2: #f1f5f9;
  --vmf-shadow: 0 18px 45px rgba(15, 23, 42, .10);
  --vmf-shadow-soft: 0 10px 24px rgba(15, 23, 42, .06);
  font-size: 14px;
}

.vmf-mobile-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 188, 241, .16);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f7fcff);
  color: var(--vmf-dark);
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.vmf-mobile-toggle::before {
  content: '☰';
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(0, 188, 241, .10);
  color: var(--vmf-blue-dark);
  font-size: 15px;
}

.vmf-mobile-toggle span {
  flex: 1;
  text-align: left;
}

.vmf-mobile-toggle em {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--vmf-blue), var(--vmf-blue-dark));
  color: #fff;
  font-style: normal;
  font-size: 12px;
  box-shadow: 0 8px 18px rgba(0, 188, 241, .25);
}

.vmf-panel {
  border: 1px solid var(--vmf-border);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  overflow: hidden;
  box-shadow: var(--vmf-shadow-soft);
}

.vmf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  background: linear-gradient(135deg, #ffffff, #f5fbff);
}

.vmf-panel-head strong {
  color: var(--vmf-dark);
  font-size: 15px;
  font-weight: 900;
}

.vmf-close {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--vmf-muted);
}

.vmf-active-bar {
  display: none;
  gap: 10px;
  padding: 12px 14px 0;
}

.vmf-active-bar.is-visible {
  display: grid;
}

.vmf-active-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vmf-active-line {
  padding: 8px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8f8ff, #f0fbff);
  color: #087ea4;
  font-weight: 800;
  font-size: 12px;
}

.vmf-clear-top {
  color: var(--vmf-muted);
  font-weight: 800;
  font-size: 12px;
  text-decoration: none !important;
}

.vmf-active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vmf-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(0, 188, 241, .22);
  border-radius: 999px;
  background: #fff;
  color: var(--vmf-dark);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .04);
  cursor: pointer;
}

.vmf-tag strong {
  color: var(--vmf-blue-dark);
  font-weight: 900;
}

.vmf-tag span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--vmf-muted);
  font-size: 12px;
  line-height: 1;
}

.vmf-form {
  padding: 10px 14px 14px;
}

.vmf-filter {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.vmf-filter:last-of-type {
  border-bottom: 0;
}

.vmf-filter summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  color: var(--vmf-dark);
  font-size: 14px;
  font-weight: 900;
}

.vmf-filter summary::-webkit-details-marker {
  display: none;
}

.vmf-filter summary::after {
  content: '+';
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--vmf-soft);
  color: var(--vmf-muted);
  font-weight: 900;
}

.vmf-filter[open] summary::after {
  content: '–';
  background: rgba(0, 188, 241, .11);
  color: var(--vmf-blue-dark);
}

.vmf-select {
  width: 100%;
  margin-top: 10px;
  min-height: 42px;
  border-radius: 13px !important;
  border-color: #d8e1ea !important;
  background: #fff;
}

.vmf-checks {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.vmf-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 12px;
  transition: background .15s ease, border-color .15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.vmf-check:hover {
  background: var(--vmf-soft);
  border-color: rgba(0, 188, 241, .10);
}

.vmf-check input {
  margin: 0;
}

.vmf-check span {
  flex: 1;
  color: #334155;
}

.vmf-check em {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-style: normal;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.vmf-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.vmf-pill {
  position: relative;
  cursor: pointer;
}

.vmf-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vmf-pill span {
  display: inline-flex;
  padding: 8px 11px;
  border: 1px solid #d8e1ea;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  font-size: 12px;
  transition: all .15s ease;
}

.vmf-pill:hover span,
.vmf-pill.is-active span,
.vmf-pill input:checked + span {
  border-color: var(--vmf-blue);
  background: #e8f8ff;
  color: #087ea4;
  box-shadow: 0 6px 14px rgba(0, 188, 241, .12);
}

.vmf-range {
  margin-top: 12px;
  padding: 10px 12px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fcfdff, #f8fbff);
  border: 1px solid rgba(15, 23, 42, .06);
}

.vmf-range-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--vmf-dark);
}

.vmf-range-values--editable {
  align-items: center;
}

.vmf-range-value-box {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.vmf-range-value-box input {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid #d8e1ea !important;
  border-radius: 13px !important;
  background: #fff;
  color: var(--vmf-dark);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  font-size: 14px;
  font-weight: 900;
  line-height: 42px;
}

.vmf-range-value-box input:focus {
  outline: none;
  border-color: var(--vmf-blue) !important;
  box-shadow: 0 0 0 3px rgba(0, 188, 241, .14);
}

.vmf-range-value-box em {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--vmf-muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.vmf-range-separator {
  flex: 0 0 auto;
  color: var(--vmf-muted);
  font-weight: 900;
}

.vmf-range-sliders {
  position: relative;
  height: 30px;
  margin: 2px 0 4px;
}

.vmf-range-sliders input[type='range'] {
  position: absolute;
  left: 0;
  top: 7px;
  width: 100%;
  height: 18px;
  margin: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  z-index: 3;
}

.vmf-range-sliders input[type='range']::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--vmf-blue);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
  cursor: pointer;
}

.vmf-range-sliders input[type='range']::-moz-range-thumb {
  pointer-events: auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--vmf-blue);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
  cursor: pointer;
}

.vmf-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  z-index: 1;
}

.vmf-range-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--vmf-blue), var(--vmf-blue-dark));
}

.vmf-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.vmf-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--vmf-dark), #1a2d44);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}

.vmf-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--vmf-shadow);
}

.vmf-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 13px;
  background: var(--vmf-soft);
  color: #64748b;
  font-weight: 800;
  text-decoration: none !important;
}

.vmf-overlay {
  display: none;
}

@media (max-width: 849px) {
  .vmf-mobile-toggle {
    display: flex;
  }

  .vmf-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 0;
    top: auto;
    z-index: 99999;
    width: auto;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(105%);
    transition: transform .22s ease;
    overflow: auto;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, .14);
  }

  .vmf-wrap.is-open .vmf-panel {
    transform: translateY(0);
  }

  .vmf-panel-head {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, .94);
  }

  .vmf-close {
    display: block;
  }

  .vmf-form {
    padding-bottom: 88px;
  }

  .vmf-actions {
    position: sticky;
    bottom: 0;
    padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.98) 26%, #fff 100%);
  }

  .vmf-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(2px);
  }

  .vmf-wrap.is-open .vmf-overlay {
    display: block;
  }

  html.vmf-lock,
  html.vmf-lock body {
    overflow: hidden;
  }
}

.vmf-admin-empty {
  padding: 12px 14px;
  margin: 10px 0;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.45;
}

.vmf-products-loading {
  position: relative;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.vmf-wrap.is-loading .vmf-submit {
  position: relative;
  opacity: 0.75;
  pointer-events: none;
}

.vmf-wrap.is-loading .vmf-submit::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  animation: vmf-spin 0.7s linear infinite;
}

@keyframes vmf-spin {
  to { transform: rotate(360deg); }
}


/* =========================================================
   VMF 3.7 - Värit, tuotelistan tagit ja mobiilin sticky-nappi
   ========================================================= */

.vmf-filter-colour .vmf-pills {
  gap: 9px;
}

.vmf-filter-colour .vmf-pill span {
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 8px;
}

.vmf-swatch,
.vmf-tag-swatch {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 999px;
  background: var(--vmf-swatch, #cbd5e1);
  border: 1px solid rgba(15, 23, 42, .16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 1px 3px rgba(15, 23, 42, .12);
}

.vmf-product-active-tags {
  display: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(0,188,241,.16);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f7fcff);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.vmf-product-active-tags.is-visible {
  display: block;
}

.vmf-product-active-tags__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.vmf-product-active-tags__head strong {
  color: var(--vmf-dark, #102033);
  font-size: 14px;
  font-weight: 900;
}

.vmf-product-active-tags__clear {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.vmf-product-active-tags__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vmf-product-active-tags .vmf-tag {
  background: #fff;
}

@media (max-width: 849px) {
  .vmf-mobile-toggle {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 99990;
    width: auto;
    max-width: none;
    margin: 0;
    min-height: 54px;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
  }

  .vmf-wrap.is-open .vmf-mobile-toggle {
    display: none;
  }

  body.woocommerce-shop,
  body.archive.woocommerce,
  body.tax-product_cat {
    padding-bottom: 82px;
  }

  .vmf-product-active-tags {
    margin: 0 0 14px;
    padding: 12px;
    border-radius: 16px;
  }
}


/* VMF 3.8 - Avaa suoraan mobiilin Suodata-napista */
@media (max-width: 849px) {
  .vmf-panel {
    overscroll-behavior: contain;
  }
}


/* VMF 3.9 - Piilota teeman oma mobiili-Suodata, jätä vain Vanhamikko Filtterin sticky-nappi */
@media (max-width: 849px) {
  /* Flatsome / UX Builder shop toolbar filter button */
  .shop-page-title .filter-button,
  .category-page-title .filter-button,
  .woocommerce .filter-button,
  .shop-container .filter-button,
  .page-title-inner .filter-button,
  .page-title .filter-button,
  .flex-col .filter-button,
  a.filter-button,
  button.filter-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Jos teema tekee Suodata-linkin ilman filter-button-luokkaa, piilotetaan equalizer-ikonia käyttävä shop-toolbar-linkki. */
  .shop-page-title a:has(.icon-equalizer),
  .category-page-title a:has(.icon-equalizer),
  .page-title-inner a:has(.icon-equalizer),
  .woocommerce a:has(.icon-equalizer) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Varmistetaan, että Vanhamikko Filtterin oma nappi ei piiloudu. */
  .vmf-wrap .vmf-mobile-toggle {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
}


/* VMF 3.10 - älä käytä teeman omaa Suodata-nappia mobiilissa */
@media (max-width: 849px) {
  a.filter-button,
  button.filter-button,
  .filter-button,
  .shop-page-title a.filter-button,
  .category-page-title a.filter-button,
  .page-title-inner a.filter-button,
  .woocommerce a.filter-button,
  .shop-container a.filter-button,
  .flex-col a.filter-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .vmf-wrap .vmf-mobile-toggle {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
}


/* VMF 3.11 - oma mobiili-Suodattimet-nappi + verkkokauppa.com-tyylinen paneeli */
@media (max-width: 849px) {
  /* Piilotetaan teeman oma Suodata, koska se voi avata Flatsomen oman offcanvasin ja jumittaa sivun. */
  a.filter-button,
  button.filter-button,
  .filter-button,
  .shop-page-title a:has(.icon-equalizer),
  .category-page-title a:has(.icon-equalizer),
  .page-title-inner a:has(.icon-equalizer),
  .woocommerce a:has(.icon-equalizer) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .vmf-wrap.vmf-mounted-to-body {
    display: block !important;
    visibility: visible !important;
  }

  .vmf-wrap .vmf-mobile-toggle {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    z-index: 99990 !important;
    width: auto !important;
    min-width: 178px !important;
    max-width: calc(100vw - 28px) !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 2px solid #1d64f2 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #1d64f2 !important;
    font-weight: 900 !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .22) !important;
  }

  .vmf-wrap .vmf-mobile-toggle::before {
    content: '≡' !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #1d64f2 !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }

  .vmf-wrap .vmf-mobile-toggle span {
    flex: 0 0 auto !important;
    text-align: center !important;
  }

  .vmf-wrap .vmf-mobile-toggle em {
    background: #1d64f2 !important;
    box-shadow: none !important;
  }

  .vmf-wrap.is-open .vmf-mobile-toggle {
    display: none !important;
  }

  .vmf-panel {
    position: fixed !important;
    top: 24px !important;
    left: 50% !important;
    right: auto !important;
    bottom: 24px !important;
    width: min(420px, calc(100vw - 32px)) !important;
    max-height: none !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    background: #fff !important;
    transform: translate(-50%, 18px) scale(.98) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: auto !important;
    box-shadow: 0 20px 70px rgba(0,0,0,.35) !important;
    transition: opacity .18s ease, transform .18s ease !important;
  }

  .vmf-wrap.is-open .vmf-panel {
    transform: translate(-50%, 0) scale(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .vmf-panel-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    min-height: 58px !important;
    padding: 0 16px !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(15,23,42,.14) !important;
  }

  .vmf-panel-head strong {
    font-size: 16px !important;
  }

  .vmf-close {
    display: grid !important;
    place-items: center !important;
    background: transparent !important;
    color: #111827 !important;
    font-size: 22px !important;
  }

  .vmf-actions {
    position: sticky !important;
    bottom: 0 !important;
    display: grid !important;
    grid-template-columns: 96px 1fr !important;
    gap: 12px !important;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    margin: 0 -14px -14px !important;
    background: rgba(255,255,255,.96) !important;
    border-top: 1px solid rgba(15,23,42,.12) !important;
    backdrop-filter: blur(10px) !important;
  }

  .vmf-actions .vmf-clear {
    order: 1 !important;
    min-height: 44px !important;
    border: 1px solid #d1d5db !important;
    background: #fff !important;
    color: #9ca3af !important;
    border-radius: 999px !important;
  }

  .vmf-actions .vmf-submit {
    order: 2 !important;
    min-height: 44px !important;
    border-radius: 999px !important;
    background: #1d64f2 !important;
    color: #fff !important;
  }

  .vmf-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99998 !important;
    background: rgba(0,0,0,.72) !important;
    backdrop-filter: none !important;
  }

  .vmf-wrap.is-open .vmf-overlay {
    display: block !important;
  }

  body.woocommerce-shop,
  body.archive.woocommerce,
  body.tax-product_cat {
    padding-bottom: 76px !important;
  }
}
