/* ===== OVERLAY ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(24, 24, 24, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.is-open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

/* ===== MODAL ===== */
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 900px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);

  /* layout desktop */
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;

  animation: modalIn 0.3s ease-out;
}

/* ===== PREVIEW (IMAGEM DO MODAL) ===== */
.modal-preview {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 12px;
  min-height: 450px;
  grid-column: 2;
  grid-row: 1 / 4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ===== HEADER ===== */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.75rem;
  color: #181818;
  margin: 0;
}

/* ===== CLOSE BUTTON ===== */
.modal-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  color: #181818;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close ion-icon {
  font-size: 28px;
}

.modal-close:hover {
  background-color: rgba(24, 24, 24, 0.1);
  transform: rotate(90deg);
}

/* ===== CONTENT ===== */
.modal-content {
  margin: 16px 0;
  color: #181818;
  font-size: 1.05rem;
  line-height: 1.6;
}

.modal-content p {
  font-weight: 500;
  margin-bottom: 1.25rem;
  color: #333;
}

.modal-content ul {
  padding-left: 0;
  margin-bottom: 1.5rem;
  list-style: none;
}

.modal-content li {
  margin: 0.75rem 0;
  padding-left: 32px;
  position: relative;
  color: #555;
  font-size: 1rem;
}

.modal-content li::before {
  content: "✓";
  color: var(--accent, #ff7a00);
  position: absolute;
  left: 0;
  font-size: 1.2rem;
  font-weight: bold;
}

/* ===== FOOTER ===== */
.modal-footer {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 32px;
}

.modal-footer .btn {
  font-size: 1rem;
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.modal-footer .btn.primary {
  background: linear-gradient(135deg, #ff7a00, #ff9933);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
}

.modal-footer .btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 122, 0, 0.4);
}

.modal-footer .btn.ghost {
  background: transparent;
  color: #ff7a00;
  border: 2px solid #ff7a00;
}

.modal-footer .btn.ghost:hover {
  background: rgba(255, 122, 0, 0.1);
  transform: translateY(-2px);
}

/* ===== ANIMAÇÕES ===== */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ======================================================
   📱 MOBILE — EXPERIÊNCIA OTIMIZADA
   - Modal ocupa tela inteira com scroll suave
   - Preview responsivo no topo
   - Botões acessíveis e touch-friendly
====================================================== */
@media (max-width: 768px) {

  .modal-overlay {
    padding: 0;
    align-items: flex-start;
  }

  .modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .modal-preview {
    width: 100%;
    min-height: 240px;
    border-radius: 0;
    order: -1;
    grid-column: unset;
    grid-row: unset;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .modal-title {
    font-size: 1.3rem;
    margin: 0;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .modal-close ion-icon {
    font-size: 32px;
  }

  .modal-content {
    font-size: 1rem;
    padding: 24px 20px;
    margin: 0;
  }

  .modal-content li {
    font-size: 0.95rem;
    padding-left: 28px;
  }

  .modal-footer {
    padding: 20px;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    bottom: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .modal-footer .btn {
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
  }
}

/* Tablet - layout intermediário */
@media (min-width: 769px) and (max-width: 1024px) {
  .modal {
    width: 95%;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    padding: 28px;
  }

  .modal-preview {
    min-height: 380px;
  }
}
