html.store-cart-open,
body.store-cart-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.store-cart-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.store-cart-floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 17px;
  background: #1b1712;
  color: #f6c421;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(0,0,0,.28);
}

.store-cart-floating:hover { transform: translateY(-2px); }
.store-cart-floating strong {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f6c421;
  color: #1b1712;
  font-size: 13px;
}
.store-cart-icon { font-size: 19px; }

.store-cart-dialog {
  width: min(680px, calc(100vw - 24px));
  height: min(760px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto 0 auto auto;
  border: 0;
  border-radius: 22px 0 0 22px;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: -20px 0 70px rgba(0,0,0,.3);
}

@supports not (height: 100dvh) {
  .store-cart-dialog {
    height: min(760px, calc(100vh - 24px));
    max-height: calc(100vh - 24px);
  }
}

.store-cart-dialog::backdrop { background: rgba(20,17,13,.58); }

.store-cart-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fffaf0;
  overscroll-behavior: contain;
}

.store-cart-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: #1b1712;
  color: #fff;
}
.store-cart-header h2, .store-cart-header p { margin:0; }
.store-cart-header .eyebrow { color:#f6c421; }
.store-cart-close { width:42px; height:42px; border:1px solid rgba(255,255,255,.25); border-radius:999px; background:transparent; color:#fff; font-size:28px; cursor:pointer; }

#store-cart-items {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.store-cart-list { display:grid; gap:12px; }
.store-cart-item { display:grid; grid-template-columns:86px 1fr auto; gap:14px; align-items:center; padding:13px; background:#fff; border:1px solid #eadfc8; border-radius:16px; }
.store-cart-thumb { width:86px; height:72px; border-radius:12px; overflow:hidden; background:#efe7d7; display:grid; place-items:center; font-weight:900; }
.store-cart-thumb img { width:100%; height:100%; object-fit:cover; }
.store-cart-item-body strong { display:block; line-height:1.35; }
.store-cart-item-body p { margin:5px 0; color:#766b5d; font-size:13px; }
.store-cart-item-price { display:flex; flex-wrap:wrap; gap:8px 12px; font-size:13px; }
.store-cart-item-price .is-member { color:#2d6c3b; font-weight:700; }
.store-cart-item-actions { display:grid; justify-items:end; gap:8px; }
.store-cart-item-actions label { font-size:12px; color:#6d6255; }
.store-cart-item-actions input { display:block; width:72px; margin-top:4px; padding:8px; }
.store-cart-item-actions button { border:0; background:transparent; color:#a32f2f; cursor:pointer; }
.store-cart-empty { text-align:center; padding:70px 20px; color:#6d6255; }
.store-cart-empty > div { font-size:52px; }

#store-cart-footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  padding: 18px 22px max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid #eadfc8;
  background: #fff;
  box-shadow: 0 -8px 22px rgba(59,39,16,.08);
}
.store-cart-total-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.store-cart-total-grid > div { padding:13px 14px; border-radius:13px; background:#fff8e7; border:1px solid #e9d8ad; }
.store-cart-total-grid > div.is-member { background:#eef8ee; border-color:#c9e3ce; }
.store-cart-total-grid span { display:block; font-size:13px; color:#74695a; }
.store-cart-total-grid strong { display:block; margin-top:3px; font-size:22px; }
.store-cart-total-grid .is-member strong { color:#2d6c3b; }
.store-cart-hint { margin:10px 0 14px; color:#73695c; font-size:13px; }
.store-cart-footer-actions { display:flex; justify-content:flex-end; gap:10px; }
.store-cart-toast { position:fixed; left:50%; bottom:28px; z-index:100; transform:translateX(-50%); padding:12px 18px; border-radius:999px; background:#1b1712; color:#fff; box-shadow:0 12px 30px rgba(0,0,0,.28); font-weight:700; }
.store-cart-toast[hidden] { display:none; }
.store-add-cart-button { text-align:center; }

@media (max-width: 680px) {
  .store-cart-floating { right:14px; bottom:max(14px, env(safe-area-inset-bottom)); padding:12px 14px; }
  .store-cart-dialog {
    width: 100vw;
    height: min(88dvh, 760px);
    max-height: 100dvh;
    border-radius: 18px 18px 0 0;
    margin: auto 0 0;
  }
  @supports not (height: 100dvh) {
    .store-cart-dialog {
      height: min(88vh, 760px);
      max-height: 100vh;
    }
  }
  .store-cart-header { padding: 17px 18px; }
  #store-cart-items { padding: 14px; }
  #store-cart-footer { padding: 14px 14px max(14px, env(safe-area-inset-bottom)); }
  .store-cart-item { grid-template-columns:72px 1fr; }
  .store-cart-thumb { width:72px; height:64px; }
  .store-cart-item-actions { grid-column:1 / -1; display:flex; align-items:end; justify-content:space-between; }
  .store-cart-item-actions label { display:flex; align-items:center; gap:8px; }
  .store-cart-item-actions input { margin:0; }
  .store-cart-total-grid { grid-template-columns:1fr; }
  .store-cart-footer-actions { display:grid; grid-template-columns:1fr 1fr; }
}

@media (max-height: 620px) {
  .store-cart-dialog {
    height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px);
  }
  .store-cart-header { padding-top: 12px; padding-bottom: 12px; }
  #store-cart-footer { padding-top: 11px; }
  .store-cart-hint { display: none; }
}
