/* Fluxo: produto → sacola → entrega (mock Brutal Burguer) */

.modal-sheet {
  width: min(480px, 100%);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}

/* —— Modal produto: bottom sheet (sobe de baixo, colado ao ecrã) —— */
#product-modal {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  place-items: unset;
  overflow: hidden;
}
#product-modal .modal-dialog.modal-sheet {
  width: 100%;
  max-width: 560px;
  height: min(92dvh, 92vh);
  max-height: min(92dvh, 92vh);
  margin: 0;
  border: 0;
  border-top: 1px solid var(--bb-border);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22);
  transform: translateY(100%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
#product-modal[aria-hidden="false"] .modal-dialog.modal-sheet {
  transform: translateY(0);
}
#product-modal .modal-close {
  top: 12px;
  right: 18px;
}

.modal-sheet .modal-close {
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(255,255,255,.92);
  box-shadow: var(--bb-shadow-sm);
}

/* —— Produto —— */
.product-sheet-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 20px 24px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.product-sheet-hero {
  position: relative;
  margin: 0 -20px 14px;
  line-height: 0;
}
.product-sheet-hero .bb-media {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}
.product-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  padding-top: 2px;
}
.product-sheet-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex: 1;
}
.product-sheet-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bb-red);
  white-space: nowrap;
}
.product-sheet-ingredients {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--bb-text-muted);
  line-height: 1.45;
}
.field-label-upper {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bb-text);
  margin: 14px 0 8px;
}
/* Opções com imagem (molho, ponto, bebidas, etc.) — compacto no modal */
#product-modal .option-group--visual .option-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 380px) {
  #product-modal .option-group--visual .option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#product-modal .option-item--visual {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  margin: 0;
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  min-height: 0;
}
#product-modal .option-item--visual:has(input:checked) {
  border-color: var(--bb-red);
  box-shadow: 0 0 0 1px rgba(225, 6, 0, 0.18);
}
#product-modal .option-item-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background: #f3f4f6;
  line-height: 0;
  overflow: hidden;
}
#product-modal .option-item-thumb .bb-media,
#product-modal .option-item-thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 6px;
  box-sizing: border-box;
}
#product-modal .option-item-thumb img.bb-media--placeholder {
  padding: 10px;
}
#product-modal .option-item-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 22px 5px 6px;
  min-height: 0;
}
#product-modal .option-item-name {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bb-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#product-modal .option-item-price {
  font-size: 0.6rem;
  font-weight: 700;
  color: #059669;
  margin-top: 1px;
}
#product-modal .option-item-price--zero {
  color: var(--bb-text-muted);
}
#product-modal .option-group--simple .option-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#product-modal .option-item--simple {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  background: #fff;
}
#product-modal .option-item--simple:has(input:checked) {
  border-color: var(--bb-red);
}
#product-modal .option-item--simple .option-item-name {
  flex: 1;
  font-size: 0.82rem;
  -webkit-line-clamp: unset;
}
#product-modal .option-item--simple .option-item-price {
  font-size: 0.82rem;
}
#product-modal .option-item--simple input {
  width: 16px;
  height: 16px;
  margin: 0;
}
#product-modal .option-item--visual input[type="radio"],
#product-modal .option-item--visual input[type="checkbox"] {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  margin: 0;
}
#product-modal .option-group {
  margin-bottom: 8px;
  padding: 8px 10px;
}
#product-modal .option-group-head h4,
#product-modal .option-group > h4 {
  font-size: 0.68rem;
}
#product-modal .option-group-head {
  margin-bottom: 6px;
}
#product-modal .option-badge {
  font-size: 0.58rem;
}
.option-group--cards .option-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.option-group--cards .option-item {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 1px solid var(--bb-border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.option-group--cards .option-item span:first-child {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  font-size: 0.75rem;
  line-height: 1.3;
  width: 100%;
}
.option-group--cards .option-item span:last-child {
  padding: 0 10px 8px;
  color: #059669;
  font-weight: 700;
  font-size: 0.78rem;
}
.option-group--cards .option-item:has(input:checked) {
  border-color: var(--bb-red);
  box-shadow: 0 0 0 1px rgba(225, 6, 0, 0.15);
}
.option-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.option-group-head h4 { margin: 0; }
.option-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bb-text-muted);
  white-space: nowrap;
}
.product-sheet-footer {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--bb-border);
  background: #fff;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--bb-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}
.qty-stepper button {
  width: 40px;
  height: 44px;
  border: 0;
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.qty-stepper span {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
}
.btn-add-sheet {
  flex: 1;
  min-height: 48px;
  border-radius: 14px;
  font-size: 0.88rem;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
  padding: 8px 12px;
}
.btn-add-sheet small {
  font-weight: 600;
  font-size: 0.72rem;
  opacity: 0.9;
}

/* —— Sacola —— */
.cart-drawer-inner {
  padding: 0;
}
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--bb-border);
}
.cart-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.cart-progress {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--bb-border);
  background: #fafafa;
}
.cart-progress p {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--bb-text-muted);
}
.cart-progress p strong { color: var(--bb-text); }
.cart-progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.cart-progress-bar span {
  display: block;
  height: 100%;
  background: var(--bb-red);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.cart-item-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--bb-border);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 10px;
}
.cart-item-card .line-price {
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.cart-item-actions button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--bb-border);
  background: #fff;
  cursor: pointer;
}
.cart-item-actions .qty-num {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}
.btn-icon-trash {
  margin-left: auto;
  color: var(--bb-text-muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
}
.cart-coupon {
  padding: 0 16px 12px;
}
.cart-coupon label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.cart-coupon-row {
  display: flex;
  gap: 8px;
}
.cart-coupon-row input {
  flex: 1;
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}
.cart-coupon-applied {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #166534;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--bb-border);
  background: #fff;
}
.cart-totals .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin: 4px 0;
  color: var(--bb-text-muted);
}
.cart-totals .row.discount { color: #059669; }
.cart-totals .row.total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bb-border);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--bb-text);
}
.cart-totals .row.total span:last-child { color: var(--bb-red); }
.btn-continue-delivery {
  margin-top: 12px;
  min-height: 52px;
  border-radius: 14px;
  font-size: 0.95rem;
  gap: 10px;
}

/* —— Checkout entrega —— */
.checkout-sheet {
  width: min(520px, 100%);
  max-height: 94vh;
}
.checkout-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--bb-border);
}
.checkout-header h2 {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.checkout-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 88px;
}
.flow-section {
  margin-bottom: 12px;
}
.flow-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.flow-num {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--bb-red);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
}
.checkout-fields label {
  display: grid;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--bb-text-muted);
  margin-bottom: 6px;
}
.checkout-fields input,
.checkout-fields textarea,
.checkout-fields select {
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  padding: 12px;
  min-height: 48px;
  font-size: 16px;
  width: 100%;
}
.pt-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.pt-affix > span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: var(--bb-text);
  background: #f3f4f6;
  border-right: 1px solid var(--bb-border);
}
.pt-affix input {
  border: 0;
  border-radius: 0;
  min-width: 0;
  letter-spacing: 0.04em;
}
.checkout-fields textarea {
  min-height: 72px;
  padding: 8px 10px;
}
.checkout-row-2 {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px;
}
.order-type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.order-type-toggle label {
  flex: 1;
  text-align: center;
  padding: 10px;
  border: 1px solid var(--bb-border);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.order-type-toggle label:has(input:checked) {
  border-color: var(--bb-red);
  background: #fff1f1;
  color: var(--bb-red-dark);
}
.order-type-toggle input { display: none; }
.payment-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.payment-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  min-height: 44px;
}
.payment-tile .ui-icon {
  width: 18px;
  height: 18px;
}
.payment-tile input { display: none; }
.payment-tile:has(input:checked) {
  border-color: var(--bb-red);
  background: #fff1f1;
  color: var(--bb-red-dark);
}
.payment-hint {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #fff1f1;
  border: 1px solid #fecaca;
  font-size: 0.68rem;
  color: #991b1b;
}
.checkout-footer {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--bb-border);
  background: #fff;
}
.checkout-footer-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--bb-text-muted);
}
.checkout-footer-total strong {
  font-size: 1.35rem;
  color: var(--bb-red);
}
.btn-finish-order {
  min-height: 52px;
  border-radius: 14px;
  width: 100%;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  gap: 8px;
}
.cart-drawer-inner {
  padding: 0;
}
.cart-items { flex: unset; }
.form-hint {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--bb-text-muted);
  text-align: center;
}
.text-right { text-align: right; }
.btn-sm { font-size: 0.78rem; padding: 6px 10px; min-height: auto; }
.checkout-flow {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.checkout-sheet {
  display: flex;
  flex-direction: column;
}
#checkout-modal .modal-dialog {
  padding: 0;
}
#product-modal .modal-dialog.modal-sheet {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#product-modal .modal-close {
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--bb-shadow-sm);
}
#product-modal #modal-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#product-modal #customize-form.product-sheet-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  gap: 0;
  overflow: hidden;
}
.product-sheet-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
.product-sheet-body textarea {
  width: 100%;
  border: 1px solid var(--bb-border);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 72px;
  resize: vertical;
}
.cart-item-options {
  font-size: 0.75rem;
  color: var(--bb-text-muted);
  margin-top: 4px;
}
