/* --------------------------------------------------------------------------
   Pedido unificado — usa a mesma linguagem visual do card "Pedido rápido"
   -------------------------------------------------------------------------- */

.cart-order-modal {
  z-index: 1200;
}

.cart-order-dialog {
  width: min(100%, 600px);
  max-height: min(860px, 92vh);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 92, 184, 0.28) transparent;
}

.cart-order-dialog > .order-modal__close {
  z-index: 4;
}

.cart-order-content {
  display: grid;
  gap: 14px;
}

.cart-checkout-step {
  display: grid;
  gap: 14px;
}

.cart-checkout-step[hidden] {
  display: none;
}

.cart-customer-section {
  display: grid;
  gap: 9px;
}

.cart-customer-section h3 {
  margin: 0;
  color: var(--color-navy);
  font-size: 0.92rem;
  line-height: 1.3;
}

.cart-products-section {
  padding-top: 13px;
  border-top: 1px solid var(--color-border);
}

.cart-section-heading,
.cart-summary-row {
  display: flex;
  align-items: center;
}

.cart-section-heading {
  justify-content: space-between;
  margin-bottom: 9px;
}

.cart-section-heading h3 {
  margin: 0;
  color: var(--color-navy);
  font-size: 0.92rem;
  line-height: 1.3;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border: 2px solid var(--color-white);
  border-radius: 999px;
  background: #ffad0a;
  color: #102f61;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
}

.cart-badge--inline {
  border-width: 0;
}

.cart-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px dashed #cad5e4;
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.cart-empty-icon {
  color: #9aaac0;
  font-size: 2rem;
}

.cart-empty-title,
.cart-empty-text,
.cart-item-name,
.cart-item-price,
.cart-quick-add p {
  margin: 0;
}

.cart-empty-title {
  color: var(--color-navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.cart-empty-text {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.cart-items-list {
  display: grid;
  gap: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
}

.cart-item-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #f3f7fc;
  object-fit: contain;
}

.cart-item-info {
  min-width: 0;
}

.cart-item-name {
  overflow: hidden;
  color: var(--color-navy);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-price {
  margin-top: 3px;
  color: var(--color-blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.cart-item-price small {
  color: var(--color-text-muted);
  font-size: 0.66rem;
  font-weight: 500;
}

.cart-qty-ctrl {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: #f8fafc;
}

.cart-qty-btn,
.cart-item-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.cart-qty-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--color-blue);
  font-size: 1rem;
  font-weight: 900;
}

.cart-qty-btn:hover {
  background: var(--color-sky);
}

.cart-qty-val {
  min-width: 22px;
  color: var(--color-navy);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.cart-item-remove {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: #9aabba;
}

.cart-item-remove .material-symbols-rounded {
  font-size: 1.15rem;
}

.cart-item-remove:hover {
  background: #fff0f0;
  color: #c53030;
}

.cart-quick-add {
  margin-top: 11px;
}

.cart-quick-add p {
  margin-bottom: 8px;
  color: var(--color-navy);
  font-size: 0.82rem;
  font-weight: 800;
}

.cart-quick-add__choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.cart-product-choice {
  min-height: 46px;
  background: var(--color-white);
}

.cart-product-choice > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.cart-product-choice small {
  color: var(--color-text-muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.cart-product-choice:hover {
  border-color: var(--color-blue);
  background: var(--color-sky);
  color: var(--color-blue);
}

.cart-catalog-link {
  display: block;
  width: max-content;
  margin: 8px auto 0;
  color: var(--color-blue);
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
}

.cart-catalog-link:hover {
  text-decoration: underline;
}

.cart-field {
  margin-top: 9px;
}

.cart-field[hidden],
.cart-change-field[hidden] {
  display: none;
}

.cart-field textarea {
  min-height: 66px;
}

.cart-address-field textarea {
  min-height: 66px;
}

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

.cart-payment {
  padding-top: 0;
  border-top: 0;
}

.cart-payment-choice {
  background: var(--color-white);
}

.cart-payment-choice:hover,
.cart-payment-choice.is-selected {
  border-color: var(--color-blue);
  background: var(--color-sky);
  color: var(--color-blue);
}

.cart-change-field {
  margin-top: 9px;
}

.cart-payment-feedback {
  display: none;
  min-height: 1.25em;
  margin: 6px 0 0 2px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.cart-payment-feedback:not(:empty) {
  display: block;
}

.cart-payment-feedback--error {
  color: #b42318;
  font-weight: 700;
}

.cart-payment-feedback--success {
  color: #15803d;
  font-weight: 600;
}

.cart-continue-btn,
.cart-edit-details-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
}

.cart-continue-btn {
  width: 100%;
  border: 0;
}

.cart-edit-details-btn {
  width: max-content;
  margin: -2px auto 0;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--color-blue);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.cart-edit-details-btn:hover {
  text-decoration: underline;
}

.cart-summary {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #f5f8fc;
}

.cart-summary-row {
  justify-content: space-between;
  gap: 16px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.cart-summary-row strong {
  color: var(--color-navy);
}

.cart-summary-row--total {
  margin-top: 3px;
  padding-top: 8px;
  border-top: 1px solid #d8e1ed;
  color: var(--color-navy);
  font-size: 0.94rem;
  font-weight: 800;
}

.cart-summary-row--total strong {
  color: #15803d;
  font-size: 1.06rem;
}

.cart-form-error {
  min-height: 1.15em;
  margin: -4px 0;
  color: #b42318;
  font-size: 0.78rem;
  font-weight: 700;
}

.cart-order-dialog .input-error {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

/* Botão flutuante */
.cart-float-btn {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 13px 0 17px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: var(--color-blue);
  box-shadow: 0 10px 26px rgba(15, 44, 92, 0.28);
  color: var(--color-white);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.cart-float-btn:hover {
  background: var(--color-navy);
  box-shadow: 0 13px 30px rgba(15, 44, 92, 0.34);
  transform: translateY(-2px);
}

.cart-float-btn:active {
  transform: translateY(0) scale(0.97);
}

.cart-float-btn .cart-float-icon {
  color: #ffad0a;
  font-size: 1.25rem;
}

.cart-float-btn .cart-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-width: 0;
}

.cart-float-btn.bump {
  animation: cart-button-bump 0.3s ease;
}

@keyframes cart-button-bump {
  50% { transform: scale(1.08); }
}

/* Confirmação discreta de item adicionado */
.cart-toast {
  position: fixed;
  right: 24px;
  bottom: 90px;
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 15px;
  border-radius: var(--radius-md);
  background: var(--color-navy);
  box-shadow: var(--shadow-lg);
  color: var(--color-white);
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.cart-toast.is-active {
  opacity: 1;
  transform: translateY(0);
}

.cart-toast-icon {
  color: #62d899;
  font-size: 1.2rem;
}

@media (max-width: 640px) {
  .cart-order-modal {
    align-items: flex-end;
    padding: 0;
  }

  .cart-order-dialog {
    width: 100%;
    max-height: 94vh;
    padding: 26px 18px 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .cart-customer-grid {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .cart-item-img {
    width: 42px;
    height: 42px;
  }

  .cart-item-remove {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    margin-top: -5px;
  }

  .cart-qty-ctrl {
    grid-column: 3;
    grid-row: 1;
  }

  .cart-float-btn {
    right: 14px;
    bottom: 16px;
  }

  .cart-toast {
    right: 14px;
    bottom: 78px;
  }
}

@media (max-width: 390px) {
  .cart-quick-add__choices {
    grid-template-columns: 1fr;
  }

  .cart-float-label {
    display: none;
  }

  .cart-float-btn {
    width: 52px;
    justify-content: center;
    padding: 0;
  }

  .cart-float-btn .cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    border: 2px solid var(--color-white);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cart-float-btn,
  .cart-toast {
    transition: none;
  }

  .cart-float-btn.bump {
    animation: none;
  }
}
