/* Guest cart */

.cart-stepper {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  min-height: 2.2rem;
  z-index: 2;
  position: relative;
  touch-action: manipulation;
}

.cart-stepper.is-active {
  min-width: 5.6rem;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .cart-stepper.is-active {
  background: rgba(245, 245, 245, 0.95);
  color: #111;
  border-color: rgba(0, 0, 0, 0.08);
}

.cart-add,
.cart-step-btn {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

html[data-theme="dark"] .cart-add,
html[data-theme="dark"] .cart-step-btn {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.cart-stepper.is-active .cart-step-btn {
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.15rem;
}

.cart-step-qty {
  min-width: 1.15rem;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
}

.cart-add:active,
.cart-step-btn:active {
  transform: scale(0.94);
}

.item-cart-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.item-cart-row .item-body {
  flex: 1;
  min-width: 0;
}

.cart-root {
  position: relative;
  z-index: 80;
}

.cart-bar {
  position: fixed;
  left: 50%;
  bottom: calc(5.1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(140%);
  width: min(420px, calc(100% - 1.2rem));
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.94);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s;
  touch-action: manipulation;
}

.cart-bar.is-on {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

@media (min-width: 900px) {
  .cart-bar {
    bottom: 1.4rem;
  }
}

body.has-cart .page-menu {
  padding-bottom: calc(9.2rem + env(safe-area-inset-bottom));
}

.cart-bar-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.cart-bar-info strong {
  font-size: 1rem;
}

.cart-bar-info span {
  font-size: 0.78rem;
  opacity: 0.75;
}

.cart-bar-open {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.7rem 1.05rem;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.cart-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: end;
}

.cart-sheet[hidden] {
  display: none !important;
}

.cart-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.cart-sheet-panel {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  max-height: min(86dvh, 720px);
  overflow: auto;
  background: var(--bg, #fafafa);
  color: inherit;
  border-radius: 22px 22px 0 0;
  padding: 0.85rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  -webkit-overflow-scrolling: touch;
}

html[data-theme="dark"] .cart-sheet-panel {
  background: #161616;
}

.cart-sheet-grab {
  width: 2.6rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.35);
  margin: 0.15rem auto 0.9rem;
}

.cart-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.cart-sheet-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
}

.cart-sheet-close {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(127, 127, 127, 0.25);
  background: transparent;
  color: inherit;
  font-size: 1.3rem;
  cursor: pointer;
}

.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.cart-lines li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .cart-lines li {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.cart-line-name {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.25;
}

.cart-line-price {
  color: var(--muted, #666);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: center;
}

.cart-qty button {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(127, 127, 127, 0.3);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
}

.cart-qty span {
  min-width: 1.2rem;
  text-align: center;
  font-weight: 700;
}

.cart-note {
  margin: 0.9rem 0 0;
}

.cart-note label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted, #666);
  margin-bottom: 0.35rem;
}

.cart-note textarea {
  width: 100%;
  min-height: 4.2rem;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.28);
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.7rem 0.8rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1rem 0 0.85rem;
  font-size: 1.05rem;
}

.cart-total strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
}

.cart-done {
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}

html[data-theme="dark"] .cart-done {
  background: #f2f2f2;
  color: #111;
}

.cart-done:disabled {
  opacity: 0.55;
}

.cart-hint {
  margin: 0.65rem 0 0;
  color: var(--muted, #666);
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
}

.cart-empty {
  margin: 0.5rem 0 1rem;
  color: var(--muted, #666);
}

.item-detail-cart {
  margin-top: 1.1rem;
  display: flex;
  justify-content: stretch;
}

.item-detail-cart .cart-stepper {
  width: 100%;
  min-height: 2.9rem;
}

.item-detail-cart .cart-add,
.item-detail-cart .cart-stepper.is-active {
  width: 100%;
  min-height: 2.9rem;
  border-radius: 999px;
}

.item-detail-cart .cart-add {
  background: #111;
  color: #fff;
  border: 0;
  font-size: 1rem;
  font-weight: 700;
  width: 100%;
  height: 2.9rem;
}

html[data-theme="dark"] .item-detail-cart .cart-add {
  background: #f2f2f2;
  color: #111;
}

.item-detail-cart .cart-stepper.is-active {
  justify-content: space-between;
  padding: 0.25rem 0.45rem;
}

.item-detail-cart .cart-stepper.is-active .cart-step-btn {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.35rem;
}

.item-detail-cart .cart-step-qty {
  font-size: 1.15rem;
}

body.cart-open {
  overflow: hidden;
}

.cart-toast {
  position: fixed;
  left: 50%;
  bottom: calc(8.2rem + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  z-index: 85;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .mobile-dock {
    z-index: 45;
  }
}
