/* phpcs:ignoreFile */
.pc-lead-plans {
  margin: 32px 0 40px;
}

.pc-lead-plans__title {
  font-size: 1.6rem;
  margin-bottom: 20px;
  text-align: center;
}

.pc-lead-plan-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.pc-lead-plan-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 0 1 320px;
  max-width: 360px;
  min-width: 280px;
}

.pc-lead-plan-grid--single .pc-lead-plan-card {
  flex-basis: min(420px, 100%);
}

.pc-lead-plan-card__img {
  background: #f5f7fa;
  padding: 0;
  text-align: center;
  line-height: 0;
}

.pc-lead-plan-card__img img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.pc-lead-plan-card__meta {
  padding: 10px 14px;
  display: grid;
  row-gap: 4px;
}

.pc-lead-plan-card__type {
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

.pc-lead-plan-card__meta p {
  margin: 0;
  line-height: 1.35;
}

.pc-lead-plan-card__btn {
  margin: 10px 14px 14px;
  width: calc(100% - 28px);
  justify-content: center;
}

.pc-modal-plan {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.pc-modal-plan--open {
  display: flex;
}

.pc-modal-plan__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

.pc-modal-plan__dialog {
  position: relative;
  width: min(960px, 100%);
  margin: 0 auto;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.pc-modal-plan__close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 999px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}

.pc-modal-plan__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Allow the plan image + form to scroll independently of the viewport on mobile */
}

.pc-modal-plan__image img {
  max-width: 100%;
  height: auto;
  display: block;
}

.pc-modal-plan__form {
  display: flex;
  flex-direction: column;
}

.pc-modal-plan__field {
  display: grid;
  row-gap: 6px;
  margin-bottom: 12px;
}

.pc-modal-plan__field input,
.pc-modal-plan__field textarea {
  width: 100%;
}

.pc-modal-plan__actions {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .pc-lead-plan-card {
    flex: 1 1 100%;
    max-width: none;
  }

  .pc-modal-plan__dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .pc-modal-plan__close {
    right: 8px;
    top: 8px;
  }

  .pc-modal-plan {
    align-items: flex-start;
    padding: 16px;
  }

  .pc-modal-plan__body {
    grid-template-columns: 1fr;
  }
}

body.pc-modal-plan-open {
  overflow: hidden;
  touch-action: none;
}

/* === Modal plan: close button must stay above plan image (iOS fix) === */
.pc-modal-plan__close {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2000;
}

@media (max-width: 768px) {
  .pc-modal-plan__close {
    top: 8px;
    right: 8px;
  }
}

.pc-modal-plan__image img {
  pointer-events: none;
}
