/* Carta de alérgenos — estilo Tepuy (ORCHA data) */
:root {
  --alerg-surface: #fff8ef;
  --alerg-muted: #534840;
}

.page-alergenos .alergenos-hero {
  padding-block: 32px 22px;
}

.page-alergenos .alergenos-hero h1 {
  margin-bottom: 0;
}

.alergenos-app-wrap {
  padding-top: 36px;
}

.alergenos-app {
  display: grid;
  gap: 18px;
}

.alergenos-card {
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--alerg-surface);
  box-shadow: 5px 5px 0 var(--ink);
}

.alergenos-header {
  display: grid;
  gap: 14px;
}

.alergenos-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}

.alergenos-header-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.alergenos-header-copy {
  flex: 1 1 220px;
  min-width: 0;
}

.alergenos-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--alerg-muted);
}

.alergenos-menu-title {
  margin: 0 0 8px;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  line-height: 1;
  text-transform: uppercase;
}

.alergenos-updated {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--alerg-muted);
}

.alergenos-disclaimer {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--alerg-muted);
}

.alergenos-disclaimer strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: "Space Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.alergenos-filters {
  display: grid;
  gap: 12px;
}

@media (min-width: 760px) {
  .alergenos-filters {
    grid-template-columns: 1fr 1fr;
  }
}

.alergenos-field {
  display: grid;
  gap: 6px;
}

.alergenos-field label {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.alergenos-field input,
.alergenos-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.alergenos-field input:focus-visible,
.alergenos-field select:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.alergenos-bread-dual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.alergenos-bread-dual span {
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  color: var(--alerg-muted);
}

.alergenos-bread-dual span.is-active {
  color: var(--ink);
  font-weight: 900;
}

.alergenos-switch {
  position: relative;
  width: 52px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}

.alergenos-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--brand);
  transition: transform 0.18s ease;
}

.alergenos-switch[aria-checked="true"]::after {
  transform: translateX(22px);
}

.alergenos-panel-head h2 {
  margin: 0 0 6px;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.alergenos-panel-head p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--alerg-muted);
}

.alergenos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.alergenos-tab {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.alergenos-tab:hover,
.alergenos-tab.is-active {
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translateY(-1px);
}

.alergenos-table-wrap {
  overflow-x: auto;
}

.alergenos-table {
  width: 100%;
  border-collapse: collapse;
}

.alergenos-table th {
  padding: 10px 12px;
  border-bottom: 2px solid var(--ink);
  text-align: left;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--alerg-muted);
}

.alergenos-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(23, 23, 23, 0.14);
  vertical-align: top;
}

.alergenos-item-name {
  font-weight: 900;
  line-height: 1.25;
}

.alergenos-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.08);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  vertical-align: middle;
}

.alergenos-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(23, 23, 23, 0.18);
  list-style: none;
  padding-left: 0;
}

.alergenos-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 4px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}

.alergenos-icon-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.alergenos-icon-btn.is-open {
  background: var(--yellow);
}

.alergenos-icon-tip {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  font-size: 0.82rem;
  font-weight: 900;
}

.alergenos-empty {
  padding: 28px 12px;
  text-align: center;
  font-weight: 800;
  color: var(--alerg-muted);
}

.alergenos-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .alergenos-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.alergenos-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.alergenos-legend img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.alergenos-powered {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--alerg-muted);
}

.alergenos-powered a {
  color: var(--teal);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.alergenos-error {
  padding: 24px;
  border: 2px solid var(--brand-dark);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 5px 5px 0 var(--brand-dark);
  text-align: center;
}

.alergenos-error p {
  margin: 0 0 14px;
  font-weight: 800;
}

.alergenos-error button {
  min-height: 42px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--brand);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}

.alergenos-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  font-weight: 900;
  color: var(--alerg-muted);
}

.alergenos-loading::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid rgba(23, 23, 23, 0.15);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: alergSpin 0.8s linear infinite;
}

@keyframes alergSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .page-alergenos .section {
    padding-inline: clamp(36px, 7vw, 96px);
  }

  .page-alergenos .alergenos-hero {
    padding-block: 44px 28px;
  }

  .alergenos-app-wrap {
    padding-top: 48px;
  }
}
