:root {
  /* ====== Cores ====== */
  --color-bg: #ffffff;
  --color-border: #E1E1E1;
  --color-text: #1f2328;
  --color-text-100: #7C7C7C;
  --color-text-muted: #6b7280;
  --color-link: #AEAEAE;
  --color-discount: #d32f2f;
  --color-primary: #772385;
  --color-primary-hover: linear-gradient(90deg, #772385 0%, #9730A8 100%);
  --color-primary-press: #7EB1F2;
  --color-primary-text: #141414;
  --color-primary-button: #FFFFFF;

  /* ====== Tipografia ====== */
  --font-family-base: "Inter", system-ui, -apple-system, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* ====== Espaços ====== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* ====== Card / Itens ====== */
  --card-bg: var(--color-bg);
  --card-radius: 12px;
  --card-border: 1px solid var(--color-border);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  --card-padding: 24px 16px 56px;
  --item-thumb: 64px;

  /* ====== Inputs / Botão ====== */
  --input-height: 44px;
  --input-width: 146px;
  --input-bg: #f9fafb;
  --input-border: #e5e7eb;
  --input-radius: 8px;
  --input-padding: 0 var(--space-3);
  --input-placeholder: #9aa3af;
  --input-text: var(--color-text);

  --button-height: 44px;
  --button-width: 105px;
  --button-padding-x: var(--space-4);
  --button-radius: 8px;
  --button-shadow: 0 1px 2px rgba(16, 24, 40, .06);

  /* ====== Totais ====== */
  --price-total-size: var(--font-size-lg);
  --price-total-weight: var(--font-weight-bold);
}

/* ====== ORDER SUMMARY – DESKTOP ====== */
.order-summary {
  width: 312px;
  max-width: 312px;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: var(--card-padding);
  font-family: var(--font-family-base);
  color: var(--color-text);
}

/* Cabeçalho */
.summary-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.summary-header h3 {
  color: var(--color-primary-text);
  font-size: var(--font-size-md);
  font-weight: 600;
  line-height: 1;
  margin: 0;
}

/* Itens (desktop) */
.summary-items {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-4);
  max-height: 260px;
  overflow-y: auto;
  padding-right: var(--space-4);
}

.summary-items::-webkit-scrollbar {
  width: 8px;
  border-radius: 5.5px;
  background: rgba(217, 217, 217, 0.50);
}

.summary-items::-webkit-scrollbar-thumb {
  border-radius: 5.5px;
  background: #7A7A7A;
}

.summary-items::-webkit-scrollbar-button:single-button {
  display: none;
  width: 0;
  height: 0;
}


.summary-item {
  display: grid;
  grid-template-columns: var(--item-thumb) 1fr;
  gap: var(--space-3);
  align-items: start;
}

.item-thumb {
  width: var(--item-thumb);
  height: var(--item-thumb);
  background: #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.item-main {
  display: grid;
  grid-template-rows: auto auto auto;
}

.item-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: #111827;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.item-price {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: #111827;
}

.item-remove {
  font-size: var(--font-size-sm);
  color: var(--color-link);
  text-decoration: underline;
}

/* Botão adicionar (desktop) */
.add-more {
  width: 100%;
  height: var(--button-height);
  margin-top: var(--space-3);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: var(--color-bg);
  color: var(--color-text-100);
  font-weight: var(--font-weight-bold);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-shadow: var(--button-shadow);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  font-size: var(--font-size-xs);
  text-decoration: none;
}

.add-more:hover {
  background: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(255, 193, 7, 0.15);
}

.add-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  position: relative;
}

.add-arrow::after {
  content: "›";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #111827;
  transform: translateX(1px);
}

/* Divisória e títulos */
.summary-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-4) 0;
}

.pay-title {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

/* Totais */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  margin: 8px 0;
}

.summary-row .value {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-100);
}

.summary-row.muted {
  color: var(--color-text-muted);
}

.summary-row .discount span {
  color: var(--color-text-100);
}

.summary-row.discount .value {
  color: var(--color-discount);
}

.summary-row.total {
  margin-top: var(--space-3);
  font-size: var(--price-total-size);
  font-weight: var(--price-total-weight);
  color: #111827;
}

/* Cupom (desktop) */
.coupon-hint {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: var(--space-3) 0 var(--space-2);
}

.coupon-link {
  color: var(--color-link);
  text-decoration: underline;
}

.coupon-field {
  display: flex;
  gap: var(--space-1);
  padding-top: var(--space-3);
  margin-bottom: var(--space-6);
}

.coupon-input {
  height: var(--input-height);
  width: var(--input-width);
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  padding: var(--input-padding);
  font-size: var(--font-size-md);
}

.coupon-input::placeholder {
  color: var(--input-placeholder);
}

.apply-btn {
  height: var(--button-height);
  width: var(--button-width);
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--button-radius);
  background: var(--color-primary);
  color: var(--color-primary-button);
  font-weight: var(--font-weight-medium);
  box-shadow: var(--button-shadow);
  cursor: pointer;
}

.apply-btn:hover {
  background: var(--color-primary-hover);
}

.apply-btn:active {
  background: var(--color-primary-press);
}

.coupon-field {
  transition: opacity 0.4s, transform 0.4s;
}

/* ====== MOBILE – igual ao print ====== */
@media (max-width:768px) {

  .add-more {
    border: 1px solid var(--color-link);
    padding: 6px 10px;
    gap: 6px;
    color: var(--color-link);

    max-width: 144px;
    max-height: 27px;
    flex-shrink: 0;

    font-size: var(--font-size-xs);
    font-weight: 400;
  }

  .add-more svg {
    display: none;
  }

  .summary-row.discount {
    margin: 0;
    border: none;
  }

  .summary-divider {
    display: none;
  }

  .summary-row span,
  .summary-row span {
    font-size: var(--font-size-xs);
  }

  .summary-row.discount span:not(.value) {
    color: var(--color-text-100);
  }

  .order-summary {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    padding: 16px;
  }

  /* lista com rolagem (scroll visível no print) */
  .summary-items {
    gap: 18px;
    max-height: 196px;
    overflow: auto;
    padding-right: 4px;
  }

  /* sem miniatura; layout 1 coluna */
  .summary-item {
    position: relative;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .item-thumb {
    display: none;
  }

  .item-subtitle {
    display: none;
  }

  /* título com chevron */
  .item-title {
    padding-right: 96px;
  }

  .item-title::after {
    content: "▾";
    margin-left: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
    vertical-align: middle;
  }

  /* preço abaixo do título */
  .item-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
  }

  .item-price {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: #111827;
  }

  /* “Remover” como pílula à direita */
  .item-remove {
    position: absolute;
    top: 0;
    right: 0;
    text-decoration: none;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    padding: 6px 12px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
  }

  #forms-add-cupom {
    margin: 0;
    padding: var(--space-3) var(--space-4);

  }

  .apply-btn,
  .coupon-input {
    height: 34px;
  }

  .coupon-input {
    background: #FFF;
    border-radius: 6px;
    border: 1px solid var(--color-border);
  }

  .coupon-hint {
    margin: 0;
  }

  /* Cupom (vermelho) e Total */
  .summary-divider {
    margin: var(--space-4) 0;
  }

  .summary-row {
    margin: 10px 0;
    font-size: var(--font-size-sm);
  }

  .summary-row.discount {
    color: var(--color-discount);
  }

  .summary-row.total {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: #111827;
  }
}

/* Toast moderno com glassmorphism */
.custom-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: 24px;
  max-width: 400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #1a1a1a;
  padding: 20px 24px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  z-index: 99999;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: translateY(100px) scale(0.8);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  overflow: hidden;
}

/* Estados do toast */
.custom-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Variações por tipo */
.custom-toast.custom-toast-success {
  background: linear-gradient(135deg,
      rgba(76, 175, 80, 0.2) 0%,
      rgba(129, 199, 132, 0.15) 100%);
  border-color: rgba(76, 175, 80, 0.3);
  color: #1b5e20;
}

.custom-toast.custom-toast-success::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #4caf50, #81c784);
}

.custom-toast.custom-toast-error {
  background: linear-gradient(135deg,
      rgba(244, 67, 54, 0.2) 0%,
      rgba(239, 154, 154, 0.15) 100%);
  border-color: rgba(244, 67, 54, 0.3);
  color: #b71c1c;
}

.custom-toast.custom-toast-error::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f44336, #ef9a9a);
}

.custom-toast.custom-toast-info {
  background: linear-gradient(135deg,
      rgba(33, 150, 243, 0.2) 0%,
      rgba(144, 202, 249, 0.15) 100%);
  border-color: rgba(33, 150, 243, 0.3);
  color: #0d47a1;
}

.custom-toast.custom-toast-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2196f3, #90caf9);
}

/* Ícone moderno */
.custom-toast .toast-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Mensagem */
.custom-toast .toast-message {
  flex: 1;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* Responsivo para desktop */
@media (min-width: 769px) {
  .custom-toast {
    bottom: 32px;
    right: 32px;
    left: auto;
    max-width: 420px;
    margin: 0;
    padding: 24px 28px;
    font-size: 16px;
  }

  .custom-toast .toast-icon {
    font-size: 28px;
    width: 36px;
    height: 36px;
  }
}

/* Responsivo para telas pequenas */
@media (max-width: 480px) {
  .custom-toast {
    bottom: 16px;
    left: 16px;
    right: 16px;
    padding: 16px 20px;
    font-size: 15px;
    border-radius: 16px;
  }

  .custom-toast .toast-icon {
    font-size: 20px;
    width: 28px;
    height: 28px;
  }

  .custom-toast .toast-message {
    font-size: 15px;
  }
}

/* Animação de saída melhorada */
.custom-toast.hide {
  opacity: 0;
  transform: translateY(100px) scale(0.9);
  transition: all 0.3s ease-in-out;
}

/* Hover effect no desktop */
@media (min-width: 769px) {
  .custom-toast:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.15),
      0 4px 12px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .custom-toast {
    background: rgba(30, 30, 30, 0.8);
    color: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .custom-toast .toast-icon {
    background: rgba(255, 255, 255, 0.1);
  }
}