.bag-stages {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 36px;
  position: relative;
  z-index: 4;
}
.bag-stages-title {
  margin-right: 10px;
  color: var(--deep);
}
.age-stage {
  position: relative;
}
.age-stage summary {
  display: flex;
  align-items: center;
  gap: 9px;
  list-style: none;
  background: #fff;
  border: 1px solid #c7e2ed;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}
.age-stage summary::-webkit-details-marker {
  display: none;
}
.age-stage summary i {
  color: var(--coral);
  font-size: 17px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.18s ease;
}
.age-stage:hover summary,
.age-stage:focus-within summary,
.age-stage[open] summary {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 58, 95, 0.18);
  transform: translateY(-2px);
}
.age-stage[open] summary i {
  transform: rotate(45deg);
}
.age-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  width: min(430px, 86vw);
  max-height: min(600px, 70vh);
  overflow: auto;
  background: #fff;
  border: 1px solid #bad6e2;
  border-radius: 22px;
  box-shadow: 0 24px 65px rgba(22, 58, 95, 0.24);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease,
    visibility 0.18s ease;
  z-index: 30;
  color: var(--char);
}
.age-stage:hover .age-popover,
.age-stage:focus-within .age-popover,
.age-stage[open] .age-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.age-stage-6 .age-popover,
.age-stage-7 .age-popover {
  left: auto;
  right: 0;
}
.age-popover-head {
  border-bottom: 1px solid #d5e6ed;
  padding-bottom: 14px;
  margin-bottom: 15px;
}
.age-popover-head p {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--coral);
  margin: 0 0 4px;
}
.age-popover-head h3 {
  font-size: 26px;
  line-height: 1.1;
  margin: 0;
  color: var(--deep);
}
.age-sections {
  display: grid;
  gap: 20px;
}
.age-sections h4 {
  color: var(--deep);
  font-size: 16px;
  margin: 0 0 9px;
}
.age-sections ul {
  columns: 2;
  column-gap: 25px;
  margin: 0;
  padding-left: 19px;
}
.age-sections li {
  break-inside: avoid;
  margin: 0 0 7px;
  line-height: 1.35;
  font-size: 14px;
}
.bag-stage-hint {
  font-size: 13px;
  color: var(--gray);
  margin: 12px 0 0;
}
@media (hover: hover) and (pointer: fine) {
  .age-stage:not([open]):focus-within .age-popover {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
  }
}
@media (max-width: 760px) {
  .bag-stages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 9px;
    margin-top: 26px;
  }
  .bag-stages-title {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    font-size: 18px;
  }
  .age-stage summary {
    justify-content: space-between;
    min-height: 48px;
    padding: 11px 13px;
    border-radius: 12px;
  }
  .age-stage[open] {
    grid-column: 1 / -1;
  }
  .age-stage[open] summary {
    transform: none;
  }
  .age-popover,
  .age-stage-6 .age-popover,
  .age-stage-7 .age-popover {
    position: static;
    width: auto;
    max-height: none;
    margin-top: 8px;
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(22, 58, 95, 0.12);
  }
  .age-sections ul {
    columns: 1;
  }
  .bag-stage-hint {
    font-size: 14px;
  }
}
