/* ============================================================================================================================
 * Tienda · interfaz del listado y de la ficha (22-oct-2026, revisión de Jorge en escaparate).
 * Hoja SIEMPRE la última (depende de fma-mobile). Solo proporciones y comportamiento: colores, tipografías y textos son los aprobados.
 *
 *  1. Anti-desborde sin romper «position: sticky» (la barra de filtros se queda a la vista)
 *  2. Migas de pan (listado y ficha)
 *  3. Cabecera del listado (título + buscador en una fila)
 *  4. Barra de filtros: grupos plegables, «Ver más», filtros aplicados, panel móvil
 *  5. Barra de orden + rejilla de tarjetas (2 / 3 / 4 / 5 columnas) + tarjeta compacta
 *  6. Ficha: migas fuera de la caja, consejo sin scroll interno
 * ========================================================================================================================== */

/* ── 1. Anti-desborde sin crear contenedores de scroll ───────────────────────────────────────────────────────────────
 * fma-ux.css pone «overflow-x: hidden !important» en html, body y los contenedores: eso los convierte en contenedores de scroll y
 * anula TODO «position: sticky» (la cabecera, la barra de filtros…). «clip» recorta igual el desborde horizontal pero no crea scroll. */
html:has(.fma-shop), body:has(.fma-shop), body:has(.fma-shop) #page, body:has(.fma-shop) .site,
body:has(.fma-shop) .woocommerce, body:has(.fma-shop) .woocommerce-page, .fma-shop, .fma-shop .container, .fma-shop__layout {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

/* La cabecera del tema está declarada «sticky» pero nunca se pegó (el overflow:hidden de arriba lo anulaba) y así es como se ve en toda la web
 * aprobada. Al quitar ese bloqueo se pegaría sola y taparía el principio de la barra de filtros: se deja como estaba, que se va con el scroll. */
body:has(.fma-shop) .site-header { position: relative !important; }

/* ── 2. Migas de pan ─────────────────────────────────────────────────────────────────────────────────────────────────── */
.fma-breadcrumb {
  display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 0 !important;
  list-style: none; margin: 0; padding: 0; min-width: 0; overflow: visible !important;
  font-size: .8125rem; line-height: 1.4; color: var(--c-grafito-soft, #4a554f);
}
.fma-breadcrumb__item {
  position: relative; display: block !important; flex: 0 0 auto; min-width: 0; margin: 0; padding: 0 0 0 20px !important;
  white-space: nowrap; font-weight: 400 !important; color: var(--c-grafito-soft, #4a554f) !important;
}
.fma-breadcrumb__item:first-child { padding-left: 0 !important; }
.fma-breadcrumb__item::after { content: none !important; display: none !important; }
/* separador: chevron «›» (máscara SVG con el color del texto; nítido a cualquier tamaño) */
.fma-breadcrumb__item + .fma-breadcrumb__item::before, .fma-chev::before {
  content: ''; position: absolute; left: 2px; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 0; background: currentColor; opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 6 15 12 9 18'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 6 15 12 9 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
.fma-breadcrumb__item a {
  display: inline-block; color: inherit !important; text-decoration: none !important; border-radius: 4px;
  transition: color .15s ease; margin: 0 !important; padding: 0 !important;
}
.fma-breadcrumb__item a:hover { color: var(--c-verde-botanico, #276b45) !important; text-decoration: underline !important; text-underline-offset: 3px; }
.fma-breadcrumb__item a:focus-visible { outline: 2px solid var(--c-verde-botanico, #276b45); outline-offset: 2px; }
/* la última (la página actual) no es un enlace: más oscura y, si no cabe, termina en «…» */
.fma-breadcrumb__item:last-child {
  flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis;
  color: var(--c-grafito, #1f2a24) !important; font-weight: 500 !important;
}
.fma-shop__breadcrumb, .fma-sp__breadcrumb { margin: 0 0 12px !important; overflow: visible !important; }
/* En móvil, una sola miga: «‹ Categoría» (el nivel anterior). Si solo hay una, esa. */
@media (max-width: 640px) {
  .fma-breadcrumb__item { display: none !important; }
  .fma-breadcrumb__item:nth-last-child(2), .fma-breadcrumb__item:only-child { display: block !important; padding-left: 0 !important; }
  .fma-breadcrumb__item:nth-last-child(2) a, .fma-breadcrumb__item:only-child a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 500; }
  .fma-breadcrumb__item:nth-last-child(2) a::before {
    content: ''; flex: none; width: 16px; height: 16px; margin: 0 -4px 0 -4px; background: currentColor; opacity: .6;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 6 9 12 15 18'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 6 9 12 15 18'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .fma-breadcrumb__item:nth-last-child(2)::before { content: none !important; display: none !important; }
  .fma-shop__breadcrumb, .fma-sp__breadcrumb { margin-bottom: 4px !important; }
}

/* ── 3. Cabecera del listado ─────────────────────────────────────────────────────────────────────────────────────────── */
.fma-shop { padding-top: 18px !important; padding-bottom: 48px !important; }
.fma-shop .container { max-width: 1440px !important; padding-left: 16px !important; padding-right: 16px !important; }
.fma-shop__top {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 460px); align-items: end; gap: 10px 28px;
  padding: 0 0 14px; margin: 0 0 18px; border-bottom: 2px solid var(--gold-light, #a9cdd8);
}
.fma-shop__header { margin: 0 !important; padding: 0 !important; border: 0 !important; min-width: 0; }
.fma-shop__title { font-size: clamp(1.55rem, 1.1rem + 1.3vw, 2.05rem) !important; line-height: 1.15 !important; margin: 0 !important; }
.fma-shop__top .fma-shop__search { margin: 0 !important; max-width: none !important; width: 100%; padding: 4px 4px 4px 16px; }
.fma-shop__top .fma-shop__search input[type="search"] { padding: 9px 0; border: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 0 !important; text-overflow: ellipsis; }
@media (max-width: 480px) { .fma-shop__search input[type="search"]::placeholder { font-size: 14px; } }
.fma-shop__top .fma-shop__search button { padding: 9px 18px; }
.fma-shop__desc { margin: 6px 0 0; font-size: .9rem; line-height: 1.5; color: var(--c-grafito-soft, #4a554f); max-width: 76ch; position: relative; }
.fma-shop__desc p { margin: 0 0 .5em; }
.fma-shop__desc.is-clamped { max-height: 3em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.fma-shop__desc-toggle { margin-top: 2px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--c-verde-botanico, #276b45); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .fma-shop__top { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-bottom: 10px; margin-bottom: 12px; }
  .fma-shop__top .fma-shop__search { order: 2; }
}

/* ── 4. Barra de filtros ─────────────────────────────────────────────────────────────────────────────────────────────── */
.fma-shop__layout { display: grid; gap: 28px; align-items: start; position: relative; }
.fma-sidebar {
  background: var(--white, #fff); border: 1px solid var(--c-linea, rgba(31,42,36,.1)); border-radius: 16px; box-shadow: none;
  padding: 0 !important; height: auto; min-width: 0;
}
.fma-sidebar__head { display: flex; align-items: center; justify-content: space-between; margin: 0 !important; padding: 14px 18px 10px !important; border: 0 !important; }
.fma-sidebar__heading { font-size: .95rem; }
.fma-sidebar__scroll { padding: 0 18px 8px; }

.fma-fgroup { border-top: 1px solid var(--c-linea, rgba(31,42,36,.1)); padding: 0; margin: 0; }
.fma-fgroup__sum {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 0; cursor: pointer; list-style: none;
  font-family: var(--font-heading, 'Cormorant Garamond', serif); font-size: .86rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--c-grafito, #1f2a24); user-select: none; border-radius: 8px;
}
.fma-fgroup__sum::-webkit-details-marker { display: none; }
.fma-fgroup__sum::marker { content: ''; }
.fma-fgroup__sum:hover { color: var(--c-verde-botanico, #276b45); }
.fma-fgroup__sum:focus-visible { outline: 2px solid var(--c-verde-botanico, #276b45); outline-offset: 2px; }
.fma-fgroup__title { flex: 1 1 auto; }
.fma-fgroup__badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-verde-botanico, #276b45); color: #fff;
  font-family: var(--font-body, Montserrat, sans-serif); font-size: .68rem; font-weight: 700; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center;
}
.fma-fgroup__chev { flex: none; color: var(--c-grafito-soft, #4a554f); transition: transform .18s ease; }
.fma-fgroup[open] > .fma-fgroup__sum .fma-fgroup__chev { transform: rotate(180deg); }
.fma-fgroup__body { padding: 0 0 12px; }

/* listas (categorías, marcas) */
.fma-fgroup .fma-filter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.fma-fgroup .fma-filter-list__item { display: block; margin: 0; padding: 0; }
.fma-fgroup .fma-filter-list__item > a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: auto; min-height: 34px; margin: 0 -8px; padding: 6px 8px;
  border-radius: 8px; font-size: .875rem; line-height: 1.25; color: var(--c-grafito-soft, #4a554f); text-decoration: none; background: none;
  transition: background .12s ease, color .12s ease;
}
.fma-fgroup .fma-filter-list__item > a:hover { background: color-mix(in srgb, var(--c-verde-botanico, #276b45) 8%, transparent); color: var(--c-verde-botanico, #276b45); }
.fma-fgroup .fma-filter-list__item > a:focus-visible { outline: 2px solid var(--c-verde-botanico, #276b45); outline-offset: -1px; }
.fma-fgroup .fma-filter-list__item.is-active > a {
  background: color-mix(in srgb, var(--c-verde-botanico, #276b45) 11%, transparent); color: var(--c-verde-botanico, #276b45); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--c-verde-botanico, #276b45);
}
/* las subcategorías de la activa NO son «activas» (el estilo antiguo del tema lo heredaba por descendencia) */
.fma-fgroup .fma-filter-list--sub .fma-filter-list__item:not(.is-active) > a { font-weight: 400; color: var(--c-grafito-soft, #4a554f); }
.fma-fgroup .fma-filter-list--sub .fma-filter-list__item:not(.is-active) > a:hover { color: var(--c-verde-botanico, #276b45); }
.fma-fgroup .fma-filter-list--sub .fma-filter-list__item:not(.is-active) > a .fma-filter-list__count { background: transparent; color: var(--c-grafito-soft, #4a554f); opacity: .75; font-weight: 500; }
.fma-fgroup .fma-filter-list__count {
  flex: none; min-width: 0; padding: 1px 7px; border-radius: 999px; background: transparent; color: var(--c-grafito-soft, #4a554f); opacity: .75; font-size: .72rem; font-weight: 500;
}
.fma-fgroup .fma-filter-list__item.is-active > a .fma-filter-list__count { background: var(--c-verde-botanico, #276b45); color: #fff; opacity: 1; font-weight: 600; }
.fma-fgroup .fma-filter-list__item--all > a { font-size: .82rem; color: var(--c-verde-botanico, #276b45); font-weight: 600; }
.fma-fgroup .fma-filter-list--sub { margin: 2px 0 4px 10px; padding-left: 6px; border-left: 1px solid var(--c-linea-strong, rgba(31,42,36,.18)); }
.fma-fgroup .fma-filter-list--sub .fma-filter-list__item > a { min-height: 30px; font-size: .84rem; }
.fma-fgroup .fma-filter-list--scroll { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; }

/* «Ver más / Ver menos» */
.fma-filter-more { margin: 4px 0 0; }
.fma-filter-more > summary {
  display: flex; align-items: center; min-height: 36px; padding: 4px 0; list-style: none; cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--c-verde-botanico, #276b45); border-radius: 6px;
}
.fma-filter-more > summary::-webkit-details-marker { display: none; }
.fma-filter-more > summary::marker { content: ''; }
.fma-filter-more > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.fma-filter-more > summary:focus-visible { outline: 2px solid var(--c-verde-botanico, #276b45); outline-offset: 2px; }
.fma-filter-more .fma-more-close { display: none; }
.fma-filter-more[open] > summary .fma-more-open { display: none; }
.fma-filter-more[open] > summary .fma-more-close { display: inline; }
.fma-fgroup__body:has(> .fma-filter-more--marcas[open]) > .fma-filter-list { display: none; }
.fma-fgroup__body:has(> .fma-filter-more--marcas[open]) > .fma-filter-more { margin-top: 0; }
.fma-brandsearch { display: block; margin: 2px 0 8px; }
.fma-brandsearch input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--c-linea-strong, rgba(31,42,36,.18)); border-radius: 10px; background: #fff;
  font: inherit; font-size: 16px; color: var(--c-grafito, #1f2a24);
}
.fma-brandsearch input:focus { outline: 0; border-color: var(--c-verde-botanico, #276b45); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-verde-botanico, #276b45) 14%, transparent); }
.fma-brand-empty { margin: 6px 0 0; font-size: .82rem; color: var(--c-grafito-soft, #4a554f); }

/* precio: rangos que se suman */
.fma-fgroup .fma-price-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.fma-fgroup .fma-price-chip {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--c-linea-strong, rgba(31,42,36,.18)); border-radius: 999px;
  background: #fff; font-size: .82rem; line-height: 1.2; color: var(--c-grafito-soft, #4a554f); text-decoration: none; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.fma-fgroup .fma-price-chip:hover { border-color: var(--c-verde-botanico, #276b45); color: var(--c-verde-botanico, #276b45); background: color-mix(in srgb, var(--c-verde-botanico, #276b45) 6%, #fff); }
.fma-fgroup .fma-price-chip:focus-visible { outline: 2px solid var(--c-verde-botanico, #276b45); outline-offset: 2px; }
.fma-fgroup .fma-price-chip.is-active { background: var(--c-verde-botanico, #276b45); border-color: var(--c-verde-botanico, #276b45); color: #fff; font-weight: 600; }

/* disponibilidad: casilla que es un enlace */
.fma-fgroup .fma-check { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0 -8px; padding: 4px 8px; border-radius: 8px; font-size: .875rem; color: var(--c-grafito-soft, #4a554f); text-decoration: none; cursor: pointer; }
.fma-fgroup .fma-check:hover { background: color-mix(in srgb, var(--c-verde-botanico, #276b45) 8%, transparent); color: var(--c-verde-botanico, #276b45); }
.fma-fgroup .fma-check:focus-visible { outline: 2px solid var(--c-verde-botanico, #276b45); outline-offset: -1px; }
.fma-check__box { flex: none; width: 18px; height: 18px; border: 1.5px solid var(--c-linea-strong, rgba(31,42,36,.3)); border-radius: 5px; background: #fff; position: relative; }
.fma-check.is-on .fma-check__box { background: var(--c-verde-botanico, #276b45); border-color: var(--c-verde-botanico, #276b45); }
.fma-check.is-on .fma-check__box::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fma-check.is-on { color: var(--c-verde-botanico, #276b45); font-weight: 600; }

/* bloque de confianza: pequeño y sin cajas de color */
.fma-sidebar-trust { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0 !important; padding: 14px 0 6px !important; border-top: 1px solid var(--c-linea, rgba(31,42,36,.1)) !important; }
.fma-sidebar-trust__item { display: flex; align-items: center; gap: 8px; padding: 0 !important; background: none !important; font-size: .78rem; color: var(--c-grafito-soft, #4a554f); }
.fma-sidebar-trust__item:hover { background: none !important; }
.fma-sidebar-trust__item svg { width: 15px !important; height: 15px !important; margin: 0 !important; color: var(--c-verde-botanico, #276b45) !important; flex: none; }

/* filtros aplicados (chips con «×») */
.fma-activos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 14px; }
.fma-activos__label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-grafito-soft, #4a554f); margin-right: 2px; }
.fma-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-height: 32px; padding: 4px 10px 4px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--c-verde-botanico, #276b45) 11%, #fff); border: 1px solid color-mix(in srgb, var(--c-verde-botanico, #276b45) 32%, transparent);
  color: var(--c-verde-botanico, #276b45); font-size: .82rem; font-weight: 600; line-height: 1.2; text-decoration: none; transition: background .12s ease, color .12s ease;
}
.fma-chip__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fma-chip svg { flex: none; opacity: .8; }
.fma-chip:hover { background: var(--c-verde-botanico, #276b45); color: #fff; }
.fma-chip:hover svg { opacity: 1; }
.fma-chip:focus-visible { outline: 2px solid var(--c-verde-botanico, #276b45); outline-offset: 2px; }
.fma-activos__clear { font-size: .82rem; font-weight: 600; color: var(--c-grafito-soft, #4a554f); text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; }
.fma-activos__clear:hover { color: var(--c-verde-botanico, #276b45); }
.fma-sidebar__scroll > .fma-activos { padding: 2px 0 12px; margin: 0; border-bottom: 1px solid var(--c-linea, rgba(31,42,36,.1)); }

/* — escritorio: columna lateral pegajosa; si es más alta que la pantalla, tiene su propio scroll — */
@media (min-width: 1025px) {
  .fma-shop__layout { grid-template-columns: 248px minmax(0, 1fr) !important; }
  .fma-sidebar {
    position: sticky !important; top: 16px !important; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
    transform: none !important; width: auto !important; left: auto !important; bottom: auto !important; z-index: 2; overflow: hidden;
  }
  .fma-sidebar__head { flex: none; }
  .fma-sidebar__close, .fma-sidebar__foot, .fma-sidebar-backdrop, .fma-filter-toggle { display: none !important; }
  .fma-sidebar__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--c-linea-strong, rgba(31,42,36,.25)) transparent; }
  .fma-sidebar__scroll > .fma-activos { display: none; }
}

/* — móvil y tableta: panel que se abre con «Filtrar» — */
@media (max-width: 1024px) {
  .fma-shop__layout { grid-template-columns: minmax(0, 1fr) !important; gap: 0; }
  .fma-sidebar {
    position: fixed !important; z-index: 10050 !important; top: 0 !important; bottom: 0 !important; left: 0 !important; width: min(90vw, 390px) !important;
    height: 100vh; height: 100dvh; max-height: none !important; display: flex; flex-direction: column; border: 0; border-radius: 0 18px 18px 0;
    box-shadow: 0 0 40px rgba(0,0,0,.25); transform: translateX(-104%) !important; visibility: hidden; overflow: hidden;
    transition: transform .26s cubic-bezier(.22,1,.36,1), visibility 0s linear .26s;
  }
  body.fma-sidebar-open .fma-sidebar { transform: none !important; visibility: visible; transition: transform .26s cubic-bezier(.22,1,.36,1), visibility 0s; }
  .fma-sidebar__head { flex: none; padding: 14px 16px 10px !important; border-bottom: 1px solid var(--c-linea, rgba(31,42,36,.1)) !important; }
  .fma-sidebar__close { display: inline-flex !important; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; }
  .fma-sidebar__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 16px 10px; }
  .fma-sidebar__foot {
    flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--c-linea, rgba(31,42,36,.1)); background: #fff;
  }
  .fma-sidebar__apply {
    flex: 1 1 auto; min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--c-verde-botanico, #276b45); color: #fff;
    font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
  }
  .fma-sidebar__apply:hover { background: var(--c-verde-botanico-dark, #1f5538); }
  .fma-sidebar__clear { flex: none; font-size: .85rem; font-weight: 600; color: var(--c-grafito-soft, #4a554f); text-decoration: underline; text-underline-offset: 3px; padding: 10px 2px; }
  .fma-sidebar-backdrop { display: block !important; position: fixed; inset: 0; z-index: 10040 !important; background: rgba(15,23,18,.5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.fma-sidebar-open .fma-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  html.fma-sidebar-open, html.fma-sidebar-open body { overflow: hidden !important; }
  .fma-fgroup__sum { min-height: 50px; }
  .fma-fgroup .fma-filter-list__item > a { min-height: 42px; }
  .fma-fgroup .fma-price-chip { min-height: 40px; padding: 8px 14px; }
  .fma-fgroup .fma-check { min-height: 44px; }
  .fma-filter-more > summary { min-height: 44px; }
  .fma-brandsearch input { height: 44px; }
  .fma-fgroup .fma-filter-list--scroll { max-height: 300px; }
  .fma-activos--main { margin: 0 0 10px; }
}

/* ── 5. Barra de orden, rejilla y tarjetas ───────────────────────────────────────────────────────────────────────────── */
.fma-shop__main { display: flex; flex-direction: column; gap: 14px !important; min-width: 0; }
.fma-shop__main > .fma-activos { margin: 0; }
.fma-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px !important; margin: 0 !important; border-bottom: 1px solid var(--c-linea, rgba(31,42,36,.1)) !important; flex-wrap: nowrap; }
.fma-toolbar__count { order: 1; margin-right: auto; font-size: .85rem; color: var(--c-grafito-soft, #4a554f); }
.fma-toolbar__count .woocommerce-result-count { margin: 0 !important; font-size: inherit !important; }
.fma-toolbar__sort { order: 2; width: auto; flex: none; margin: 0; }
.fma-toolbar__sort form { margin: 0 !important; }
.fma-toolbar__sort select { height: 40px; padding: 0 34px 0 14px; border-radius: 10px; font-size: .875rem; }
.fma-filter-toggle {
  order: 0; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px !important; margin: 0 !important;
  border: 0; border-radius: 12px !important; background: var(--c-verde-botanico, #276b45); color: #fff; font-family: inherit; font-size: .9rem !important; font-weight: 600; box-shadow: none !important; transform: none !important; cursor: pointer;
}
.fma-filter-toggle:hover { background: var(--c-verde-botanico-dark, #1f5538); }
.fma-filter-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-verde-botanico, #276b45) 35%, transparent); outline-offset: 2px; }
.fma-filter-toggle svg { width: 18px !important; height: 18px !important; flex: none; }
.fma-filter-toggle__n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff; color: var(--c-verde-botanico, #276b45); font-size: .75rem; font-weight: 700; }
@media (max-width: 1024px) {
  body .fma-toolbar { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 8px 10px !important; align-items: stretch; border-bottom: 0 !important; padding: 0 !important; margin: 0 0 2px !important; }
  body .fma-filter-toggle { display: inline-flex !important; grid-column: 1 !important; order: 0 !important; width: 100% !important; margin: 0 !important; min-height: 44px !important; padding: 0 16px !important; }
  body .fma-toolbar__sort { grid-column: 2 !important; order: 0 !important; max-width: none !important; width: 100% !important; margin: 0 !important; }
  body .fma-toolbar__sort form, body .fma-toolbar__sort .woocommerce-ordering { width: 100% !important; margin: 0 !important; }
  body .fma-toolbar__sort select { width: 100% !important; max-width: none !important; height: 44px !important; min-height: 0 !important; font-size: .85rem !important; }
  body .fma-toolbar__count { display: block !important; grid-column: 1 / -1 !important; order: 3 !important; margin: 0 !important; }
  body .fma-toolbar__count, body .fma-toolbar__count .woocommerce-result-count { font-size: .78rem !important; margin: 0 !important; opacity: 1 !important; }
}

/* rejilla: 2 col (≤599) · 3 (600-899) · 4 (900-1024) · 3 + barra (1025-1199) · 4 (1200-1359) · 5 (≥1360) */
body .fma-shop__main ul.products, body .fma-shop ul.products {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin: 0 0 24px !important; padding: 0 !important; list-style: none;
}
@media (min-width: 600px)  { body .fma-shop__main ul.products, body .fma-shop ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; } }
@media (min-width: 900px)  { body .fma-shop__main ul.products, body .fma-shop ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 14px !important; } }
@media (min-width: 1025px) { body .fma-shop__main ul.products, body .fma-shop ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (min-width: 1200px) { body .fma-shop__main ul.products, body .fma-shop ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (min-width: 1360px) { body .fma-shop__main ul.products, body .fma-shop ul.products { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; } }

/* tarjeta compacta (misma estética, menos tamaño) */
ul.products li.product.fma-card { border-radius: 12px; height: 100%; }
ul.products li.product.fma-card:hover { transform: none !important; box-shadow: 0 6px 18px rgba(31,42,36,.10); border-color: color-mix(in srgb, var(--c-verde-botanico, #276b45) 45%, transparent); }
/* sin «zoom» al pasar el ratón: reescalar la foto la volvía borrosa y hacía saltar la tarjeta al hacer scroll con el ratón encima */
.fma-card:hover .fma-card__img, ul.products li.product.fma-card:hover .fma-card__img { transform: none !important; }
.fma-card__img { transition: none; image-rendering: auto; }
.fma-card__image { background: #fff; }
@media (min-width: 769px) {
  ul.products li.product .fma-card__badges { top: 8px; left: 8px; gap: 4px; }
  ul.products li.product .fma-badge { padding: 2px 8px; font-size: .62rem; }
  ul.products li.product .fma-card__body { padding: 10px 12px 12px !important; gap: 4px !important; }
  ul.products li.product .fma-card__cat { font-size: .62rem !important; letter-spacing: .06em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  ul.products li.product h2.fma-card__title { font-size: .875rem !important; line-height: 1.32 !important; min-height: 2.64em; margin: 0 0 2px !important; }
  ul.products li.product .fma-card__price { margin: 2px 0 0; }
  ul.products li.product .fma-card__price .woocommerce-price-amount, ul.products li.product .fma-card__price ins { font-size: 1.05rem !important; }
  ul.products li.product .fma-card__price del .woocommerce-price-amount { font-size: .8rem !important; }
  ul.products li.product .fma-card__stock { font-size: .72rem; margin: 0; }
  ul.products li.product .fma-card__actions { padding: 8px 12px 12px; }
}
/* el título de 2 líneas reserva siempre su sitio: las tarjetas de una fila quedan alineadas */
/* (style.css daba a este h2 un padding de 16/16/4 px con !important: con la altura fija de 2 líneas solo se veía la primera) */
body ul.products li.product h2.fma-card__title {
  display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden !important;
  padding: 0 !important; min-height: 0 !important; max-height: none !important; height: 2.64em !important; box-sizing: border-box;
}
body ul.products li.product h2.fma-card__title a { display: inline !important; -webkit-line-clamp: unset !important; overflow: visible !important; }
ul.products li.product .fma-card__body { flex: 1 1 auto; }

/* ── 6. Ficha ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* migas fuera de la caja blanca (la plantilla las pone encima) */
.fma-sp__breadcrumb { max-width: none !important; margin: 0 0 12px !important; padding: 0 !important; }
.single-product .fma-single { padding-top: 14px !important; }
.single-product div.product.fma-sp { padding-top: 28px; }
/* miniaturas de la galería: una sola fila (6) en escritorio; en móvil, una tira que se desliza (antes 2 filas con una miniatura suelta) */
.fma-gallery__thumbs { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 8px !important; margin-top: 10px !important; }
@media (max-width: 768px) {
  .single-product div.product.fma-sp { padding-top: 16px; }
  .fma-gallery__thumbs { display: flex !important; overflow-x: auto; gap: 8px !important; padding-bottom: 4px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .fma-gallery__thumbs::-webkit-scrollbar { display: none; }
  .fma-gallery__thumbs li { flex: 0 0 64px; scroll-snap-align: start; }
}
/* consejo farmacéutico: ya no es una caja pegajosa con scroll interno (atrapaba la rueda del ratón y el dedo, y en portátiles bajos se cortaba) */
body .fma-consejo { position: static !important; top: auto !important; }
body .fma-consejo__body { max-height: none !important; height: auto !important; overflow: visible !important; padding-right: 0 !important; }
/* la última tarjeta de la ficha no se corta con la esquina redondeada de la caja */
.single-product div.product.fma-sp { padding-bottom: 24px; }

/* [hidden] también en las listas de filtros (el display:block de arriba lo anulaba) */
.fma-filter-list__item[hidden], .fma-brand-empty[hidden] { display: none !important; }
