/* Fixed floating actions: content scrolls, the primary action stays visible. */
.sheet.cart-sheet,
.sheet.product-sheet {
  display: flex;
  flex-direction: column;
  height: min(92dvh, 760px);
  max-height: min(92dvh, 760px);
  overflow: hidden;
}
.sheet.cart-sheet { position: relative; }
#cartModal:not(.open) .cart-sheet { visibility: hidden; pointer-events: none; }

.sheet.cart-sheet > header,
.sheet.product-sheet > header { flex: 0 0 auto; touch-action: none; }
.sheet.cart-sheet.is-dragging,
.sheet.product-sheet.is-dragging { transition: none; }

.sheet.cart-sheet .sheet-scroll,
.sheet.product-sheet .option-groups {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet.cart-sheet .sheet-scroll { padding-bottom: 104px; }

.sheet.product-sheet .option-groups { padding-bottom: 20px; }

.cart-submit-bar,
.product-total {
  position: static;
  flex: 0 0 auto;
  border: 0;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: transparent;
  text-align: center;
}
.cart-submit-bar { position: absolute; right: 0; bottom: 0; left: 0; z-index: 4; pointer-events: none; }

.cart-submit-bar #submitOrder,
.product-total #confirmProduct {
  display: inline-flex;
  width: min(100%, 488px);
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  box-shadow: 0 12px 22px #6e233340;
}
.cart-submit-bar #submitOrder { pointer-events: auto; }

.product-total { display: flex; justify-content: center; }
.product-total > div { display: none; }
.cart-inline-submit { display: none; }
.whatsapp-submit-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: currentColor; }

/* A compact, truly centered cart trigger — independent from count and total widths. */
.cart-fab {
  position: fixed;
  right: auto;
  left: 50%;
  width: min(400px, calc(100% - 64px));
  grid-template-columns: 24px 1fr auto;
  transform: translate(-50%, 120%);
}
.cart-fab.visible { transform: translate(-50%, 0); }
.cart-fab .cart-fab-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max-content;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.cart-fab #cartCount,
.cart-fab > strong { position: relative; z-index: 1; }
.cart-fab #cartCount { grid-column: 1; justify-self: start; }
.cart-fab > strong { grid-column: 3; justify-self: end; }

/* Freezy-only product selectors: the selected state is a small strawberry. */
.product-sheet .choice { position: relative; }
.product-sheet .choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}
.product-sheet .choice::before {
  content: "○";
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  color: var(--primary);
  font-size: 17px;
  line-height: 1;
}
.product-sheet .choice.selected::before { content: "🍓"; font-size: 15px; }

/* Freezy uses a friendlier, more legible reading scale inside sheets. */
.sheet > header h2 { font-size: 30px; }
.sheet > header p:not(.kicker) { font-size: 14px; line-height: 1.45; }
.product-sheet .option-group legend { font-size: 17px; }
.product-sheet .option-group legend small { font-size: 13px; }
.product-sheet .choice { font-size: 14px; }
.product-sheet .choice b { font-size: 12px; }
.cart-sheet .cart-item strong { font-size: 17px; }
.cart-sheet .cart-item small,
.cart-sheet .helper,
.cart-sheet .note-field span { font-size: 13px; line-height: 1.45; }
.cart-sheet .total-row { font-size: 17px; }
.cart-sheet .total-row strong { font-size: 23px; }
.cart-sheet .order-form { gap: 16px; }
.cart-sheet .order-form label > span,
.cart-sheet .order-form legend { font-size: 13px; }
.cart-sheet .order-form input,
.cart-sheet .order-form select,
.cart-sheet .order-form textarea { font-size: 15px; }
.cart-sheet .order-form fieldset label { font-size: 14px; }
