/* AROMELIER_PRODUCT_PURCHASE_LAYOUT_V34: resilient product purchase layout. */

/* Keep the purchase panel inside the mobile hero even when v28 sets it to start. */
@media (max-width: 760px) {
  .store-v2-body .product-detail-hero {
    align-items: stretch;
  }

  .store-v2-body .product-detail-intro > .product-hero-purchase {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* The panel, rather than the viewport, determines whether options have two columns. */
.store-v2-body .product-detail-shell .product-hero-purchase {
  container-type: inline-size;
  min-width: 0;
  box-sizing: border-box;
}

.store-v2-body .product-detail-shell .product-purchase-controls,
.store-v2-body .product-detail-shell .exact-variant-grid,
.store-v2-body .product-detail-shell .product-buy-row,
.store-v2-body .product-detail-shell .product-buy-row > div {
  min-width: 0;
}

.store-v2-body .product-detail-shell .exact-variant-grid {
  max-height: min(360px, 50dvh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  grid-template-columns: minmax(0, 1fr);
}

.store-v2-body .product-detail-shell .product-exact-variant {
  min-height: 58px;
  box-sizing: border-box;
}

.store-v2-body .product-detail-shell .product-exact-variant > b,
.store-v2-body .product-detail-shell .product-exact-variant > strong {
  min-width: 0;
}

.store-v2-body .product-detail-shell .product-exact-variant.active,
.store-v2-body .product-detail-shell .product-exact-variant[aria-pressed="true"] {
  border-color: var(--wine, #a52234);
  box-shadow: 0 0 0 2px rgba(165, 34, 52, .14);
}

.store-v2-body .product-detail-shell .product-exact-variant:focus-visible,
.store-v2-body .product-detail-shell .product-quick-trust a:focus-visible,
.store-v2-body .product-detail-shell .delivery-estimate__change:focus-visible {
  outline: 3px solid rgba(165, 34, 52, .34);
  outline-offset: 3px;
}

@container (min-width: 520px) {
  .store-v2-body .product-detail-shell .exact-variant-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A price change may alter text, but never the width or flow of the CTA. */
.store-v2-body .product-detail-shell .product-buy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

@container (min-width: 400px) {
  .store-v2-body .product-detail-shell .product-buy-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(160px, .85fr);
    align-items: end;
  }
}

.store-v2-body .product-detail-shell .product-price {
  display: block;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.store-v2-body .product-detail-shell .product-variant-spec {
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.store-v2-body .product-detail-shell .product-variant-spec .product-concentration {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-v2-body .product-detail-shell .product-variant-spec .product-volume {
  flex: 0 0 auto;
}

.store-v2-body .product-detail-shell .product-buy-row .add-to-cart {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  white-space: normal;
}

/* The delivery estimate follows the controls and remains a secondary, compact block. */
.store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate {
  margin-top: 14px;
  padding: 11px 12px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
}

.store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate .delivery-estimate__icon {
  width: 30px;
  height: 30px;
}

.store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate .delivery-estimate__icon svg {
  width: 26px;
  height: 26px;
}

.store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate .delivery-estimate__date {
  min-height: 22px;
  margin: 2px 0 7px;
  font-size: 16px;
  line-height: 1.25;
}

.store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate .delivery-estimate__origin {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.25;
}

.store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate .delivery-estimate__status {
  margin-top: 3px;
  display: block;
  color: var(--muted, #6b6460);
  font-size: 10px;
  line-height: 1.2;
}

@container (min-width: 520px) {
  .store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate .delivery-estimate__body {
    display: grid;
    grid-template-columns: minmax(132px, .72fr) minmax(236px, 1.28fr);
    grid-template-areas:
      "label city"
      "date city"
      "origin status";
    column-gap: 12px;
    align-items: center;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__label {
    grid-area: label;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__date {
    grid-area: date;
    margin: 0;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__city-row {
    grid-area: city;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__origin {
    grid-area: origin;
    margin-top: 4px;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__status {
    grid-area: status;
    margin-top: 4px;
    align-self: end;
    text-align: right;
  }
}

@media (max-width: 760px) {
  .store-v2-body .product-detail-shell .product-hero-purchase > .delivery-estimate {
    margin-top: 12px;
    padding: 9px 10px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__icon {
    width: 28px;
    height: 28px;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__icon svg {
    width: 24px;
    height: 24px;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__label {
    font-size: 9px;
    line-height: 1.2;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__date {
    min-height: 24px;
    margin: 2px 0 5px;
    font-size: 16px;
    line-height: 1.25;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__city-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__city,
  .store-v2-body .product-detail-shell .delivery-estimate__change {
    min-width: 0;
    min-height: 44px;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__city {
    padding-inline: 10px;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__change {
    width: auto;
    padding-inline: 10px;
    font-size: 10px;
    white-space: nowrap;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__origin {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.25;
  }

  .store-v2-body .product-detail-shell .delivery-estimate__status {
    margin-top: 2px;
  }

  .store-v2-body .product-detail-shell .product-quick-trust {
    margin-top: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-v2-body .product-detail-shell .product-quick-trust a,
  .store-v2-body .product-detail-shell .product-quick-trust a + a {
    min-width: 0;
    min-height: 44px;
    padding: 9px 8px;
    border-top: 0;
  }

  .store-v2-body .product-detail-shell .product-quick-trust a + a {
    border-left: 1px solid var(--line);
  }

  .store-v2-body .product-detail-shell .product-quick-trust strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .store-v2-body .product-detail-shell .product-quick-trust small {
    display: none;
  }
}

@media (max-width: 359px) {
  .store-v2-body .product-detail-shell .product-quick-trust {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-v2-body .product-detail-shell .product-quick-trust a + a {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store-v2-body .product-detail-shell .product-exact-variant,
  .store-v2-body .product-detail-shell .product-quick-trust a,
  .store-v2-body .product-detail-shell .delivery-estimate__change,
  .store-v2-body .product-detail-shell .add-to-cart {
    transition: none;
  }
}
