:root {
  --navy: #13264a;
  --navy-2: #1e3766;
  --orange: #e8821e;
  --orange-d: #c9650c;
  --gold: #e9b44c;
  --cream: #fbf6ec;
  --paper: #fffdf8;
  --line: #eadfca;
  --ink: #1b2233;
  --muted: #6b6f7c;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(19, 38, 74, .06), 0 8px 24px -12px rgba(19, 38, 74, .18);
  --display: "Barlow Condensed", system-ui, sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --script: "Caveat Brush", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.45;
}
button { font: inherit; color: inherit; cursor: pointer; }
strong { font-weight: 700; }

.wrap { margin-inline: auto; }

/* ---------- Cabecera ---------- */
.masthead {
  position: relative; z-index: 20;
  background: var(--navy);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 16px 14px;
  text-align: center;
}
.masthead__name { min-width: 0; }
.brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: .7rem;
  color: var(--gold);
}
.title { margin: 0; line-height: 1; }
.title__top {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.title__script {
  font-family: var(--script);
  font-weight: 400;
  color: var(--orange);
  font-size: 1.9rem;
}

/* ---------- Logo y desplegable "Sobre nosotros" ---------- */
.about { position: relative; flex: none; }
.about__toggle {
  display: block; padding: 0; border: 0; background: none;
  border-radius: 50%;
  transition: transform .15s;
}
.about__toggle:hover { transform: scale(1.06); }
.about__toggle:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.about__toggle img {
  display: block; width: 56px; height: 56px;
  border-radius: 50%; object-fit: cover; background: #fff;
  border: 3px solid var(--gold);
}
.about__panel {
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 32px));
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-top: 4px solid var(--orange);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 18px 40px -14px rgba(19, 38, 74, .45);
  font-size: .9rem;
  text-align: center;
}
.about__panel::before {
  content: ""; position: absolute; top: -11px; left: 50%; margin-left: -7px;
  border: 7px solid transparent; border-bottom-color: var(--orange); border-top: 0;
}
.about__panel p { margin: 0 0 8px; }
.about__logo {
  display: block; width: 96px; height: 96px; margin: 0 auto 10px;
  border-radius: 50%; object-fit: cover; background: #fff;
  border: 3px solid var(--gold);
}
.about__cta {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; font-size: 1.05rem; color: var(--navy);
}
.social { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 8px; }
.social a {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: #fff;
  transition: background-color .15s, transform .15s;
}
.social a:hover { background: var(--orange); transform: translateY(-2px); }
.social a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.social svg { width: 18px; height: 18px; }

/* ---------- Layout ---------- */
.wrap { width: min(980px, 100% - 24px); }
.layout { display: grid; gap: 10px; padding: 12px 0 20px; }
.controls, .results { display: grid; gap: 10px; }

@media (min-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 20px; padding-top: 24px; }
  .results { position: sticky; top: 16px; }
}

/* ---------- Paneles ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
}
.hint { margin: 8px 0; color: var(--muted); font-size: .85rem; }

/* ---------- Diámetro ---------- */
.readout { margin: 0; display: flex; align-items: baseline; gap: 2px; color: var(--navy); line-height: 1; }
.readout output { font-family: var(--display); font-weight: 800; font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.readout span { font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--orange); }

.slider { position: relative; padding-bottom: 24px; }
.slider input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 34px; background: transparent; margin: 0; touch-action: pan-y;
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
}
.slider input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px; margin-top: -10px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--navy);
  box-shadow: 0 3px 10px rgba(19, 38, 74, .35);
}
.slider input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--navy);
  box-shadow: 0 3px 10px rgba(19, 38, 74, .35);
}
.slider input:focus-visible { outline: none; }
.slider input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(232, 130, 30, .35); }
/* Las marcas se alinean con el centro del pulgar (14px = mitad de su ancho) */
.ticks { position: absolute; left: 14px; right: 14px; bottom: 0; height: 22px; }
.tick {
  position: absolute; transform: translateX(-50%);
  border: 0; background: none; padding: 2px 3px;
  font-family: var(--display); font-weight: 600; font-size: .82rem;
  color: var(--muted);
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.tick.is-active { color: #fff; background: var(--orange); }
/* Gramos: solo la franja que admite el diámetro va en color; el resto, gris */
#noodle-g {
  --band: linear-gradient(90deg,
    var(--line) calc(14px + (100% - 28px) * var(--lo, 0)),
    var(--gold) calc(14px + (100% - 28px) * var(--lo, 0)),
    var(--orange) calc(14px + (100% - 28px) * var(--hi, 1)),
    var(--line) calc(14px + (100% - 28px) * var(--hi, 1)));
}
#noodle-g::-webkit-slider-runnable-track { background: var(--band); }
#noodle-g::-moz-range-track { background: var(--band); }
.tick.is-off { opacity: .4; }
.grams-range { margin: 4px 0 0; }

/* ---------- Fideos ---------- */
.noodle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.noodle {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 4px;
  padding: 6px 4px 8px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid var(--line);
  transition: border-color .15s, box-shadow .15s;
}
.noodle:hover { border-color: var(--gold); }
.noodle:focus-visible { outline: 3px solid rgba(232, 130, 30, .45); outline-offset: 2px; }
.noodle.is-active { border-color: var(--orange); box-shadow: 0 4px 14px -6px rgba(232, 130, 30, .6); }
.noodle__art svg { width: 100%; max-width: 64px; height: auto; display: block; }
.noodle__name {
  font-family: var(--display); font-weight: 700; font-size: .85rem;
  text-transform: uppercase; color: var(--navy); line-height: 1.05;
}

/* ---------- Resultados ---------- */
.result-card {
  background: var(--navy);
  color: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 14px 30px -16px rgba(19, 38, 74, .6);
}
.broth-hero {
  background: var(--orange); color: #fff;
  border-radius: 12px; padding: 16px 14px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25), 0 10px 24px -12px rgba(232, 130, 30, .8);
}
.broth-hero__label {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; font-size: .9rem;
}
.broth-hero__value {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(3rem, 15vw, 4.4rem); line-height: .95;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(19, 38, 74, .25);
}
.broth-hero__sub { font-size: .85rem; opacity: .9; }

.qty { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.qty__item { border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; background: rgba(255, 255, 255, .08); }
.qty__label {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; font-size: .72rem; opacity: .8;
}
.qty__value {
  font-family: var(--display); font-weight: 700;
  font-size: 1.4rem; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.qty__sub { font-size: .74rem; opacity: .75; }
.qty__item--wide { grid-column: 1 / -1; }
.servings-note {
  margin: 6px 0 0; font-family: var(--display); font-weight: 700;
  font-size: 1.05rem; color: var(--orange-d);
}

/* ---------- Consejo ---------- */
.tip {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  background: linear-gradient(135deg, #fff3df, #ffe6c2);
  border: 2px solid var(--orange);
  border-radius: 14px;
  padding: 10px 12px;
}
.tip__icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: grid; place-items: center;
}
.tip__icon svg { width: 20px; height: 20px; }
.tip__eyebrow {
  margin: 0; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; font-size: .68rem; color: var(--orange-d);
}
.tip__title {
  margin: 0 0 2px; font-family: var(--display); font-weight: 800;
  font-size: 1.1rem; line-height: 1.05; color: var(--navy); text-transform: uppercase;
}
.tip__text { margin: 0; color: #3b3326; font-size: .85rem; }

/* ---------- Tabla ---------- */
.ref-box { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.ref-box summary {
  cursor: pointer; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; font-size: .9rem; color: var(--navy);
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ref { width: 100%; border-collapse: collapse; min-width: 480px; font-variant-numeric: tabular-nums; font-size: .88rem; }
.ref th, .ref td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.ref thead th {
  background: var(--navy); color: #fff;
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.ref thead th:first-child { border-top-left-radius: 8px; text-align: left; }
.ref thead th:last-child { border-top-right-radius: 8px; }
.ref thead th.is-col { background: var(--orange); }
.ref tbody th { text-align: left; font-family: var(--display); font-weight: 700; color: var(--navy); }
.ref tbody td { font-weight: 600; }
.ref tbody tr.is-row { background: #fff3df; }
.ref tbody tr.is-row td.is-col { background: var(--orange); color: #fff; }

/* ---------- Pie ---------- */
.footer { color: var(--muted); text-align: center; padding: 0 0 76px; font-size: .8rem; }
.footer p { margin: 0; }
.footer strong { color: var(--navy); }

/* ---------- Badge de Instagram ---------- */
.ig-badge {
  position: fixed; z-index: 10;
  right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px 10px 10px;
  border-radius: 999px;
  background: linear-gradient(45deg, var(--orange-d), var(--orange) 55%, var(--gold));
  color: #fff; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .02em;
  box-shadow: 0 8px 22px -8px rgba(201, 101, 12, .7);
  transition: transform .15s;
}
.ig-badge:hover { transform: translateY(-2px); }
.ig-badge:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.ig-badge svg { width: 24px; height: 24px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
