.wgf-calculator,
.wgf-filters,
.wgf-products {
  display: block;
  width: 100%;
}

.wgf-calculator form,
.wgf-filters form {
  display: block;
}

.wgf-calculator label,
.wgf-filters label {
  display: block;
  margin-bottom: 0.5rem;
}

.wgf-calculator select,
.wgf-filters select,
.wgf-calculator button,
.wgf-filters button {
  max-width: 100%;
}

.wgf-filter-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.wgf-filters__mobile-toggle,
.wgf-filters__backdrop {
  display: none;
}

[data-wgf-empty-state='true'] {
  margin: 0.25rem 0 0;
}

[data-wgf-auth-errors='true']:empty {
  display: none;
}

/* ===== Popup calculator states ===== */
#wgf-popup-intro,
#wgf-popup-wizard {
  opacity: 1;
}

#wgf-popup-intro.is-hidden,
#wgf-popup-wizard.is-hidden {
  display: none;
}

#wgf-popup-intro.is-fading-out {
  opacity: 0;
  transition: opacity 220ms ease;
}

#wgf-popup-intro.is-visible,
#wgf-popup-wizard.is-visible {
  display: block;
  animation: wgfFadeIn 280ms ease;
}

@keyframes wgfFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Products layout ===== */
.wgf-products__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.wgf-products__orderby {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

@media(max-width:767px){
  .wgf-products__orderby{
    margin-left: -6px
  }
}

.wgf-products__count,
.wgf-products__orderby label {
  margin: 0;
}

.wgf-products__orderby select {
  width: auto;
}

.wgf-products__list {
  display: grid;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.wgf-products__item {
  display: block;
  min-width: 0;
}

.wgf-products__item > * {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
}

.wgf-products--cols-1 .wgf-products__list { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.wgf-products--cols-2 .wgf-products__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wgf-products--cols-3 .wgf-products__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wgf-products--cols-4 .wgf-products__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wgf-products--cols-5 .wgf-products__list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.wgf-products--cols-6 .wgf-products__list { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .wgf-products__list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ===== Visual theme (your custom styles) ===== */
.wgf-filters h2 {
  color: #1364bf;
}

.wgf-calculator fieldset,
.wgf-filters fieldset {
  border: 0;
  margin: 0 0 40px !important;
  padding: 0;
}

.wgf-filters legend,
.wgf-calculator legend {
  box-sizing: border-box;
  color: #1364BF;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal;
  font-weight: 600;
  font-family: 'Golos Text';
  margin-bottom: 14px;
}

.wgf-filters fieldset span,
.wgf-calculator fieldset span {
  font-size: 14px;
  font-family: 'Golos Text';
  color: #1364BF;
}

.wgf-filters fieldset a,
.wgf-calculator fieldset a {
  color: #1364bf;
  font-size: 15px;
  font-family: 'Golos Text';
  font-weight: 600;
}

.wgf-filters fieldset a:hover,
.wgf-filters fieldset a[aria-current="page"],
.wgf-calculator fieldset a:hover,
.wgf-calculator fieldset a[aria-current="page"] {
  color: #72C2BA;
}

.wgf-filters button,
.wgf-calc-next,
.wgf-calc-back {
  background: #1364bf;
  color: #fff;
  font-family: 'Golos Text';
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  border: 1px solid #1364bf;
  border-radius: 0;
  cursor: pointer;
}

.wgf-filters button {
  margin-top: 25px;
  margin-right: 10px;
}

.wgf-calc-next,
.wgf-calc-back {
  margin-top: 25px;
}

.wgf-filters button:hover,
.wgf-calc-next:hover,
.wgf-calc-back:hover {
  background: #fff;
  color: #1364BF;
}

.wgf-filters button:focus,
.wgf-filters button:focus-visible,
.wgf-calc-next:focus,
.wgf-calc-next:focus-visible,
.wgf-calc-back:focus,
.wgf-calc-back:focus-visible {
  background: #fff;
  color: #1364BF;
}

.wgf-calc-form {
  position: relative;
  text-align: center;
}

.wgf-calc-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.wgf-calc-actions--inline {
  justify-content: flex-end;
}

.wgf-calc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wgf-calc-title {
  color: #72C2BA;
  font-size: 18px;
  font-weight: 600;
  font-family: 'Golos Text';
  text-align: center;
}

.wgf-calc-question {
  font-family: 'Golos Text';
  font-size: 33px;
  text-align: center;
  color: #1364BF;
  line-height: 1em;
  margin-bottom: 25px;
}

.wgf-calc-field-label {
  display: none !important;
}

.elementor-popup-modal .dialog-message {
  min-height: 410px;
}

select.wgf-calc-select {
  border: 1px solid #1364bf;
  border-radius: 0;
  color: #1364BF;
  font-family: 'Golos Text';
  font-size: 15px;
}

/* ===== Calculator inline mode ===== */
.wgf-calculator[data-context="inline"] .wgf-calc-form {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.wgf-calculator[data-context="inline"] .wgf-calc-title {
  font-size: 16px;
  margin-bottom: 10px;
}

.wgf-calculator[data-context="inline"] .wgf-calc-question {
  font-size: 26px;
  line-height: 1.15;
  margin-bottom: 18px;
}

.wgf-calculator[data-context="inline"] .wgf-calc-controls {
  margin-bottom: 6px;
}

.wgf-calculator[data-context="inline"] .wgf-calc-select {
  width: 100%;
  min-height: 44px;
}

.wgf-calculator[data-context="inline"] .wgf-calc-actions {
  justify-content: flex-end !important;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.wgf-calculator[data-context="inline"] .wgf-calc-next,
.wgf-calculator[data-context="inline"] .wgf-calc-back {
  margin-top: 0 !important;
  padding: 10px 18px;
  line-height: 1.1;
}

/* ===== Pagination ===== */
.wgf-products .page-numbers {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
}

.wgf-products .page-numbers li {
  margin: 0;
  padding: 0;
}

.wgf-products .page-numbers a,
.wgf-products .page-numbers span.current {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #1364BF;
  color: #1364BF;
  text-decoration: none;
  box-sizing: border-box;
  font-family: 'Golos Text', sans-serif;
  font-size: 14px;
  line-height: 1;
}

.wgf-products .page-numbers span.current {
  background: #1364BF;
  color: #fff;
  font-weight: 700;
}

.wgf-products .page-numbers a:hover {
  background: #1364BF;
  color: #fff;
}

.wgf-products .page-numbers a.prev,
.wgf-products .page-numbers a.next {
  width: auto;
  min-width: auto;
  height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  font-weight: 600;
}

.wgf-products .page-numbers a.prev:hover,
.wgf-products .page-numbers a.next:hover {
  color: #7fd1b9;
}

.wgf-products .page-numbers span.prev,
.wgf-products .page-numbers span.next {
  display: none;
}

.wgf-products .page-numbers .dots {
  border: 0;
  width: auto;
  min-width: auto;
  height: auto;
  padding: 0 4px;
}

/* ===== Toolbar details ===== */
#wgf-orderby,
.wgf-products__count {
  border: none !important;
  border-radius: 0 !important;
  padding: 0;
  color: #72C2BA;
  font-family: 'Golos Text';
  font-size: 13px;
}

/* ===== Mobile filters bottom sheet ===== */
@media (max-width: 768px) {
  .wgf-filters__mobile-toggle {
    position: static;
    z-index: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: #1364bf;
    color: #fff;
    font-family: 'Golos Text';
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid #1364bf;
    border-radius: 0;
    cursor: pointer;
    box-shadow: none;
  }

  .wgf-filters__mobile-toggle:hover,
  .wgf-filters__mobile-toggle:focus,
  .wgf-filters__mobile-toggle:focus-visible {
    background: #fff;
    color: #1364BF;
  }

  .wgf-filters {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    max-height: 82vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 30px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 220ms ease;
    pointer-events: none;
  }

  .wgf-filters.is-mobile-open {
    transform: translateY(0);
    pointer-events: auto;
  }

  .wgf-filters__backdrop.is-visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 997;
    background: rgba(0, 0, 0, 0.45);
  }

  body.wgf-filters-mobile-lock {
    overflow: hidden;
  }

  .wgf-products__toolbar {
    gap: 10px;
  }

  .wgf-products__list {
    grid-template-columns: repeat(var(--wgf-mobile-cols, 2), minmax(0, 1fr)) !important;
  }

  .wgf-products--mobile-cols-1 .wgf-products__list { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
  .wgf-products--mobile-cols-2 .wgf-products__list { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .wgf-products--mobile-cols-3 .wgf-products__list { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
