/* Listado marketplace: panel full-bleed + filtros izquierda / resultados derecha */
body.page-marketplace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.page-marketplace > header.site-header,
body.page-marketplace > .dir-breadcrumb {
  flex-shrink: 0;
}
body.page-marketplace > footer {
  flex-shrink: 0;
  margin-top: 0;
}
body.site-public main.mp-page {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff !important;
  background-color: #fff !important;
  box-sizing: border-box;
}
.mp-page__panel {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
}
.mp-page__inner {
  width: 100%;
  max-width: var(--container-max, 1320px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 32px) 40px;
  box-sizing: border-box;
}
.mp-page__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border-light, #eee);
}
.mp-page__intro {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.mp-page__title {
  margin: 0;
  font-family: var(--font-heading, inherit);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  color: var(--color-text-heading, #1a1a1a);
  white-space: nowrap;
}
.mp-page__subtitle {
  margin: 0;
  color: var(--color-text-medium, #666);
  font-size: 0.9rem;
  line-height: 1.35;
}
.mp-page__subtitle::before {
  content: '—';
  margin-right: 12px;
  color: var(--color-border-light, #ddd);
}
.mp-page__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.mp-page__layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 24px 28px;
  align-items: start;
  width: 100%;
}
.mp-page__sidebar {
  position: sticky;
  top: 16px;
}
.mp-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}
.mp-filters__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-heading, #1a1a1a);
}
.mp-filters__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.mp-filters__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}
.mp-filters input,
.mp-filters select {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.95rem;
  box-sizing: border-box;
  background: #fff;
}
.mp-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.mp-filters__actions .btn {
  flex: 1 1 auto;
  text-align: center;
  justify-content: center;
}
.mp-page__results {
  min-width: 0;
}
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.mp-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.mp-card:hover { box-shadow: 0 8px 24px #00000014; transform: translateY(-2px); }
.mp-card--destacado { border-color: var(--color-brand-gold, #B9984B); }
.mp-card__media,
.mp-card__placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f1f5f9;
}
.mp-card__media img {
  position: absolute;
  inset: auto;
  left: 0;
  top: 50%;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  object-fit: cover;
  object-position: center center;
  display: block;
}
.mp-card__placeholder { display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 2rem; }
.mp-card__placeholder--lg { min-height: 280px; border-radius: 14px; aspect-ratio: auto; }
.mp-card__body { padding: 12px 14px 16px; }
.mp-card__body h2 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.3; }
.mp-card__price { margin: 0 0 4px; font-weight: 800; color: var(--color-brand-gold-dark, #947A3C); }
.mp-card__meta { margin: 0; font-size: 0.85rem; color: #64748b; }
.mp-empty { text-align: center; padding: 40px 16px; color: #64748b; }
.mp-empty i { font-size: 2rem; display: block; margin-bottom: 10px; }
.mp-page__pagination {
  margin-top: 24px;
}

.mp-page__pagination.admin-pagination-root {
  --pg-primary: var(--color-brand-gold, #B9984B);
  --pg-primary-soft: color-mix(in srgb, var(--color-brand-gold, #B9984B) 18%, transparent);
}
@media (max-width: 900px) {
  .mp-page__layout {
    grid-template-columns: 1fr;
  }
  .mp-page__sidebar {
    position: static;
  }
}

/* Detalle de producto */
body.site-public main.mp-page--detail {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff !important;
  background-color: #fff !important;
}
.mp-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.9fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  width: 100%;
}
.mp-detail__gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.mp-detail__main {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(560px, 70vw);
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.mp-detail__main img {
  position: absolute;
  inset: auto;
  left: 0;
  top: 50%;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  object-fit: cover;
  object-position: center center;
  display: block;
  cursor: zoom-in;
}
.mp-detail__controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.mp-detail__nav,
.mp-detail__zoom {
  pointer-events: auto;
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.15s;
}
.mp-detail__nav:hover,
.mp-detail__zoom:hover {
  background: rgba(15, 23, 42, 0.78);
}
.mp-detail__nav--prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.mp-detail__nav--next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.mp-detail__zoom {
  top: 12px;
  right: 12px;
}
.mp-detail__main--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.95rem;
}
.mp-detail__main--empty i { font-size: 2.4rem; }
.mp-detail__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mp-detail__thumb {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #f1f5f9;
  flex-shrink: 0;
}
.mp-detail__thumb img {
  position: absolute;
  inset: auto;
  left: 0;
  top: 50%;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  object-fit: cover;
  object-position: center center;
  display: block;
}
.mp-detail__thumb.is-active,
.mp-detail__thumb:hover {
  border-color: var(--color-brand-gold, #B9984B);
}

/* Lightbox zoom */
body.mp-lightbox-open { overflow: hidden; }
.mp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.mp-lightbox[hidden] { display: none !important; }
.mp-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.82);
  cursor: pointer;
}
.mp-lightbox__box {
  position: relative;
  z-index: 1;
  width: 90vw;
  height: 90vh;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.mp-lightbox__stage {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mp-lightbox__stage.is-zoomed { cursor: grab; }
.mp-lightbox__stage.is-zoomed.is-dragging { cursor: grabbing; }
.mp-lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
.mp-lightbox__close,
.mp-lightbox__nav,
.mp-lightbox__zoom {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}
.mp-lightbox__close:hover,
.mp-lightbox__nav:hover,
.mp-lightbox__zoom:hover {
  background: rgba(255, 255, 255, 0.28);
}
.mp-lightbox__close { top: 14px; right: 14px; }
.mp-lightbox__zoom { top: 14px; right: 68px; }
.mp-lightbox__nav--prev { left: 14px; top: 50%; transform: translateY(-50%); }
.mp-lightbox__nav--next { right: 14px; top: 50%; transform: translateY(-50%); }
.mp-detail__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mp-detail__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mp-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mp-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}
.mp-badge--cond {
  background: #fff7ed;
  color: #9a3412;
}
.mp-detail__title {
  margin: 0;
  font-family: var(--font-heading, inherit);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.25;
  color: var(--color-text-heading, #1a1a1a);
}
.mp-detail__price {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: var(--color-brand-gold-dark, #947A3C);
  letter-spacing: -0.02em;
}
.mp-detail__desc {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  line-height: 1.65;
  color: #334155;
  white-space: pre-wrap;
  font-size: 0.98rem;
}
.mp-detail__loc {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}
.mp-detail__loc i { margin-right: 6px; color: var(--color-brand-primary, #B20F0F); }
.mp-detail__seller {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  margin-right: auto;
}
.mp-detail__seller-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mp-detail__seller-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.mp-detail__seller-text strong {
  font-size: 0.98rem;
  color: #0f172a;
}
.mp-detail__seller-label {
  font-weight: 600;
  color: #64748b;
}
.mp-detail__seller-text span {
  font-size: 0.85rem;
  color: #64748b;
}
.mp-detail__seller-text #mp-rating-summary i {
  color: var(--color-brand-gold, #B9984B);
}
.mp-detail__contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mp-detail__hint { margin: 0; color: #64748b; font-size: 0.9rem; }
.mp-btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  padding: 13px 18px;
  border-radius: 12px;
  text-decoration: none;
}
.mp-btn-wa:hover { background: #1ebe5b; color: #fff; }
.mp-btn-tel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid #e2e8f0;
}
.mp-btn-tel:hover { background: #f8fafc; }
.mp-login-cta {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px;
}
.mp-login-cta p { margin: 0 0 8px; }
.mp-login-cta__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  justify-content: center;
}
.mp-detail__section-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-heading, #1a1a1a);
}
.mp-detail__back {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}
.mp-detail__back a {
  color: var(--color-brand-gold-dark, #947A3C);
  text-decoration: none;
  font-weight: 600;
}
.mp-detail__back a:hover { text-decoration: underline; }
.mp-vendedor-actions {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fafafa;
}
.mp-vendedor-actions__title { margin: 0 0 4px; font-size: 1.05rem; }
.mp-vendedor-actions__hint,
.mp-vendedor-actions__login { margin: 0 0 12px; color: #64748b; font-size: 0.9rem; }
.mp-interaccion-msg { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; }
.mp-interaccion-msg.is-ok { background: #dcfce7; color: #166534; }
.mp-interaccion-msg.is-err { background: #fee2e2; color: #991b1b; }
.mp-stars { display: flex; gap: 4px; margin-bottom: 12px; }
.mp-stars__item { cursor: pointer; color: #cbd5e1; font-size: 1.35rem; position: relative; }
.mp-stars__item input { position: absolute; opacity: 0; pointer-events: none; }
.mp-stars__item.is-on,
.mp-stars__item:has(input:checked),
.mp-stars__item:hover { color: var(--color-brand-gold, #B9984B); }
.mp-form-valorar__label { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.mp-form-valorar textarea,
.mp-form-reportar textarea,
.mp-form-reportar select {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
  background: #fff;
}
.mp-reportar-wrap { margin-top: 16px; }
.mp-reportar-toggle {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}
.mp-reportar-toggle:hover { color: #991b1b; }
.mp-reportar-done { margin: 0; color: #64748b; font-size: 0.9rem; }
.mp-form-reportar { margin-top: 10px; }
.mp-form-reportar label { display: block; margin-bottom: 4px; font-size: 0.85rem; }
.mp-reviews { margin-top: 36px; }
.mp-reviews__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mp-reviews__item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; }
.mp-reviews__head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 6px; }
.mp-reviews__head time { color: #94a3b8; font-size: 0.8rem; margin-left: auto; }
.mp-reviews__stars { color: var(--color-brand-gold, #B9984B); }
.mp-star--off { color: #cbd5e1; }
.mp-reviews__item p { margin: 0; color: #334155; line-height: 1.45; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media (max-width: 900px) {
  .mp-detail { grid-template-columns: 1fr; }
  .mp-detail__main { max-height: none; }
}
@media (max-width: 800px) {
  .mp-page__header { align-items: flex-start; }
  .mp-page__intro { flex-direction: column; align-items: flex-start; }
  .mp-page__subtitle::before { display: none; }
  .mp-page__title { white-space: normal; }
}
