.vf-product,
.vf-bag {
  margin: auto;
  padding: 0;
  border: 1px solid var(--line, #c9d5ed);
  color: var(--ink, #101532);
  background: var(--mist, #e6eeff);
  overscroll-behavior: contain;
}

.vf-product::backdrop,
.vf-bag::backdrop {
  background: rgb(12 17 41 / 58%);
}

html:has(.vf-product[open], .vf-bag[open]) {
  overflow: hidden;
}

.vf-product [hidden],
.vf-bag [hidden] {
  display: none;
}

.vf-product button,
.vf-bag button {
  font: inherit;
  cursor: pointer;
}

.vf-product button:focus-visible,
.vf-bag button:focus-visible {
  outline: 2px solid var(--blue, #2439d4);
  outline-offset: 3px;
}

.vf-product h2,
.vf-bag h2 {
  margin: 0;
  font-family: var(--display, inherit);
  font-size: clamp(2.35rem, 6vw, 4.4rem);
  font-weight: 650;
  line-height: .95;
  letter-spacing: -.07em;
}

.vf-product p,
.vf-bag p {
  margin: 0;
}

.vf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.vf-close {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line, #c9d5ed);
  border-radius: 50%;
  color: var(--ink, #101532);
  background: var(--mist, #e6eeff);
}

.vf-close::before,
.vf-close::after {
  position: absolute;
  width: 16px;
  height: 1px;
  background: currentColor;
  content: "";
}

.vf-close::before { transform: rotate(45deg); }
.vf-close::after { transform: rotate(-45deg); }

.vf-primary {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: .65rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  background: var(--blue, #2439d4);
  text-align: center;
}

.vf-text-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .22em;
}

.vf-product {
  width: min(52rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100% - 2rem);
  max-height: calc(100dvh - 2rem);
  border-radius: 26px;
}

.vf-product__layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
}

.vf-product .vf-close {
  position: absolute;
  z-index: 1;
  top: .85rem;
  right: .85rem;
}

.vf-product__visual {
  position: relative;
  min-height: 100%;
  background: #c7c8ed;
}

.vf-product__visual img {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-product__details {
  align-self: center;
  padding: clamp(3.5rem, 7vw, 4.5rem) clamp(1.35rem, 5vw, 3rem) 1.9rem;
}

.vf-product .vf-product__price {
  margin-top: .65rem;
  font-size: 1.1rem;
  font-weight: 650;
}

.vf-product .vf-product__description {
  margin-top: 1.2rem;
  line-height: 1.55;
}

.vf-product__specs {
  margin: 1.25rem 0;
  font-size: .9rem;
  line-height: 1.35;
}

.vf-product__specs div {
  display: grid;
  grid-template-columns: minmax(6rem, .65fr) minmax(0, 1fr);
  gap: .6rem;
  padding-block: .65rem;
  border-top: 1px solid var(--line, #c9d5ed);
}

.vf-product__specs div:last-child {
  border-bottom: 1px solid var(--line, #c9d5ed);
}

.vf-product__specs dt { font-weight: 650; }

.vf-product__specs dd {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
}

.vf-swatch {
  flex: 0 0 11px;
  height: 11px;
  border: 1px solid rgb(12 17 41 / 22%);
  border-radius: 50%;
}

.vf-product__feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: .75rem;
  margin-top: .35rem;
  font-size: .875rem;
}

.vf-bag {
  inset: .65rem .65rem .65rem auto;
  width: min(29rem, calc(100% - 1.3rem));
  max-width: none;
  height: calc(100% - 1.3rem);
  height: calc(100dvh - 1.3rem);
  max-height: none;
  overflow: hidden;
  border-radius: 24px;
}

.vf-bag__layout {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.vf-bag__header,
.vf-bag__footer,
.vf-bag__contents {
  padding-inline: clamp(1rem, 5vw, 1.7rem);
}

.vf-bag__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.3rem;
  border-bottom: 1px solid var(--line, #c9d5ed);
}

.vf-bag h2 { font-size: clamp(2.25rem, 7vw, 3.1rem); }

.vf-bag__contents { overflow: auto; }
.vf-bag .vf-bag__empty { padding-block: 1.5rem; }

.vf-bag__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.vf-bag__item {
  position: relative;
  display: grid;
  grid-template-columns: clamp(3.7rem, 20vw, 5.5rem) minmax(0, 1fr) auto;
  gap: clamp(.6rem, 2vw, 1rem);
  align-items: start;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line, #c9d5ed);
}

.vf-bag__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
}

.vf-bag__item h3 {
  margin: 0;
  font-size: 1.07rem;
  line-height: 1.2;
}

.vf-bag__color,
.vf-bag__note { font-size: .9rem; }

.vf-bag__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .15rem .6rem;
  margin-top: .5rem;
  font-size: .85rem;
}

.vf-quantity {
  display: inline-grid;
  grid-template-columns: 44px minmax(1.2rem, auto) 44px;
  align-items: center;
  border: 1px solid var(--line, #c9d5ed);
  border-radius: 999px;
  text-align: center;
}

.vf-quantity button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 1.05rem;
}

.vf-bag__item-price,
.vf-bag__subtotal { font-weight: 650; }

.vf-bag__footer {
  padding-block: 1.05rem max(1.2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line, #c9d5ed);
}

.vf-bag__subtotal {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: 1.05rem;
}

.vf-bag .vf-bag__note { margin: .5rem 0 .9rem; }

@media (hover: hover) {
  .vf-close:hover,
  .vf-quantity button:hover { background: var(--accent, #e8fb9a); }

  .vf-primary:hover { filter: brightness(.88); }
  .vf-text-button:hover { color: var(--blue, #2439d4); }
}

@media (max-width: 40rem) {
  .vf-product { width: min(26rem, calc(100% - 1.15rem)); }

  .vf-product__layout { grid-template-columns: minmax(0, 1fr); }

  .vf-product__visual {
    min-height: 0;
    aspect-ratio: 1.35;
  }

  .vf-product__details { padding: 1.4rem 1.1rem 1.25rem; }
  .vf-product__feedback { column-gap: .55rem; }
}

.vf-bag__note a { text-decoration: underline; text-underline-offset: .2em; }
.vf-checkout-link { display: flex; align-items: center; justify-content: space-between; }
.vf-bag__summary:not([hidden]) + button {
  min-height: 44px;
  margin-top: .35rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.vf-quantity button:disabled { opacity: .45; cursor: default; }
