@font-face {
  font-family: Barlow;
  src: url("/assets/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url("/assets/barlow-600.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/barlow-condensed-700.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}
/* Mismo sistema de rotulación que styles.css: cabina, azul TFL, rojo y cinta. */
:root {
  --blue: #0b2d5b;
  --red: #e10600;
  --ink: #16202c;
  --muted: #4c5866;
  --line: #d6dadf;
  --pale: #f3f4f1;
  --white: #fff;
  --rotulo: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--pale);
  color: var(--ink);
  font:
    17px/1.55 Barlow,
    "Segoe UI",
    Arial,
    sans-serif;
}
html {
  scrollbar-color: #b6bdc6 #f3f4f1;
}
::selection {
  background: var(--blue);
  color: white;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: var(--blue);
  text-underline-offset: 4px;
}
input {
  caret-color: var(--red);
}
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 0.004em;
  color: var(--blue);
  text-wrap: balance;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.calc-wrap {
  max-width: 1440px;
  margin: auto;
  padding: 0 48px;
}
.intro {
  padding: 48px 0 38px;
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 70px;
  align-items: center;
}
h1,
h2 {
  text-transform: uppercase;
}
.intro h1 {
  font-size: clamp(2.8rem, 4.8vw, 4.3rem);
  max-width: 720px;
  margin-bottom: 18px;
}
.intro > div > p {
  max-width: 65ch;
  color: var(--muted);
  margin: 0;
}
.intro-note {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.intro-note svg {
  width: 48px;
  flex: 0 0 48px;
  color: var(--blue);
}
.intro-note p {
  font-size: 14px;
}
.intro-note strong {
  color: var(--blue);
}
.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 355px;
  gap: 38px;
  align-items: start;
  padding-bottom: 64px;
}
.catalog {
  min-width: 0;
}
.catalog-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.catalog-heading h2 {
  font-size: 30px;
  margin-bottom: 16px;
}
.catalog-heading span {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.search-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.search-field {
  position: relative;
}
.search-field svg {
  position: absolute;
  left: 16px;
  top: 15px;
  width: 22px;
  height: 22px;
  color: var(--muted);
}
.search-field input {
  border: 1px solid #8a9bb1;
  border-radius: 2px;
  background: white;
  width: 100%;
  padding: 13px 16px 13px 48px;
  color: var(--ink);
  min-height: 52px;
}
input::placeholder {
  color: var(--muted);
}
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0;
}
/* Pestañas rectangulares, como los tipos de carga del cotizador; la cinta marca la elegida. */
.categories button {
  position: relative;
  padding: 10px 16px 14px;
  min-height: 46px;
  border: 1px solid #b6bdc6;
  border-radius: 2px;
  color: var(--blue);
  background: white;
  font: 700 1rem/1 var(--rotulo);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.categories button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--red) 0 12px, #fff 12px 24px);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.categories button[aria-pressed="true"]::after {
  transform: scaleX(1);
}
.categories button:hover {
  background: var(--pale);
}
.categories button[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.reference-help {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.objects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}
.object {
  border-top: 1px solid var(--line);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.object h3 {
  font-family: Barlow, "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.2;
  font-size: 16px;
  letter-spacing: 0;
  margin: 0 0 5px;
}
.object p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.object-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.object-volume {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.stepper {
  display: flex;
  border: 1px solid #8a9bb1;
  border-radius: 2px;
  overflow: visible;
}
.stepper button {
  width: 42px;
  min-height: 44px;
  border: 0;
  background: var(--pale);
  color: var(--blue);
  font-size: 23px;
  border-radius: 2px;
}
.stepper input {
  width: 44px;
  border: 0;
  background: white;
  text-align: center;
  color: var(--blue);
  appearance: textfield;
  -moz-appearance: textfield;
  font-weight: 600;
  padding: 0;
}
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper button:hover:not(:disabled) {
  background: #dce5f0;
}
.object[data-selected="true"] h3 {
  color: var(--blue);
}
.object[data-selected="true"] .stepper {
  border-color: var(--blue);
}
.summary {
  position: sticky;
  top: 24px;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  background: white;
}
.total-panel {
  background: var(--blue);
  padding: 27px 28px 23px;
  color: white;
}
.total-panel h2 {
  font-size: 23px;
  color: white;
  margin-bottom: 12px;
}
.total-number {
  font:
    700 clamp(3rem, 5vw, 4.4rem)/1.02 "Barlow Condensed",
    "Arial Narrow",
    sans-serif;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.total-number .unit {
  font-size: 25px;
  font-weight: 500;
}
.total-panel p {
  color: #d7e3f4;
  font-size: 13px;
  margin: 12px 0 0;
}
.summary-body {
  padding: 24px 26px;
}
.summary-body > p {
  font-size: 13px;
  color: var(--muted);
}
#selection {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  max-height: 260px;
  overflow: auto;
  scrollbar-gutter: stable;
}
#selection li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
#selection strong {
  font-weight: 600;
  color: var(--blue);
}
#selection li span {
  font-variant-numeric: tabular-nums;
}
#selection button {
  width: 38px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}
.primary-action,
.secondary-action {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 2px;
  font: 700 1.02rem/1.1 var(--rotulo);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.primary-action {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: var(--red);
  color: white;
}
.primary-action:disabled {
  opacity: 1;
  border: 1px dashed #b6bdc6;
  background: transparent;
  color: var(--muted);
}
.primary-action:hover:not(:disabled) {
  background: #b80500;
}
.primary-action span {
  font-size: 20px;
  line-height: 20px;
}
.secondary-action {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: white;
  color: var(--blue);
}
.secondary-action:hover:not(:disabled) {
  background: var(--pale);
}
.reset-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.reset-row button {
  padding: 10px 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12px;
}
.volume-notice {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin: 12px 0 0;
  line-height: 1.65;
}
.summary-body .action-status {
  color: var(--blue);
  margin: 4px 0;
}
.action-status:empty {
  display: none;
}
.missing-object {
  font-size: 14px;
  padding: 22px;
  background: var(--pale);
  margin: 20px 0 0;
}
.error {
  color: #a41b12;
  font-size: 14px;
}
.error:empty {
  display: none;
}
.empty-search {
  padding: 32px 16px;
  background: var(--pale);
  text-align: center;
}
.empty-search button {
  padding: 12px;
  border: 1px solid var(--blue);
  background: white;
  border-radius: 2px;
  color: var(--blue);
}
.explanation {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
}
.explanation h2 {
  font-size: 36px;
}
.explanation p {
  color: var(--muted);
  font-size: 14px;
  max-width: 70ch;
}
.explanation a {
  font-size: 14px;
  font-weight: 600;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.mobile-total {
  display: none;
}
@media (max-width: 700px) {
  body {
    padding-bottom: 90px;
  }
  .mobile-total {
    position: fixed;
    z-index: 5;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 20px max(12px, env(safe-area-inset-bottom));
    color: white;
    background: var(--blue);
  }
  .mobile-total strong {
    display: block;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
  }
  .mobile-total small {
    color: #d7e3f4;
    font-size: 11px;
  }
  .mobile-total a {
    color: white;
    padding: 12px;
    border: 1px solid #a2b5ce;
    border-radius: 2px;
    font-size: 13px;
    text-decoration: none;
  }
  #resumen {
    scroll-margin-top: 20px;
  }
}
@media (min-width: 1500px) {
  .calc-wrap {
    padding-left: 64px;
    padding-right: 64px;
  }
}
@media (max-width: 1050px) {
  .calculator-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 24px;
  }
  .calc-wrap {
    padding: 0 28px;
  }
  .objects {
    grid-template-columns: 1fr;
  }
  .intro {
    gap: 28px;
  }
  .summary-body {
    padding: 20px;
  }
  .total-panel {
    padding: 24px;
  }
}
@media (max-width: 700px) {
  .calc-wrap {
    padding: 0 20px;
  }
  .intro {
    display: block;
    padding: 32px 0 26px;
  }
  .intro h1 {
    font-size: 44px;
  }
  .intro > div > p {
    font-size: 15px;
  }
  .intro-note {
    display: none;
  }
  .calculator-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .catalog,
  .summary {
    width: 100%;
  }
  .summary {
    position: static;
  }
  .catalog-heading h2 {
    font-size: 27px;
  }
  .categories {
    gap: 6px;
  }
  .categories button {
    padding: 9px 11px;
  }
  .objects {
    grid-template-columns: 1fr;
  }
  .object {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .object > div:first-child {
    max-width: 55%;
  }
  .object-controls {
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
  }
  .object-volume {
    font-size: 12px;
  }
  .object h3 {
    font-size: 15px;
  }
  .stepper button {
    width: 42px;
  }
  .total-panel {
    padding: 22px;
  }
  .total-number {
    font-size: 48px;
  }
  .summary-body {
    padding: 22px;
  }
  .explanation {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 30px 0;
  }
  .explanation h2 {
    font-size: 32px;
  }
  .calculator-layout {
    padding-bottom: 36px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition:
      background-color 0.15s ease-out,
      color 0.15s ease-out;
  }
}

@media (max-width: 700px) {
  html {
    scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
  body {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  }
  .categories button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .stepper button,
  .stepper input {
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
  .stepper button {
    font-size: 23px;
  }
  .mobile-total {
    padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  }
}
@media (max-width: 360px) {
  .calc-wrap {
    padding-inline: 16px;
  }
  .intro h1 {
    font-size: 40px;
  }
  .object {
    flex-wrap: wrap;
  }
  .object > div:first-child {
    max-width: 100%;
  }
  .object-controls {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* Con la cabecera y el pie compartidos, el espacio para el total fijo lo da el pie, no el cuerpo. */
@media (max-width: 700px) {
  body {
    padding-bottom: 0;
  }
  .site-footer {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }
}
