/**
 * Portal Block Styles
 */

/* Core Portal */
div.portal {
  max-width: 560px;
  margin: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;

  &::-webkit-scrollbar {
    display: none;
  }

  > iframe {
    border: none;
  }
}

/* Scroll lock when modal is open.
   overflow:hidden only — position:fixed disrupts iOS touch-event routing into iframes. */
body.cps-modal-open {
  overflow: hidden;
}

/* Portal Modal */
dialog.cps-portal-modal {
  border: 1px solid;
  border-radius: 6px;
  padding: 0;
  width: 95%;
  max-width: 550px !important;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;

  ::backdrop {
    background: rgba(0, 0, 0, 0.7);
  }

  div.portal {
    height: calc(100dvh - 40px);
    max-height: 700px;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateZ(0);
    > iframe {
      border: none;
      height: 99%;
      width: 100%;
    }
  }

  .close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      background: rgba(0, 0, 0, 0.7);
    }
  }

  /* Mobile */
  @media (max-width: 767px) {
    top: 0 !important;
    max-width: 500px !important;
    height: 100%;
  }

  /* Desktop */
  @media (min-width: 768px) {
    max-height: 95dvh;
  }
}

/* Phone Number Block */
.phone-icon-wrapper {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}

.phone-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: inline-block;
}

.cps-phone-number {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #333;
}

.cps-phone-number:hover {
  color: #007bff;
}

.number {
  font-size: 16px;
  font-weight: bold;
}
