/* MFPS Network Ads — doble ancho, sin radio, sin botón CTA, temáticas */
.mfps-ad-item,
.mfps-ad-tile {
  --mfps-accent: #056448;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

#mfps-ad-float,
#mfps-ad-rail,
#mfps-ad-rail-mount {
  display: none !important;
}

/* Rellenar huecos cuando hay anuncios de 2 columnas */
.mfps-ads-packed,
.souk-home-feed-grid.mfps-ads-packed,
#souk-home-feed-grid.mfps-ads-packed,
ul.products.mfps-ads-packed,
.grid.mfps-ads-packed {
  grid-auto-flow: dense !important;
}

/* Ocupa 2 cartas de producto (Soukia feed = CSS grid 2/4 cols) */
.souk-home-feed-grid > .mfps-ad-span2.product-item,
#souk-home-feed-grid > .mfps-ad-span2.product-item,
.row.souk-home-feed-grid > .mfps-ad-span2.product-item {
  grid-column: span 2 !important;
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  float: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

/* Carruseles horizontales: ancho ≈ 2 productos (ganar a soukia-app.css) */
.souk-slider-track > .product-item.mfps-ad-span2,
.souk-slider-track > .mfps-ad-span2.product-item,
.souk-slider-track > [class*="col-"].mfps-ad-span2 {
  flex: 0 0 clamp(330px, calc(((100% - 32px) / 5.2) * 2 + 10px), 540px) !important;
  max-width: none !important;
  width: auto !important;
  min-width: 330px !important;
  grid-column: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

/* Bootstrap rows sin CSS grid: ~50% = 2 de 4 cols */
.row:not(.souk-home-feed-grid) > .mfps-ad-span2.product-item.col-lg-6 {
  flex: 0 0 50%;
  max-width: 50%;
  width: 50%;
  grid-column: auto;
}

@media (max-width: 575.98px) {
  .row:not(.souk-home-feed-grid) > .mfps-ad-span2.product-item {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }
}

/* WooCommerce: 2 columnas de 3 — solo al inicio de fila para no dejar huecos */
ul.products.columns-3 li.mfps-ad-span2,
ul.products.columns-3 .mfps-ad-span2 {
  width: 64.5% !important;
  max-width: 64.5% !important;
  float: left !important;
  clear: none !important;
}
ul.products.columns-3 li.mfps-ad-span2.mfps-ad-rowstart,
ul.products.columns-3 .mfps-ad-span2.mfps-ad-rowstart {
  clear: both !important;
}

ul.products.columns-4 li.mfps-ad-span2 {
  width: 48% !important;
  max-width: 48% !important;
  float: left !important;
}
ul.products.columns-4 li.mfps-ad-span2.mfps-ad-rowstart {
  clear: both !important;
}

ul.products.columns-2 li.mfps-ad-span2 {
  width: 100% !important;
  max-width: 100% !important;
  clear: both !important;
}

/* IaMyth / CSS grid */
.mfps-ad-span2.mfps-ad-tile,
article.mfps-ad-span2,
.grid > .mfps-ad-span2 {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .mfps-ad-span2.mfps-ad-tile,
  article.mfps-ad-span2,
  .grid > .mfps-ad-span2 {
    grid-column: span 1;
  }
  ul.products.columns-3 li.mfps-ad-span2 {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Toda la carta es un único enlace — sin botón */
a.mfps-tile-hit {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  height: 100%;
  min-height: 220px;
  text-decoration: none !important;
  color: inherit !important;
  border-radius: 0 !important;
  overflow: hidden;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  position: relative;
}

a.mfps-tile-hit:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  color: inherit !important;
}

.mfps-tile-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  padding: 6px 10px;
  border-radius: 0;
}

.mfps-tile-media {
  flex: 1.15 1 0;
  min-width: 42%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  line-height: 0;
  overflow: hidden;
}

.mfps-tile-media img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  max-height: 280px;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 0 !important;
  background: #0a0a0a;
}

.mfps-tile-emoji-wrap {
  display: grid !important;
  place-items: center;
  min-height: 220px;
}

.mfps-tile-emoji {
  font-size: clamp(48px, 7vw, 72px);
  line-height: 1;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.mfps-tile-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
}

.mfps-tile-title {
  margin: 0;
  font-size: clamp(16px, 2.1vw, 22px);
  font-weight: 850;
  line-height: 1.2;
  border-radius: 0;
}

.mfps-tile-blurb {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  opacity: 0.92;
}

.mfps-tile-hint {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Host wrappers sin radio de producto */
.mfps-tile-card-host,
.mfps-ad-item .card,
.mfps-ad-tile.surface-panel {
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  padding: 0 !important;
}

/* ——— Temáticas de fondo ——— */
.mfps-theme-rollercoin a.mfps-tile-hit {
  color: #fff7d6 !important;
  border-color: #f5b942;
  background:
    radial-gradient(circle at 18% 20%, rgba(250, 204, 21, 0.35), transparent 42%),
    radial-gradient(circle at 85% 80%, rgba(249, 115, 22, 0.28), transparent 45%),
    linear-gradient(135deg, #1a1205 0%, #3b2a0a 38%, #0b1220 100%);
}
.mfps-theme-rollercoin .mfps-tile-title { color: #ffe566; }
.mfps-theme-rollercoin .mfps-tile-blurb,
.mfps-theme-rollercoin .mfps-tile-hint { color: #fde68a; }
.mfps-theme-rollercoin .mfps-tile-media {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 215, 0, 0.08) 0 10px, transparent 10px 20px),
    #0a0a0a;
}

.mfps-theme-soukia a.mfps-tile-hit {
  color: #ecfdf5 !important;
  border-color: #10b981;
  background:
    radial-gradient(circle at 12% 0%, rgba(16, 185, 129, 0.35), transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(234, 179, 8, 0.22), transparent 42%),
    linear-gradient(145deg, #052e24 0%, #0b3d32 45%, #14532d 100%);
}
.mfps-theme-soukia .mfps-tile-title { color: #bbf7d0; }
.mfps-theme-soukia .mfps-tile-blurb,
.mfps-theme-soukia .mfps-tile-hint { color: #d1fae5; }
.mfps-theme-soukia .mfps-tile-emoji-wrap {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #064e3b, #115e59);
}

.mfps-theme-iamyth a.mfps-tile-hit {
  color: #e0f2fe !important;
  border-color: #38bdf8;
  background:
    radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.28), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.28), transparent 42%),
    linear-gradient(140deg, #0b1220 0%, #172554 55%, #1e1b4b 100%);
}
.mfps-theme-iamyth .mfps-tile-title { color: #7dd3fc; }
.mfps-theme-iamyth .mfps-tile-blurb,
.mfps-theme-iamyth .mfps-tile-hint { color: #bae6fd; }
.mfps-theme-iamyth .mfps-tile-emoji-wrap {
  background:
    linear-gradient(180deg, rgba(14,165,233,0.2), transparent),
    #0f172a;
}

.mfps-theme-sheelatato a.mfps-tile-hit {
  color: #fff1f2 !important;
  border-color: #fb7185;
  background:
    radial-gradient(circle at 15% 20%, rgba(251, 113, 133, 0.3), transparent 42%),
    radial-gradient(circle at 90% 85%, rgba(244, 114, 182, 0.25), transparent 45%),
    linear-gradient(145deg, #4c0519 0%, #7f1d1d 40%, #9f1239 100%);
}
.mfps-theme-sheelatato .mfps-tile-title { color: #fecdd3; }
.mfps-theme-sheelatato .mfps-tile-blurb,
.mfps-theme-sheelatato .mfps-tile-hint { color: #ffe4e6; }
.mfps-theme-sheelatato .mfps-tile-emoji-wrap {
  background:
    repeating-radial-gradient(circle at 30% 40%, rgba(255,255,255,0.07) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, #881337, #9f1239);
}

.mfps-theme-mfps a.mfps-tile-hit {
  color: #ecfeff !important;
  border-color: #22d3ee;
  background:
    radial-gradient(circle at 18% 25%, rgba(34, 211, 238, 0.28), transparent 40%),
    radial-gradient(circle at 88% 75%, rgba(168, 85, 247, 0.28), transparent 42%),
    linear-gradient(145deg, #020617 0%, #0f172a 40%, #164e63 100%);
}
.mfps-theme-mfps .mfps-tile-title { color: #67e8f9; }
.mfps-theme-mfps .mfps-tile-blurb,
.mfps-theme-mfps .mfps-tile-hint { color: #a5f3fc; }
.mfps-theme-mfps .mfps-tile-emoji-wrap {
  background:
    linear-gradient(135deg, rgba(34,211,238,0.15), rgba(168,85,247,0.18)),
    #020617;
}

@media (max-width: 700px) {
  a.mfps-tile-hit {
    flex-direction: column;
    min-height: 0;
  }
  .mfps-tile-media img {
    max-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.mfps-tile-hit:hover { transform: none; }
}
