/* ============================================================
   Modal Components — Success & Error
   Matching Figma design: node 1:2 (success), 1:112 (error)
   ============================================================ */

/* Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalOverlayIn 0.2s ease;
}

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

/* Dialog box */
.modal-dialog {
  position: relative;
  background: linear-gradient(180deg, #fff5f5 0%, #ffe8e0 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalDialogIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalDialogIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Success dialog width */
.modal-success-dialog {
  width: 460px;
  max-width: 100%;
}

/* Error dialog width */
.modal-error-dialog {
  width: 420px;
  max-width: 100%;
}

/* ============================================================
   Header (both modals share structure)
   ============================================================ */
.modal-success-header {
  position: relative;
  background: linear-gradient(180deg, #e8315b 0%, #ff6b8a 100%);
  height: 189px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 32px;
}

.modal-error-header {
  position: relative;
  background: linear-gradient(180deg, #c72c41 0%, #e8315b 100%);
  height: 186px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 32px;
}

/* Icon circle */
.modal-success-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.modal-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Title */
.modal-success-title {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  letter-spacing: 0.55px;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Wave SVG at bottom of header */
.modal-header-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  line-height: 0;
}

.modal-header-wave svg {
  width: 100%;
  height: 100%;
}

/* Close X button */
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.15s;
  padding: 0;
}

.modal-close-btn:hover {
  opacity: 1;
}

/* Decorative dots */
.modal-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.modal-dot-yellow {
  width: 8px;
  height: 8px;
  background: #ffdf20;
  opacity: 0.8;
}
.modal-dot-white-sm {
  width: 6px;
  height: 6px;
  background: #fff;
  opacity: 0.6;
}
.modal-dot-yellow-lg {
  width: 10px;
  height: 10px;
  background: #fff085;
  opacity: 0.7;
}
.modal-dot-pink {
  width: 6px;
  height: 6px;
  background: #fccee8;
  opacity: 0.8;
}
.modal-dot-white-xs {
  width: 4px;
  height: 4px;
  background: #fff;
  opacity: 0.5;
}
.modal-dot-cream {
  width: 8px;
  height: 8px;
  background: #fef9c2;
  opacity: 0.6;
}
.modal-dot-red-light {
  width: 8px;
  height: 8px;
  background: #ffa2a2;
  opacity: 0.4;
}
.modal-dot-pink-sm {
  width: 6px;
  height: 6px;
  background: #fccee8;
  opacity: 0.5;
}

/* ============================================================
   Body
   ============================================================ */
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
}

/* ============================================================
   Cards
   ============================================================ */
.modal-card {
  background: #fff;
  border: 1px solid #fce7f3;
  border-radius: 14px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Order info card top row */
.modal-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 17px 0;
}

.modal-card-icon-wrap {
  width: 36px;
  height: 36px;
  background: #fff0f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-order-id-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.modal-order-id {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #e8315b;
  letter-spacing: 0.75px;
  margin: 0;
}

/* Card rows */
.modal-card-rows {
  border-top: 1px solid #fccee8;
  margin-top: 13px;
  padding: 13px 17px 17px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-row-label {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

.modal-row-value {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #333;
  text-align: right;
}

.modal-row-value--red {
  color: #e8315b;
}

/* Label small */
.modal-label-sm {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #333;
  margin: 0;
}

.modal-label-dark {
  color: #333;
}

/* Delivery card */
.modal-card--delivery {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1px 0 17px;
  min-height: 72px;
}

.modal-delivery-date {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: #e8315b;
  margin: 0;
  font-weight: 400;
}

/* ============================================================
   Gift notice
   ============================================================ */
.modal-gift-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8f0;
  border: 1px solid #ffe0c0;
  border-radius: 10px;
  padding: 12px 13px;
  min-height: 46px;
}

.modal-gift-notice-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.modal-gift-notice p {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.43;
}

.modal-gift-notice strong {
  color: #e8315b;
  font-weight: 600;
}

/* ============================================================
   Buttons
   ============================================================ */
.modal-btn-primary {
  width: 100%;
  height: 46px;
  background: linear-gradient(180deg, #e8315b 0%, #ff6b8a 100%);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.75px;
  cursor: pointer;
  box-shadow:
    0 10px 15px rgba(252, 206, 232, 0.5),
    0 4px 6px rgba(252, 206, 232, 0.5);
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.modal-btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.modal-btn-primary:active {
  opacity: 1;
  transform: translateY(0);
}

/* Error modal — close only, full width */
.modal-btn-outline-full {
  width: 100%;
  height: 49px;
  background: transparent;
  border: 2px solid #e8315b;
  border-radius: 999px;
  color: #e8315b;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.7px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.modal-btn-outline-full:hover {
  background: #e8315b;
  color: #fff;
}

/* ============================================================
   Error card body styles
   ============================================================ */
.modal-card--error {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.modal-error-icon-wrap {
  width: 48px;
  height: 48px;
  background: #fff0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.modal-error-main-msg {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: #333;
  margin: 0;
  font-weight: 400;
}

.modal-error-sub-msg {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #888;
  margin: 0;
  line-height: 1.63;
  max-width: 330px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 500px) {
  .modal-success-dialog,
  .modal-error-dialog {
    width: 100%;
    border-radius: 12px;
  }

  .modal-success-title {
    font-size: 18px;
  }
}
