/* =========================================================
   EXPOSITORES DE PRODUCTO — Estilos categoría v4
   Estructura plana: 3 secciones a borde completo, sin separación
   ========================================================= */

/* --- Variables --------------------------------------------------------- */
:root {
  --ep-bg: #f5f4f0;
  --ep-surface: #ffffff;
  --ep-surface-alt: #f9f8f5;
  --ep-ink: #1a1a1a;
  --ep-ink-soft: #666;
  --ep-ink-mute: #999;
  --ep-border: #e8e6e1;
  --ep-border-soft: #efece6;
  --ep-accent: #d4920a;
  --ep-radius: 12px;
  --ep-radius-sm: 8px;
  --ep-radius-pill: 24px;
}

/* --- Forzar full width en página de categoría ------------------------- */
body#category .container,
body#category .container-fluid,
body#category .container-sm,
body#category .container-md,
body#category .container-lg,
body#category .container-xl,
body#category .container-xxl,
body#category #inner-wrapper,
body#category #inner-wrapper.container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
body#category #content-wrapper,
body#category #wrapper,
body#category #main { padding: 0; }
body#category .page-header,
body#category .page-content { padding: 0; margin: 0; background: transparent; border: none; box-shadow: none; }

/* --- Base ------------------------------------------------------------- */
#category #wrapper,
#category .page-wrapper--category {
  background: var(--ep-bg);
  font-family: 'DM Sans', sans-serif;
  color: var(--ep-ink);
}

/* Breadcrumb */
#category .breadcrumb {
  background: white!important;
  padding: 14px 40px;
  font-size: 12px;
  color: var(--ep-ink-mute);
  margin: 0;
}
.pagination .page-list li{
    border: none!important;
}
/* 1. Quitamos cualquier margen superior que venga por defecto */
#js-active-search-filters {
    margin-top: 0 !important;
    margin-bottom: 40px !important; /* Esto es lo que dará el hueco real */
    display: block !important;
}

/* 2. Por si acaso, le damos margen también al contenedor que creaste */
.ep-active-filters {
    margin-bottom: 40px !important;
    float: left; /* Ayuda a que el contenedor ocupe su espacio real */
    width: 100%;
}

/* 3. Para que no se monte sobre la primera fila de productos */
#js-product-list {
    clear: both !important;
    margin-top: 20px !important;
}
#category .breadcrumb a { color: var(--ep-ink-mute); text-decoration: none; }
#category .breadcrumb li:last-child a,
#category .breadcrumb li:last-child span { color: var(--ep-ink); font-weight: 500; }
#category .breadcrumb li + li::before { content: "›"; padding: 0 6px; color: var(--ep-ink-mute); }

/* --- Page wrapper ----------------------------------------------------- */
.ep-page {
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =========================================================
   SECCIÓN 1 — Cabecera de categoría
   ========================================================= */
.ep-card-cat {
  background: var(--ep-surface-alt);
  border: none;
  border-bottom: 1px solid var(--ep-border);
  border-radius: 0;
  padding: 36px 40px;
}
.ep-cat-header__badge {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--ep-accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.ep-cat-header__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.2;
  color: var(--ep-ink);
}
.ep-cat-header__desc {
  font-size: 14px;
  color: #777;
  max-width: 560px;
  line-height: 1.6;
  margin: 0;
}
.ep-cat-header__desc p { margin: 0; }

/* =========================================================
   SECCIÓN 2 — Tienda (pills + filtros + productos)
   ========================================================= */
.ep-card-shop {
  background: var(--ep-surface);
  border: none;
  border-radius: 0;
  overflow: hidden;
}

/* Pills de subcategorías */
.ep-subcats {
  padding: 18px 40px;
  border-bottom: 1px solid var(--ep-border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ep-subcats__pill {
  padding: 8px 18px;
  border-radius: var(--ep-radius-pill);
  font-size: 13px;
  color: var(--ep-ink-soft);
  border: 1px solid #d5d3cc;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  background: transparent;
  white-space: nowrap;
}
.ep-subcats__pill:hover { border-color: var(--ep-ink); color: var(--ep-ink); }
.ep-subcats__pill.is-active, 
a.ep-subcats__pill.is-active {
    background-color: var(--ep-ink) !important;
    color: #ffffff !important;
    border-color: var(--ep-ink) !important;
    text-decoration: none !important;
}

/* Toolbar */
.ep-card-shop__toolbar {
  padding: 14px 40px;
  border-bottom: 1px solid var(--ep-border);
}
.ep-sortbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 12px;
  color: var(--ep-ink-mute);
  gap: 16px;
}
.ep-sortbar__count { color: var(--ep-ink-mute); }
.ep-sortbar__count strong { color: var(--ep-ink); font-weight: 500; }
.ep-sortbar__sort { display: flex; align-items: center; gap: 8px; }
.ep-sortbar__sort .select-title {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--ep-ink);
  font-weight: 500;
  padding: 0;
}

/* Body con dos columnas: filtros + productos */
.ep-card-shop__body {
  display: grid;
  grid-template-columns: 240px 1fr;
}
.ep-card-shop__filters {
  padding: 24px 24px 24px 40px;
  border-right: 1px solid var(--ep-border);
  background: var(--ep-surface);
}
.ep-card-shop__filters:empty { display: none; }
.ep-card-shop__filters:empty + .ep-card-shop__products { grid-column: 1 / -1; }

.ep-card-shop__products {
  padding: 24px 40px;
  background: var(--ep-surface);
}

/* Grid de productos */
#js-product-list .products,
.products.products-grid,
.product-miniature-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}
#js-product-list .products > .item,
#js-product-list .products > .col,
#js-product-list .products > article,
#js-product-list .products > li,
.products.products-grid > article {
  width: 100% !important;
  max-width: 100% !important;
  flex: unset !important;
  padding: 0;
  list-style: none;
  margin: 0;
}

/* =========================================================
   CARD DE PRODUCTO (miniatura)
   ========================================================= */
.ep-card {
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ep-card:hover {
  border-color: var(--ep-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ep-card__media {
  position: relative;
  display: block;
  background: var(--ep-border-soft);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.ep-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ep-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ep-ink-mute);
  font-size: 13px;
}

/* Flags */
.ep-card__flags {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-direction: column;
  align-items: flex-start;
  z-index: 2;
}
.ep-card__flag {
  background: rgba(26,26,26,0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ep-card__flag--new,
.ep-card__flag--new-product { background: var(--ep-accent); color: #fff; }
.ep-card__flag--available,
.ep-card__flag--online-only { background: #f0ede5; color: var(--ep-ink-soft); }
.ep-card__flag--discount,
.ep-card__flag--discount-percentage { background: var(--ep-accent); color: #fff; }

/* Info */
.ep-card__info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ep-card__ref {
  font-size: 11px;
  color: var(--ep-ink-mute);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.ep-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ep-ink);
  margin: 0 0 4px;
  line-height: 1.35;
}
.ep-card__name a { color: inherit; text-decoration: none; }
.ep-card__attrs {
  font-size: 12px;
  color: var(--ep-ink-mute);
  margin-bottom: 6px;
}
.ep-card__price {
  font-size: 17px;
  font-weight: 700;
  color: var(--ep-ink);
  margin-top: 2px;
}
.ep-card .product-functional-buttons,
.ep-card .highlighted-informations { display: none; }

/* =========================================================
   PAGINACIÓN — solo la del bloque de productos
   ========================================================= */
.ep-card-shop__footer,
.ep-pagination-wrapper { display: none !important; }

#js-product-list .pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--ep-border);
}
.pagination .page-list { display: flex; gap: 6px; padding: 0; margin: 0; list-style: none; }
.pagination li a,
.pagination li span {
  width: 34px;
  height: 34px;
  border-radius: var(--ep-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 1px solid var(--ep-border);
  color: var(--ep-ink-soft);
  text-decoration: none;
  background: var(--ep-surface);
  transition: all 0.2s;
}
.pagination li a:hover { border-color: var(--ep-ink); color: var(--ep-ink); }
.pagination li.current span,
.pagination li.current a {
  background: var(--ep-ink);
  color: #fff;
  border-color: var(--ep-ink);
}

/* =========================================================
   SECCIÓN 3 — Texto SEO expandible
   ========================================================= */
.ep-seo {
  background: var(--ep-surface-alt);
  padding: 28px 40px;
  border: none;
  border-top: 1px solid var(--ep-border);
  border-radius: 0;
}
.ep-seo__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ep-ink);
}
.ep-seo__content {
  font-size: 13px;
  color: #888;
  line-height: 1.7;
  position: relative;
  max-height: 60px;
  overflow: hidden;
  transition: max-height 0.3s;
}
.ep-seo__content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(to bottom, transparent, var(--ep-surface-alt));
  pointer-events: none;
}
.ep-seo.is-open .ep-seo__content { max-height: 2000px; }
.ep-seo.is-open .ep-seo__content::after { display: none; }
.ep-seo__toggle {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--ep-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

/* =========================================================
   FILTROS ps_facetedsearch
   ========================================================= */
#search_filters,
#search_filters_wrapper {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
#search_filters .facet { margin-bottom: 28px; padding: 0; border: none; }
#search_filters .facet-title,
#search_filters .h6 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ep-ink);
  margin-bottom: 14px;
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
  border: none;
}

/* Slider precio */
#search_filters .ui-slider {
  background: var(--ep-border);
  height: 4px;
  border-radius: 2px;
  border: none;
  margin: 16px 0 12px;
}
#search_filters .ui-slider-range {
  background: var(--ep-accent);
  border-radius: 2px;
}
#search_filters .ui-slider-handle {
  width: 14px;
  height: 14px;
  background: var(--ep-ink);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  top: -6px;
  margin-left: -7px;
}

/* Checkboxes */
#search_filters .facet-label {
  display: flex;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--ep-ink-soft);
  cursor: pointer;
  margin: 0;
}
#search_filters .custom-checkbox {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 18px;
  height: 18px;
  margin-right: 10px;
}
#search_filters .custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
#search_filters .custom-checkbox span:not(.color) {
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1.5px solid #d5d3cc;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all 0.15s;
}
#search_filters .custom-checkbox input[type="checkbox"]:checked + span:not(.color) {
  background: var(--ep-ink);
  border-color: var(--ep-ink);
}
#search_filters .custom-checkbox input[type="checkbox"]:checked + span:not(.color)::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

/* Esconder árbol categorías residual */
.ep-card-shop__filters .block-categories,
.ep-card-shop__filters .category-top-menu,
#left-column #ps_categorytree-block { display: none !important; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1199px) {
  .ep-card-shop__body { grid-template-columns: 220px 1fr; }
  #js-product-list .products { grid-template-columns: repeat(2, 1fr) !important; }
  .ep-card-cat,
  .ep-card-shop__toolbar,
  .ep-card-shop__products,
  .ep-seo,
  .ep-subcats { padding-left: 24px; padding-right: 24px; }
  .ep-card-shop__filters { padding-left: 24px; }
  #category .breadcrumb { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 767px) {
  .ep-card-cat { padding: 24px 20px; }
  .ep-cat-header__title { font-size: 22px; }
  .ep-card-shop__body { grid-template-columns: 1fr; }
  .ep-card-shop__filters {
    border-right: none;
    border-bottom: 1px solid var(--ep-border);
    padding: 20px;
  }
  .ep-subcats { overflow-x: auto; flex-wrap: nowrap; padding: 14px 20px; }
  #js-product-list .products { grid-template-columns: 1fr !important; }
  .ep-card-shop__products,
  .ep-card-shop__toolbar { padding-left: 20px; padding-right: 20px; }
  .ep-seo { padding: 20px; }
  #category .breadcrumb { padding-left: 20px; padding-right: 20px; }
}


/* Usamos el ID del cuerpo para asegurar que gane a cualquier otra regla */
#category .ep-card-seo {
    background: #ffffff !important;
    padding: 40px !important; 
    margin-top: 40px !important;
    margin-bottom: 40px !important;
    display: block !important;
    overflow: visible !important; /* Cambiado de hidden a visible */
    height: auto !important;
}

/* Forzamos el contenido para que no se corte */
#category .ep-seo__content {
    max-height: none !important; 
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    color: #444 !important;
}

/* Ocultamos el botón de "Leer más" si no lo vas a usar, 
   para que no estorbe visualmente */
#category .ep-seo__toggle {
    display: none !important;
}


/* ============================================================
   CTA "Ver producto" en miniatura de categoría
   ============================================================ */
.ep-card__cta {
  display: block;
  margin-top: 14px;
  padding: 11px 16px;
  background: #000;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 0;
  transition: background .2s ease;
}
.ep-card__cta:hover,
.ep-card__cta:focus {
  background: #222;
  color: #fff;
  text-decoration: none;
}

/* Forzar color blanco en el CTA aunque haya estilos previos sobre <a> en ep-card */
.ep-card a.ep-card__cta,
.ep-card a.ep-card__cta:link,
.ep-card a.ep-card__cta:visited {
  color: #fff !important;
}
.ep-card a.ep-card__cta:hover,
.ep-card a.ep-card__cta:focus,
.ep-card a.ep-card__cta:active {
  color: #fff !important;
  background: #222;
}

/* Border radius del CTA */
.ep-card .ep-card__cta {
  border-radius: 5px;
}

/* ============================================================
   CTA "Ver producto" en slider de Productos más vendidos (pd-card)
   ============================================================ */
.pd-card .pd-card__link {
  display: block;
  margin-top: 14px;
  padding: 11px 16px;
  background: #000;
  color: #fff !important;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 0;
  border-radius: 5px;
  transition: background .2s ease;
}
.pd-card:hover .pd-card__link,
.pd-card .pd-card__link:hover,
.pd-card .pd-card__link:focus {
  background: #222;
  color: #fff !important;
  text-decoration: none;
}

/* ============================================================
   Footer — forzar 3 columnas iguales en desktop
   ============================================================ */
@media (min-width: 768px) {
  #footer-container-main > .container > .row > [class*="col"] {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}
