/* GH · Mis guardados · front
 * Corazón de productos (miniaturas + ficha), botón «Guardar» de gamas y
 * página de tarjetas de productos.
 * BEM con prefijo .ghg- · tokens del tema con fallback.
 * Verde = acción normal (convención de colores del proyecto). */

/* ─── Corazón de guardar producto ─────────────────────────────────── */

.ghg-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--gh-grey-600, #525252);
  background: var(--gh-white, #fff);
  border: 1px solid var(--gh-grey-200, #e5e5e5);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s ease, scale 0.15s ease;
}

/* `scale` (no `transform`): así el realce se suma al `translate` con el que
   se coloca alguna variante (--title) en lugar de sustituirlo; con
   `transform` el corazón del título bajaba media altura al pasar el ratón,
   salía de debajo del puntero y temblaba (2026-11-08). */
.ghg-heart:hover {
  color: var(--gh-green-700, #1d7a4f);
  scale: 1.08;
}

.ghg-heart.is-saved {
  color: var(--gh-green-600, #23915e);
  border-color: var(--gh-green-200, #bfe3d2);
}

.ghg-heart:disabled {
  opacity: 0.6;
  cursor: default;
}

.ghg-heart__icon {
  font-size: 20px;
  line-height: 1;
}

/* Sobre la imagen de la miniatura (el ancla es su bloque superior) */
.product-miniature__top {
  position: relative;
}

.ghg-heart--overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* En la ficha, junto al botón de comprar */
.ghg-heart--inline {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

/* Corazón de gama en la barra del título de la categoría (category-header.tpl
   del tema: .category__titlebar es su ancla). Sustituye desde 2026-11-08 a la
   píldora «Guardar» que iba bajo el título. */
.ghg-heart--title {
  position: absolute;
  top: 50%;
  right: 16px;
  z-index: 2;
  translate: 0 -50%;
}

/* ─── Página «Mis guardados» ──────────────────────────────────────── */

/* Hero a sangre · pegado bajo el menú (misma receta que el estudio de hogar).
   El ancho del wrapper lo libera el tema (pages/_module-guardados.scss). */
.ghg-hero {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
  margin-bottom: 44px;
}

/* Contenido alineado al raíl del header (mismo mecanismo que el estudio) */
.ghg-page {
  max-width: var(--gh-container, 1500px);
  margin: 0 auto;
  padding: 0 var(--gh-space-24, 96px) 64px;
}

/* Layout de dos columnas · nav izquierda + contenido amplio
   (misma estructura que el estudio de hogar, con tokens del sistema) */
.ghg-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: start;
}

.ghg-nav {
  position: sticky;
  top: 20px;
  padding: 18px 18px 18px 0;
}

.ghg-nav__title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gh-grey-500, #737373);
}

.ghg-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ghg-nav__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gh-grey-900, #171717);
  border-radius: 11px;
}

.ghg-nav__item.is-active {
  background: var(--gh-green-50, #edf7f2);
  box-shadow: inset 0 0 0 1px var(--gh-green-200, #bfe3d2);
}

.ghg-nav__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--gh-green-600, #23915e);
}

/* Aviso de invitado: lo guardado vive en este navegador */
.ghg-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--gh-space-5, 24px);
  padding: 16px 20px;
  background: var(--gh-green-50, #edf7f2);
  border: 1px solid var(--gh-green-200, #bfe3d2);
  border-radius: var(--gh-radius-lg, 12px);
}

.ghg-notice__text {
  margin: 0;
  color: var(--gh-green-900, #0f3d2e);
  font-size: var(--gh-text-sm, 0.875rem);
}

/* CTA · misma receta que el botón de compra (verde sólido, píldora) */
.ghg-notice__cta {
  display: inline-block;
  padding: 10px 20px;
  font-size: var(--gh-text-sm, 0.875rem);
  font-weight: 700;
  color: #fff;
  background: var(--gh-green-600, #23915e);
  border-radius: var(--gh-radius-full, 999px);
  text-decoration: none;
  white-space: nowrap;
}

.ghg-notice__cta:hover,
.ghg-notice__cta:focus {
  color: #fff;
  background: var(--gh-green-700, #1d7a4f);
}

/* Rejilla de tarjetas de productos · tarjeta presente = producto guardado
   (con sesión las pinta el servidor; sin sesión las inyecta el JS) */
.ghg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gh-space-4, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ghg-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--gh-white, #fff);
  border: 1px solid var(--gh-grey-200, #e5e5e5);
  border-radius: var(--gh-radius-lg, 12px);
}

.ghg-card__imgwrap {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--gh-white, #fff);
}

.ghg-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ghg-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  padding: 14px 16px 16px;
}

.ghg-card__title {
  margin: 0;
  font-size: var(--gh-text-base, 1rem);
  font-weight: 700;
  color: var(--gh-grey-900, #171717);
}

.ghg-card__price {
  margin: 0;
  font-size: var(--gh-text-base, 1rem);
  font-weight: 700;
  color: var(--gh-green-800, #14532d);
}

.ghg-card__regular-price {
  margin-left: 6px;
  font-size: var(--gh-text-sm, 0.875rem);
  font-weight: 400;
  color: var(--gh-grey-500, #737373);
  text-decoration: line-through;
}

.ghg-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.ghg-card__go {
  display: inline-block;
  padding: 8px 16px;
  font-size: var(--gh-text-sm, 0.875rem);
  font-weight: 700;
  color: #fff;
  background: var(--gh-green-600, #23915e);
  border-radius: var(--gh-radius-full, 999px);
  text-decoration: none;
}

.ghg-card__go:hover,
.ghg-card__go:focus {
  color: #fff;
  background: var(--gh-green-700, #1d7a4f);
}

.ghg-card__remove {
  padding: 8px 12px;
  font-size: var(--gh-text-sm, 0.875rem);
  color: var(--gh-grey-600, #525252);
  background: transparent;
  border: 0;
  border-radius: var(--gh-radius-full, 999px);
  cursor: pointer;
}

.ghg-card__remove:hover {
  color: var(--gh-grey-900, #171717);
  background: var(--gh-grey-100, #f5f5f5);
}

/* Estado vacío */
.ghg-empty {
  margin: var(--gh-space-6, 32px) 0;
  text-align: center;
  color: var(--gh-grey-600, #525252);
}

.ghg-empty a {
  color: var(--gh-green-700, #1d7a4f);
  font-weight: 600;
}

/* ─── Cajón «Mis guardados» (categorías) ───────────────────────────
   Contenido que pinta la acción `panel` en el hueco de renderDrawerSlot();
   el cajón y la sección del estudio son del tema (_saved-drawer.scss). */
.ghg-panel__loading {
  margin: 0;
  font-size: var(--gh-text-sm, 0.875rem);
  color: var(--gh-grey-500, #737373);
}
.ghg-panel__sec + .ghg-panel__sec {
  margin-top: 28px;
}
.ghg-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: var(--gh-text-base, 1rem);
  font-weight: 700;
  color: var(--gh-grey-900, #171717);
}
.ghg-panel__count {
  min-width: 22px;
  padding: 1px 7px;
  font-size: var(--gh-text-xs, 0.75rem);
  font-weight: 700;
  text-align: center;
  color: var(--gh-green-700, #1d7a4f);
  background: var(--gh-green-50, #edf7f2);
  border-radius: var(--gh-radius-full, 999px);
}
.ghg-panel__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ghg-panel__empty {
  margin: 0;
  font-size: var(--gh-text-sm, 0.875rem);
  color: var(--gh-grey-500, #737373);
}
/* Fila compacta: miniatura · nombre (+ frase o precio) · Quitar. */
.ghg-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--gh-white, #fff);
  border: 1px solid var(--gh-grey-200, #e5e5e5);
  border-radius: var(--gh-radius-md, 10px);
}
.ghg-mini__link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.ghg-mini__img {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--gh-radius-sm, 6px);
  background: var(--gh-grey-100, #f5f5f5);
}
.ghg-mini__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ghg-mini__name {
  overflow: hidden;
  font-size: var(--gh-text-sm, 0.875rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--gh-grey-900, #171717);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ghg-mini__link:hover .ghg-mini__name {
  color: var(--gh-green-700, #1d7a4f);
}
.ghg-mini__sub {
  overflow: hidden;
  font-size: var(--gh-text-xs, 0.75rem);
  color: var(--gh-grey-500, #737373);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ghg-mini__remove {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: var(--gh-text-xs, 0.75rem);
  color: var(--gh-grey-600, #525252);
  background: transparent;
  border: 1px solid var(--gh-grey-200, #e5e5e5);
  border-radius: var(--gh-radius-full, 999px);
  cursor: pointer;
}
.ghg-mini__remove:hover {
  color: var(--gh-grey-900, #171717);
  border-color: var(--gh-grey-400, #a3a3a3);
}
