/* CSS Desktop para Item */
/* Este arquivo será usado para dispositivos desktop e tablet */

/* Variáveis CSS */
:root {
  --primary: #3498db;
  --secondary: #2C3E50;
  --background: #F8F9FA;
  --card-bg: #FFFFFF;
  --text: #2C3E50;
  --text-muted: #6C757D;
  --border: #DEE2E6;
  --success: #27ae60;
  --warning: #e67e22;
  --danger: #e74c3c;
  --info: #17A2B8;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --spacing: 1rem;
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 100px;
}

/* ✅ LAYOUT PRINCIPAL MELHORADO - CENTRALIZADO COMO O INDEX */
.main-container {
  max-width: 1100px; /* Limita a largura máxima como o index */
  margin: 0 auto; /* Centraliza o container */
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Espaçamento consistente */
  min-height: 100vh;
}

/* Botão de voltar */
.back-button {
  position: fixed;
  top: 2rem;
  left: 2rem;
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 100;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.back-button:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

/* ✅ IMAGEM DO ITEM - CENTRALIZADA E LIMITADA */
.item-image {
  width: 100%;
  max-width: 600px; /* Limita a largura máxima */
  height: 350px; /* Altura menor */
  margin: 0 auto 1.5rem; /* Centraliza a imagem */
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

/* ✅ DETALHES DO ITEM - CENTRALIZADOS */
.item-details {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto 1.5rem; /* Centraliza */
  max-width: 800px; /* Limita a largura */
  width: 100%;
}

.item-name {
  font-size: 2.2rem; /* Reduzido */
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.2;
  text-align: center; /* Centraliza o título */
}

.item-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
  text-align: center; /* Centraliza a descrição */
}

/* Info da pizza */
.pizza-size-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #e3f2fd;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  border-left: 4px solid var(--info);
  max-width: 600px; /* Limita a largura */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

.pizza-size-info i {
  font-size: 2rem;
  color: var(--info);
}

.pizza-size-info .content {
  flex: 1;
}

.pizza-size-info .title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.pizza-size-info .description {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ✅ PREÇOS - CENTRALIZADOS */
.price-container {
  display: flex;
  align-items: center;
  justify-content: center; /* Centraliza os preços */
  gap: 1rem;
  margin-bottom: 1rem;
}

.item-price,
.price-promocional {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.price-original {
  font-size: 1.5rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.promocao-badge {
  background: var(--danger);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

#pizza-price-display {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 1rem;
  padding: 1rem;
  background: #f0f8ff;
  border-radius: var(--radius);
  text-align: center;
  max-width: 400px; /* Limita a largura */
  margin-left: auto;
  margin-right: auto;
  margin-top: 1rem;
}

/* ✅ SEÇÕES DE CONTEÚDO - CENTRALIZADAS */
.content-section,
.sabores-section,
.complementos-section,
.adicionais-section,
.observacoes-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto 1.5rem; /* Centraliza todas as seções */
  max-width: 800px; /* Limita a largura de todas as seções */
  width: 100%;
  overflow: hidden;
  padding: 2rem; /* Padding consistente */
}

.section-title {
  font-size: 1.4rem; /* Reduzido */
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center; /* Centraliza os títulos */
  gap: 0.75rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
  text-align: center;
}

.section-title i {
  color: var(--primary);
}

/* Contador de seleção */
.selection-counter {
  background: linear-gradient(135deg, var(--primary) 0%, #2980b9 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  text-align: center;
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  max-width: 500px; /* Limita a largura */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

.selection-counter.complete {
  background: linear-gradient(135deg, var(--success) 0%, #1e7e34 100%);
}

/* Mensagem de erro */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  border-left: 4px solid var(--danger);
  display: flex;
  align-items: center;
  justify-content: center; /* Centraliza a mensagem */
  gap: 0.5rem;
  max-width: 600px; /* Limita a largura */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
  text-align: center;
}

/* ✅ SELEÇÃO DE SABORES - MELHORADA */
.sabor-selection {
  margin-bottom: 2rem; /* Reduzido */
  max-width: 700px; /* Limita a largura */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

.sabor-selection h3 {
  font-size: 1.2rem; /* Reduzido */
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center; /* Centraliza os títulos */
  gap: 1rem;
}

.step-indicator {
  background: var(--primary);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.sabor-selection.has-selection .step-indicator {
  background: var(--success);
}

/* Items de sabor */
.sabor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.sabor-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(52, 152, 219, 0.15);
  transform: translateY(-2px);
}

.sabor-item.selected {
  border-color: var(--primary);
  background: rgba(52, 152, 219, 0.05);
}

.sabor-info {
  flex: 1;
  margin-right: 1rem;
}

.sabor-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.sabor-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.sabor-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.sabor-radio {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* ✅ ESTILOS PARA COMPLEMENTOS - MELHORADOS E CENTRALIZADOS */
.complemento-section {
  margin-bottom: 2rem !important;
  border: 2px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden !important;
  background: white !important;
  box-shadow: var(--shadow) !important;
  max-width: 700px !important; /* Limita a largura */
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 2rem !important;
}

.complemento-section.obrigatorio {
  border-color: var(--warning) !important;
  background: rgba(230, 126, 34, 0.05) !important;
}

.complemento-header {
  background: #f8f9fa !important;
  padding: 1.5rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 1px solid var(--border) !important;
}

.complemento-title {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.complemento-title.obrigatorio {
  color: var(--warning) !important;
}

.complemento-title i {
  color: var(--primary) !important;
  font-size: 1.1rem !important;
}

.complemento-title.obrigatorio i {
  color: var(--warning) !important;
}

.complemento-counter {
  background: var(--info) !important;
  color: white !important;
  padding: 0.5rem 1rem !important;
  border-radius: 15px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
}

.complemento-counter.obrigatorio {
  background: var(--warning) !important;
}

.complemento-counter.valid {
  background: var(--success) !important;
}

.complemento-description {
  padding: 1rem 1.5rem !important;
  color: var(--text-muted) !important;
  background: #f1f3f4 !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  text-align: center !important; /* Centraliza descrições */
}

.complemento-info-text {
  padding: 0.75rem 1.5rem !important;
  background: #fefefe !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  text-align: center !important; /* Centraliza texto informativo */
}

/* Container dos itens de complemento */
.complemento-itens {
  padding: 1rem !important;
}

/* ✅ ITEMS DE COMPLEMENTO - MELHORADOS */
.complemento-item,
.complemento-item-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 1.25rem 1.5rem !important;
  border: 2px solid var(--border) !important;
  border-radius: var(--radius) !important;
  margin-bottom: 1rem !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  background: white !important;
  max-width: 600px !important; /* Limita largura dos itens */
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 1rem !important;
}

.complemento-item:last-child,
.complemento-item-card:last-child {
  border-bottom: none !important;
  margin-bottom: 0 !important;
}

.complemento-item:hover,
.complemento-item-card:hover {
  background: #f8f9fa !important;
  border-color: var(--primary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.15) !important;
}

.complemento-item.selected,
.complemento-item-card.selected {
  background: rgba(52, 152, 219, 0.05) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2) !important;
}

.complemento-info,
.complemento-item-info {
  flex: 1 !important;
  margin-right: 1rem !important;
}

.complemento-name,
.complemento-item-nome {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  margin-bottom: 0.25rem !important;
}

.complemento-item .complemento-description,
.complemento-item-descricao {
  color: var(--text-muted) !important;
  font-size: 0.9rem !important;
  margin-bottom: 0.5rem !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  line-height: 1.3 !important;
  text-align: left !important; /* Volta ao alinhamento esquerdo nos itens */
}

.complemento-price,
.complemento-item-preco {
  font-weight: 600 !important;
  color: var(--primary) !important;
  font-size: 0.95rem !important;
}

.complemento-price.free,
.complemento-item-preco.free {
  color: var(--success) !important;
}

.complemento-radio,
.complemento-checkbox {
  width: 20px !important;
  height: 20px !important;
  cursor: pointer !important;
  transform: scale(1.2) !important;
}

/* ✅ CONTROLES DE QUANTIDADE - CENTRALIZADOS */
.complemento-item-controls {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 8px !important;
  justify-content: center !important; /* Centraliza os controles */
}

.btn-qty-menos,
.btn-qty-mais {
  background: var(--primary) !important;
  color: white !important;
  border: none !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  transition: all 0.3s ease !important;
  font-size: 1rem !important;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.25) !important;
}

.btn-qty-menos:hover,
.btn-qty-mais:hover {
  background: #2980b9 !important;
  transform: scale(1.1) !important;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4) !important;
}

.qty-display {
  font-weight: 700 !important;
  color: var(--text) !important;
  min-width: 30px !important;
  text-align: center !important;
  font-size: 1rem !important;
  background: var(--background) !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border) !important;
}

/* Adicionais (compatibilidade) */
.adicional-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  background: white;
  transition: all 0.3s ease;
  max-width: 600px; /* Limita largura */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}

.adicional-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.adicional-info {
  flex: 1;
}

.adicional-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.adicional-price {
  color: var(--primary);
  font-weight: 600;
}

.adicional-button {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.adicional-button:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.adicional-button.added {
  background: var(--success);
  color: white;
}

/* ✅ OBSERVAÇÕES - CENTRALIZADAS */
.observacoes-textarea {
  width: 100%;
  max-width: 600px; /* Limita a largura */
  margin: 0 auto; /* Centraliza */
  display: block;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
}

.observacoes-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.caracteres-contador {
  text-align: center; /* Centraliza o contador */
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 600px; /* Alinha com o textarea */
  margin-left: auto;
  margin-right: auto;
  margin-top: 0.5rem;
}

/* Barra inferior */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
  z-index: 1000;
}

.quantity-wrapper {
  display: flex;
  align-items: center;
}

.quantity-controls {
  display: flex;
  align-items: center;
  background: var(--background);
  border-radius: 30px;
  padding: 0.5rem;
  border: 2px solid var(--border);
}

.quantity-button {
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background: white;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quantity-button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

.quantity-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quantity-display {
  min-width: 60px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 1rem;
}

.add-to-cart {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-width: 250px;
  max-width: 350px; /* Limita largura do botão */
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

.add-to-cart:hover:not(:disabled) {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(52, 152, 219, 0.4);
}

.add-to-cart:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ✅ MELHORIAS ESPECÍFICAS PARA DESKTOP GRANDE */
@media (min-width: 1400px) {
  .main-container {
    max-width: 1200px; /* Aumentado um pouco */
  }
  
  .item-details,
  .content-section,
  .sabores-section,
  .complementos-section,
  .adicionais-section,
  .observacoes-section {
    max-width: 900px;
  }
  
  .item-image {
    max-width: 700px;
  }
}

/* Responsive para tablets */
@media (max-width: 1024px) {
  .main-container {
    padding: 1rem;
    max-width: none; /* Remove limitação em tablet */
  }
  
  .item-image {
    max-width: none;
    height: 300px;
  }
  
  .item-name {
    font-size: 2rem;
  }
  
  .item-details,
  .content-section,
  .sabores-section,
  .complementos-section,
  .adicionais-section,
  .observacoes-section {
    padding: 1.5rem;
    max-width: none; /* Remove limitação em tablet */
  }
  
  .bottom-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .add-to-cart {
    width: 100%;
    max-width: 400px;
  }

  .complemento-section {
    max-width: none !important; /* Remove limitação em tablet */
  }

  .complemento-item,
  .complemento-item-card {
    max-width: none !important;
    padding: 1rem 1.25rem !important;
  }

  .complemento-name,
  .complemento-item-nome {
    font-size: 1rem !important;
  }

  .btn-qty-menos,
  .btn-qty-mais {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.9rem !important;
  }
}

/* Responsive para mobile */
@media (max-width: 768px) {
  .back-button {
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
  }
  
  .main-container {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .item-image {
    height: 250px;
    margin-bottom: 1rem;
    max-width: none;
  }
  
  .item-name {
    font-size: 1.5rem;
  }
  
  .item-details,
  .content-section,
  .sabores-section,
  .complementos-section,
  .adicionais-section,
  .observacoes-section {
    padding: 1rem;
    max-width: none; /* Remove limitação em mobile */
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .sabor-item,
  .adicional-item,
  .complemento-item,
  .complemento-item-card {
    max-width: none !important;
    padding: 1rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .complemento-item-controls {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .quantity-controls {
    padding: 0.25rem;
  }
  
  .quantity-button {
    width: 40px;
    height: 40px;
  }
  
  .add-to-cart {
    padding: 0.875rem 1.5rem;
    min-width: 200px;
    font-size: 1rem;
    max-width: none; /* Remove limitação em mobile */
  }
  
  .bottom-bar {
    padding: 1rem;
  }

  .complemento-header {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: flex-start !important;
  }

  .complemento-counter {
    align-self: flex-end !important;
  }

  .complemento-radio,
  .complemento-checkbox {
    transform: scale(1.4) !important;
  }

  .observacoes-textarea {
    max-width: none; /* Remove limitação em mobile */
  }

  .caracteres-contador {
    max-width: none; /* Remove limitação em mobile */
  }
}

/* Estados específicos */
.status-update {
  animation: highlight 2s ease-in-out;
}

@keyframes highlight {
  0% { background: rgba(52, 152, 219, 0.1); }
  50% { background: rgba(52, 152, 219, 0.2); }
  100% { background: transparent; }
}

/* Mensagem de sucesso */
#mensagem-sucesso {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(0.8); 
  }
  to { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1); 
  }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Animações específicas para complementos */
.complemento-section {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.complemento-section:nth-child(1) { animation-delay: 0.1s; }
.complemento-section:nth-child(2) { animation-delay: 0.2s; }
.complemento-section:nth-child(3) { animation-delay: 0.3s; }
.complemento-section:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}