/* Luke product popup .luke-pv (templates/luke/parts/product-popup.php, luke-pv.js): /byb-addons/ and bundle pages.
   Loaded after luke-byb.css (stepper .luke-step) */

.luke-pv {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  align-items: flex-end;
  background: rgba(2, 16, 11, .3);
  cursor: pointer; /* iOS Safari fires click on a div only with a pointer cursor */
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  position: fixed;
  transition: opacity .3s, visibility .3s;
  visibility: hidden;
  z-index: 65; /* above the bottom bar and the bundle sheet, under the toast */
}
.luke-pv-open .luke-pv {
  opacity: 1;
  visibility: visible;
}
.luke-pv-box {
  -webkit-overflow-scrolling: touch;
  background: var(--c-cream);
  border-radius: 24px 24px 0 0;
  cursor: default;
  display: grid;
  gap: 16px;
  max-height: 90vh;
  max-height: 90dvh;
  max-width: 600px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 24px;
  scrollbar-width: thin;
  transform: translateY(100%);
  transition: transform .3s;
  width: 100%;
}
.luke-pv-open .luke-pv-box {
  transform: none;
}
.luke-pv-box:focus {
  outline: 0;
}
.luke-pv-close { /* a zero-height row: 8px from the top right corner of the sheet, over the photo corner */
  align-items: center;
  background: var(--c-white);
  border-radius: 50%;
  box-shadow: 0 4px 11px rgba(0, 0, 0, .1);
  color: var(--c-dark);
  display: flex;
  grid-column: 1 / -1;
  height: 32px;
  justify-content: center;
  justify-self: end;
  margin: -8px -8px -24px 0;
  position: relative;
  transition: background-color .2s;
  width: 32px;
  z-index: 2;
}
.luke-pv-close svg {
  height: 20px;
  width: 20px;
}
.luke-pv-close:hover {
  background: var(--c-accent);
}
.luke-pv-photo img {
  aspect-ratio: 1;
  border-radius: 20px;
  display: block;
  object-fit: cover;
  width: 100%;
}
.luke-pv-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Card: name, text, badges, price, stepper + button */
.luke-pv-card {
  background: var(--c-white);
  border-radius: 24px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .06), 0 4px 11px rgba(0, 0, 0, .05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
}
.luke-pv-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.luke-pv-brand {
  color: var(--c-gray);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 16px;
  text-transform: uppercase;
}
.luke-pv-name {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 28px;
  margin: 0;
}
.luke-pv-qty {
  color: var(--c-gray);
  font-size: 14px;
  line-height: 20px;
}
.luke-pv-text {
  font-size: 14px;
  line-height: 20px;
  margin: 0;
}
.luke-pv-badges {
  border-top: 1px solid var(--c-beige0);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}
.luke-pv-badges .luke-badge {
  background: var(--c-white);
  border: 1px solid var(--c-beige0);
  font-size: 11px;
  line-height: 14px;
  padding: 4px 9px;
}
.luke-pv-price-row {
  align-items: center;
  border-top: 1px solid var(--c-beige0);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: space-between;
  padding-top: 12px;
}
.luke-pv-price {
  align-items: baseline;
  display: flex;
  gap: 8px;
}
.luke-pv-in { /* "3 in your bundle": only when this extra is in the bundle */
  align-items: center;
  background: #F2F8E4;
  border-radius: 30px;
  color: var(--c-green);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: -.02em;
  line-height: 20px;
  padding: 6px 10px;
}
.luke-pv-in svg {
  height: 20px;
  width: 20px;
}
.luke-pv-price b {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 22px;
}
.luke-pv-price s {
  color: var(--c-gray);
  font-size: 14px;
  line-height: 20px;
}
.luke-pv-atc {
  display: flex;
  gap: 12px;
}
.luke-pv-step {
  align-self: stretch;
  border-radius: 16px;
  gap: 12px;
  padding: 5px 12px;
}
.luke-pv-add {
  flex: 1;
  min-width: 0;
  padding-bottom: 8px;
  padding-top: 8px;
}
/* Ingredients, Nutrition facts: collapsed, any number open */
.luke-pv-acc {
  padding: 0 4px;
}
.luke-pv-item + .luke-pv-item {
  border-top: 1px solid var(--c-beige1);
}
.luke-pv-q {
  align-items: center;
  color: var(--c-dark);
  display: flex;
  gap: 16px;
  padding: 12px 0;
  text-align: left;
  width: 100%;
}
.luke-pv-q span {
  flex: 1;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 22px;
}
.luke-pv-arrow {
  align-items: center;
  background: var(--c-beige1);
  border-radius: 50%;
  display: flex;
  flex-shrink: 0;
  height: 32px;
  justify-content: center;
  transform: rotate(180deg);
  transition: background-color .2s;
  width: 32px;
}
.luke-pv-arrow svg {
  height: 20px;
  width: 20px;
}
.luke-pv-q:hover .luke-pv-arrow,
.luke-pv-item.open .luke-pv-arrow {
  background: var(--c-accent);
}
.luke-pv-item.open .luke-pv-arrow {
  transform: none;
}
.luke-pv-a {
  display: none;
  font-size: 14px;
  line-height: 20px;
  padding: 4px 0 20px;
}
.luke-pv-item.open .luke-pv-a {
  display: block;
}
.luke-pv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.luke-pv-list li {
  padding-left: 16px;
  position: relative;
}
.luke-pv-list li::before {
  background: var(--c-green);
  border-radius: 50%;
  content: "";
  height: 6px;
  left: 2px;
  position: absolute;
  top: 7px;
  width: 6px;
}

/* Nutrition facts table (Figma 945-71022): name | amount | % daily value, lines between the groups */
.luke-pv-nutra {
  background: var(--c-white);
  border: 1px solid var(--c-dark);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 6px;
  line-height: 20px;
  padding: 12px 16px;
}
.luke-pv-nutra-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 24px;
}
.luke-pv-nutra-cal {
  align-items: center;
  border-bottom: 1px solid var(--c-dark);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 6px;
}
.luke-pv-nutra-cal b {
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}
.luke-pv-nutra-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 64px 48px;
}
.luke-pv-nutra-row span + span {
  text-align: right;
  white-space: nowrap;
}
.luke-pv-nutra-row span:first-child {
  font-weight: 600;
}
.luke-pv-nutra-sub span:first-child {
  font-weight: 400;
  padding-left: 16px;
}
.luke-pv-nutra-line,
.luke-pv-nutra-note {
  border-top: 1px solid var(--c-dark);
  padding-top: 6px;
}

@media (min-width: 768px) {
  .luke-pv-box {
    padding: 20px 20px 32px;
  }
  .luke-pv-card {
    gap: 16px;
    padding: 32px 30px;
  }
  .luke-pv-name {
    font-size: 32px;
    line-height: 36px;
  }
  .luke-pv-text {
    font-size: 16px;
    line-height: 22px;
  }
  .luke-pv-close {
    margin: -12px -12px -20px 0;
  }
  .luke-pv-badges,
  .luke-pv-price-row {
    padding-top: 16px;
  }
  .luke-pv-in {
    font-size: 18px;
    gap: 8px;
    line-height: 24px;
    padding: 8px 12px;
  }
  .luke-pv-in svg {
    height: 24px;
    width: 24px;
  }
  .luke-pv-nutra-row {
    grid-template-columns: minmax(0, 1fr) 76px 56px;
  }
  .luke-pv-badges .luke-badge {
    font-size: 13px;
    line-height: 18px;
    padding: 6px 13px;
  }
  .luke-pv-price b {
    font-size: 24px;
    line-height: 28px;
  }
  .luke-pv-atc {
    gap: 24px;
  }
  .luke-pv-step {
    padding: 13px 16px;
  }
  .luke-pv-step .luke-step-qty {
    font-size: 16px;
    line-height: 22px;
  }
  .luke-pv-q span {
    font-size: 24px;
    line-height: 28px;
  }
  .luke-pv-arrow {
    height: 40px;
    width: 40px;
  }
  .luke-pv-arrow svg {
    height: 24px;
    width: 24px;
  }
  .luke-pv-a {
    font-size: 16px;
    line-height: 22px;
  }
  .luke-pv-list li::before {
    top: 8px;
  }
}

@media (min-width: 1200px) {
  .luke-pv {
    align-items: center;
    padding: 40px;
  }
  .luke-pv-box {
    align-items: start;
    border-radius: 40px;
    column-gap: 40px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    max-width: 1200px;
    opacity: 0;
    padding: 24px 40px 40px; /* + 16px row gap under the close button row */
    transform: scale(.97);
    transition: transform .3s, opacity .3s;
  }
  .luke-pv-open .luke-pv-box {
    opacity: 1;
  }
  .luke-pv-close {
    height: 40px;
    margin: -8px -24px -32px 0; /* the top right corner of the box, a zero-height row */
    width: 40px;
  }
  .luke-pv-close svg {
    height: 24px;
    width: 24px;
  }
  .luke-pv-photo { /* stays in view while the right column scrolls */
    position: sticky;
    top: 0;
  }
  .luke-pv-photo img {
    border-radius: 40px;
  }
  .luke-pv-main {
    gap: 24px;
  }
  .luke-pv-card {
    border-radius: 40px;
    padding: 40px 30px;
  }
  .luke-pv-name {
    font-size: 36px;
    line-height: 40px;
  }
  .luke-pv-acc {
    padding: 0;
  }
  .luke-extras .luke-pv-box {
    max-width: 1160px;
  }
}
