/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #0d0d0d;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header FIXO */
.topo {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #1a1a1a;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  gap: 15px;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-tiny {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.logo-small {
  height: 50px;
  margin-right: 15px;
}

.topo h1 {
  font-size: 2em;
  font-weight: bold;
  margin: 0;
}

.topo h1 span {
  color: #ff0000;
}

/* Layout principal */
.layout {
  display: flex;
  min-height: 100vh;
  padding-top: 70px; /* compensa o header fixo */
}

/* Conteúdo esquerdo */
.left {
  flex: 1;
  min-width: 0;
  padding: 30px;
  margin-right: 380px; /* reserva espaço para o painel fixo */
  overflow-y: auto;
}

/* Cards */
.card {
  background: #1e1e1e;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.card h2 {
  margin-bottom: 15px;
  color: #ffffff;
  font-size: 1.4em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* Botões normais */
button {
  padding: 14px 20px;
  background: #2a2a2a;
  color: #d0d0d0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  font-weight: 500;
}

button:hover:not(:disabled) {
  background: #ff3333;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 51, 51, 0.3);
}

button:disabled {
  background: #ff3333;
  color: white;
  cursor: not-allowed;
}

button.toggle-active {
  background: #00aa55 !important;
  color: white;
  box-shadow: 0 0 10px rgba(0, 170, 85, 0.6);
  transform: scale(1.05);
}

/* Modificação + / - */
.mod-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  font-size: 1.6em;
  margin: 20px 0;
  padding: 15px;
  background: #222;
  border-radius: 16px;
}

.mod-box button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #333;
  color: #bb86fc;
  font-size: 1.8em;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mod-box button:hover:not(:disabled) {
  background: #bb86fc;
  color: #121212;
  transform: scale(1.1);
}

.mod-box span {
  min-width: 40px;
  text-align: center;
  font-weight: bold;
  color: #bb86fc;
}


/* Total Card */
.total-card {
  background: #1a1a1a;
  padding: 50px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);

  position: fixed; /* melhor que absolute */
  top: 55%;
  right: 40px;
  transform: translateY(-50%);
}

}

.total-card h3 {
  color: #fff;
  margin-bottom: 10px;
}

.total-card p#total {
  font-size: 2.8em;
  font-weight: bold;
  color: #00ffaa;
  margin: 20px 0;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.4);
}

.total-card button {
  width: 100%;
  margin: 10px 0;
  padding: 14px;
  font-size: 1.1em;
}

.total-card .reset {
  background: #aa0000;
}

.total-card .reset:hover {
  background: #ff2222;
}

#descontoInfo {
  margin: 15px 0;
  font-size: 1.2em;
  color: #ff6666;
  font-weight: bold;
}

/* Animação total */
.anim {
  animation: pulse 0.6s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Modais */
.modal, #modalDesconto {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #1e1e1e;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.modal-content h3 {
  margin-bottom: 20px;
  color: #fff;
  font-size: 1.6em;
}

.modal-content input {
  width: 100%;
  padding: 14px;
  margin: 15px 0;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 10px;
  color: white;
  font-size: 1.1em;
}

.modal-actions button {
  padding: 12px 24px;
  margin: 10px;
  min-width: 120px;
}

.modal-actions button:first-child {
  background: #00aa55;
}

.modal-actions button:first-child:hover {
  background: #00cc66;
}

.modal-actions button:last-child {
  background: #555;
}

.modal-actions button:last-child:hover {
  background: #777;
}

#modalDesconto small {
  display: block;
  margin-top: 20px;
  color: #aaa;
  font-size: 0.95em;
}
.right-panel {
  position: fixed;
  top: 70px;
  right: 0;
  width: 380px;
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}


/* ========================= */
/* MOBILE ONLY */
/* ========================= */
@media (max-width: 768px) {

  body {
    overflow-y: auto;
  }

  /* Layout vira coluna */
  .layout {
    flex-direction: column;
    padding-top: 70px;
  }

  /* REMOVE O ESPAÇO FIXO */
  .left {
    margin-right: 0 !important;
    padding: 15px;
  }

  main.left,
  aside.right {
    width: 100%;
    max-width: 100%;
  }

  /* TOTAL vira bloco normal */
  .total-card {
    position: relative !important;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    margin: 20px 0;
    padding: 20px;
  }

  /* Grid adaptado */
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  button {
    min-height: 44px;
  }
}
