/* tm-vip-cards */
/* TigreMarket | Tarjetas de planes vigentes (Inicio, Pro y Empresa).
   Estilos encapsulados: no alteran los anuncios del plan gratuito. */

.tm-market-v3 .tm-product-card.tm-card-vip {
  --tm-vip-gold: #e7b852;
  --tm-vip-gold-light: #ffdfa0;
  --tm-vip-ink: #101925;
  position: relative;
  isolation: isolate;
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  align-self: start;
  overflow: hidden;
  border: 2px solid #bd8930 !important;
  border-radius: 22px !important;
  background: #101925 !important;
  box-shadow: 0 14px 35px rgba(49, 39, 24, .18), 0 0 0 1px rgba(255, 223, 150, .36) inset !important;
  transition: transform .2s ease, box-shadow .2s ease;
}

.tm-market-v3 .tm-product-card.tm-card-vip:hover {
  transform: translateY(-5px);
  border-color: #eec979 !important;
  box-shadow: 0 22px 42px rgba(35, 29, 23, .24), 0 0 0 1px rgba(255, 223, 150, .5) inset !important;
}

/* Restaura el comportamiento original: la fotografía ocupa todo el recuadro,
   incluso si es pequeña o tiene otra proporción; nunca deja bandas laterales. */
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media {
  position: relative !important;
  isolation: isolate;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto;
  width: 100%;
  height: 300px !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  border: none;
  background: #172638 !important;
  overflow: hidden !important;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media .tm-vip-primary-image {
  position: relative !important;
  z-index: 1;
  display: block !important;
  flex: 0 0 auto;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  object-fit: fill !important;
  object-position: center !important;
  background: transparent !important;
  transform: none !important;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media .tm-product-video {
  z-index: 1;
  object-fit: contain !important;
  background: #111d2d;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-no-image {
  color: #e6d5b0;
  background: #172638;
}

/* Insignia y patrocinio debajo de la foto; nunca tapa la publicidad. */
.tm-market-v3 .tm-card-vip .tm-vip-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 7px 12px;
  border-top: 1px solid #d1a654;
  border-bottom: 1px solid rgba(231, 184, 82, .42);
  background: linear-gradient(105deg, #29261f 0%, #393023 52%, #151d2b 100%);
}

.tm-market-v3 .tm-card-vip .tm-vip-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #ffe3a0;
  border-radius: 999px;
  padding: 5px 13px;
  color: #18150e;
  background: linear-gradient(135deg, #ffefb1 0%, #edbd5b 49%, #c8912d 100%);
  box-shadow: 0 2px 8px #0003, inset 0 1px #fff9;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .025em;
  white-space: nowrap;
}

.tm-market-v3 .tm-card-vip .tm-vip-status-note {
  color: #ffe0a0;
  font-size: 11px;
  font-style: italic;
  line-height: 1.25;
  text-align: right;
}

/* Franja de descubrimiento: conserva enlaces, favoritos y compartir reales. */
.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-utility {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 48px;
  margin: 9px 10px 0;
  padding: 5px;
  border: 1px solid rgba(235, 184, 79, .75);
  border-radius: 13px;
  background: linear-gradient(100deg, #654821 0%, #3c3429 43%, #1a2431 100%);
  box-shadow: 0 1px 0 rgba(255, 233, 183, .17) inset;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery.is-featured,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery.is-for-you {
  min-height: 36px;
  padding: 4px 5px;
  color: #ffe7b0;
  background: transparent;
  border-radius: 9px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery:hover,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery.is-featured:hover {
  background: rgba(255, 230, 155, .1);
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery-tag,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery.is-featured .tm-card-discovery-tag {
  padding: 7px 8px;
  border: 1px solid #ffdb8b;
  color: #20190f;
  background: linear-gradient(135deg, #ffe4a0, #e1a942);
  text-transform: none;
  font-size: 10px;
  letter-spacing: 0;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery-prompt {
  color: #ffe3af;
  font-size: 10px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery-arrow,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery.is-featured .tm-card-discovery-arrow {
  color: #f4c574;
  background: #192333;
  border: 1px solid rgba(250, 207, 121, .65);
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-utility-plain {
  flex: 1;
  justify-content: space-between;
  color: #ffde94;
  padding: 0 7px;
  font-weight: 900;
  font-size: 11px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-card-utility-plain:hover { color: #fff6d7; }

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media-tools .tm-product-favorite,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media-tools .tm-product-share-premium,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media-tools .tm-product-pip {
  width: 33px;
  height: 33px;
  background: linear-gradient(145deg, #263143, #101824);
  color: #ffdc8c;
  border: 1px solid #d3a750;
  box-shadow: 0 2px 8px #0005;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media-tools .tm-product-share-premium::after {
  border-color: rgba(255, 221, 144, .35);
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media-tools .tm-product-favorite:hover,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media-tools .tm-product-share-premium:hover,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media-tools .tm-product-pip:hover {
  background: #463322;
  color: #fff5d3;
}

/* VIP y Destacado forman una sola franja compacta, continua y sin huecos.
   Las dos filas comparten fondo, bordes y el mismo contenedor. */
.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(248, 205, 121, .88);
  border-bottom: 1px solid rgba(219, 164, 72, .56);
  background: linear-gradient(115deg, #393023, #292923 58%, #1c2736) !important;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-vip-status-bar {
  min-height: 0;
  padding: 5px 10px 2px;
  border: 0;
  background: transparent;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-vip-status-badge {
  padding: 4px 10px;
  font-size: 11px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-card-utility {
  min-height: 0;
  margin: 0 !important;
  padding: 3px 9px 6px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-card-discovery {
  min-height: 32px;
  padding: 2px 3px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-card-discovery-tag,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-card-discovery.is-featured .tm-card-discovery-tag {
  padding: 6px 8px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-product-media-tools .tm-product-favorite,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-product-media-tools .tm-product-share-premium,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-action-ribbon .tm-product-media-tools .tm-product-pip {
  width: 31px;
  height: 31px;
}

/* Contenido oscuro: categoría, verificación real, vendedor, titular y resumen. */
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-content {
  position: relative;
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column !important;
  min-width: 0;
  padding: 13px 12px 15px;
  color: #f6f7fb;
  background:
  radial-gradient(ellipse 85% 38% at 100% 80%, rgba(64, 81, 107, .19), transparent),
  linear-gradient(140deg, #131c28, #0d1622 68%, #121f30);
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-type,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-category,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-type {
  color: #ffda8a;
  background: linear-gradient(140deg, #393126, #1c2634);
  border: 1px solid #a8782e;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-category {
  color: #f5f6fb;
  background: linear-gradient(140deg, #484a51, #292e38);
  border: 1px solid #606570;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-verified {
  color: #eef8ff;
  background: linear-gradient(110deg, #0874b5, #074c89);
  border: 1px solid #339eda;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-seller {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 9px;
  color: #c8d0dc;
  font-size: 11px;
  line-height: 1.3;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-seller img,
.tm-market-v3 .tm-product-card.tm-card-vip .tm-seller-initial {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(249, 223, 166, .72);
  border-radius: 50%;
  object-fit: cover;
  background: #f7f4ef;
  color: #d62445;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-seller strong {
  color: #fff;
  font-size: inherit;
  font-weight: 850;
  line-height: 1.3;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-title {
  display: -webkit-box;
  min-height: 0;
  margin: 0 0 7px;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 9px;
  color: #d4dbe6;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 11px;
  margin: 0 0 6px;
  color: #d6dbe5;
  font-size: 11px;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-meta i { color: #f7d28d; }
.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-meta span { color: inherit; }

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-price {
  margin: 7px 0 10px;
  padding-top: 0;
  color: #ffcf72;
  font-size: 29px;
  font-weight: 950;
  letter-spacing: -.04em;
  line-height: 1.1;
  text-shadow: 0 1px 1px #0007;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-actions-v3 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px;
  width: 100%;
  margin-top: 0;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-actions-v3 > a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 6px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-detail-button {
  border: 1px solid #eac375;
  color: #ffda8b;
  background: #111d2a;
  box-shadow: 0 0 0 1px rgba(255, 236, 182, .24) inset;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-detail-button:hover {
  color: #161b24;
  background: #f0c36d;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-whatsapp {
  border: 1px solid #36d989;
  color: #fff;
  background: linear-gradient(160deg, #0bca6a, #049b4d);
  box-shadow: 0 0 0 1px rgba(208, 255, 226, .25) inset;
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-whatsapp:hover {
  color: #fff;
  background: linear-gradient(160deg, #08ac59, #067c44);
}

.tm-market-v3 .tm-product-card.tm-card-vip .tm-product-actions-v3 > a:only-child {
  grid-column: 1 / -1;
}

.tm-market-v3 .tm-product-card.tm-card-vip :is(a,button):focus-visible {
  outline: 3px solid #ffe2a7;
  outline-offset: 2px;
}

/* En el feed móvil de dos columnas, conservar botones legibles y sin desbordes. */
@media (max-width: 767px) and (min-width: 450px) {
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media { height: 235px !important; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery-prompt { display: none; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-card-discovery-arrow { width: 20px; height: 20px; }
  .tm-market-v3 .tm-product-card.tm-card-vip:has(.tm-product-pip) .tm-card-discovery-arrow { display: none; }
  .tm-market-v3 .tm-product-card.tm-card-vip:has(.tm-product-pip) .tm-product-media-tools { gap: 3px; }
  .tm-market-v3 .tm-product-card.tm-card-vip:has(.tm-product-pip) .tm-product-media-tools > button { width: 29px; height: 29px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-status-note { font-size: 9px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-status-badge { padding: 5px 9px; font-size: 11px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-actions-v3 {
  grid-template-columns: 1fr !important;
  }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-content { padding: 10px 9px 12px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-price { font-size: 24px; }
}

@media (max-width: 449px) {
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-media { height: 330px !important; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-content { padding: 15px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-title { font-size: 17px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-vip-description { font-size: 13px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-actions-v3 > a { font-size: 13px; min-height: 45px; }
  .tm-market-v3 .tm-product-card.tm-card-vip .tm-product-price { font-size: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-market-v3 .tm-product-card.tm-card-vip { transition: none; }
}

/* tm-home-premium-ux */
/* TigreMarket | Home Premium UX 2026
 * Solo cambia la presentación del index. No modifica los componentes de anuncios,
 * la lógica del buscador, las recomendaciones, el SEO ni los reproductores.
 */

body.tm-market-v3.tm-home-redesign {
  background: #f5f7fb;
  --tm-home-red: #ef3047;
  --tm-home-ink: #142137;
  --tm-home-muted: #68788e;
  --tm-home-border: #e0e7f0;
}

/* Cabecera + búsqueda: un único bloque fijo, también al desplazarse. */
body.tm-home-redesign .tm-home-header-shell {
  position: sticky;
  top: 0;
  z-index: 1040;
  isolation: isolate;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 9px 28px rgba(16, 33, 54, .085);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.tm-home-redesign.tm-market-v3 .main-navbar {
  position: relative;
  top: auto;
  z-index: 3;
  border-bottom: 1px solid #eff1f5;
  box-shadow: none;
  background: transparent;
}

body.tm-home-redesign.tm-market-v3 .main-navbar > .container {
  min-height: 59px;
  max-width: 1330px;
}

body.tm-home-redesign.tm-market-v3 .nav-actions .btn {
  border-radius: 11px;
  font-size: .77rem;
  font-weight: 800;
}

body.tm-home-redesign .tm-home-search-dock {
  position: relative;
  z-index: 2;
  padding: 9px 0;
  background: #fff;
  border-bottom: 1px solid #e6eaf0;
}

body.tm-home-redesign .tm-home-search-dock > .container {
  position: relative;
  max-width: 1330px;
}

body.tm-home-redesign .tm-home-search-form {
  display: grid;
  grid-template-columns: minmax(210px, 1.95fr) minmax(145px, .85fr) minmax(130px, .75fr) auto auto;
  align-items: center;
  gap: 9px;
  margin: 0;
}

body.tm-home-redesign .tm-home-search-keyword {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafd;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

body.tm-home-redesign .tm-home-search-keyword:focus-within {
  border-color: #ee5066;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(239, 48, 71, .09);
}

body.tm-home-redesign .tm-home-search-keyword > i {
  flex: 0 0 auto;
  color: #78879c;
  font-size: 1.08rem;
}

body.tm-home-redesign .tm-home-search-keyword input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #19273b;
  font-size: .88rem;
}

body.tm-home-redesign .tm-home-search-keyword input::placeholder { color: #8b97a7; }
body.tm-home-redesign .tm-home-search-keyword input::-webkit-search-cancel-button { cursor: pointer; }

body.tm-home-redesign .tm-home-quick-select {
  position: relative;
  min-width: 0;
  min-height: 46px;
  padding: 5px 10px 5px 12px;
  border: 1px solid #e0e6ee;
  border-radius: 12px;
  background: #fff;
}

body.tm-home-redesign .tm-home-quick-select label {
  display: block;
  margin: 0;
  color: #8490a2;
  font-size: .6rem;
  font-weight: 800;
  line-height: 1.25;
}

body.tm-home-redesign .tm-home-quick-select select {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 20px 0 0;
  height: 24px;
  border: 0;
  outline: 0;
  color: #243148;
  background-color: transparent;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

body.tm-home-redesign .tm-home-quick-select:focus-within {
  border-color: #f05c70;
  box-shadow: 0 0 0 3px rgba(239, 48, 71, .08);
}

body.tm-home-redesign .tm-home-filter-toggle,
body.tm-home-redesign .tm-home-search-submit {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: .81rem;
  font-weight: 850;
  line-height: 1;
  transition: background-color .18s, border-color .18s, transform .18s;
}

body.tm-home-redesign .tm-home-filter-toggle {
  border: 1px solid #dfe5ee;
  background: #fff;
  color: #35445a;
}

body.tm-home-redesign .tm-home-filter-toggle:hover,
body.tm-home-redesign .tm-home-filter-toggle[aria-expanded="true"] {
  border-color: #f6afba;
  background: #fff2f4;
  color: #d51e39;
}

body.tm-home-redesign .tm-home-filter-count {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 50%;
  color: white;
  background: #e52a44;
  font-size: .66rem;
}

body.tm-home-redesign .tm-home-search-submit {
  min-width: 108px;
  color: #fff;
  background: linear-gradient(120deg, #ff4259, #d91532);
  border: 1px solid #ec2b46;
  box-shadow: 0 5px 14px rgba(231, 29, 53, .16);
}

body.tm-home-redesign .tm-home-search-submit:hover {
  background: #d71935;
  transform: translateY(-1px);
}

/* Conserva las señales de carga del HOTFIX estable durante un GET lento. */
body.tm-home-redesign .tm-home-search-submit.has-pending-filters {
  box-shadow: 0 0 0 3px rgba(239, 48, 71, .16), 0 7px 18px rgba(231, 29, 53, .2);
}

body.tm-home-redesign .tm-home-search-form.is-submitting .tm-home-search-submit,
body.tm-home-redesign .tm-home-search-form.is-submitting .tm-filter-submit {
  cursor: progress;
}

body.tm-home-redesign .tm-home-search-form.is-submitting .tm-home-search-submit > i,
body.tm-home-redesign .tm-home-search-form.is-submitting .tm-filter-submit > i {
  display: none;
}

body.tm-home-redesign .tm-home-search-form.is-submitting .tm-home-search-submit::before,
body.tm-home-redesign .tm-home-search-form.is-submitting .tm-filter-submit::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tmHomeSearchSpin .7s linear infinite;
}

/* Filtros avanzados: siguen formando parte del mismo GET y conservan sus IDs. */
body.tm-home-redesign .tm-home-advanced-section[hidden],
body.tm-home-redesign .tm-home-filter-backdrop[hidden] { display: none !important; }

body.tm-home-redesign .tm-home-advanced-section {
  position: absolute;
  top: calc(100% + 8px);
  left: 12px;
  right: 12px;
  z-index: 10;
  max-height: min(73vh, 510px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 75px rgba(11, 25, 43, .24);
  animation: tmHomeFilterAppear .2s ease-out;
}

body.tm-home-redesign .tm-home-advanced-section .tm-filter-panel {
  padding: 23px;
  border: 1px solid #e2e8f1;
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
}

body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading {
  margin-bottom: 19px;
}

body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading h2 { font-size: 1.18rem; }
body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading p { font-size: .8rem; }

body.tm-home-redesign .tm-home-filter-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.tm-home-redesign .tm-home-filter-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e7ee;
  border-radius: 10px;
  background: #f7f9fc;
  color: #46556c;
}

body.tm-home-redesign .tm-home-filter-close:hover { color: #d21d36; background: #fff1f4; }

body.tm-home-redesign .tm-home-advanced-section .tm-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 11px;
}

body.tm-home-redesign .tm-home-advanced-section .tm-filter-field select {
  height: 45px;
  background: #f8fafd;
  font-size: .79rem;
}

body.tm-home-redesign .tm-home-advanced-section .tm-filter-helper {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: .69rem;
  line-height: 1.35;
}

body.tm-home-redesign .tm-home-advanced-section .tm-filter-helper[hidden],
body.tm-home-redesign .tm-home-location-notice[hidden] {
  display: none !important;
}

body.tm-home-redesign .tm-home-location-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 1100;
  width: max-content;
  max-width: min(440px, calc(100vw - 30px));
  padding: 14px 18px;
  transform: translateX(-50%);
  border: 1px solid #ffd1d8;
  border-radius: 13px;
  background: #fff;
  color: #a91a34;
  box-shadow: 0 10px 35px rgba(15, 23, 42, .22);
  font-size: .84rem;
  font-weight: 650;
  text-align: center;
}

body.tm-home-redesign .tm-home-advanced-section .tm-filter-submit {
  min-width: 132px;
  height: 45px;
  padding: 0 15px;
  color: #fff;
  background: #19283d;
  box-shadow: none;
}

body.tm-home-redesign .tm-home-filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(17, 30, 48, .24);
  cursor: default;
}

/* Portada: la foto original del país se conserva, ahora como campaña compacta. */
body.tm-home-redesign.tm-market-v3 .tm-premium-hero {
  position: relative;
  display: block;
  width: min(1370px, calc(100% - 32px));
  height: auto;
  min-height: 420px;
  max-height: none;
  margin: 17px auto 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  color: #fff;
  background: #132138;
  box-shadow: 0 20px 45px rgba(21, 38, 63, .14);
}

body.tm-home-redesign.tm-market-v3 .tm-premium-hero::before {
  z-index: 1;
  background: linear-gradient(90deg, #101b2cef 0%, #101b2ce0 37%, #101b2c58 70%, #101b2c12 100%);
}

body.tm-home-redesign.tm-market-v3 .tm-premium-content {
  position: static;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 1320px;
  min-height: 420px;
  height: auto;
  margin: 0 auto;
  padding: 32px 38px 30px;
}

body.tm-home-redesign.tm-market-v3 .tm-hero-campaign {
  position: absolute;
  z-index: 0;
  inset: 0;
  top: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #15243a;
  transform: none;
}

body.tm-home-redesign.tm-market-v3 .tm-hero-campaign img {
  display: block;
  width: 100%;
  height: 100% !important;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: cover !important;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-copy,
body.tm-home-redesign.tm-market-v3.tm-country-photo-hero .tm-premium-copy {
  position: relative;
  z-index: 3;
  top: auto;
  left: auto;
  display: block;
  width: min(600px, 68%);
  max-width: 600px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  text-align: left;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-copy::before,
body.tm-home-redesign.tm-market-v3.tm-country-photo-hero .tm-premium-copy::before { display: none; }

body.tm-home-redesign.tm-market-v3 .tm-premium-badge {
  margin: 0 0 16px;
  padding: 8px 13px;
  border: 1px solid #ffffff32;
  color: #e8edf6;
  background: #ffffff16;
  font-size: .66rem;
  font-weight: 900;
  box-shadow: none;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-copy h1 {
  max-width: 650px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.6rem, 4.15vw, 3.8rem);
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -.055em;
  text-shadow: none;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-copy h1 strong {
  display: block;
  margin-top: 2px;
  color: #ff5268;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-copy > p {
  max-width: 490px;
  margin: 15px 0 0;
  color: #d7e0eb;
  font-size: .88rem;
  line-height: 1.55;
  font-weight: 500;
  text-shadow: none;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-controls {
  position: relative;
  z-index: 3;
  width: min(600px, 68%);
  max-width: 600px;
  margin: 18px 0 0;
  padding: 0;
  transform: none;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-actions > * {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  min-height: 41px;
  padding: 7px 12px;
  border: 1px solid #ffffff55;
  border-radius: 11px;
  color: #fff;
  background: #17263acf;
  box-shadow: none;
  font-size: .76rem;
  text-decoration: none;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-actions > .tm-btn-primary {
  border-color: #e9364b;
  background: #ed3047;
}

body.tm-home-redesign.tm-market-v3 .tm-action-icon-box {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: #ffffff24;
}

body.tm-home-redesign.tm-market-v3 .tm-action-icon { width: 15px; height: 15px; }
body.tm-home-redesign.tm-market-v3 .tm-action-copy { display: inline-flex; flex-direction: row; gap: 0; }
body.tm-home-redesign.tm-market-v3 .tm-action-copy strong { font-size: .73rem; color: inherit; }
body.tm-home-redesign.tm-market-v3 .tm-action-copy small { display: none; }

body.tm-home-redesign.tm-market-v3 #tm-location-status {
  max-width: 560px;
  margin-top: 11px !important;
  color: #d8e0ed !important;
  text-align: left;
  font-size: .68rem;
  line-height: 1.35;
}

/* Indicadores bajo el hero, en vez de otra banda que tapa la campaña. */
body.tm-home-redesign .tm-home-stats-strip { padding: 10px 0 4px; }
body.tm-home-redesign .tm-home-stats-strip > .container { max-width: 1320px; }
body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stats {
  position: static;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(720px, 100%);
  margin: 0 auto;
  gap: 9px;
}

body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat {
  min-height: 53px;
  padding: 8px 13px;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  color: #1c2a3f;
  background: #fff;
  box-shadow: 0 5px 15px #203d550a;
}

body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat > .tm-stat-icon {
  width: 33px;
  height: 33px;
  flex-basis: 33px;
}

body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat > .tm-stat-icon img { width: 17px; height: 17px; }
body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat strong { color: #ef3047; font-size: 1.07rem; }
body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat span { color: #78869a; font-size: .64rem; }

/* Categorías reales del PHP: tarjetas compactas, imágenes y enlace intactos. */
body.tm-home-redesign.tm-market-v3 .tm-discovery-section { padding: 21px 0 7px; }
body.tm-home-redesign.tm-market-v3 .tm-discovery-heading { margin-bottom: 13px; }
body.tm-home-redesign.tm-market-v3 .tm-discovery-heading h2 { font-size: 1.5rem; }

body.tm-home-redesign.tm-market-v3 .tm-category-carousel-shell {
  padding: 12px 15px !important;
  border: 1px solid #e5eaf1;
  border-radius: 19px !important;
  box-shadow: 0 9px 26px #172a4510 !important;
}

body.tm-home-redesign.tm-market-v3 .tm-category-carousel {
  grid-template-rows: repeat(2, 80px);
  grid-auto-columns: calc((100% - 50px) / 6);
  gap: 10px;
  padding: 2px;
}

body.tm-home-redesign.tm-market-v3 .tm-category-mini-card {
  min-height: 80px;
  gap: 9px;
  padding: 0 8px 0 0;
  border-radius: 11px;
}

body.tm-home-redesign.tm-market-v3 .tm-category-mini-icon,
body.tm-home-redesign.tm-market-v3 .tm-category-mini-card:nth-child(3n + 1) .tm-category-mini-icon {
  width: 70px;
  height: 100%;
  flex: 0 0 70px;
  border-radius: 10px 0 0 10px;
}

body.tm-home-redesign.tm-market-v3 .tm-category-mini-card strong { font-size: .74rem; line-height: 1.24; }
body.tm-home-redesign.tm-market-v3 .tm-category-carousel.is-expanded { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: none; }
body.tm-home-redesign.tm-market-v3 .tm-carousel-arrow { width: 37px; height: 37px; }

/* La propuesta de pago y sus enlaces quedan intactos, pero sin repetición visual. */
body.tm-home-redesign.tm-market-v3 .tm-premium-upsell-section { padding: 17px 0 23px; }
body.tm-home-redesign.tm-market-v3 .tm-premium-upsell {
  grid-template-columns: minmax(245px, 1.2fr) minmax(280px, 1fr) auto;
  gap: 17px;
  padding: 17px 22px;
  border-radius: 17px !important;
  background: linear-gradient(115deg, #17263d 0%, #142138 63%, #5a2638 100%);
  box-shadow: 0 12px 28px #1b344526 !important;
}

body.tm-home-redesign.tm-market-v3 .tm-premium-upsell h2 { font-size: clamp(1.05rem, 1.6vw, 1.37rem); line-height: 1.22; }
body.tm-home-redesign.tm-market-v3 .tm-premium-upsell-main p { max-width: 430px; font-size: .72rem; line-height: 1.4; }
body.tm-home-redesign.tm-market-v3 .tm-premium-benefits { gap: 8px; }
body.tm-home-redesign.tm-market-v3 .tm-premium-benefit { gap: 7px; }
body.tm-home-redesign.tm-market-v3 .tm-premium-benefit span { font-size: .64rem; }
body.tm-home-redesign.tm-market-v3 .tm-premium-main-button { min-height: 46px; font-size: .72rem; }

body.tm-home-redesign #categorias,
body.tm-home-redesign #publicaciones,
body.tm-home-redesign #planes { scroll-margin-top: 142px; }

@keyframes tmHomeFilterAppear {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tmHomeSearchSpin { to { transform: rotate(360deg); } }

@media (max-width: 1199.98px) {
  body.tm-home-redesign .tm-home-search-form {
    grid-template-columns: minmax(195px, 1.5fr) minmax(110px, .7fr) minmax(105px, .7fr) auto auto;
    gap: 7px;
  }
  body.tm-home-redesign .tm-home-filter-toggle,
  body.tm-home-redesign .tm-home-search-submit { padding-inline: 12px; }
  body.tm-home-redesign.tm-market-v3 .tm-category-carousel { grid-auto-columns: calc((100% - 30px) / 4); }
  body.tm-home-redesign.tm-market-v3 .tm-category-carousel.is-expanded { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.tm-home-redesign.tm-market-v3 .tm-premium-upsell { grid-template-columns: minmax(0, 1fr) auto; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-benefits { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
  body.tm-home-redesign.tm-market-v3 .main-navbar > .container { min-height: 54px; }
  body.tm-home-redesign .tm-mobile-country-bar { min-height: 36px; padding-block: 3px; }
  body.tm-home-redesign .tm-mobile-country-select { height: 29px; }
  body.tm-home-redesign .tm-home-search-dock { padding: 8px 0; }
  body.tm-home-redesign .tm-home-search-form {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto auto;
    gap: 7px;
  }
  body.tm-home-redesign .tm-home-search-keyword { grid-column: 1 / 3; }
    
    
    
    
  body.tm-home-redesign .tm-home-search-keyword,
  body.tm-home-redesign .tm-home-search-submit { min-height: 42px; }
  body.tm-home-redesign .tm-home-search-keyword input { height: 40px; }
  body.tm-home-redesign .tm-home-quick-select { min-height: 42px; }
  body.tm-home-redesign .tm-home-filter-toggle { min-height: 42px; }
    
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-submit { grid-column: 1 / -1; }

  body.tm-home-redesign.tm-market-v3 .tm-premium-hero { min-height: 375px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-content { min-height: 375px; padding: 25px 27px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-copy,
  body.tm-home-redesign.tm-market-v3.tm-country-photo-hero .tm-premium-copy,
  body.tm-home-redesign.tm-market-v3 .tm-premium-controls { width: min(550px, 84%); }
  body.tm-home-redesign.tm-market-v3 .tm-premium-copy h1 { font-size: clamp(2.3rem, 5vw, 3rem); }
  body.tm-home-redesign.tm-market-v3 .tm-category-carousel { grid-auto-columns: calc((100% - 20px) / 3); }
  body.tm-home-redesign.tm-market-v3 .tm-category-carousel.is-expanded { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body.tm-home-redesign.tm-market-v3 .main-navbar > .container { min-height: 49px; }
  body.tm-home-redesign.tm-market-v3 .brand-logo-text { font-size: 1.12rem; }
  body.tm-home-redesign .tm-home-search-dock > .container { padding-inline: 11px; }
  body.tm-home-redesign .tm-home-search-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 6px; }
  body.tm-home-redesign .tm-home-search-keyword { padding-inline: 11px; }
  body.tm-home-redesign .tm-home-search-keyword input { font-size: .78rem; }
  body.tm-home-redesign .tm-home-quick-select { padding: 5px 7px 4px 9px; }
  body.tm-home-redesign .tm-home-quick-select select { font-size: .7rem; }
  body.tm-home-redesign .tm-home-filter-toggle,
  body.tm-home-redesign .tm-home-search-submit { min-width: 42px; padding: 0 11px; }
  body.tm-home-redesign .tm-home-filter-toggle > span,
  body.tm-home-redesign .tm-home-search-submit > span { display: none; }
  body.tm-home-redesign .tm-home-filter-count { position: absolute; top: -4px; right: -4px; }
  body.tm-home-redesign .tm-home-filter-toggle { position: relative; }
  body.tm-home-redesign .tm-home-advanced-section { left: 10px; right: 10px; top: calc(100% + 7px); max-height: min(70dvh, 500px); }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-panel { padding: 16px; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading { align-items: flex-start; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading h2 { font-size: .95rem; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading p { font-size: .68rem; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-icon { width: 33px; height: 33px; }
  body.tm-home-redesign .tm-home-filter-heading-actions { gap: 3px; }
  body.tm-home-redesign .tm-home-filter-heading-actions .tm-clear-filters { font-size: 0; width: 31px; overflow: hidden; }
  body.tm-home-redesign .tm-home-filter-heading-actions .tm-clear-filters i { font-size: 1rem; }

  body.tm-home-redesign.tm-market-v3 .tm-premium-hero { width: calc(100% - 20px); min-height: 0; margin-top: 10px; border-radius: 17px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-hero::before { background: linear-gradient(90deg, #101b2cf2, #101b2ccd 75%, #101b2c99); }
  body.tm-home-redesign.tm-market-v3 .tm-hero-campaign { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: .62; }
  body.tm-home-redesign.tm-market-v3 .tm-hero-campaign img { height: 100% !important; aspect-ratio: auto; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-content { min-height: 362px; padding: 25px 19px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-copy,
  body.tm-home-redesign.tm-market-v3.tm-country-photo-hero .tm-premium-copy,
  body.tm-home-redesign.tm-market-v3 .tm-premium-controls { width: 100%; max-width: none; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-badge { font-size: .59rem; margin-bottom: 12px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-copy h1 { font-size: clamp(2rem, 8.2vw, 2.6rem); }
  body.tm-home-redesign.tm-market-v3 .tm-premium-copy > p { font-size: .77rem; margin-top: 11px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-controls { margin-top: 16px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-actions { gap: 6px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-actions > * { min-height: 38px; padding: 6px 9px; font-size: .69rem; }
  body.tm-home-redesign.tm-market-v3 .tm-action-icon-box { width: 20px; height: 20px; }
  body.tm-home-redesign.tm-market-v3 .tm-action-copy strong { font-size: .68rem; }
  body.tm-home-redesign.tm-market-v3 #tm-location-status { font-size: .62rem; }

  body.tm-home-redesign .tm-home-stats-strip { padding-top: 7px; }
  body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stats-grid { gap: 5px; }
  body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat { min-height: 43px; padding: 5px 4px; justify-content: center; }
  body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat strong { font-size: .89rem; }
  body.tm-home-redesign.tm-market-v3 .tm-home-stats-strip .tm-live-stat span { font-size: .54rem; }

  body.tm-home-redesign.tm-market-v3 .tm-discovery-section { padding-top: 17px; }
  body.tm-home-redesign.tm-market-v3 .tm-discovery-heading h2 { font-size: 1.25rem; }
  body.tm-home-redesign.tm-market-v3 .tm-category-carousel-shell { padding: 9px !important; }
  body.tm-home-redesign.tm-market-v3 .tm-category-carousel { grid-template-rows: 75px; grid-auto-columns: minmax(160px, 51%); }
  body.tm-home-redesign.tm-market-v3 .tm-category-mini-card { min-height: 75px; }
  body.tm-home-redesign.tm-market-v3 .tm-category-carousel.is-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.tm-home-redesign.tm-market-v3 .tm-category-mini-icon,
  body.tm-home-redesign.tm-market-v3 .tm-category-mini-card:nth-child(3n + 1) .tm-category-mini-icon { width: 66px; flex-basis: 66px; }

  body.tm-home-redesign.tm-market-v3 .tm-premium-upsell-section { padding: 12px 0 20px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-upsell { grid-template-columns: 1fr; gap: 8px; padding: 15px; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-benefits { grid-column: auto; display: flex; flex-wrap: wrap; }
  body.tm-home-redesign.tm-market-v3 .tm-premium-upsell-actions { grid-column: auto; }

  body.tm-home-redesign #categorias,
  body.tm-home-redesign #publicaciones,
  body.tm-home-redesign #planes { scroll-margin-top: 172px; }
}

@media (prefers-reduced-motion: reduce) {
  body.tm-home-redesign .tm-home-advanced-section { animation: none; }
  body.tm-home-redesign .tm-home-search-submit { transition: none; }
}

/* ================================================================
 * CABECERA DE DOS FILAS — revisión de estabilidad
 * 1: marca · búsqueda con filtros · cuenta
 * 2: mercado/país · navegación
 * En resoluciones menores, los filtros restantes se abren en un panel.
 * Todos los controles comparten un único formulario GET existente.
 * ================================================================ */
body.tm-home-redesign .tm-home-header-shell {
  display: grid;
  grid-template-columns: minmax(160px, 208px) minmax(0, 1fr) auto;
  grid-template-rows: minmax(76px, auto) 49px;
  align-items: center;
  column-gap: clamp(10px, 1vw, 18px);
  width: 100%;
  padding-inline: clamp(14px, 2.15vw, 40px);
  background: #fff;
  box-shadow: 0 9px 27px rgba(25, 41, 63, .075);
}

/* Las cajas intermedias no añaden filas adicionales ni duplican controles. */
body.tm-home-redesign.tm-market-v3 .main-navbar,
body.tm-home-redesign.tm-market-v3 .main-navbar > .container,
body.tm-home-redesign .tm-home-search-dock,
body.tm-home-redesign .tm-home-search-dock > .container {
  display: contents !important;
}

body.tm-home-redesign.tm-market-v3 .main-navbar .brand-logo {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
}

body.tm-home-redesign.tm-market-v3 .main-navbar .brand-logo-text {
  font-size: clamp(1.05rem, 1.35vw, 1.48rem);
}

body.tm-home-redesign .tm-home-search-form {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  position: relative;
  margin: 0;
  gap: 7px;
  grid-template-columns: minmax(150px, 1.65fr) minmax(105px, .84fr) minmax(105px, .84fr) auto auto;
}

body.tm-home-redesign .tm-home-search-keyword,
body.tm-home-redesign .tm-home-quick-select,
body.tm-home-redesign .tm-home-filter-toggle,
body.tm-home-redesign .tm-home-search-submit {
  min-height: 47px;
  border-radius: 11px;
}

body.tm-home-redesign .tm-home-search-keyword {
  background: #f9fbfe;
  border-color: #d6e0ec;
}

body.tm-home-redesign .tm-home-search-submit {
  min-width: 50px;
  padding: 0 13px;
  background: #f42e4b;
  box-shadow: 0 4px 13px rgba(244, 46, 75, .13);
  order: 99;
}

body.tm-home-redesign .tm-home-filter-toggle { order: 98; }

body.tm-home-redesign .tm-home-search-form.has-pending-filters .tm-home-search-submit {
  box-shadow: 0 0 0 3px rgba(242, 43, 72, .12), 0 4px 13px rgba(244, 46, 75, .13);
}

body.tm-home-redesign .tm-home-search-form.is-submitting .tm-home-search-submit {
  cursor: progress;
  opacity: .78;
}

body.tm-home-redesign .tm-home-search-form.is-submitting .tm-home-search-submit i {
  animation: tmHomeSearchBusy 1s linear infinite;
}
@keyframes tmHomeSearchBusy { to { transform: rotate(360deg); } }

body.tm-home-redesign .tm-home-account-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

body.tm-home-redesign .tm-home-account-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  margin: 0;
  padding: 0 14px;
  border-radius: 11px;
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}

body.tm-home-redesign .tm-home-account-actions .btn-outline-light {
  border-color: #d5dfec;
  background: #fff;
  color: #25354d;
}

body.tm-home-redesign .tm-home-account-actions .btn-warning {
  border-color: #f22c48;
  background: #f22c48;
  color: #fff;
}

body.tm-home-redesign .tm-home-account-actions .btn-danger {
  border-color: #f6dfe2;
  background: #fff2f4;
  color: #cb1937;
}

body.tm-home-redesign.tm-market-v3 .main-navbar .nav-actions {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: clamp(4px, .8vw, 17px);
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4px 0;
  border-top: 1px solid #edf1f7;
}

body.tm-home-redesign.tm-market-v3 .main-navbar .nav-actions > .btn {
  flex: 0 0 auto;
  padding: 9px 10px;
  min-height: 36px;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: #46536b;
  font-size: .79rem;
  font-weight: 800;
}

body.tm-home-redesign.tm-market-v3 .main-navbar .nav-actions > .btn:hover {
  color: #e92342;
  background: #fff3f5;
}

body.tm-home-redesign.tm-market-v3 .tm-country-switcher .tm-country-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #fee0e5;
  border-radius: 10px;
  box-shadow: none;
  background: #fff0f3;
  color: #de1f3b;
  font-size: .78rem;
  font-weight: 850;
}

body.tm-home-redesign.tm-market-v3 .tm-country-switcher .tm-country-button:hover {
  border-color: #ffafbc;
  background: #ffe8ed;
}

body.tm-home-redesign .tm-home-search-form .tm-home-advanced-section {
  order: 0;
}

/* En pantallas anchas se presentan todos los filtros sin panel secundario. */
@media (min-width: 1720px) {
  body.tm-home-redesign .tm-home-search-form {
    grid-template-columns: minmax(180px, 1.55fr) repeat(2, minmax(105px, .79fr)) repeat(4, minmax(95px, .72fr)) 50px;
  }
  body.tm-home-redesign .tm-home-advanced-section,
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-panel,
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-form {
    display: contents !important;
  }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading,
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-submit,
  body.tm-home-redesign .tm-home-filter-toggle { display: none !important; }
  /* Notas visibles en el panel pequeño; ocultas en la barra de una sola fila. */
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-helper { display: none !important; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-field {
    min-width: 0;
    min-height: 47px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5px 9px 4px;
    border: 1px solid #dfe6f0;
    border-radius: 11px;
    background: #f9fbfe;
  }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-field label {
    margin: 0;
    font-size: .59rem;
    line-height: 1.2;
    color: #77869a;
  }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-field select {
    display: block;
    width: 100%;
    height: 25px;
    min-height: 0;
    min-width: 0;
    padding: 0 15px 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #223149;
    font-size: .71rem;
    font-weight: 800;
    cursor: pointer;
    text-overflow: ellipsis;
  }
  body.tm-home-redesign .tm-home-search-submit { min-width: 48px; padding-inline: 12px; }
  body.tm-home-redesign .tm-home-search-submit span { display: none; }
}

/* En portátil los filtros de distancia/tipo/precio/orden siguen a un clic. */
@media (max-width: 1719.98px) {
  body.tm-home-redesign .tm-home-advanced-section { display: none !important; }
  body.tm-home-redesign .tm-home-advanced-section.is-open { display: block !important; }
  body.tm-home-redesign .tm-home-filter-toggle { display: inline-flex !important; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-panel { display: block !important; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-heading { display: flex !important; }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-form {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-submit { display: inline-flex !important; }
  body.tm-home-redesign .tm-home-filter-toggle { min-width: 47px; }
  body.tm-home-redesign .tm-home-advanced-section { top: calc(100% + 13px); }
}

@media (max-width: 1280px) {
  body.tm-home-redesign .tm-home-header-shell {
    grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) auto;
    gap: 10px;
  }
  body.tm-home-redesign .tm-home-account-actions .btn { min-height: 41px; padding-inline: 10px; font-size: .7rem; }
  body.tm-home-redesign .tm-home-search-form { grid-template-columns: minmax(120px, 1.4fr) minmax(95px, .8fr) minmax(95px, .8fr) auto auto; }
  body.tm-home-redesign .tm-home-search-submit span { display: none; }
  body.tm-home-redesign .tm-home-filter-toggle > span { display: none; }
  body.tm-home-redesign .tm-home-search-submit,
  body.tm-home-redesign .tm-home-filter-toggle { min-width: 43px; padding-inline: 10px; }
}

@media (max-width: 991.98px) {
  body.tm-home-redesign .tm-home-header-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 51px 39px auto;
    row-gap: 0;
    padding: 0;
  }
  body.tm-home-redesign.tm-market-v3 .main-navbar .brand-logo {
    grid-column: 1;
    grid-row: 1;
    margin-left: 13px;
    align-self: center;
  }
  body.tm-home-redesign .tm-home-account-actions {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    max-width: calc(100vw - 170px);
    overflow-x: auto;
    scrollbar-width: thin;
    margin-right: 8px;
    gap: 5px;
  }
  body.tm-home-redesign .tm-home-account-actions .btn { min-height: 32px; padding-inline: 8px; font-size: .65rem; }
  body.tm-home-redesign .tm-mobile-top-actions,
  body.tm-home-redesign.tm-market-v3 .main-navbar .nav-actions { display: none !important; }
  body.tm-home-redesign .tm-mobile-country-bar {
    display: flex;
    grid-column: 1;
    grid-row: 2;
    height: 39px;
    min-height: 39px;
    padding: 3px 13px;
    box-shadow: none;
  }
  body.tm-home-redesign .tm-home-search-form {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    padding: 8px 11px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
    gap: 6px;
    border-bottom: 1px solid #ecf0f5;
  }
  body.tm-home-redesign .tm-home-search-keyword { grid-column: 1 / -1; min-height: 40px; }
  body.tm-home-redesign .tm-home-search-keyword input { height: 39px; }
  body.tm-home-redesign .tm-home-quick-category { grid-column: 1; }
  body.tm-home-redesign .tm-home-quick-city { grid-column: 2; }
  body.tm-home-redesign .tm-home-filter-toggle { grid-column: 3; }
  body.tm-home-redesign .tm-home-search-submit { grid-column: 4; }
  body.tm-home-redesign .tm-home-quick-select,
  body.tm-home-redesign .tm-home-filter-toggle,
  body.tm-home-redesign .tm-home-search-submit { min-height: 40px; }
  body.tm-home-redesign .tm-home-advanced-section { left: 10px; right: 10px; top: calc(100% + 6px); }
  body.tm-home-redesign .tm-home-advanced-section .tm-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.tm-home-redesign #categorias,
  body.tm-home-redesign #publicaciones,
  body.tm-home-redesign #planes { scroll-margin-top: 180px; }
}

@media (max-width: 380px) {
  body.tm-home-redesign .tm-home-account-actions { max-width: calc(100vw - 152px); }
  body.tm-home-redesign .tm-home-account-actions .btn { font-size: .61rem; padding-inline: 6px; }
  body.tm-home-redesign.tm-market-v3 .main-navbar .brand-logo-text { font-size: 1.03rem; }
  body.tm-home-redesign .tm-home-search-form { padding-inline: 8px; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  body.tm-home-redesign .tm-home-search-form.is-submitting .tm-home-search-submit i { animation: none; }
}
