/* Basic modal styling with responsive layout and fixed image area (cover) */
.spm-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.spm-modal.spm-open {
  display: flex;
}
.spm-modal-backdrop {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}
.spm-modal-inner {
  position: relative;
  max-width: 1000px;
  width: calc(100% - 48px);
  margin: 2rem auto;
  z-index: 100000;
  display: flex;
  align-items: stretch;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}
.spm-modal-content {
  background: #fff;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  width: 100%;
}
.spm-modal-image {
  flex: 0 0 40%;
  min-width: 240px;
  max-width: 420px;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: block;
}
.spm-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.spm-modal-body-wrap {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
}
.spm-modal-body {
  margin-top: 8px;
}
.spm-modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: 0;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  color: #fff;
  z-index: 100001;
}
.spm-button {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 4px;
  text-decoration: none;
  background: #3fb4e5;
  color: #fff !important;
}
/* overlay style when image is used and text needs contrast */
.spm-modal-body-wrap {
  color: var(--e-global-color-text);
}

.spm-modal-body-wrap h2 {
  font-family: var(--e-global-typography-secondary-font-family), Sans-serif;
  font-size: var(--e-global-typography-secondary-font-size);
  font-weight: var(--e-global-typography-secondary-font-weight);
  text-transform: var(--e-global-typography-secondary-text-transform);
  font-style: var(--e-global-typography-secondary-font-style);
  color: var(--e-global-color-primary);
}

.spm-modal-body-wrap p {
  font-family: var(--e-global-typography-text-font-family), Sans-serif;
  font-size: var(--e-global-typography-text-font-size);
  font-weight: var(--e-global-typography-text-font-weight);
  text-transform: var(--e-global-typography-text-text-transform);
  font-style: var(--e-global-typography-text-font-style);
  line-height: var(--e-global-typography-text-line-height);
}

.spm-button {
  font-family: var(--e-global-typography-dddcc7f-font-family), Sans-serif;
  font-size: var(--e-global-typography-dddcc7f-font-size);
  font-weight: var(--e-global-typography-dddcc7f-font-weight);
  text-transform: var(--e-global-typography-dddcc7f-text-transform);
  font-style: var(--e-global-typography-dddcc7f-font-style);
}

/* Mobile / tablet adjustments */
@media (max-width: 900px) {
  .spm-modal-content {
    flex-direction: column;
  }
  .spm-modal-inner {
    flex-direction: column;
    max-width: 720px;
  }
  .spm-modal-image {
    width: 100%;
    flex-basis: auto;
    min-height: 200px;
    max-width: 100%;
  }
  .spm-modal-body-wrap {
    padding: 18px;
  }
  .spm-modal-close {
    color: #333;
  }
}
@media (max-width: 480px) {
  .spm-modal-body-wrap {
    padding: 14px;
  }
  .spm-modal-inner {
    margin: 12px;
  }
  .spm-modal-image {
    min-height: 160px;
  }
}

/* Disable page scroll when open */
body.spm-modal-open {
  overflow: hidden;
  height: 100%;
}
