/* Popup xác nhận — desktop: modal giữa; mobile: bottom drawer đồng bộ popup khác */

.hny-confirm {
  position: fixed;
  inset: 0;
  z-index: 110000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.hny-confirm[hidden] {
  display: none !important;
}

.hny-confirm__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.hny-confirm__panel {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 22rem);
  padding: 1.25rem 1.25rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 0.25rem 0.5rem rgba(15, 23, 42, 0.06),
    0 1rem 2.5rem rgba(15, 23, 42, 0.12);
}

.hny-confirm__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.hny-confirm__message {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #475569;
}

.hny-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.hny-confirm__btn {
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.hny-confirm__btn--ghost {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

.hny-confirm__btn--ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.hny-confirm__btn--danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.hny-confirm__btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.hny-confirm__btn:focus-visible {
  outline: 2px solid #1b77ee;
  outline-offset: 2px;
}

@keyframes hnyConfirmFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hnyConfirmSlideUp {
  from {
    transform: translate3d(0, 100%, 0);
    opacity: 0.96;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@media (max-width: 47.999rem) {
  .hny-confirm {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
  }

  .hny-confirm__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    padding-top: 0.375rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
    border-radius: 1rem 1rem 0.75rem 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: none;
    box-shadow:
      0 -0.5rem 2.5rem rgba(15, 23, 42, 0.16),
      0 -0.125rem 0.5rem rgba(15, 23, 42, 0.06),
      0 1rem 2.5rem rgba(15, 23, 42, 0.12);
    animation: hnyConfirmSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .hny-confirm__panel::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 0.3125rem;
    margin: 0 auto 0.75rem;
    border-radius: 999px;
    background: #cbd5e1;
    flex-shrink: 0;
  }

  .hny-confirm__title {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hny-confirm__overlay,
  .hny-confirm__panel {
    animation: none;
  }
}
