/* =======================
   Layout geral
======================= */
body {
  overflow-x: hidden;
  background-color: #f8f9fa;
  padding-top: 210px; /* mini-header + logo-container */
}

.mini-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #ffffff;
  border-bottom: 1px solid #ddd;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  z-index: 2100;
}

.logo-mini {
  height: 40px;
  margin-right: 15px;
}

#campo-busca {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
}

/* =======================
   Logo fixa e sobreposição
======================= */
.logo-container {
  background-color: white;
  border-bottom: 1px solid #ccc;
  position: fixed;
  top: 60px;
  width: 100%;
  height: 200px;
  overflow: hidden;
  z-index: 2000;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sobre-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.icone-redondo {
  width: 80px;
  height: 80px;
  background-color: white;
  border-radius: 50%;
  border: 3px solid #ccc;
  margin: 0 auto 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.icone-redondo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dados-empresa {
  font-size: 0.75rem;
  color: #fff;
  padding: 0 5px;
  word-break: break-word;
  white-space: normal;
}

.btn-info-empresa {
  background: transparent;
  border: none;
  color: #fff;
  text-decoration: underline;
  font-size: 0.9rem;
  margin-left: 5px;
  cursor: pointer;
}

.btn-info-empresa:hover {
  text-decoration: none;
}

/* =======================
   Layout principal
======================= */
.main-container {
  display: flex;
  flex-direction: row;
  margin-top: 50px;
  padding: 0 15px;
}

.produtos {
  flex: 1;
  padding-right: 15px;
  margin-right: 320px;
}

.carrinho-lateral {
  width: 320px;
  background-color: #fff;
  border-left: 1px solid #ddd;
  position: fixed;
  top: 260px;
  right: 0;
  height: calc(100% - 260px);
  overflow-y: auto;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  z-index: 2200;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: transform 0.3s ease-in-out;
  transform: translateX(0);
}

.carrinho-lateral.show {
  transform: translateX(0);
}

#btn-toggle-carrinho {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2500;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#lista-carrinho {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.item-carrinho {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 0;
  font-size: 0.95rem;
  align-items: center;
}

.item-carrinho button {
  margin-left: 8px;
}

.total {
  font-weight: bold;
  font-size: 1.2rem;
  text-align: right;
  margin-bottom: 15px;
}

#dados-cliente label {
  font-size: 0.9rem;
  font-weight: 500;
}

.barra-busca {
  max-width: 500px;
  margin: 0 auto;
}

/* =======================
   Modais
======================= */
.modal {
  z-index: 2100 !important;
}

.modal-backdrop {
  z-index: 2090 !important;
}

body.modal-open .logo-container {
  z-index: 1000;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-conteudo {
  background: #fff;
  color: #000;
  padding: 20px 25px;
  border-radius: 12px;
  max-width: 90%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  text-align: center;
}

.btn-fechar {
  margin-top: 15px;
  background-color: #333;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

/* =======================
   Modal Produto 
======================= */
/* Força layout horizontal do modal do produto */
.produto-modal {
  display: flex;
  flex-direction: row !important; /* força horizontal */
  gap: 20px;
  padding: 0;
  align-items: flex-start;
}

/* Imagem do produto à esquerda */
.produto-modal .modal-imagem-container {
  flex: 0 0 200px; /* largura fixa da imagem */
  display: flex;
  justify-content: center;
  align-items: center;
}

.produto-modal .modal-imagem-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Informações do produto à direita */
.produto-modal .modal-info-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 15px;
}

/* Responsivo: em telas pequenas, empilha verticalmente */
@media (max-width: 768px) {
  .produto-modal {
    flex-direction: column !important;
  }

  .produto-modal .modal-imagem-container {
    width: 100%;
    margin-bottom: 15px;
  }
}


/* Ajuste para imagem do modal do produto */
.produto-modal .modal-imagem-container img {
  max-width: 180px;   /* limita largura */
  max-height: 180px;  /* limita altura */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .produto-modal .modal-imagem-container {
    width: 100%;
    margin-bottom: 15px;
    justify-content: center;
  }

  .produto-modal .modal-imagem-container img {
    max-width: 100%;
    height: auto;
  }
}






@media (max-width: 992px) {
  .main-container {
    flex-direction: column;
    margin-top: 20px;
    padding: 10px;
  }

  .produtos {
    padding-right: 0;
    margin-right: 0;
  }

  .carrinho-lateral {
    position: fixed;
    top: 140px;
    right: 0;
    width: 80%;
    max-width: 320px;
    height: calc(100% - 140px);
    border-left: none;
    border-top: 1px solid #ddd;
    background-color: #fff;
    box-shadow: -4px 0 12px rgba(0,0,0,0.2);
    transform: translateX(100%);
  }

  #btn-toggle-carrinho {
    display: block;
  }

  .logo-container {
    height: 180px;
    padding: 8px 0;
  }

  .icone-redondo {
    width: 60px;
    height: 60px;
  }

  .dados-empresa {
    font-size: 0.75rem;
  }
}

/* 🔧 Força o container da imagem a ser fixo no modal */
.produto-modal .modal-imagem-container {
  flex: 0 0 220px !important;   /* largura fixa */
  max-width: 220px !important;  /* não deixa expandir */
  min-width: 0 !important;      /* permite encolher em flexbox */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 12px;
}

/* 🔧 Ajusta a imagem dentro do container */
.produto-modal .modal-imagem-container img {
  max-width: 100% !important;   /* ocupa só o container */
  max-height: 200px !important; /* altura limitada */
  height: auto !important;
  object-fit: contain !important;
  border-radius: 8px;
}

/* 🔧 Informações ficam ao lado e aproveitam o resto do espaço */
.produto-modal .modal-info-container {
  flex: 1 1 auto !important;
  min-width: 0;
  padding: 16px;
  overflow: auto;
}

/* Responsivo: em telas pequenas, empilha */
@media (max-width: 768px) {
  .produto-modal {
    flex-direction: column !important;
  }

  .produto-modal .modal-imagem-container {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px;
  }

  .produto-modal .modal-imagem-container img {
    max-width: 100% !important;
    max-height: 300px !important;
  }
}


.modal-content.produto-modal {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
}

/* Imagem fica com largura fixa */
.produto-modal .modal-imagem-container {
  flex: 0 0 200px;
  max-width: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.produto-modal .modal-imagem-container img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Infos ocupam o resto */
.produto-modal .modal-info-container {
  flex: 1 1 auto;
  min-width: 0;
}

/* No mobile volta a ser coluna */
@media (max-width: 768px) {
  .modal-content.produto-modal {
    flex-direction: column;
  }

  .produto-modal .modal-imagem-container {
    max-width: 100%;
    margin-bottom: 15px;
  }

  .produto-modal .modal-imagem-container img {
    max-height: 300px;
  }
}


.modal-content.produto-modal {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
  width: 100%;
}

/* Imagem fixa à esquerda */
.produto-modal .modal-imagem-container {
  flex: 0 0 200px;
  max-width: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Infos ocupam TODO o espaço restante */
.produto-modal .modal-info-container {
  flex: 1 1 auto;
  min-width: 0;
  width: calc(100% - 220px); /* ocupa o resto */
}

