/* Reusable tab strip used by merged sections (Bolsa de Empleo, Mis
 * Lugares, Programa de Lealtad). Each section has 2 tabs that swap the
 * body. The description card under the tabs explains what the active
 * tab does so the UI stays self-explanatory.
 */

.section-tabs-bar {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
  padding: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex-wrap: wrap;
}

.section-tab-btn {
  flex: 1 1 0;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.section-tab-btn:hover:not(.is-active) {
  color: var(--text);
  background: rgba(0, 0, 0, .03);
}

.section-tab-btn.is-active {
  background: var(--surface, #fff);
  color: var(--primary);
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.section-tab-btn:active {
  transform: scale(.98);
}

.section-tab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.section-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 4px;
  background: rgba(249, 115, 22, .15);
  color: var(--primary);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.section-tab-btn.is-active .section-tab-badge {
  background: var(--primary);
  color: #fff;
}

/* Body panels — only the active one is visible. We keep both in the DOM
 * so the existing loaders can render into their containers regardless
 * of which tab is showing.
 */
.section-tab-panel {
  display: none;
  animation: section-tab-fade .25s ease;
}

.section-tab-panel.is-active {
  display: block;
}

@keyframes section-tab-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Per-tab explanation card. Soft tinted box so the user understands
 * what each tab is for without reading documentation.
 */
.section-tab-desc {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: rgba(249, 115, 22, .06);
  border: 1px solid rgba(249, 115, 22, .15);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.section-tab-desc-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--primary);
  margin-top: 1px;
}

.section-tab-desc strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Sub-header row inside a panel — title-row analog scoped to the tab. */
.section-tab-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  .section-tab-panel { animation: none; }
}

@media (max-width: 540px) {
  .section-tabs-bar { flex-direction: column; }
  .section-tab-btn { flex: 1 1 auto; min-width: 0; }
}

/* ─── Menu explainer card ───
 * Shown above the "Mis Menús" list to prevent the common mistake of
 * creating a menú named "Bebidas" — that's a section inside a menu,
 * not a menu itself.
 */
.menu-explainer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin: 14px 0 22px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, .08), rgba(249, 115, 22, .03)),
    var(--bg-card, #fff);
  border: 1px solid rgba(249, 115, 22, .2);
  border-radius: 16px;
  box-shadow: 0 6px 18px -12px rgba(249, 115, 22, .35);
}

.menu-explainer-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.menu-explainer-body strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary, #F97316);
}
.menu-explainer-body p {
  margin: 4px 0 0;
}
.menu-explainer-body b {
  color: var(--text);
  font-weight: 700;
}
.menu-explainer-body u {
  text-decoration: underline;
  text-decoration-color: rgba(249, 115, 22, .55);
  text-underline-offset: 2px;
  font-weight: 700;
}

.menu-explainer-tree {
  min-width: 200px;
  padding: 12px 14px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.menu-explainer-tree-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  font-weight: 800;
  color: var(--text);
}
.menu-explainer-tree-ic {
  color: var(--primary, #F97316);
  flex-shrink: 0;
}
.menu-explainer-tree-branch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 4px 14px;
  position: relative;
  color: var(--text-secondary);
}
.menu-explainer-tree-branch::before {
  content: "└";
  position: absolute;
  left: 0;
  color: rgba(249, 115, 22, .55);
  font-weight: 700;
}
.menu-explainer-tree-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: rgba(249, 115, 22, .12);
  color: var(--primary);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .menu-explainer { grid-template-columns: 1fr; }
  .menu-explainer-tree { width: 100%; }
}

/* ─── Inline hint inside the "Nuevo menú" modal ───
 * Small banner at the top of the form reminding the user that a menú
 * is the whole carta, not a single section.
 */
.menu-modal-hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(249, 115, 22, .07);
  border: 1px solid rgba(249, 115, 22, .22);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}
.menu-modal-hint svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--primary, #F97316);
}
.menu-modal-hint b {
  color: var(--primary, #F97316);
  font-weight: 700;
}
