/* El corazón interactivo: panel de estado, lista de empaque y simulacro */

/* ---------- Panel de estado de la mochila ---------- */

.status {
  background: linear-gradient(165deg, var(--c-surface-2), var(--c-void) 78%);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-lift);
  display: grid;
  gap: var(--space-6);
}

.status__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.status__pct {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 2rem + 6vw, 5rem);
  font-weight: 900;
  font-stretch: 76%;
  line-height: 0.82;
  font-variant-numeric: tabular-nums;
  color: var(--c-amber);
  transition: color var(--dur) ease;
}

.status[data-complete='true'] .status__pct {
  color: var(--c-safe);
}

.status__state {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: right;
  color: var(--c-text-soft);
}

.status__ring {
  height: 10px;
  border-radius: 99px;
  background: var(--c-void);
  border: 1px solid var(--c-line);
  overflow: hidden;
}

.status__ring span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-rescue), var(--c-amber));
  transition: width var(--dur-slow) var(--ease-out-expo);
}

.status[data-complete='true'] .status__ring span {
  background: linear-gradient(90deg, var(--c-safe), #a8f8cd);
}

.status__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--c-line);
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: var(--text-xs);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--c-text-mute);
}

.status__weight {
  font-size: var(--text-sm);
  color: var(--c-text-soft);
}

.status__weight b {
  color: var(--c-text);
}

/* ---------- Controles ---------- */

.controls {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  margin-bottom: var(--space-8);
}

.control__label {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  font-weight: 600;
  margin-bottom: var(--space-3);
  display: block;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--c-void);
  border: 1px solid var(--c-line);
  border-radius: 99px;
  padding: 0.3rem;
}

.stepper button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-text-soft);
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.stepper button:hover:not(:disabled) {
  background: var(--c-amber);
  color: #1a1204;
}

.stepper button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper__value {
  min-width: 3.4rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 99px;
  background: var(--c-void);
  border: 1px solid var(--c-line);
  font-size: var(--text-sm);
  color: var(--c-text-soft);
  transition: all var(--dur-fast) ease;
}

.chip:hover {
  border-color: var(--c-line-strong);
  color: var(--c-text);
}

.chip[aria-pressed='true'] {
  background: var(--c-amber);
  border-color: var(--c-amber);
  color: #1a1204;
  font-weight: 600;
}

@media (min-width: 780px) {
  .controls {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-8);
  }
}

/* ---------- Categorías ---------- */

.category {
  border-top: 1px solid var(--c-line);
  padding-block: var(--space-6);
}

.category__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  text-align: left;
  padding: var(--space-2) 0;
}

.category__kicker {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--c-text-mute);
  font-variant-numeric: tabular-nums;
}

.category__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  font-stretch: 86%;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}

.category__count {
  font-size: var(--text-sm);
  color: var(--c-text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.category__count[data-done='true'] {
  color: var(--c-safe);
}

.category__chevron {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--c-text-mute);
  border-bottom: 2px solid var(--c-text-mute);
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease-out-expo);
  flex: none;
}

.category[data-open='false'] .category__chevron {
  transform: rotate(-45deg);
}

.category__hint {
  color: var(--c-text-soft);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-4) 2.6rem;
}

.category__items {
  display: grid;
  gap: var(--space-2);
}

.category[data-open='false'] .category__hint,
.category[data-open='false'] .category__items {
  display: none;
}

/* ---------- Ítem ---------- */

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-4);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  transition: border-color var(--dur) ease, background var(--dur) ease,
    transform var(--dur) var(--ease-out-expo);
}

.item:hover {
  border-color: var(--c-line-strong);
  transform: translateX(3px);
}

.item[data-checked='true'] {
  background: rgba(58, 214, 138, 0.06);
  border-color: rgba(58, 214, 138, 0.32);
}

.item__toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
  text-align: left;
  min-width: 0;
}

.item__box {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  border: 2px solid var(--c-line-strong);
  background: var(--c-void);
  display: grid;
  place-items: center;
  transition: all var(--dur-fast) var(--ease-spring);
}

.item__box svg {
  width: 15px;
  height: 15px;
  stroke: #062516;
  stroke-width: 3.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset var(--dur) var(--ease-out-expo);
}

.item[data-checked='true'] .item__box {
  background: var(--c-safe);
  border-color: var(--c-safe);
  transform: scale(1.06);
}

.item[data-checked='true'] .item__box svg {
  stroke-dashoffset: 0;
}

.item__main {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.item__name {
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  transition: color var(--dur) ease;
}

.item[data-checked='true'] .item__name {
  color: var(--c-text-soft);
}

.item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-size: var(--text-xs);
}

.tag {
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--c-line-strong);
  color: var(--c-text-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.tag--qty {
  background: var(--c-void);
  color: var(--c-amber);
  border-color: rgba(255, 176, 32, 0.35);
  font-variant-numeric: tabular-nums;
}

.tag--essential {
  background: rgba(255, 95, 31, 0.14);
  border-color: rgba(255, 95, 31, 0.4);
  color: #ff9d6e;
}

.item__why {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-4) 0 0 calc(26px + var(--space-4));
  color: var(--c-text-soft);
  font-size: var(--text-sm);
  border-top: 1px dashed var(--c-line);
  margin-top: var(--space-2);
}

.item__why[hidden] {
  display: none;
}

.item__info {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--c-line-strong);
  color: var(--c-text-mute);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
  transition: all var(--dur-fast) ease;
}

.item__info:hover,
.item__info[aria-expanded='true'] {
  border-color: var(--c-amber);
  color: var(--c-amber);
  background: var(--c-amber-glow);
}

/* ---------- Simulacro de 60 segundos ---------- */

.drill {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-line-strong);
  background: radial-gradient(120% 130% at 50% 0%, rgba(255, 95, 31, 0.14), var(--c-void) 60%);
  text-align: center;
  justify-items: center;
}

.drill[data-running='true'] {
  animation: quake 0.42s linear infinite;
}

@keyframes quake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2px, 1px, 0); }
  50% { transform: translate3d(2px, -1px, 0); }
  75% { transform: translate3d(-1px, -2px, 0); }
}

.drill__clock {
  font-family: var(--font-display);
  font-size: clamp(4rem, 2rem + 11vw, 8rem);
  font-weight: 900;
  font-stretch: 74%;
  line-height: 0.8;
  font-variant-numeric: tabular-nums;
  color: var(--c-rescue);
}

.drill[data-running='false'] .drill__clock {
  color: var(--c-text-mute);
}

.drill__step {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 900;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  min-height: 1.2em;
}

.drill__detail {
  color: var(--c-text-soft);
  max-width: 46ch;
  min-height: 3.2em;
}

.drill__dots {
  display: flex;
  gap: 0.5rem;
}

.drill__dots span {
  width: 34px;
  height: 4px;
  border-radius: 99px;
  background: var(--c-line-strong);
  transition: background var(--dur) ease;
}

.drill__dots span[data-active='true'] {
  background: var(--c-rescue);
}

/* ---------- Celebración ---------- */

.spark {
  position: fixed;
  top: 0;
  left: 0;
  width: 9px;
  height: 15px;
  z-index: 95;
  pointer-events: none;
  border-radius: 2px;
  animation: fall linear forwards;
}

@keyframes fall {
  from {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translate3d(var(--drift, 40px), 108vh, 0) rotate(760deg);
    opacity: 0;
  }
}
