.bag-detail {
  --max: 1000px;
  padding-block: 58px var(--section-gap);
}

.bag-heading {
  text-align: center;
  padding-bottom: 40px;
}

.bag-heading h1 {
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -.045em;
}

.bag-heading-review,
.bag-detail-empty {
  display: grid;
  justify-items: center;
}

.bag-heading-subtotal {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-block: 10px 19px;
  color: var(--muted);
}

.bag-heading-subtotal strong {
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--line);
  color: var(--ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.bag-checkout {
  --pill-bg: var(--ink);
  --pill-fg: var(--surface);
  --pill-edge: var(--ink);
  width: min(100%, 248px);
}

.bag-checkout:hover {
  --pill-bg: var(--dark);
}

.bag-continue {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.bag-detail-empty {
  gap: 18px;
  margin-top: 14px;
}

.bag-detail-empty p {
  color: var(--muted);
}

[data-bag-page] {
  display: grid;
  grid-template-columns: clamp(96px, 15vw, 156px) minmax(0, 1fr) max-content minmax(114px, max-content);
  column-gap: clamp(18px, 3vw, 36px);
}

.bag-detail-lines,
.bag-detail-line,
.bag-detail-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

.bag-detail-lines {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}

.bag-detail-line {
  grid-template-areas: "image copy quantity price";
  align-items: start;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}

.bag-product-image {
  grid-area: image;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--subtle);
  padding: 8px;
}

.bag-product-image img {
  display: block;
  width: 100%;
  height: auto;
}

.bag-product-copy {
  grid-area: copy;
}

.bag-product-copy h2 {
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.bag-product-copy h2 a {
  text-decoration: none;
}

.bag-product-copy h2 a:hover {
  text-decoration: underline;
}

.bag-product-sku {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.bag-text-link {
  color: var(--accent);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bag-text-link:hover {
  color: var(--ink);
}

.bag-model summary {
  width: fit-content;
  min-height: 44px;
  padding-block: 11px;
  cursor: pointer;
  list-style: none;
}

.bag-model summary::-webkit-details-marker {
  display: none;
}

.bag-model summary::after {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-start: 8px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
  content: "";
}

.bag-model[open] summary::after {
  transform: rotate(225deg);
}

.bag-model-options {
  display: grid;
  gap: 8px;
  justify-items: start;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 12px;
  font-size: 14px;
}

.bag-model-options .pill {
  min-height: 44px;
  font-size: 14px;
}

.bag-model-error {
  color: #A2342A;
}

.bag-model-error:empty {
  margin-top: -8px;
}

.bag-detail-quantity {
  grid-area: quantity;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
}

.bag-stepper {
  display: grid;
  grid-template-columns: 44px minmax(2ch, auto) 44px;
  align-items: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.bag-stepper button {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-size: 19px;
}

.bag-stepper button:hover:not(:disabled) {
  background: var(--subtle);
}

.bag-stepper button:disabled {
  opacity: .34;
}

.bag-detail-price {
  grid-area: price;
  display: grid;
  justify-items: end;
  text-align: end;
}

.bag-detail-price strong {
  font-size: 22px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.bag-detail-price button {
  min-height: 44px;
  padding: 0 0 0 6px;
  border: 0;
  background: transparent;
}

.bag-detail-summary {
  align-items: baseline;
  padding-top: 20px;
  font-size: 19px;
  font-weight: 600;
}

.bag-detail-summary dt {
  grid-column: 3;
}

.bag-detail-summary dd {
  grid-column: -2;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.bag-support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: var(--section-gap);
}

[data-bag-page][hidden] + .bag-support {
  margin-top: 0;
}

.bag-support h2 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.bag-policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(12px, 2vw, 24px);
}

.bag-policy-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.bag-policy-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.bag-policy-links svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 650px) {
  .bag-detail {
    padding-top: 33px;
  }

  .bag-heading {
    padding-bottom: 26px;
  }

  [data-bag-page] {
    grid-template-columns: clamp(68px, 19vw, 100px) minmax(0, 1fr) max-content;
    column-gap: 14px;
  }

  .bag-detail-line {
    grid-template-areas:
      "image copy copy"
      "quantity quantity price";
    align-items: center;
    row-gap: 10px;
    padding-block: 20px;
  }

  .bag-product-image {
    align-self: start;
    border-radius: 12px;
    padding: 5px;
  }

  .bag-product-copy h2 {
    font-size: 22px;
  }

  .bag-detail-quantity {
    justify-self: start;
  }

  .bag-detail-price {
    align-self: end;
  }

  .bag-detail-price strong {
    font-size: 19px;
  }

  .bag-detail-summary dt {
    grid-column: 1 / span 2;
  }

  .bag-support {
    align-items: flex-start;
    flex-direction: column;
  }
}
