dialog,
dialog::backdrop {
  opacity: 0;
}
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  border: 0;
  padding: 1.5rem 2.5rem;
  border-radius: 1rem;
  background-color: var(--main-white);
  color: var(--main-dark-color);
  width: min(90%, 40em);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1001;
}
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
dialog[open] {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
dialog[open]::backdrop {
  opacity: 1;
}
html:has(dialog[open]) {
  overflow: hidden;
  height: 100vh;
}
/* Przycisk zamykania, nagłówek */
dialog header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}
dialog header h2 {
  margin-block: 0;
  flex: 1;
  color: var(--main-dark-color);
}
dialog header button {
  margin-inline-start: auto;
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  background: transparent;
  border: none;
  color: var(--main-dark-color);
  cursor: pointer;
}
dialog header button:hover {
  background-color: rgba(0, 0, 0, 0.1);
}
dialog section {
  margin-bottom: 1.5rem;
}
dialog section p {
  margin: 0.5rem 0;
  color: var(--main-dark-color);
}
dialog menu {
  text-align: right;
  margin: 0;
  padding-inline: 0;
}
/* Przycisk główny modala */
.primary-btn {
  color: var(--main-white);
  background: var(--main-light-color);
  border: none;
  padding: 0.8rem 2.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}
.primary-btn:is(:hover, :focus-visible) {
  background: #c30d87;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(223, 14, 154, 0.3);
  color: var(--main-white);
}

.front-side button {
  margin-top: auto;
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 768px) {
  dialog {
    width: min(95%, 40em);
    padding: 1rem 1.5rem;
    max-height: 90vh;
  }
}
