/* Perks storefront preview — layered on the site's existing styles.css. */

/* Editorial introduction */
.store-intro {
  background: var(--cream, #f9f5ee);
  overflow: hidden;
}

.store-intro-inner {
  width: min(1280px, calc(100% - 100px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: stretch;
  min-height: 365px;
}

.store-intro-copy {
  min-width: 0;
  align-self: center;
  padding: 64px 9% 64px 0;
}

.store-intro-copy .eyebrow {
  margin-bottom: 18px;
}

.store-intro-copy h1 {
  max-width: 690px;
  margin: 0 0 20px;
  color: var(--dark, #30231d);
  font-family: var(--serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(3rem, 4.8vw, 5.4rem);
  line-height: 1.03;
  letter-spacing: -.045em;
}

.store-intro-copy h1 em {
  color: #a84a0f;
}

.store-intro-copy p:not(.eyebrow) {
  max-width: 490px;
  margin-bottom: 0;
  color: #61544b;
  font-size: 1rem;
  line-height: 1.8;
}

.store-intro-image {
  position: relative;
  min-height: 365px;
  overflow: hidden;
  background: #dfd0c0;
}

.store-intro-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-alert,
.store-pickup {
  color: #51392d;
  font-size: .85rem;
  line-height: 1.6;
}

.demo-alert {
  background: #f4e8da;
  border-block: 1px solid #e5d4c2;
  padding: 16px max(50px, calc((100vw - 1280px) / 2));
}

.demo-alert p,
.store-pickup p {
  margin: 0;
  color: inherit;
}

.demo-alert strong,
.store-pickup strong {
  color: #30231d;
}

.demo-alert a,
.store-pickup a,
.store-help a,
.cart-footnote a {
  color: #933d0b;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.store-pickup {
  background: #fffdf9;
  border-bottom: 1px solid var(--line, #e6dacf);
  padding: 14px max(50px, calc((100vw - 1280px) / 2));
}

.store-intro-copy .store-pickup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.store-intro-copy .store-pickup > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #cbb9a8;
  color: #9b4109;
  font-size: 1.1rem;
}

.store-intro-copy .store-pickup strong,
.store-intro-copy .store-pickup small {
  display: block;
}

.store-intro-copy .store-pickup small {
  color: #65574d;
  font-size: .75rem;
}

.container > .demo-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  margin-top: 26px;
  padding: 17px 20px;
  border: 1px solid #e5d4c2;
  border-left: 3px solid #b34d0b;
}

.container > .demo-alert a {
  flex: 0 0 auto;
  font-weight: 700;
}

/* Menu, search and categories */
.store-shell {
  width: min(1280px, calc(100% - 100px));
  margin-inline: auto;
  padding-block: 58px 90px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: clamp(32px, 4vw, 62px);
  align-items: start;
}

.store-main {
  min-width: 0;
}

.store-main h2 {
  font-family: var(--serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(2.25rem, 3.2vw, 3.5rem);
  letter-spacing: -.04em;
}

.store-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px 24px;
  margin-bottom: 22px;
}

.store-toolbar h2,
.store-toolbar p {
  margin-bottom: 0;
}

.store-search {
  width: min(100%, 330px);
  min-width: 200px;
}

input.store-search,
.store-search input {
  width: 100%;
  min-height: 48px;
  padding: 11px 15px;
  border: 1px solid #cdbfb2;
  border-radius: 0;
  background: #fffdf9;
  color: #29221e;
}

.store-search input::placeholder,
input.store-search::placeholder {
  color: #6e625a;
  opacity: 1;
}

.store-search label {
  display: block;
  margin-bottom: 6px;
  color: #4e4037;
  font-size: .76rem;
  font-weight: 700;
}

.category-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #b8a698 transparent;
  padding: 7px 4px 13px;
  margin: 0 0 20px;
  -webkit-overflow-scrolling: touch;
}

.category-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid #d4c7bb;
  border-radius: 0;
  background: #fffdf9;
  color: #49392f;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}

.category-button:hover {
  border-color: #6b5040;
  background: #f5ebe0;
}

.category-button[aria-pressed='true'] {
  border-color: #30231d;
  background: #30231d;
  color: #fffaf5;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.product-grid > .store-help {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px solid #e6dacf;
  background: #f9f5ee;
}

.product-card {
  --art-bg: #f1e3d5;
  --art-ink: #714938;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e6dacf;
  border-radius: 0;
  background: #fffdf9;
  color: #29221e;
  text-align: left;
  box-shadow: 0 3px 14px rgba(61, 40, 28, .035);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.product-card:hover {
  border-color: #b79e8b;
  box-shadow: 0 9px 22px rgba(61, 40, 28, .09);
  transform: translateY(-2px);
}

.product-card[data-category*='tea' i],
.product-card.tea,
.product-art[data-category*='tea' i],
.product-art.art-tea {
  --art-bg: #e3ebe3;
  --art-ink: #526a55;
}

.product-card[data-category*='lotus' i],
.product-card.lotus,
.product-art[data-category*='lotus' i],
.product-art.art-lotus {
  --art-bg: #e8e0e9;
  --art-ink: #70576c;
}

.product-card[data-category*='soda' i],
.product-card.soda,
.product-art[data-category*='soda' i],
.product-art.art-soda {
  --art-bg: #e0e9e8;
  --art-ink: #496c6b;
}

.product-card[data-category*='food' i],
.product-card[data-category*='treat' i],
.product-card[data-category*='bakery' i],
.product-card.food,
.product-art[data-category*='food' i],
.product-art[data-category*='treat' i],
.product-art.art-food {
  --art-bg: #f2e6ce;
  --art-ink: #79583e;
}

.product-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 150px;
  aspect-ratio: 2.2 / 1;
  overflow: hidden;
  background: var(--art-bg, #f1e3d5);
  color: var(--art-ink, #714938);
}

.product-art::before {
  content: '';
  position: absolute;
  width: 125px;
  height: 125px;
  max-width: 48%;
  border-radius: 50%;
  background: rgba(255, 253, 249, .42);
}

.product-art svg {
  position: relative;
  display: block;
  width: min(31%, 102px);
  height: auto;
  max-height: 110px;
}

.product-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  padding: 22px 23px 26px;
}

.product-category {
  display: block;
  margin-bottom: 8px;
  color: #914315;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.product-title {
  display: block;
  margin: 0 0 8px;
  color: #30231d;
  font-family: var(--serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.24rem, 1.65vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.product-desc {
  display: block;
  margin: 0 0 17px;
  color: #65574d;
  font-size: .83rem;
  font-weight: 400;
  line-height: 1.55;
}

.product-price {
  display: inline-block;
  margin-top: auto;
  padding-right: 48px;
  color: #30231d;
  font-size: .83rem;
  font-weight: 700;
  line-height: 1.4;
}

.product-add {
  position: absolute;
  right: 19px;
  bottom: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d8c4b3;
  border-radius: 50%;
  color: #963d0b;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
}

.product-card:hover .product-add {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Cart and line items */
.store-cart {
  position: sticky;
  top: 24px;
  min-width: 0;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid #e0d3c6;
  background: #f9f5ee;
  box-shadow: 0 10px 30px rgba(60, 39, 27, .05);
}

.cart-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid #e2d6ca;
}

.cart-head h2,
.cart-head h3 {
  margin: 0;
  color: #30231d;
  font-family: var(--serif, 'Playfair Display', Georgia, serif);
  font-size: 1.65rem;
  letter-spacing: -.035em;
}

.cart-head .eyebrow {
  margin: 0;
}

.cart-content {
  min-width: 0;
  padding: 0 24px;
}

.cart-empty {
  margin: 0;
  padding: 31px 0;
  color: #68594f;
  font-size: .86rem;
  line-height: 1.7;
}

.cart-empty h3 {
  margin: 16px 0 7px;
  color: #30231d;
  font-family: var(--serif, 'Playfair Display', Georgia, serif);
  font-size: 1.3rem;
}

.cart-empty p {
  margin: 0;
}

.cart-empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #d2bca9;
  border-radius: 50%;
  color: #9b4109;
  font-size: 1.2rem;
}

.cart-line {
  padding: 18px 0;
  border-bottom: 1px solid #e2d6ca;
}

.cart-line-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  color: #30231d;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.4;
}

.cart-options {
  margin: 6px 0 0;
  color: #68594f;
  font-size: .77rem;
  line-height: 1.5;
}

.cart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d2c2b4;
  background: #fffdf9;
  color: #30231d;
}

.quantity-control button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #30231d;
  font-size: 1.1rem;
}

.quantity-control button:hover {
  background: #efe4d9;
}

.quantity-control span,
.quantity-control output {
  min-width: 25px;
  text-align: center;
  font-size: .82rem;
  font-weight: 700;
}

.cart-controls > button:not(.button),
.cart-controls a {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #914315;
  font-size: .75rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-summary {
  padding: 20px 24px 0;
  color: #30231d;
  font-size: .88rem;
}

.cart-content > .cart-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-inline: 0;
}

.cart-summary > div,
.cart-summary > p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: inherit;
}

.cart-cta {
  width: calc(100% - 48px);
  margin: 16px 24px 0;
}

.cart-footnote {
  margin: 0;
  padding: 14px 24px 24px;
  color: #68594f;
  font-size: .74rem;
  line-height: 1.55;
}

.cart-content > .cart-cta {
  width: 100%;
  margin: 8px 0 0;
}

.cart-content > .cart-footnote {
  padding-inline: 0;
}

.cart-mobile-trigger {
  display: none;
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding-inline: 6px;
  border-radius: 50%;
  background: #f0e0d0;
  color: #51301e;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1;
}

/* Native dialogs retain their browser-controlled closed state. */
.store-dialog {
  width: min(580px, calc(100% - 32px));
  max-width: none;
  max-height: min(85vh, 780px);
  max-height: min(85dvh, 780px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dfd0c2;
  border-radius: 0;
  background: #fffdf9;
  color: #29221e;
  box-shadow: 0 22px 70px rgba(35, 22, 15, .25);
}

.store-dialog::backdrop {
  background: rgba(38, 27, 21, .66);
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid #e6dacf;
}

.dialog-head h2,
.dialog-head h3 {
  margin: 0;
  color: #30231d;
  font-family: var(--serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  letter-spacing: -.035em;
}

.dialog-head p {
  margin: 7px 0 0;
  color: #65574d;
  font-size: .85rem;
}

.dialog-close {
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d5c7ba;
  background: #fffdf9;
  color: #30231d;
  font-size: 1.35rem;
  line-height: 1;
}

.dialog-close:hover {
  background: #f3e8dc;
  border-color: #9b8170;
}

.dialog-body {
  padding: 24px 28px;
}

.dialog-body p {
  color: #65574d;
  line-height: 1.65;
}

.option-group {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-group legend,
.option-group h3,
.option-group h4 {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  color: #30231d;
  font-family: var(--sans, 'DM Sans', Arial, sans-serif);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

.option-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #d4c6b9;
  background: #fffdf9;
  color: #42352d;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.option-choice:hover {
  border-color: #8b6d58;
  background: #f8f0e8;
}

.option-choice:has(input:checked) {
  border-color: #9b4109;
  background: #f7e7d9;
  color: #71300a;
}

.option-choice input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #9b4109;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 28px 26px;
  border-top: 1px solid #e6dacf;
}

.dialog-actions .button {
  min-height: 50px;
}

.dialog-body .dialog-actions {
  justify-content: space-between;
  margin-top: 22px;
  padding: 20px 0 0;
}

.dialog-body > .cart-footnote {
  padding: 16px 0 0;
}

.dialog-price {
  color: #30231d !important;
  font-weight: 700;
}

.checkout-dialog {
  width: min(520px, calc(100% - 32px));
}

.store-help {
  padding: 0 0 70px;
  color: #65574d;
  font-size: .85rem;
  line-height: 1.7;
}

.store-help p:last-child {
  margin-bottom: 0;
}

.store-toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100% - 32px));
  padding: 13px 18px;
  background: #30231d;
  color: #fffaf5;
  box-shadow: 0 8px 24px rgba(39, 25, 17, .2);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.5;
}

/* An explicit hidden rule is needed where component display styles would win. */
.store-intro [hidden],
.demo-alert [hidden],
.store-pickup [hidden],
.store-shell [hidden],
.store-dialog [hidden],
.store-help [hidden],
.demo-alert[hidden],
.store-pickup[hidden],
.store-help[hidden],
.store-toast[hidden],
.cart-mobile-trigger[hidden] {
  display: none !important;
}

.store-shell :is(a, button, input, select, textarea):focus-visible,
.store-dialog :is(a, button, input, select, textarea):focus-visible,
.store-intro :is(a, button):focus-visible,
.store-help a:focus-visible,
.cart-mobile-trigger:focus-visible {
  outline: 3px solid #9b4109;
  outline-offset: 3px;
}

.option-choice:has(input:focus-visible) {
  outline: 3px solid #9b4109;
  outline-offset: 3px;
}

@media (max-width: 1050px) {
  .store-intro-inner,
  .store-shell {
    width: calc(100% - 64px);
  }

  .demo-alert,
  .store-pickup {
    padding-inline: 32px;
  }

  .store-shell {
    grid-template-columns: minmax(0, 1fr) minmax(255px, 290px);
    gap: 28px;
  }

  .product-grid {
    gap: 14px;
  }

  .product-copy {
    padding: 19px;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .store-intro-inner,
  .store-shell {
    width: calc(100% - 40px);
  }

  .store-intro-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .store-intro-copy {
    padding: 58px 0 34px;
  }

  .store-intro-copy h1 {
    font-size: clamp(2.8rem, 10vw, 4.2rem);
  }

  .store-intro-image {
    min-height: 230px;
    height: clamp(230px, 48vw, 340px);
  }

  .demo-alert,
  .store-pickup {
    padding-inline: 20px;
  }

  .store-shell {
    display: block;
    padding-block: 44px 65px;
  }

  .store-toolbar {
    align-items: stretch;
  }

  .container > .demo-alert {
    align-items: flex-start;
    flex-direction: column;
  }

  .store-search {
    width: 100%;
    max-width: none;
  }

  .store-cart {
    display: none;
  }

  .cart-mobile-trigger {
    position: fixed;
    z-index: 40;
    right: 20px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: calc(100% - 40px);
    min-height: 56px;
    padding: 12px 18px;
    border: 1px solid #30231d;
    background: #30231d;
    color: #fffaf5;
    box-shadow: 0 8px 24px rgba(39, 25, 17, .24);
    font-weight: 700;
  }

  .cart-mobile-trigger:hover {
    border-color: #4e3529;
    background: #4e3529;
    color: #fffaf5;
  }

  .cart-mobile-trigger:focus-visible {
    outline-color: #b34d0b;
  }

  .store-toast {
    right: 20px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    left: 20px;
    max-width: none;
  }

  .store-help {
    padding-bottom: 50px;
  }
}

@media (max-width: 420px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .product-art {
    min-height: 132px;
    aspect-ratio: 2.6 / 1;
  }

  .product-art::before {
    width: 105px;
    height: 105px;
  }

  .product-art svg {
    max-height: 90px;
  }

  .dialog-head {
    padding: 22px 20px 18px;
  }

  .dialog-body {
    padding: 20px;
  }

  .dialog-actions {
    padding: 18px 20px 22px;
  }

  .dialog-actions .button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-button,
  .product-card,
  .store-dialog .button,
  .cart-mobile-trigger {
    transition: none !important;
    animation: none !important;
  }

  .product-card:hover,
  .store-dialog .button:hover {
    transform: none;
  }
}

.dialog-body [data-product-status]{padding:10px 0 0;margin:0;color:#8a350b}.dialog-body [data-product-status]:empty{display:none}

/* Square product photos keep their original proportions; unmatched items keep their category illustration. */
.product-art{aspect-ratio:1.7 / 1}
.product-art.has-photo{background:#fff}
.product-art.has-photo::before{display:none}
.product-art.has-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.product-dialog-image{height:200px;background:#fff;border-bottom:1px solid #e6dacf}
.product-dialog-image img{width:100%;height:100%;object-fit:contain}
@media(max-width:420px){.product-art{aspect-ratio:1.8 / 1}.product-dialog-image{height:170px}}
