/**
 * MODALS-OPTIMIZED.CSS
 * Estilos otimizados para modais com contraste WCAG AAA
 * Inclui: fechar com X, ESC, clique fora
 */

/* ========== OVERLAY ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(2px);
}

/* ========== MODAL BASE ========== */
.modal-container {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

/* ========== BOTÃO FECHAR (X) ========== */
.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f0f0f0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
}

.modal-close-btn:hover {
  background: #e0e0e0;
  transform: rotate(90deg);
}

.modal-close-btn:focus {
  outline: 2px solid #D4AF8F;
  outline-offset: 2px;
}

/* ========== MODAL HEADER ========== */
.modal-header {
  text-align: center;
  margin-bottom: 30px;
}

.modal-icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
}

.modal-title {
  color: #1a1a1a;
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

/* ========== MODAL BODY ========== */
.modal-body {
  margin-bottom: 30px;
}

.modal-message {
  color: #2C2C2C;
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 500;
}

/* ========== MODAL INFO BOX ========== */
.modal-info-box {
  background: linear-gradient(135deg, #E8D4B8 0%, #D4AF8F 100%);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  border-left: 4px solid #C4996F;
}

.modal-info-title {
  color: #2C2C2C;
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.modal-info-price {
  font-size: 18px;
  color: #1a1a1a;
  font-weight: 700;
  margin: 10px 0 0 0;
}

/* ========== MODAL BUTTONS ========== */
.modal-button {
  background: linear-gradient(135deg, #D4AF8F 0%, #C4996F 100%);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(212, 175, 143, 0.4);
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

.modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 175, 143, 0.5);
}

.modal-button:focus {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.modal-button:active {
  transform: translateY(0);
}

/* ========== MODAL SECONDARY BUTTON ========== */
.modal-button-secondary {
  background: #f0f0f0;
  color: #1a1a1a;
  border: 2px solid #D4AF8F;
}

.modal-button-secondary:hover {
  background: #e8e8e8;
  border-color: #C4996F;
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 768px) {
  .modal-container {
    padding: 30px 20px;
    margin: 20px;
  }

  .modal-close-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .modal-title {
    font-size: 22px;
  }

  .modal-message {
    font-size: 15px;
  }

  .modal-info-box {
    padding: 15px;
  }

  .modal-button {
    padding: 14px 30px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .modal-container {
    padding: 25px 15px;
    width: 95%;
  }

  .modal-close-btn {
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-message {
    font-size: 14px;
  }

  .modal-info-box {
    padding: 12px;
  }

  .modal-button {
    padding: 12px 24px;
    font-size: 14px;
  }
}

/* ========== ACESSIBILIDADE ========== */
.modal-overlay:focus-within {
  outline: none;
}

.modal-container:focus-visible {
  outline: 3px solid #D4AF8F;
  outline-offset: 2px;
}

/* Suporte para modo escuro */
@media (prefers-color-scheme: dark) {
  .modal-container {
    background: #1a1a1a;
    color: #ffffff;
  }

  .modal-title {
    color: #ffffff;
  }

  .modal-message {
    color: #e0e0e0;
  }

  .modal-close-btn {
    background: #2a2a2a;
    color: #ffffff;
  }

  .modal-close-btn:hover {
    background: #3a3a3a;
  }

  .modal-info-box {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
  }

  .modal-info-title {
    color: #ffffff;
  }

  .modal-info-price {
    color: #e0e0e0;
  }
}

/* Reduz animações para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal-container,
  .modal-close-btn,
  .modal-button {
    animation: none;
    transition: none;
  }
}
