/* ==========================================================================
   COMER BIEN — Estilos integrados con Cocina Radial
   Clases con prefijo .cb-* para no interferir con el menú circular.
   ========================================================================== */

:root {
  --cb-cream: #fbf7f1;
  --cb-cream-dark: #f1e6d8;
  --cb-forest: #2f7d4b;
  --cb-forest-dark: #225c36;
  --cb-sage: #e6f0ea;
  --cb-terracotta: #d9480f;
  --cb-border: #eadbc7;
  --cb-text: #231912;
  --cb-muted: #6e5947;
}

.cb-hidden {
  display: none !important;
}

/* Ajuste armónico en la topbar de Cocina Radial */
.topbar-inner {
  max-width: 1280px;
}

.topbar-controls {
  flex-wrap: nowrap;
  gap: 10px;
}

.topbar-controls .search-box {
  flex: 1 1 200px;
  max-width: 280px;
  min-width: 160px;
}

@media (max-width: 980px) {
  .topbar-controls {
    flex-wrap: wrap;
  }
}

/* Botón en topbar alineado con Favoritos */
.cb-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--cb-forest);
  background: var(--cb-forest);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.16s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.cb-auth-btn:hover {
  background: var(--cb-forest-dark);
}
.cb-auth-btn.is-logged {
  background: var(--cb-sage);
  color: var(--cb-forest-dark);
}

/* Link sutil y armónico debajo de la leyenda del menú radial */
.cb-guest-inline {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border, #e6dec8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted, #5c6670);
}

.cb-guest-inline-link {
  color: var(--cb-forest);
  font-weight: 700;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cb-sage);
  transition: 0.15s ease;
}
.cb-guest-inline-link:hover {
  background: var(--cb-forest);
  color: #fff;
}

/* Barra de cambio entre Menú Radial y COMER BIEN */
.cb-mode-bar {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cb-mode-pills {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

.cb-mode-pill {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: 0.16s ease;
}
.cb-mode-pill.active {
  background: #ffffff;
  color: var(--cb-forest);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.cb-user-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
}

/* Contenedor principal de COMER BIEN */
.cb-stage {
  max-width: 1200px;
  margin: 14px auto 48px;
  padding: 0 16px;
  color: var(--cb-text);
}

.cb-subnav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  scrollbar-width: none;
}
.cb-subnav::-webkit-scrollbar {
  display: none;
}

.cb-subnav-btn {
  border: none;
  background: transparent;
  color: #475569;
  padding: 8px 13px;
  border-radius: 11px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.16s ease;
}
.cb-subnav-btn:hover {
  background: #f1f5f9;
  color: var(--cb-forest);
}
.cb-subnav-btn.active {
  background: var(--cb-forest);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 111, 78, 0.25);
}

/* Cards y grilla */
.cb-hero {
  background: linear-gradient(135deg, var(--cb-forest), var(--cb-forest-dark));
  color: #fff;
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.cb-hero h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  color: #fff;
}
.cb-hero-stats {
  display: flex;
  gap: 10px;
}
.cb-stat {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 112px;
}
.cb-stat small {
  display: block;
  font-size: 11px;
  color: #d1fae5;
}
.cb-stat strong {
  display: block;
  font-size: 20px;
  margin-top: 2px;
}

.cb-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.cb-section-head h3 {
  margin: 0;
  font-size: 20px;
  color: var(--cb-text);
}

.cb-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 680px) {
  .cb-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cb-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 680px) {
  .cb-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .cb-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cb-grid-4 {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .cb-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cb-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px;
  color: var(--cb-text);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.cb-card-dashed {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  box-shadow: none;
}

.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}
.cb-btn-primary {
  background: var(--cb-forest);
  color: #fff;
}
.cb-btn-primary:hover {
  background: var(--cb-forest-dark);
}
.cb-btn-secondary {
  background: var(--cb-sage);
  color: var(--cb-forest-dark);
}
.cb-btn-accent {
  background: var(--cb-terracotta);
  color: #fff;
}
.cb-btn-outline {
  background: #fff;
  color: var(--cb-text);
  border-color: #d4c8ae;
}
.cb-btn-ghost {
  background: transparent;
  color: var(--cb-muted);
}
.cb-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 9px;
}

.cb-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.cb-badge-green {
  background: #d1fae5;
  color: #065f46;
}
.cb-badge-amber {
  background: #fef3c7;
  color: #92400e;
}
.cb-badge-sage {
  background: var(--cb-sage);
  color: var(--cb-forest-dark);
}
.cb-badge-orange {
  background: #ffedd5;
  color: #9a3412;
}

.cb-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cb-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #d4c8ae;
  background: var(--cb-cream);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-text);
  cursor: pointer;
}
.cb-chip.active {
  background: var(--cb-forest);
  border-color: var(--cb-forest);
  color: #fff;
}
.cb-chip-warn.active {
  background: var(--cb-terracotta);
  border-color: var(--cb-terracotta);
  color: #fff;
}

.cb-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cb-field label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}
.cb-field input,
.cb-field select,
.cb-field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #d4c8ae;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--cb-text);
}

.cb-alert {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.cb-alert-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}
.cb-alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.cb-alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

/* Recetas */
.cb-recipe-card {
  background: #fff;
  border: 1px solid var(--cb-border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cb-recipe-thumb {
  position: relative;
  height: 165px;
  background: var(--cb-sage);
  cursor: pointer;
}
.cb-recipe-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cb-recipe-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

/* Planificador */
.cb-day-card {
  background: #fff;
  border: 1px solid var(--cb-border);
  border-radius: 18px;
  overflow: hidden;
}
.cb-day-head {
  background: var(--cb-cream);
  padding: 10px 16px;
  border-bottom: 1px solid var(--cb-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cb-slot-cell {
  padding: 12px;
  border-bottom: 1px solid var(--cb-cream-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 112px;
}
@media (min-width: 760px) {
  .cb-slot-cell {
    border-bottom: none;
    border-right: 1px solid var(--cb-cream-dark);
  }
  .cb-slot-cell:last-child {
    border-right: none;
  }
}

/* Modal COMER BIEN */
.cb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.cb-modal-box {
  background: #fff;
  color: var(--cb-text);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid var(--cb-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.cb-modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Rueda circular de ingredientes para ¿Qué cocino hoy? */
.cb-pantry-wheel-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: center;
}
@media (min-width: 820px) {
  .cb-pantry-wheel-wrap {
    grid-template-columns: 360px 1fr;
  }
}

.cb-pantry-svg {
  width: 100%;
  max-width: 350px;
  height: auto;
  margin: 0 auto;
  display: block;
  user-select: none;
}

.cb-pantry-wedge {
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.cb-pantry-wedge:hover path {
  filter: brightness(0.95);
}

.cb-pantry-center {
  cursor: pointer;
}
.cb-pantry-center:hover circle {
  fill: var(--cb-forest-dark);
}

.radial-sector.is-disabled {
  opacity: 0.42;
  filter: grayscale(0.75);
  cursor: not-allowed !important;
}
.radial-sector.is-disabled:hover {
  transform: none !important;
}

/* Barra rápida dentro de receta.modal de Cocina Radial */
.cb-radial-log-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cb-sage);
  border: 1px solid #c6dec9;
}
