.shop-dialog,
.shop-dialog * {
  box-sizing: border-box;
}

body:has(.shop-dialog[open]) {
  overflow: hidden;
}

.shop-dialog {
  width: min(92vw, 34rem);
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line, #e4dce5);
  border-radius: 1.25rem;
  background: var(--paper, #fcf9f6);
  color: var(--ink, #201626);
  box-shadow: 0 1.75rem 6rem rgba(32, 22, 38, .25);
}

.shop-dialog::backdrop {
  background: rgba(32, 22, 38, .62);
}

.shop-drawer {
  width: min(100%, 34rem);
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  max-height: 100%;
  inset: 0 0 0 auto;
  margin: 0;
  border-radius: 1.25rem 0 0 1.25rem;
}

.shop-wide-dialog,
.shop-checkout,
.shop-gallery-dialog {
  width: min(94vw, 64rem);
}

.shop-gallery-dialog {
  width: min(94vw, 54rem);
}

.shop-gallery-viewport {
  max-height: 61vh;
  max-height: 61dvh;
  overflow: auto;
  border-radius: .65rem;
  background: #f0e8ee;
}

.shop-gallery-viewport img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 61vh;
  max-height: 61dvh;
  margin-inline: auto;
  object-fit: contain;
}

.shop-gallery-viewport.is-zoomed img {
  width: 150%;
  max-width: none;
  max-height: none;
}

.shop-gallery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin-top: .9rem;
}

.shop-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .875rem clamp(1rem, 5vw, 2rem);
  border-bottom: 1px solid var(--line, #e4dce5);
  background: var(--paper, #fcf9f6);
}

.shop-dialog-header h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.15;
}

.shop-dialog-close {
  display: grid;
  min-width: 2.75rem;
  min-height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line, #e4dce5);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.65rem;
  cursor: pointer;
}

.shop-dialog-body {
  padding: clamp(1rem, 5vw, 2rem);
}

.shop-dialog-body h3,
.shop-finder-form legend {
  margin: 0 0 .875rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

.shop-button,
.shop-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .625rem 1rem;
  border: 1px solid transparent;
  border-radius: 50rem;
  background: var(--plum, #281332);
  color: #fff;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.shop-button:hover:not(:disabled) {
  background: #492b58;
  color: #fff;
}

.shop-button-light {
  border-color: var(--line, #e4dce5);
  background: transparent;
  color: var(--ink, #201626);
}

.shop-text-button {
  width: fit-content;
  padding-inline: 0;
  background: transparent;
  color: var(--ink, #201626);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.shop-button:disabled,
.shop-dialog button:disabled,
.shop-finder-form button:disabled {
  opacity: .55;
  cursor: default;
}

.shop-dialog :focus-visible,
.shop-finder-form :focus-visible,
[data-search-results] :focus-visible {
  outline: 2px solid #795489;
  outline-offset: 3px;
}

.shop-empty,
.shop-muted {
  color: var(--muted, #695b70);
}

.shop-empty {
  padding: 1rem 0;
}

.shop-error {
  color: #9a1f38;
}

.shop-notice {
  position: fixed;
  z-index: 40;
  inset: auto 1rem max(1rem, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto 0;
  padding: .8rem 1.1rem;
  border-radius: .7rem;
  background: var(--plum, #281332);
  color: #fff;
  box-shadow: 0 .5rem 2rem #20162630;
}

.shop-notice.is-error {
  background: #802b40;
}

.shop-dialog > .shop-notice {
  right: max(1rem, calc((100vw - 48rem) / 2));
}

.shop-dialog-body > .shop-text-button {
  margin-top: -.625rem;
  margin-bottom: .7rem;
}

.shop-cart-lines,
.shop-checkout-lines {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-cart-line,
.shop-saved-line {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line, #e4dce5);
}

.shop-cart-line a,
.shop-compact-product,
.shop-compare-table a {
  color: inherit;
  text-decoration: none;
}

.shop-cart-line a,
.shop-compare-table a {
  font-weight: 700;
}

.shop-cart-line a:hover,
.shop-compact-product:hover strong,
.shop-compare-table a:hover {
  text-decoration: underline;
}

.shop-cart-line > div,
.shop-saved-line > div {
  grid-column: 2;
}

.shop-cart-line > p,
.shop-cart-line div > p {
  margin: .2rem 0;
  font-size: .88rem;
}

.shop-cart-line img,
.shop-compact-product img,
.shop-compare-table img {
  display: block;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: .55rem;
  object-fit: cover;
}

.shop-cart-line strong {
  grid-column: 3;
  font-size: .9rem;
  white-space: nowrap;
}

.shop-quantity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-top: .4rem;
}

.shop-quantity button:not(.shop-text-button) {
  min-width: 2.2rem;
  min-height: 2.75rem;
  padding: 0;
  border-color: var(--line, #e4dce5);
  background: transparent;
  color: var(--ink, #201626);
}

.shop-quantity .shop-text-button {
  font-size: .88rem;
}

.shop-totals {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.15rem;
}

.shop-totals + p {
  margin: .65rem 0 1rem;
}

.shop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
}

.shop-checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .84fr);
  align-items: start;
  gap: clamp(1rem, 4vw, 2.25rem);
}

.shop-checkout-form,
.shop-form-grid,
.shop-checkout-summary {
  display: grid;
  gap: .85rem;
}

.shop-checkout-form h3:not(:first-child) {
  margin-top: 1rem;
}

.shop-checkout-summary {
  padding: 1rem;
  border: 1px solid var(--line, #e4dce5);
  border-radius: .85rem;
  background: #fff;
}

.shop-checkout-summary > p,
.shop-checkout-summary > div > p {
  margin: 0;
}

.shop-checkout-summary > p:empty {
  display: none;
}

.shop-field {
  display: grid;
  gap: .4rem;
  color: var(--ink, #201626);
  font-size: .9rem;
  font-weight: 650;
}

.shop-field input,
.shop-field select {
  min-width: 0;
  width: 100%;
  min-height: 2.75rem;
  padding: .65rem;
  border: 1px solid #b3a6b7;
  border-radius: .45rem;
  background: #fff;
  color: var(--ink, #201626);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}

.shop-checkout-lines li,
.shop-summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .6rem;
  border-bottom: 1px solid var(--line, #e4dce5);
}

.shop-checkout-lines strong,
.shop-summary dd {
  margin: 0;
  white-space: nowrap;
}

.shop-checkout-variant {
  display: block;
  color: var(--muted, #695b70);
  font-size: .875rem;
}

.shop-summary {
  margin: .25rem 0;
}

.shop-summary div:last-child {
  border: 0;
  font-weight: 700;
  font-size: 1.15rem;
}

.shop-receipt {
  max-width: 28rem;
  margin: 0 auto;
}

.shop-payment-instructions {
  white-space: pre-line;
}

.shop-saved-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.shop-compact-wrap {
  display: grid;
  gap: .45rem;
  justify-items: start;
  min-width: 0;
}

.shop-compact-product {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  width: 100%;
  font-size: .93rem;
  line-height: 1.3;
}

.shop-compact-product img {
  flex: none;
  width: 3.15rem;
  height: 3.15rem;
}

.shop-compact-product span,
.shop-compact-product strong {
  display: block;
}

.shop-recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: .7rem;
}

.shop-recent-list .shop-compact-wrap {
  padding: .65rem;
  border: 1px solid var(--line, #e4dce5);
  border-radius: .65rem;
  background: #fff;
}

.shop-table-scroll {
  overflow-x: auto;
  margin-top: 1.1rem;
  border: 1px solid var(--line, #e4dce5);
  border-radius: .65rem;
}

.shop-compare-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  text-align: left;
}

.shop-compare-table th,
.shop-compare-table td {
  min-width: 9rem;
  padding: .8rem;
  border-bottom: 1px solid var(--line, #e4dce5);
  vertical-align: top;
}

.shop-compare-table th:first-child {
  min-width: 6rem;
}

.shop-compare-table tbody tr:nth-child(odd) {
  background: #f4eef4;
}

.shop-compare-table img {
  margin-bottom: .55rem;
}

.shop-finder-form {
  max-width: 40rem;
  margin-inline: auto;
}

.shop-finder-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.shop-finder-form legend {
  padding: 0;
  font-weight: 700;
}

.shop-finder-choice {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 3rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line, #e4dce5);
  border-radius: .55rem;
  background: #fff;
  cursor: pointer;
}

.shop-finder-choice:has(input:checked) {
  border-color: #785289;
  background: #f1e7f5;
}

.shop-finder-choice input {
  margin: 0;
  accent-color: var(--plum, #281332);
}

.shop-finder-reasons {
  padding-left: 1.25rem;
}

.shop-finder-reasons li + li {
  margin-top: .5rem;
}

[data-search] {
  position: relative;
}

[data-search-results] {
  position: absolute;
  z-index: 6;
  top: calc(100% + .35rem);
  right: 0;
  left: 0;
  min-width: min(18rem, calc(100vw - 2rem));
  max-height: min(24rem, 55vh);
  overflow-y: auto;
  padding: .5rem;
  border: 1px solid var(--line, #e4dce5);
  border-radius: .75rem;
  background: #fff;
  color: var(--ink, #201626);
  box-shadow: 0 .75rem 2rem #20162625;
}

[data-search-results] .shop-compact-product,
.shop-search-more {
  padding: .5rem;
  border-radius: .5rem;
}

[data-search-results] .shop-compact-product:hover,
.shop-search-more:hover {
  background: #f3edf5;
}

.shop-search-more {
  display: block;
  margin-top: .25rem;
  color: inherit;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.shop-dialog [hidden],
.shop-notice[hidden],
[data-search-results][hidden],
[data-whatsapp][hidden],
[data-recently-viewed][hidden] {
  display: none !important;
}

@media (max-width: 42rem) {
  .shop-checkout-grid,
  .shop-finder-form fieldset {
    grid-template-columns: 1fr;
  }

  .shop-finder-form fieldset {
    gap: .55rem;
  }

  .shop-finder-choice {
    min-height: 2.75rem;
  }

  .shop-compare-table th,
  .shop-compare-table td {
    min-width: 8rem;
  }

  .shop-drawer {
    border-radius: 0;
  }

  body > .shop-notice {
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
}
