:root {
  --market-bg: #f4f7fb;
  --market-surface: #ffffff;
  --market-surface-soft: #f8fafc;
  --market-text: #0f172a;
  --market-muted: #64748b;
  --market-border: #dfe7f1;
  --market-primary: #2563eb;
  --market-primary-dark: #1d4ed8;
  --market-accent: #06b6d4;
  --market-success: #16a34a;
  --market-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --market-shadow-hover: 0 22px 48px rgba(15, 23, 42, 0.15);
}

html { scroll-behavior: smooth; }

body.rnx-market-home,
body.rnx-product-clean {
  background: var(--market-bg);
  color: var(--market-text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Header: una sola composicion clara y legible. */
body .rnx-modern-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--market-border) !important;
  box-shadow: 0 5px 24px rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body .rnx-modern-shell {
  width: 100%;
  max-width: 1320px;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: auto minmax(260px, 560px) auto;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

body .rnx-modern-brand {
  min-width: 214px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--market-text) !important;
  text-decoration: none !important;
}

body .rnx-modern-brand .rnx-brand-logo {
  display: block;
  width: 214px;
  height: 48px;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: left center;
}

.rnx-brand-mark {
  width: 43px;
  height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--market-primary), var(--market-accent));
  box-shadow: 0 9px 20px rgba(37, 99, 235, 0.24);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

body .rnx-modern-brand .rnx-modern-brand-text {
  display: flex !important;
  flex-direction: column;
  color: var(--market-text) !important;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

body .rnx-modern-brand .rnx-modern-brand-text b { color: var(--market-text); }
body .rnx-modern-brand .rnx-modern-brand-text small {
  margin-top: 4px;
  color: var(--market-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body .rnx-topbar-search { max-width: none; min-width: 0; margin: 0; }
body .rnx-topbar-search .form-group { margin: 0; position: relative; }
body .rnx-topbar-search input.form-control {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--market-border);
  border-radius: 13px;
  background: var(--market-surface-soft);
  color: var(--market-text);
  font-size: 14px;
  box-shadow: none;
}
body .rnx-topbar-search input.form-control::placeholder { color: #94a3b8; }
body .rnx-topbar-search input.form-control:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
body .rnx-topbar-search button {
  right: 5px;
  top: 5px;
  transform: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--market-primary);
  color: #fff;
}
body .rnx-topbar-search button:hover { background: var(--market-primary-dark); color: #fff; }

body .rnx-modern-actions { display: flex; gap: 7px; margin-left: 0; }
body .rnx-modern-actions .rnx-nav-pill,
body .rnx-modern-actions .rnx-login-pill {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--market-border);
  border-radius: 12px !important;
  background: #fff;
  color: #334155 !important;
  font-size: 12.5px;
  font-weight: 850;
  box-shadow: none;
}
body .rnx-modern-actions .rnx-nav-pill:hover {
  border-color: rgba(37, 99, 235, 0.4);
  background: #eff6ff;
  color: var(--market-primary) !important;
  transform: translateY(-1px);
}
body .rnx-modern-actions .rnx-login-pill {
  border-color: var(--market-primary);
  background: var(--market-primary);
  color: #fff !important;
}
body .rnx-modern-actions .rnx-login-pill:hover {
  background: var(--market-primary-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

body .rnx-top-picker { position: relative; margin: 0; }
body .rnx-top-picker > summary {
  display: inline-flex; align-items: center; gap: 7px; list-style: none; cursor: pointer; user-select: none;
}
body .rnx-top-picker > summary::-webkit-details-marker { display: none; }
body .rnx-top-picker[open] > summary {
  border-color: rgba(37, 99, 235, 0.4); background: #eff6ff; color: var(--market-primary) !important;
}
body .rnx-top-picker[open] > .dropdown-menu { display: block; }

body .rnx-access-picker { position: relative; margin: 0; }
body .rnx-access-picker > summary { list-style: none; cursor: pointer; user-select: none; }
body .rnx-access-picker > summary::-webkit-details-marker { display: none; }
body .rnx-access-picker[open] > summary { background: var(--market-primary-dark); }
body .rnx-access-arrow { margin-left: 2px; font-size: 9px; transition: transform .18s ease; }
body .rnx-access-picker[open] .rnx-access-arrow { transform: rotate(180deg); }
body .rnx-access-menu {
  position: absolute; z-index: 1100; top: calc(100% + 10px); right: 0; width: 310px;
  padding: 8px; border: 1px solid var(--market-border); border-radius: 16px;
  background: #fff; box-shadow: 0 20px 48px rgba(15, 23, 42, .18);
}
body .rnx-access-menu::before {
  content: ""; position: absolute; right: 22px; top: -6px; width: 11px; height: 11px;
  background: #fff; border-left: 1px solid var(--market-border); border-top: 1px solid var(--market-border); transform: rotate(45deg);
}
body .rnx-access-menu a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 12px; color: #172033; text-decoration: none;
}
body .rnx-access-menu a:hover { background: #f1f5f9; color: var(--market-primary); text-decoration: none; }
body .rnx-access-menu b, body .rnx-access-menu small { display: block; }
body .rnx-access-menu b { margin-bottom: 2px; font-size: 13px; font-weight: 900; }
body .rnx-access-menu small { color: #64748b; font-size: 11.5px; font-weight: 650; }
body .rnx-access-icon {
  display: inline-flex; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center;
  border-radius: 11px; background: #eaf2ff; color: #2563eb; font-size: 15px;
}
body .rnx-access-icon.is-rnx { background: #ecfdf3; color: #15803d; }

body .rnx-mobile-nav { position: relative; margin: 0; }
body .rnx-mobile-nav > summary {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  list-style: none; cursor: pointer; border: 1px solid var(--market-border); border-radius: 11px;
  background: #fff; color: #334155; font-size: 17px;
}
body .rnx-mobile-nav > summary::-webkit-details-marker { display: none; }
body .rnx-mobile-nav[open] > summary { border-color: var(--market-primary); background: var(--market-primary); color: #fff; }
body .rnx-mobile-nav-menu {
  position: fixed; z-index: 1200; top: 58px; right: 10px; width: min(340px, calc(100vw - 20px));
  max-height: calc(100vh - 68px); overflow-y: auto; padding: 8px;
  border: 1px solid var(--market-border); border-radius: 15px; background: #fff;
  box-shadow: 0 22px 55px rgba(15, 23, 42, .22);
}
body .rnx-mobile-nav-menu a {
  display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 8px 10px;
  border-radius: 10px; color: #172033; text-decoration: none;
}
body .rnx-mobile-nav-menu a:hover, body .rnx-mobile-nav-menu a:focus { background: #eff6ff; color: var(--market-primary); text-decoration: none; }
body .rnx-mobile-nav-menu a > i { width: 26px; color: var(--market-primary); text-align: center; }
body .rnx-mobile-nav-menu a span, body .rnx-mobile-nav-menu a b, body .rnx-mobile-nav-menu a small { display: block; }
body .rnx-mobile-nav-menu a b { font-size: 13px; font-weight: 900; }
body .rnx-mobile-nav-menu a small { margin-top: 1px; color: #64748b; font-size: 10.5px; font-weight: 650; }
body .rnx-mobile-nav-title {
  padding: 8px 10px 4px; color: #94a3b8; font-size: 9.5px; font-weight: 900;
  letter-spacing: .08em; text-transform: uppercase;
}

@media (max-width: 520px) {
  body .rnx-access-menu { position: fixed; top: 66px; right: 12px; width: calc(100vw - 24px); }
  body .rnx-access-menu::before { display: none; }
}

body .rnx-trust-strip {
  border: 0;
  border-top: 1px solid #edf2f7;
  background: #f8fafc !important;
}
body .rnx-trust-inner {
  max-width: 1320px;
  padding: 7px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
body .rnx-trust-item { color: #475569; font-size: 11.5px; font-weight: 800; }
body .rnx-trust-item i { color: var(--market-success); }

/* Hero y controles del catalogo. */
body.rnx-market-home .mk-hero {
  position: relative;
  overflow: hidden;
  padding: 46px 18px 40px;
  background:
    radial-gradient(circle at 82% 12%, rgba(6, 182, 212, 0.2), transparent 30%),
    radial-gradient(circle at 62% 110%, rgba(37, 99, 235, 0.3), transparent 38%),
    linear-gradient(135deg, #0b1730 0%, #10254a 58%, #0b1730 100%);
}
body.rnx-market-home .mk-hero-in { max-width: 1320px; }
body.rnx-market-home .mk-hero h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(30px, 3vw, 43px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
body.rnx-market-home .mk-hero p { max-width: 720px; color: #cbd5e1; font-size: 15px; line-height: 1.65; }
body.rnx-market-home .mk-hero-form .form-group { max-width: 680px; }
body.rnx-market-home .mk-hero-form .form-control {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.23);
}
body.rnx-market-home .mk-chip {
  padding: 8px 14px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}
body.rnx-market-home .mk-chip:hover { background: rgba(255, 255, 255, 0.15); }
body.rnx-market-home .mk-chip.on { border-color: #3b82f6; background: #2563eb; }

body.rnx-market-home .mk-shell { max-width: 1320px; padding-top: 30px; }
body.rnx-market-home .mk-bar { margin-bottom: 18px; }
body.rnx-market-home .mk-bar h2 { color: var(--market-text); font-size: 24px; letter-spacing: -0.02em; }
body.rnx-market-home .mk-sort { padding: 4px; border: 1px solid var(--market-border); border-radius: 13px; background: #fff; }
body.rnx-market-home .mk-sort a { border: 0; border-radius: 9px; background: transparent; color: #64748b; }
body.rnx-market-home .mk-sort a.on { background: #eaf2ff; color: var(--market-primary); }
body.rnx-market-home .mk-filtros {
  padding: 14px 16px;
  border-color: var(--market-border);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}
body.rnx-market-home .mk-filtros input[type="number"] { min-height: 38px; border-color: var(--market-border); }
body.rnx-market-home .mk-filtros .btn { min-height: 38px; padding: 0 17px; background: var(--market-primary); border-color: var(--market-primary); }

/* Tarjetas de cuentas. */
.list-view .grid-item { margin-bottom: 24px; }
.list-view .market-account-card {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--market-border);
  border-radius: 18px;
  background: var(--market-surface);
  box-shadow: var(--market-shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.list-view .market-account-card:hover {
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: var(--market-shadow-hover);
  transform: translateY(-5px);
}
.market-card-media { position: relative; overflow: hidden; background: #0f172a; }
.market-card-media .card-img-top-wrapper { overflow: hidden; background: #0f172a; }
.market-card-media .card-img-top {
  width: 100%;
  padding-top: 69%;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: #0f172a;
  transition: transform 450ms ease;
}
.market-account-card:hover .card-img-top { transform: none; }
.market-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.03) 42%, rgba(2, 6, 23, 0.58) 100%);
}
.market-card-no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 0 !important;
  aspect-ratio: 1.45 / 1;
  color: #94a3b8;
  background: radial-gradient(circle at 50% 25%, #243655, #0f172a) !important;
}
.market-card-no-image i { font-size: 30px; color: #60a5fa; }
.market-card-no-image span { font-size: 12px; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.market-card-badges {
  position: absolute;
  z-index: 2;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.market-card-category,
.market-card-photos {
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  backdrop-filter: blur(8px);
}
.market-card-category { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-card-photos { flex: 0 0 auto; }
.list-view .market-account-card .card-body { padding: 15px 16px 16px; }
.market-card-kicker {
  margin-bottom: 8px;
  color: var(--market-success);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
/* Antiguedad del anuncio ("hace 5 min"): dato secundario, no compite con el
   sello de verificado ni con el precio. */
.market-card-time {
  margin-left: auto;
  color: var(--market-muted, #8b93a7);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.market-card-time i { opacity: .75; margin-right: 2px; }
.market-card-title { margin: 0; }
.list-view .market-card-title .grid-title {
  display: block;
  color: var(--market-text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
/* El titulo ocupa como mucho 2 lineas: antes un titulo largo empujaba el precio
   y descuadraba la altura de las tarjetas vecinas. */
.list-view .market-card-title .display-name {
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-view .market-card-title .grid-title:hover { color: var(--market-primary); }

/* Resumen del anuncio: las primeras 5 lineas (el recorte real se hace en PHP,
   esto sujeta las lineas que ademas se parten por ancho). */
.market-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 7px;
  color: var(--market-muted, #6b7280);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;      /* respeta los saltos del anuncio */
  text-decoration: none;
}
.market-card-desc:hover { color: var(--market-text, #1f2937); text-decoration: none; }
.market-card-footer {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #edf2f7;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.market-card-price { min-width: 0; }
.market-card-price small { display: block; margin-bottom: 2px; color: var(--market-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.market-card-price strong { display: block; overflow-wrap: anywhere; color: var(--market-primary); font-size: 20px; font-weight: 950; line-height: 1.1; }
.market-card-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--market-primary);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none !important;
}
.market-card-cta:hover { background: var(--market-primary); color: #fff; }

/* Las fichas y perfiles comparten superficies y header con el catalogo. */
body .rnx-card { border-color: var(--market-border); border-radius: 18px; box-shadow: var(--market-shadow); }
body .rnx-product-shell { max-width: 1320px; }
body .rnx-price { color: var(--market-primary); }

@media (max-width: 1199.98px) {
  body .rnx-modern-shell { grid-template-columns: auto minmax(220px, 1fr) auto; gap: 10px; }
  body .rnx-modern-brand { min-width: auto; }
  body .rnx-modern-actions .rnx-nav-pill,
  body .rnx-modern-actions .rnx-login-pill { width: 42px; padding: 0; }
  body .rnx-modern-actions a span:not(.rnx-badge-count) { display: none; }
}

@media (max-width: 991.98px) {
  body .rnx-modern-shell { min-height: 62px; grid-template-columns: 1fr auto; padding: 8px 14px; }
  body .rnx-desktop-search { display: none !important; }
  body .rnx-mobile-search { display: block; padding: 0 14px 10px; }
  body .rnx-trust-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  body .rnx-modern-brand .rnx-brand-logo { width: 184px; height: 42px; }
  body .rnx-modern-brand .rnx-modern-brand-text small { display: none; }
  body.rnx-market-home .mk-hero { padding: 34px 15px 30px; }
  body.rnx-market-home .mk-shell { padding: 22px 12px 34px; }
  body.rnx-market-home .mk-sort { width: 100%; overflow-x: auto; }
  body.rnx-market-home .mk-sort a { white-space: nowrap; }
  .market-card-cta span { display: none; }
  .market-card-cta { width: 34px; justify-content: center; padding: 0; }
  .market-card-price strong { font-size: 17px; }
  .list-view .market-card-title .grid-title { font-size: 13.5px; }
  .market-card-desc { font-size: 10.5px; line-height: 1.45; }
}

@media (max-width: 575.98px) {
  body .rnx-modern-shell { min-height: 58px; }
  body .rnx-modern-brand .rnx-brand-logo { width: 150px; height: 38px; }
  .rnx-brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 10px; }
  body .rnx-modern-brand .rnx-modern-brand-text { font-size: 15px; }
  body .rnx-modern-actions { gap: 5px; }
  body .rnx-modern-actions .rnx-nav-pill,
  body .rnx-modern-actions .rnx-login-pill { width: 38px; min-height: 38px; }
  body.rnx-market-home .mk-filtros { align-items: stretch; }
  body.rnx-market-home .mk-sort { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  body.rnx-market-home .mk-sort a { text-align: center; }
  body.rnx-market-home .mk-filtros label { flex: 1 1 120px; }
  body.rnx-market-home .mk-filtros input[type="number"] { width: 100%; }
  body.rnx-market-home .mk-shell .row.list-view,
  body .rnx-related-section .row.list-view { margin-left: -6px; margin-right: -6px; }
  .list-view .grid-item { padding-left: 6px; padding-right: 6px; margin-bottom: 12px; }
  .list-view .market-account-card { border-radius: 14px; }
  .list-view .market-account-card .card-body { padding: 11px 10px 12px; }
  .market-card-badges { left: 7px; right: 7px; bottom: 7px; }
  .market-card-category { max-width: 74%; }
  .market-card-kicker { font-size: 8.5px; }
  .list-view .market-card-title .grid-title { font-size: 12.5px; }
  .market-card-footer { margin-top: 11px; padding-top: 10px; }
  .market-card-price strong { font-size: 15px; }
  /* En movil caben dos tarjetas por fila: se baja el cuerpo de texto para que
     el resumen se lea sin que la tarjeta crezca de mas. */
  .market-card-desc { font-size: 10px; line-height: 1.45; margin-top: 5px; -webkit-line-clamp: 4; }
  .market-card-time { font-size: 8.5px; }
  .market-card-category { font-size: 9px; }
}
.rnx-language-menu{min-width:220px!important;max-height:70vh;overflow-y:auto}.rnx-language-menu .dropdown-item{display:flex!important;align-items:center;justify-content:space-between;gap:18px}.rnx-language-menu .dropdown-item small{font-size:10px;font-weight:900;color:#94a3b8}.rnx-language-menu .dropdown-item.is-active{background:#eff6ff;color:#1d4ed8}.rnx-mobile-lang-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:6px 10px 10px}.rnx-mobile-nav-menu .rnx-mobile-lang-grid a{display:block;padding:7px 9px;border:1px solid #e2e8f0;border-radius:8px;font-size:12px;color:#334155;background:#f8fafc}.rnx-mobile-nav-menu .rnx-mobile-lang-grid a.is-active{background:#dbeafe;border-color:#93c5fd;color:#1d4ed8;font-weight:900}html[dir=rtl] .rnx-modern-shell,html[dir=rtl] .mk-bar,html[dir=rtl] .rnx-layout{direction:rtl}html[dir=rtl] .rnx-topbar-search button{right:auto;left:5px}html[dir=rtl] .rnx-topbar-search .form-control{padding-left:56px;padding-right:20px}
