/* ── WooGlobalFilters — Frontend CSS ──────────────────────────────────────
   All selectors are intentionally non-specific so Elementor's generated
   CSS (which includes the widget wrapper class) can override any value.
   ────────────────────────────────────────────────────────────────────── */

:root {
  --wglf-accent: #202020;
  --wglf-accent-hover: #494949;
  --wglf-border: #d0d5dd;
  --wglf-text: #303030;
  --wglf-muted: #6b7280;
  --wglf-bg-light: #f3f4f6;
  --wglf-radius: 6px;
  --wglf-transition: 0.18s ease;
}

/* ════════════════════════════════════════════════════════════════════════
   FILTER FORM
   ════════════════════════════════════════════════════════════════════════ */

/* The form fills its parent column naturally — no width overrides needed.
   Only height is controlled so it does not stretch to match sibling columns. */
.wglf-filters,
.wbvf-filters {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px;
  color: var(--wglf-text);
  height: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 20px !important;
  box-sizing: border-box !important;
}

/* Only collapse HEIGHT on the widget wrapper — never touch width or align-self
   because that would shrink the Elementor column to min-content. */
.elementor-widget-wbvf-filter-widget,
.elementor-widget-wglf-filter-widget,
.elementor-widget-woobiavi-filters,
.elementor-widget-wbvf-filter-widget .elementor-widget-container,
.elementor-widget-wglf-filter-widget .elementor-widget-container,
.elementor-widget-woobiavi-filters .elementor-widget-container {
  height: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* ── Collapse column height to its own content ─────────────────────────────
   Setting align-self: flex-start on the COLUMN (flex item of the section row)
   only affects the cross-axis of the row = vertical direction.
   It does NOT collapse horizontal width — that is safe and correct.
   This stops the column from stretching to match the products-grid column.
   ─────────────────────────────────────────────────────────────────────────── */
.elementor-column:has(.wglf-filters),
.elementor-column:has(.wbvf-filters),
.e-con:has(.wglf-filters),
.e-con:has(.wbvf-filters),
.e-child:has(.wglf-filters),
.e-child:has(.wbvf-filters) {
  align-self: flex-start !important;
}

/* ── Widget title ───────────────────────────────────────────────────────── */
.wglf-widget-title {
  margin: 0 0 12px;
  font-size: 1.05em;
  font-weight: 600;
  color: var(--wglf-text);
}

/* ── Filter group ───────────────────────────────────────────────────────── */
.wglf-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Collapsible state */
.wglf-filter-group.is-collapsed .wglf-group-options,
.wglf-filter-group.is-collapsed .wglf-search-wrapper {
  display: none !important;
}

.wglf-filter-group.is-collapsed .wglf-collapse-icon {
  transform: rotate(0deg);
}

/* ── Group label / header ───────────────────────────────────────────────── */
.wglf-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0 10px;
  border: none;
  border-bottom: 1px solid var(--wglf-border);
  background: none;
  font-size: inherit;
  font-weight: 600;
  color: var(--wglf-text);
  cursor: pointer;
  text-align: left;
  margin-bottom: 10px;
  transition: color var(--wglf-transition);
}

.wglf-group-label:hover {
  color: var(--wglf-accent);
}

.wglf-collapse-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
  user-select: none;
  transition: transform 0.2s ease;
}

/* ── Group options wrapper ──────────────────────────────────────────────── */
.wglf-group-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Modern minimal scrollbar for filter groups */
.wglf-group-options::-webkit-scrollbar {
  width: 5px;
}

.wglf-group-options::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.wglf-group-options::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.wglf-group-options::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── Color Swatches (VTEX Minimalist 4-Column Grid — Gray & White Palette) ── */
.wglf-group-options--swatches {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px 6px !important;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 2px !important;
  align-items: center;
  justify-items: center;
  box-sizing: border-box;
  width: 100%;
}

.wbvf-swatch-option {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}

.wbvf-swatch-option input[type="checkbox"] {
  display: none !important;
}

.wbvf-swatch-color {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  flex-shrink: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
  box-sizing: border-box !important;
}

.wbvf-swatch--light .wbvf-swatch-color {
  border: 1px solid #cbd5e1 !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wbvf-swatch-option:hover .wbvf-swatch-color {
  transform: scale(1.18) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), 0 3px 8px rgba(0, 0, 0, 0.15) !important;
}

.wbvf-swatch-option:has(input:checked) .wbvf-swatch-color,
.wbvf-swatch-option.is-checked .wbvf-swatch-color {
  transform: scale(1.15) !important;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #0f172a !important;
}

.wbvf-swatch-option.is-zero-count {
  opacity: 0.45;
  filter: grayscale(0.5);
}

/* VTEX Minimalist Swatch Count Badge — Crisp White & Dark Gray (No Blue!) */
.wbvf-swatch-count {
  position: absolute !important;
  top: -2px !important;
  right: 2px !important;
  margin: 0 !important;
  font-size: 9px !important;
  line-height: 1 !important;
  padding: 1px 4px !important;
  min-width: 11px !important;
  height: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  border: 1px solid #cbd5e1 !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  z-index: 2;
}

.wbvf-swatch-option:hover .wbvf-swatch-count {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

/* ── Individual option ──────────────────────────────────────────────────── */
.wglf-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  line-height: 1.4;
  transition: color var(--wglf-transition);
}

.wglf-filter-option span {
  flex: 1;
  color: var(--wglf-text);
  transition: color var(--wglf-transition);
}

.wglf-filter-option:hover span {
  color: var(--wglf-accent);
}

.wglf-filter-option:has(input:checked) span {
  color: var(--wglf-accent);
  font-weight: 600;
}

.wglf-filter-option input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--wglf-accent);
  cursor: pointer;
}

/* ── Term count badge ───────────────────────────────────────────────────── */
.wglf-term-count {
  margin-left: auto;
  font-size: 11px;
  font-style: normal;
  color: var(--wglf-muted);
  background: var(--wglf-bg-light);
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: background var(--wglf-transition), color var(--wglf-transition);
}

/* ── Button-style options ───────────────────────────────────────────────── */
.wglf-group-options--buttons {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 8px !important;
}

.wglf-filter-option--button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid var(--wglf-border);
  border-radius: var(--wglf-radius);
  background: #fff;
  cursor: pointer;
  transition: all var(--wglf-transition);
}

.wglf-filter-option--button input[type="checkbox"] {
  display: none !important;
  /* Hide checkbox */
}

.wglf-filter-option--button span {
  font-size: 13px;
  color: var(--wglf-text);
  font-weight: 400 !important;
}

.wglf-filter-option--button:hover {
  border-color: var(--wglf-accent);
  background: var(--wglf-bg-light);
}

.wglf-filter-option--button:has(input:checked) {
  background: var(--wglf-accent);
  border-color: var(--wglf-accent);
}

.wglf-filter-option--button:has(input:checked) span {
  color: #fff !important;
  font-weight: 500 !important;
}

/* ── Group search field ─────────────────────────────────────────────────── */
.wglf-search-wrapper {
  margin-bottom: 10px;
}

.wglf-group-search {
  width: 100%;
  padding: 6px 10px 6px 28px;
  border: 1px solid var(--wglf-border);
  border-radius: var(--wglf-radius);
  font-size: 13px;
  color: var(--wglf-text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 8px center;
  transition: border-color var(--wglf-transition);
  box-sizing: border-box;
}

.wglf-group-search:focus {
  border-color: var(--wglf-accent);
  outline: none;
}

/* ── Price range list ─────────────────────────────────────────────────────── */
.wglf-price-ranges {
  flex-direction: column;
  gap: 6px;
}

.wglf-price-range-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  line-height: 1.4;
  transition: color var(--wglf-transition);
}

.wglf-price-range-option input[type="radio"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--wglf-accent);
  cursor: pointer;
}

.wglf-price-range-option span {
  flex: 1;
  color: var(--wglf-text);
  transition: color var(--wglf-transition);
}

.wglf-price-range-option:hover span {
  color: var(--wglf-accent);
}

.wglf-price-range-option:has(input:checked) span {
  color: var(--wglf-accent);
  font-weight: 600;
}

/* ── "Más opciones" button ───────────────────────────────────────── */
.wglf-more-options-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--wglf-accent);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--wglf-transition);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wglf-more-options-btn:hover {
  color: var(--wglf-accent-hover);
}

.wglf-more-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}

/* ── Expanded extra options — scrollable container ────────────────── */
.wglf-group-options--more {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
  border-top: 1px solid var(--wglf-border);
  padding-top: 6px;
  margin-top: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--wglf-border) transparent;
}

.wglf-group-options--more::-webkit-scrollbar {
  width: 5px;
}

.wglf-group-options--more::-webkit-scrollbar-track {
  background: transparent;
}

.wglf-group-options--more::-webkit-scrollbar-thumb {
  background: var(--wglf-border);
  border-radius: 3px;
}

/* ── Clear filters button ───────────────────────────────────────────────── */
.wglf-clear-btn,
.wbvf-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 14px;
  margin-top: 4px;
  margin-bottom: 0 !important;
  border: 1px solid var(--wglf-border);
  border-radius: var(--wglf-radius);
  background: transparent;
  color: var(--wglf-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--wglf-transition), color var(--wglf-transition), border-color var(--wglf-transition);
}

.wglf-clear-btn:hover,
.wbvf-clear-btn:hover {
  background: var(--wglf-bg-light);
  color: var(--wglf-text);
  border-color: #9ca3af;
}

/* ════════════════════════════════════════════════════════════════════════
   PRODUCTS GRID
   ════════════════════════════════════════════════════════════════════════ */

.wglf-products-grid {
  min-height: 120px;
  transition: opacity 0.22s ease;
}

.wglf-products-grid.is-loading,
.products.is-loading {
  opacity: 0.4;
  pointer-events: none;
}

/* Force WooCommerce products list into CSS Grid
   Column count is controlled by Elementor's responsive columns control.
   These are fallback defaults. */
.wglf-products-grid ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Remove WooCommerce float/width overrides */
.wglf-products-grid ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  clear: none !important;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.wglf-empty {
  padding: 32px 16px;
  color: var(--wglf-muted);
  text-align: center;
  font-size: 14px;
}

/* ════════════════════════════════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════════════════════════════════ */

.wglf-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
}

.wglf-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--wglf-border);
  border-radius: var(--wglf-radius);
  background: #fff;
  color: var(--wglf-text);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--wglf-transition), color var(--wglf-transition), border-color var(--wglf-transition);
}

.wglf-page-btn:hover,
.wglf-page-btn.is-active {
  background: var(--wglf-accent);
  border-color: var(--wglf-accent);
  color: #fff;
}

/* ════════════════════════════════════════════════════════════════════════
   MOBILE TOGGLE & DRAWER
   ════════════════════════════════════════════════════════════════════════ */

.wglf-mobile-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--wglf-border);
  border-radius: var(--wglf-radius);
  background: #fff;
  color: var(--wglf-text);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--wglf-transition), border-color var(--wglf-transition);
}

.wglf-mobile-toggle:hover {
  background: var(--wglf-bg-light);
  border-color: #9ca3af;
}

/* ════════════════════════════════════════════════════════════════════════
   ELEMENTOR EDITOR — onboarding notice
   ════════════════════════════════════════════════════════════════════════ */

.wglf-editor-notice {
  padding: 24px 20px;
  border: 2px dashed #c0c7d0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

.wglf-notice-icon {
  font-size: 28px;
  display: block;
  text-align: center;
  margin-bottom: 10px;
}

.wglf-editor-notice p {
  margin: 0 0 8px;
  text-align: center;
}

.wglf-notice-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  text-align: left;
}

.wglf-notice-steps li {
  margin-bottom: 6px;
}

.wglf-notice-steps a {
  color: var(--wglf-accent);
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE — defaults (Elementor controls override per-widget)
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .wglf-products-grid ul.products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .wglf-mobile-toggle {
    display: inline-flex;
  }

  /* Slide-in drawer */
  .wglf-filters {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(85vw, 320px);
    background: #fff;
    padding: 24px 20px;
    border-right: 1px solid var(--wglf-border);
    transform: translateX(-105%);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    z-index: 99999;
    overflow-y: auto;
  }

  .wglf-filters.is-open {
    transform: translateX(0);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.15);
  }

  .wglf-products-grid ul.products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {

  .wbvf-products-grid ul.products,
  .wglf-products-grid ul.products {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   VTEX MODERN RETAIL STYLES & SHIMMER SKELETON
   ════════════════════════════════════════════════════════════════════════ */

/* Active Chips Bar */
.wbvf-active-chips-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
}

.wbvf-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wbvf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.wbvf-chip:hover {
  background: #334155;
}

.wbvf-chip-remove {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.wbvf-chip-remove:hover {
  color: #ffffff;
}

.wbvf-clear-all-chips {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  padding: 2px 6px;
}

.wbvf-clear-all-chips:hover {
  text-decoration: underline;
}

/* Context term indicator */
.wbvf-filter-option.is-context-term span,
.wglf-filter-option.is-context-term span {
  font-weight: 600;
  color: var(--wglf-accent);
}

/* Disabled option (0 count) */
.wbvf-filter-option.is-disabled,
.wglf-filter-option.is-disabled {
  opacity: 0.65;
  cursor: pointer;
}

/* Skeleton Shimmer Grid */
.wbvf-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.wbvf-skeleton-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wbvf-skeleton-img,
.wbvf-skeleton-title,
.wbvf-skeleton-price {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: wbvf-shimmer 1.5s infinite;
  border-radius: 6px;
}

.wbvf-skeleton-img {
  height: 180px;
  width: 100%;
}

.wbvf-skeleton-title {
  height: 16px;
  width: 75%;
}

.wbvf-skeleton-price {
  height: 14px;
  width: 40%;
}

@keyframes wbvf-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 768px) {
  .wbvf-skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .wbvf-skeleton-grid {
    grid-template-columns: 1fr;
  }
}