/* ============================================
   SAMET - Unidades & Cards "Premium Dark"
   ============================================ */

/* ---- Forms de visita ---- */
#formNoCliente {
  width: 85%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 12px;
  gap: 10px;
}

#formSouCliente {
  width: 85%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 12px;
  gap: 10px;
}

#formDadosCompletos {
  width: 90%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 10px;
  gap: 10px;
}

#formDadosCompletos input,
select {
  width: 90%;
  height: 40px;
  background-color: transparent;
  color: var(--text, #2d3436);
  border: none;
  border-bottom: 2px solid var(--border, #e2e4e1);
  border-radius: 0;
  padding: 0 4px;
  font-family: "Inter", sans-serif;
  transition: border-color 0.3s ease;
}

#formDadosCompletos input:focus,
select:focus {
  border-bottom-color: var(--green-light, #96ba3e);
  outline: none;
}

.show {
  display: flex !important;
}

.hide {
  display: none;
}

/* ---- Container de unidades ---- */
.unidades {
  width: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  gap: 8px;
}

.unidades-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---- Cards de unidade (listagem inicial) ---- */
.lista-unidades-inicial {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px 0;
}

.unidade-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  background: var(--white, #fff);
  border: 2px solid var(--border, #e2e4e1);
  border-left: 5px solid var(--green-light, #96ba3e);
  border-radius: var(--radius-sm, 14px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.unidade-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(61, 74, 33, 0.12);
  border-color: var(--green-light, #96ba3e);
  border-left-color: var(--green, #3d4a21);
}

.unidade-card.selecionada {
  background: linear-gradient(135deg, var(--green, #3d4a21) 0%, #5a6e30 100%);
  border-color: var(--green, #3d4a21);
  border-left-color: var(--green-light, #96ba3e);
  color: #ffffff;
  box-shadow: 0 8px 28px rgba(61, 74, 33, 0.3);
  transform: translateY(-2px);
}

.unidade-card.selecionada .unidade-card-nome,
.unidade-card.selecionada .unidade-card-descricao-data {
  color: #ffffff;
}

.unidade-card.selecionada .unidade-card-descricao-data i {
  color: rgba(255, 255, 255, 0.85);
}

.unidade-card-nome {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #2d3436);
  line-height: 1.2;
}

.unidade-card-descricao-data {
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-light, #7c8389);
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.unidade-card-descricao-data i {
  color: var(--green-light, #96ba3e);
  font-size: 0.75rem;
}

/* ---- Outras Unidades (outrasUnidades.html) ---- */
.outrasUnidadesItem {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm, 14px);
  background-color: var(--white, #fff);
  border: 2px solid var(--border, #e2e4e1);
  border-left: 5px solid var(--green-light, #96ba3e);
  padding: 12px 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.outrasUnidadesItem:hover {
  border-color: var(--green-light, #96ba3e);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(61, 74, 33, 0.1);
}

.outrasUnidadesItem.selecionada {
  background: linear-gradient(135deg, var(--green, #3d4a21) 0%, #5a6e30 100%);
  border-color: var(--green, #3d4a21);
  border-left-color: var(--green-light, #96ba3e);
}

.outrasUnidadesItem.selecionada img {
  filter: brightness(0) invert(1);
}

.outrasUnidadesItem.selecionada h1 {
  color: #fff;
}

.outrasUnidadesItem.selecionada p {
  color: rgba(255, 255, 255, 0.85);
}

.outrasUnidadesItem h1 {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #2d3436);
}

/* ---- Unidade Item (unidade.html) ---- */
.unidadeItem {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm, 14px);
  background-color: var(--bg-light, #f7f8f5);
  border-left: 5px solid var(--green-light, #96ba3e);
  padding: 14px 16px;
  transition: all 0.3s ease;
  border: 2px solid var(--border, #e2e4e1);
}

.unidadeItem:hover {
  background-color: var(--green-pale, #e8f0d4);
  cursor: pointer;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(61, 74, 33, 0.1);
}

.unidadeItem h1 {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #2d3436);
}

.unidadeItem.selecionada {
  background: linear-gradient(135deg, var(--green, #3d4a21) 0%, #5a6e30 100%);
  color: #fff;
  border-color: var(--green, #3d4a21);
  box-shadow: 0 6px 20px rgba(61, 74, 33, 0.3);
}

.unidadeItem.selecionada h1 {
  color: #fff;
}

.unidadeItem.selecionada p {
  color: rgba(255, 255, 255, 0.85);
}

.unidadeItem.selecionada img {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%)
    hue-rotate(93deg) brightness(103%) contrast(103%);
}

.unidadeHorario {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.unidadeHorario img {
  filter: invert(42%) sepia(16%) saturate(12%) hue-rotate(27deg) brightness(93%)
    contrast(88%);
  margin: 0;
  width: auto;
  margin-right: 5px;
}

.unidadeHorario p {
  margin: 0;
  width: auto;
  margin-right: 5px;
}

/* ---- Botão Solicitar Visita ---- */
.buttonSolicitarVisita {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--green, #3d4a21);
  border-radius: 50px;
  text-decoration: none;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border: 2px solid var(--green, #3d4a21);
  transition: all 0.3s ease;
  width: 80%;
  margin-top: 10px;
}

.buttonSolicitarVisita:hover {
  background: var(--green, #3d4a21);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(61, 74, 33, 0.25);
}

.buttonSolicitarVisita img {
  width: 16px;
  height: 16px;
}

.buttonSolicitarVisita p {
  margin: 0;
  font-weight: 600;
  width: auto;
}

/* ---- Divisores ---- */
.divisor {
  width: 100%;
  height: 1px;
  background-color: var(--border, #e2e4e1);
}

.divisor-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---- Botão Agendar (genérico) ---- */
.buttonAgendar {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--green, #3d4a21) 0%, #5a6e30 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter", sans-serif;
  margin: 0 0 12px 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(61, 74, 33, 0.2);
  letter-spacing: 0.3px;
}

.buttonAgendar:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(61, 74, 33, 0.35);
}

.buttonAgendar.inativo {
  background: var(--bg-light, #f7f8f5);
  color: var(--text-light, #7c8389);
  cursor: not-allowed;
  box-shadow: none;
  border: 2px solid var(--border, #e2e4e1);
}

.buttonAgendar.inativo:hover {
  transform: none;
  box-shadow: none;
}

#buttonAgendarVisita {
  width: 80%;
  height: 44px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #ffffff;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

#buttonAgendarVisita:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

#buttonAgendarVisita:disabled {
  background: #d4d6d2;
  cursor: not-allowed;
  box-shadow: none;
}

.buttonSelectUnidade {
  width: 80%;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  margin-top: 5px;
  text-decoration: none;
  color: var(--text-light, #7c8389);
  padding: 10px 0;
}

#openButton {
  cursor: pointer;
}

/* ---- Footer (overrides para esta page) ---- */
.footer {
  width: 92%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  margin-top: 8px;
  border-top: 1px solid var(--border, #e2e4e1);
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ---- Modal de unidades (mantido por compatibilidade) ---- */
.modal-unidades {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 18, 8, 0.6);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}

.modal-unidades .modal-content {
  position: relative;
  background-color: var(--white, #fff);
  margin: 5% auto;
  padding: 0;
  border-radius: var(--radius, 24px);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  animation: slideUp 0.35s ease;
}

.modal-unidades .modal-header {
  background: linear-gradient(135deg, var(--green, #3d4a21), #5a6e30);
  color: white;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-unidades .modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  font-family: "Inter", sans-serif;
}

.btn-fechar {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.25s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-fechar:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.modal-body {
  padding: 0;
  max-height: calc(80vh - 100px);
  overflow-y: auto;
}

.secao-unidades {
  border-bottom: 1px solid var(--border, #e2e4e1);
}

.secao-unidades:last-child {
  border-bottom: none;
}

.secao-titulo {
  background-color: var(--bg-light, #f7f8f5);
  padding: 16px 24px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--green, #3d4a21);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border, #e2e4e1);
  font-family: "Inter", sans-serif;
}

.secao-titulo i {
  color: var(--green-light, #96ba3e);
  font-size: 18px;
}

.secao-titulo .fa-star {
  color: #f59e0b;
}

.lista-unidades {
  padding: 0;
}

.unidade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border, #e2e4e1);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.unidade-item:hover {
  background-color: var(--green-pale, #e8f0d4);
  transform: translateX(4px);
}

.unidade-item.principal {
  background-color: rgba(150, 186, 62, 0.06);
  border-left: 4px solid var(--green-light, #96ba3e);
}

.unidade-item.principal:hover {
  background-color: var(--green-pale, #e8f0d4);
}

.unidade-item:last-child {
  border-bottom: none;
}

.unidade-info {
  flex: 1;
}

.unidade-info h5 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--green, #3d4a21);
  font-family: "Inter", sans-serif;
}

.unidade-endereco {
  margin: 0 0 6px 0;
  font-size: 13px;
  color: var(--text-light, #7c8389);
  line-height: 1.4;
  font-family: "Inter", sans-serif;
}

.unidade-data {
  margin: 0;
  font-size: 13px;
  color: var(--text-light, #7c8389);
  font-weight: 500;
  font-family: "Inter", sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}

.unidade-data i {
  color: var(--green-light, #96ba3e);
  font-size: 13px;
}

.unidade-acoes {
  color: var(--green-light, #96ba3e);
  font-size: 16px;
  transition: all 0.25s ease;
}

.unidade-item:hover .unidade-acoes {
  color: var(--green, #3d4a21);
  transform: translateX(3px);
}

/* ---- Animações ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Scrollbar ---- */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--bg-light, #f7f8f5);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--green-light, #96ba3e);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--green, #3d4a21);
}

/* ---- Responsivo ---- */
@media (max-width: 768px) {
  .modal-unidades .modal-content {
    margin: 10% auto;
    width: 95%;
    max-height: 85vh;
  }

  .modal-unidades .modal-header {
    padding: 18px 20px;
  }

  .modal-unidades .modal-header h3 {
    font-size: 18px;
  }

  .secao-titulo {
    padding: 14px 20px;
    font-size: 14px;
  }

  .unidade-item {
    padding: 14px 20px;
  }

  .unidade-info h5 {
    font-size: 14px;
  }

  .lista-unidades-inicial {
    margin: 8px 0 12px 0;
    gap: 8px;
  }

  .unidade-card {
    padding: 12px 14px;
  }

  .buttonAgendar {
    padding: 12px;
    font-size: 14px;
    margin: 0 0 14px 0;
  }

  .unidades {
    width: 88%;
  }
}

@media (max-width: 480px) {
  .modal-unidades .modal-content {
    margin: 5% auto;
    width: 98%;
    max-height: 90vh;
    border-radius: 16px;
  }

  .lista-unidades-inicial {
    margin: 6px 0 10px 0;
    gap: 6px;
  }

  .unidade-card {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .unidade-card-nome {
    font-size: 0.88rem;
  }

  .buttonAgendar {
    padding: 12px;
    font-size: 14px;
    margin: 0 0 12px 0;
  }

  .unidades {
    width: 90%;
  }
}
