/* ── HOME ─────────────────────────────────── */

/* ── Header ───────────────────────────────── */

.home__header {
  background: var(--color-bg-elevated);
  padding: 52px var(--screen-padding) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.home__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.home__greeting {
  font-size: var(--text-label-md);
  color: var(--color-text-subtle);
  margin-bottom: 2px;
}

.home__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--color-text-primary);
  line-height: 1.1;
}

.home__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-circle);
  background: var(--color-brand-primary);
  color: #fff;
  font-size: var(--text-heading-sm);
  font-weight: var(--fw-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home__search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg-muted);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.home__search:active {
  background: var(--color-border-subtle);
}

.home__search-placeholder {
  font-size: var(--text-body-md);
  color: var(--color-text-subtle);
  flex: 1;
}

/* ── Body scrollable ─────────────────────── */

.home__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--screen-padding) 0;
}

/* ── Tarjeta despensa ────────────────────── */

.home__pantry-card {
  background: linear-gradient(135deg, #2a4030 0%, #3d5a40 100%);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: var(--space-5);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.home__pantry-card__bubble {
  position: absolute;
  border-radius: var(--radius-circle);
  background: rgba(255, 255, 255, 0.06);
}

.home__pantry-card__bubble--tl {
  width: 120px;
  height: 120px;
  top: -20px;
  right: -20px;
}

.home__pantry-card__bubble--br {
  width: 80px;
  height: 80px;
  bottom: -40px;
  right: 30px;
  background: rgba(255, 255, 255, 0.04);
}

.home__pantry-card__label {
  font-size: var(--text-label-sm);
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: var(--space-2);
  position: relative;
}

.home__pantry-card__count {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: var(--fw-semibold);
  color: #fff;
  line-height: 1;
  margin-bottom: var(--space-1);
  position: relative;
}

.home__pantry-card__count span {
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  font-weight: var(--fw-normal);
}

.home__pantry-card__cats {
  font-size: var(--text-body-sm);
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: var(--space-4);
  position: relative;
}

.home__pantry-card__btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-chip);
  font-size: var(--text-label-md);
  font-weight: var(--fw-semibold);
  position: relative;
  transition: background var(--duration-fast) var(--ease-standard);
}

.home__pantry-card__btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Label de sección + filtros ─────────── */

.home__section-label {
  font-size: var(--text-label-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: var(--space-3);
}

.home__filter-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  overflow-x: auto;
  margin-bottom: var(--space-5);
  margin-inline: calc(-1 * var(--screen-padding));
  padding-inline: var(--screen-padding);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.home__filter-bar::-webkit-scrollbar { display: none; }

/* ── Secciones ───────────────────────────── */

.home__section {
  margin-bottom: var(--space-6);
}

.home__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.home__section-title {
  font-family: var(--font-display);
  font-size: var(--text-heading-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}

.home__section-link {
  font-size: var(--text-label-md);
  font-weight: var(--fw-medium);
  color: var(--color-brand-primary);
}

/* ── Tarjetas "Puedes cocinar ahora" ─────── */

.home__cook-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.home__cook-card {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard);
}

.home__cook-card:active { transform: scale(0.98); }

.home__cook-card__img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.home__cook-card__body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
}

.home__cook-card__name {
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--space-1);
}

.home__cook-card__meta {
  font-size: var(--text-body-sm);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-2);
}

.home__cook-card__match {
  display: inline-block;
  font-size: var(--text-label-sm);
  font-weight: var(--fw-semibold);
  padding: 3px 8px;
  border-radius: var(--radius-chip);
}

.home__cook-card > svg {
  margin-right: var(--space-3);
  flex-shrink: 0;
}

/* ── Recetas guardadas (scroll horizontal) ─ */

.home__saved-scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  margin-inline: calc(-1 * var(--screen-padding));
  padding-inline: var(--screen-padding);
  padding-bottom: var(--space-2);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.home__saved-scroll::-webkit-scrollbar { display: none; }

.home__saved-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.home__saved-card__img {
  height: 100px;
}

.home__saved-card__body {
  padding: 12px;
}

.home__saved-card__name {
  font-size: var(--text-label-lg);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  line-height: 1.3;
  margin-bottom: var(--space-1);
}

.home__saved-card__meta {
  font-size: var(--text-label-sm);
  color: var(--color-text-subtle);
}

/* ── AiHub banner ────────────────────────── */

.home__ai-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: linear-gradient(135deg,#2a1a08,#5a3a08);
  border: 1.5px solid rgba(212,168,48,.3);
  border-radius: 16px;
  padding: 13px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
}

.home__ai-banner__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg,#d4a830,#b8860b);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(212,168,48,.3);
}

.home__ai-banner__text { flex: 1; }

.home__ai-banner__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ai-golden);
  margin-bottom: 2px;
}

.home__ai-banner__sub {
  font-size: 12px;
  color: rgba(212,168,48,.65);
}

/* ── FamilyKitchen banner ─────────────────── */

.home__fk-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: linear-gradient(135deg,#1a2e20,#2d5240);
  border: none;
  border-radius: 16px;
  padding: 13px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
}

.home__fk-banner__avatars {
  display: flex;
  flex-shrink: 0;
}

.home__fk-banner__text { flex: 1; }

.home__fk-banner__title {
  font-size: 13px;
  font-weight: 700;
  color: #f5f0e8;
  margin-bottom: 2px;
}

.home__fk-banner__sub {
  font-size: 12px;
  color: rgba(245,240,232,.6);
}

/* ── Espacio inferior (clearance navbar) ─── */

.home__bottom-space {
  height: calc(var(--nav-h) + var(--space-4));
}

/* ── Search activo ────────────────────────────── */
.home__header--search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--screen-padding);
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.home__search--active {
  flex: 1;
  cursor: default;
}

.home__search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  width: 100%;
  min-width: 0;
}

.home__search-cancel {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-brand-primary);
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Search results ───────────────────────────── */
.home__search-count {
  font-size: 13px;
  color: var(--color-text-subtle);
  padding: 12px var(--screen-padding) 4px;
}

.home__search-results {
  display: flex;
  flex-direction: column;
  padding-bottom: 32px;
}

.home__search-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px var(--screen-padding);
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  background: var(--color-bg-elevated);
  transition: background 0.12s;
}
.home__search-card:active { background: var(--color-bg-surface); }

.home__search-card-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
}

.home__search-card-body {
  flex: 1;
  min-width: 0;
}

.home__search-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home__search-card-meta {
  font-size: 12px;
  color: var(--color-text-subtle);
  margin-bottom: 4px;
}

.home__search-card-match {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ── Empty / hint ─────────────────────────────── */
.home__search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 32px;
  gap: 10px;
  color: var(--color-text-subtle);
}

.home__search-hint {
  font-size: 15px;
  color: var(--color-text-subtle);
  margin-top: 40px;
}

.home__search-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 8px;
}

.home__search-empty-sub {
  font-size: 14px;
  color: var(--color-text-subtle);
  line-height: 1.5;
}
