/* Material Design 3 Color Tokens */
:root {
  --md-sys-color-primary: #0061a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d1e4ff;
  --md-sys-color-on-primary-container: #001d36;
  --md-sys-color-secondary: #535f70;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-surface: #fdfbff;
  --md-sys-color-on-surface: #1a1c1e;
  --md-sys-color-surface-variant: #dfe2eb;
  --md-sys-color-on-surface-variant: #43474e;
  --md-sys-color-outline: #73777f;
  --md-sys-color-outline-variant: #c3c7cf;
  --md-sys-color-error: #ba1a1a;

  --elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
  --elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background-color: #f0f4f8;
  /* Light neutral background */
  font-family: 'Roboto', 'Inter', sans-serif;
  color: var(--md-sys-color-on-surface);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  line-height: 1.5;
}

.app-container {
  width: 100%;
  max-width: 1000px;
}

.main-card {
  background-color: var(--md-sys-color-surface);
  border-radius: 28px;
  box-shadow: var(--elevation-2);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow: hidden;
}

.header {
  border-bottom: 0px solid var(--md-sys-color-outline-variant);
  padding-bottom: 0.5rem;
}

.titulo {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.titulo-icon {
  width: 48px;
  height: 48px;
  filter: sepia(1) saturate(5) hue-rotate(190deg);
  /* Mantém o tema azul do MD3 */
}

.primary-text {
  color: var(--md-sys-color-primary);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
}

/* Form Styles */
.formulario {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  margin-left: 0.25rem;
}

.select-wrapper,
.quantidade-input {
  position: relative;
  background-color: var(--md-sys-color-surface-variant);
  border-radius: 4px 4px 0 0;
  border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
  transition: all 0.2s ease;
}

.select-wrapper:focus-within,
.quantidade-input:focus {
  border-bottom: 2px solid var(--md-sys-color-primary);
  background-color: #e8ebf2;
}

.produto-input,
.quantidade-input {
  width: 100%;
  height: 56px;
  padding: 0 1rem;
  font-size: 1rem;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  outline: none;
  font-family: inherit;
}

.produto-input {
  appearance: none;
  cursor: pointer;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="%2343474E"><path d="M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"/></svg>') no-repeat right 1rem center;
}

.quantity-field {
  max-width: 120px;
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Buttons */
button {
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.1px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 24px;
  border-radius: 20px;
  border: none;
}

.btn-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.btn-filled:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  filter: brightness(1.1);
}

.btn-outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}

.btn-outlined:hover {
  background-color: rgba(0, 97, 164, 0.08);
}

/* Cart Section */
.carrinho {
  background-color: var(--md-sys-color-surface-variant);
  border-radius: 24px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.carrinho-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-icon {
  width: 24px;
  height: 24px;
  /* Filtro para converter o ícone preto para #43474e */
  filter: sepia(5%) saturate(0%) brightness(35%) contrast(35%);
}

.carrinho__titulo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}

.carrinho__produtos {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100px;
}

.carrinho__produtos__produto {
  background: var(--md-sys-color-surface);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--md-sys-color-outline-variant);
  animation: slideIn 0.3s ease-out;
}

.produto-nome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.qtd-badge {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.produto-preco {
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.empty-msg {
  color: var(--md-sys-color-on-surface-variant);
  font-style: italic;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 1rem;
}

.divider {
  height: 1px;
  background-color: var(--md-sys-color-outline-variant);
}

.carrinho-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.total-label {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--md-sys-color-secondary);
}

.carrinho__total {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .main-card {
    padding: 1.5rem;
  }

  .titulo {
    font-size: 2rem;
  }
}