/* =========================================================================
   1. GRID & CARD
   ========================================================================= */
.er-pro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
}

.er-pro-card {
    position: relative;
    border-radius: var(--er-radius);
    background: #fff;
    box-shadow: var(--er-shadow);
    color: var(--er-text);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: visible; 
    transition: box-shadow .18s ease, transform .18s ease;
}
.er-pro-card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,.16);
  /* transform: translateY(-2px); */
  /* filter: brightness(1.05); */
}

.er-pro-media {
    display: block;
    line-height: 0;
    background: #000;
    border-radius: var(--er-radius) var(--er-radius) 0 0;
    overflow: hidden;
}
.er-pro-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.er-pro-media img:hover {
    filter: brightness(1.05);
}


/* =========================================================================
   2. BADGES (SELLOS)
   ========================================================================= */
.er-badges {
    position: absolute;
    top: 5px;
    right: -5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 40;
    pointer-events: auto;
}
.er-badge {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .16));
    transition: transform .18s ease, filter .18s ease;
}
.er-badge__shape {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, #ffffff 0, #fff8dd 32%, rgba(255,255,255,0) 60%),
    linear-gradient(135deg, #b57a00 0%, #f5e1a0 50%, #d8a63a 100%);
    /* La URL de la forma viene inyectada por PHP en el atributo style */
    -webkit-mask: var(--badge-shape) center/contain no-repeat;
    mask: var(--badge-shape) center/contain no-repeat;
}

.er-badge--nuevo .er-badge__shape {
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.9) 0, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #7B2CFF 0%, #f5e1a0 50%, #dba800 100%) !important;
}


/* =========================================================================
   3. TOOLTIPS — MISMO TEXTO EN MOBILE Y DESKTOP
   ========================================================================= */

.er-badge {
    position: relative;
}

.er-badge[data-tip-mobile]::after {
    content: attr(data-tip-mobile);

    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;

    width: max-content;
    max-width: 170px;
    padding: 6px 9px;

    color: #fdfdfd;
    background:
        radial-gradient(
            circle at 20% 0,
            rgba(255,255,255,.20),
            rgba(10,12,18,.95)
        );

    border: 1px solid rgba(245,214,135,.95);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0,0,0,.45);

    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;

    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px) scale(.96);
    transform-origin: top right;

    transition:
        opacity .18s ease,
        transform .18s ease;
}

/* Activado por toque mediante el JS existente */
.er-badge.is-visible::after {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.er-badge:hover,
.er-badge:focus-visible,
.er-badge.is-visible {
    z-index: 60;
}

/* Hover real: únicamente dispositivos con mouse */
@media (hover: hover) and (pointer: fine) {
    .er-badge[data-tip-mobile]:hover::after,
    .er-badge[data-tip-mobile]:focus-visible::after {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================================
   4. BODY, ACTIONS & RESPONSIVE
   ========================================================================= */
.er-pro-body {
    padding: 11px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.er-pro-name {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.25;
    text-align: center;
}

.er-pro-name-link{ 
  color: inherit; 
  text-decoration: none;
 }

.er-pro-name-link:hover{ 
  text-decoration: none;
  color: inherit;
 }


.er-pro-name .er-name-sep-pin {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin: 0 1px 0 1px;
    background: var(--er-accent);
   -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000' d='M12 2a6 6 0 0 0-6 6c0 4.97 6 12 6 12s6-7.03 6-12a6 6 0 0 0-6-6zm0 9a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000' d='M12 2a6 6 0 0 0-6 6c0 4.97 6 12 6 12s6-7.03 6-12a6 6 0 0 0-6-6zm0 9a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.er-pro-tagline {
    font-size: 0.9rem;
    color: var(--er-muted);
    text-align: center;
    margin: 0 0 8px;
}
.er-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}
.er-tag {
    background: #fff9f2;
    border: 1px solid #fabb67;
    color: #000;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: .78rem;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
    will-change: transform;
}
.er-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .06);
}

.er-tag.er-tag--solo-terapeuticos {
    background: #e79a32;
    border: 1px solid #fff4e6;
    color: #ffffff;
    white-space: nowrap;
    font-weight: 600;
}

.er-tag--price {
    background: var(--price-bg);
    border: 1px solid var(--price-bd);
    color: var(--price-fg);
    font-weight: 700;
}
.er-tag.er-tag--price:hover {
    background: var(--price-bg-h);
    border-color: var(--price-bd-h);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .08);
    transform: translateY(-1px) scale(1.02);
}
.er-tag.er-tag--price::before {
  content: "$";
  margin-right: 4px;
  opacity: .85;
}

.er-pro-meta {
    text-align: center;
    margin: 8px 0 12px;
}
.er-meta-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--er-cta);
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(37, 160, 66, 0.4);
}

.er-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
}
.er-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: .2s;
}
.er-btn.secondary {
    background: #fff;
    color: var(--er-cta);
    border: 1px solid var(--er-cta);
    white-space: nowrap;
}

.er-btn.secondary:hover {
    transform: scale(1.10);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

.er-icon-btn { /* Estilos del botón de WhatsApp */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  background: #25D366;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.er-icon-btn:hover {
    transform: scale(1.10);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

.er-icon-btn__icon {
    display: block;
    width: 22px;
    height: 22px;
    background-image: url("https://espaciorelax.net/wp-content/uploads/2025/11/Digital_Glyph_White.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ====================================================
   Versión compacta de las cards (listados largos)
   ==================================================== */

.er-list-compact .er-pro-card {
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

/* Imagen más baja: antes era 2/3, la pasamos a 4/5 */
.er-list-compact .er-pro-media img {
  aspect-ratio: 4 / 5;
}

/* Menos padding en el cuerpo */
.er-list-compact .er-pro-body {
  padding: 10px 10px 12px;
}

/* Título un pelín más chico */
.er-list-compact .er-pro-name {
  font-size: 1rem;
  margin-bottom: 4px;
}

/* Chips más pegados */
.er-list-compact .er-tags {
  gap: 6px;
  margin: 4px 0 4px;
}

.er-list-compact .er-tag {
  font-size: .75rem;
  padding: 3px 7px;
}

/* Botón Ver perfil más compacto */
.er-list-compact .er-actions {
  margin-top: 8px;
  gap: 8px;
}

/* En estas listas largas normalmente no ponés WhatsApp,
   así que solo ajusto el botón secundario por las dudas */
.er-list-compact .er-btn.secondary {
  font-size: 0.9rem;
  padding: 6px 10px;
}

/* =========================================================
   TOP 4 — reutiliza los estilos comerciales globales
   ========================================================= */

.er-top4-badge {
    display: none;
}

.er-pro-grid--premium .er-card-top4 .er-top4-badge {
    display: block;
    z-index: 20;

    border: 1px solid #d3af5c;
    background: #234f3f;
    color: #f6e7bb;
}

/* En perfiles Top, ocultar la etiqueta comercial Estelar */
.er-pro-grid--premium
.er-card-top4
.er-card-commercial-badge--premium {
    display: none !important;
}


/* MEDIA QUERIES (Desktop/Mobile) */
@media (min-width: 320px) {
.er-pro-grid {
  grid-template-columns: repeat(2, 1fr); }
}

/* --- C. TABLET (MIN-WIDTH: 480PX) --- */
@media (min-width: 480px) {
.er-badges {
  top: 5px;
  right: -5px; /* CLAVE: Asegura que el sello sobresalga en este rango */
  gap: 8px;
}
.er-badge {
  width: 36px;
  height: 36px;
}
}


/* MÓVIL GRANDE / LANDSCAPE (MIN-WIDTH: 576px) - 3 col - */
@media (min-width: 576px) {
  .er-pro-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* TABLETA (MIN-WIDTH: 768px) - 4 col - */
@media (min-width: 768px) {
  .er-pro-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
.er-badge {
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
  transform-origin: center; }

.er-badge:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .45)) brightness(1.08); }

}

/* ESCRITORIO ESTÁNDAR (MIN-WIDTH: 1200px) - 4 col - */
@media (min-width: 1200px) {
.er-pro-grid {
  grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================
   CARD COMPLETA CONSOLIDADA
   Antes pertenecía al plugin ER Cards Globales.
   ========================================================= */
.er-pro-card.er-card-enhanced-v1 {
  position: relative;
}

.er-card-commercial-badge {
  position: absolute;
  z-index: 7;
  top: 12px;
  left: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .2);
}

.er-card-commercial-badge--premium {
  background: linear-gradient(135deg, #8b620d, #d1a43b);
}

.er-card-commercial-badge--select {
  background: linear-gradient(135deg, #155f2b, #3c9b54);
}

.er-card-commercial-badge--destacada {
  background: linear-gradient(135deg, #a55019, #d98a48);
}

.er-card-tier--premium {
  border: 2px solid #b98919;
  box-shadow: 0 12px 30px rgba(117, 82, 10, .18);
}

.er-card-tier--select {
  border: 2px solid #267a3c;
  box-shadow: 0 10px 24px rgba(30, 111, 52, .13);
}

.er-card-tier--destacada {
  border: 1px solid #e2a36d;
}

.er-card-mode-group {
  display: flex;
  flex: 0 0 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin: 2px 0;
}

.er-card-mode-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid #d7dfd8;
  border-radius: 999px;
  background: #f2f4f2;
  color: #56635a;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.er-pro-card .er-card-mode-chip > svg {
  display: block;
  width: 13px;
  height: 13px;
  max-width: 13px;
  max-height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 640px) {
  .er-pro-card .er-card-commercial-badge {
    top: 8px !important;
    left: 0 !important;
    right: auto !important;
    padding: 4px 8px;
    min-height: 0;
    max-width: calc(100% - 12px);
    border-radius: 0 999px 999px 0 !important;
    font-size: 9px;
    line-height: 1.1;
    letter-spacing: .02em;
    white-space: nowrap;
    transform: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .16);
  }

  .er-card-mode-group {
    gap: 4px;
    margin: 0;
  }

  .er-card-mode-chip {
    gap: 3px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .er-pro-card .er-card-mode-chip > svg {
    width: 11px;
    height: 11px;
    max-width: 11px;
    max-height: 11px;
    flex-basis: 11px;
  }
}
