@use '_theme.scss' as theme;

.address-card {
  position: relative;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  box-sizing: border-box;
  min-width: 0;

  @media (min-width: theme.$lg) {
    width: 247px;
    max-width: 247px;
  }

  @media (min-width: theme.$md) and (max-width: theme.$lg) {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  @media (min-width: theme.$sm) and (max-width: theme.$md) {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  @media (max-width: theme.$sm) {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  .address-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 20px;
    font-size: var(--text-size-label);
    gap: 20px;
    border-bottom: 1px solid var(--color-line);
    position: relative;
  }

  .address-header-warning {
    position: absolute;
    left: 5px;
    top: 38%;
  }

  .address-header-error.icon.icon-holder.error-icon svg path:first-child {
    fill: var(--color-error);
  }

  .address-header-error-text {
    position: absolute;
    display: none;
    background-color: white;
    color: var(--text-color-ultra-dark);
    border: 1px solid var(--color-line);
    padding: 5px 7px;
    font-size: var(--text-size-fineprint);
    z-index: 1;
    min-width: 200px;
    top: 100%;
    left: 100%;
  }

  .address-header-error:hover + .address-header-error-text {
    display: block;
  }

  .address-header-title {
    margin: 0;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    color: var(--text-color-ultra-dark);
  }

  .address-body {
    position: relative;
    padding: 20px;

    p {
      margin: 0;
      font-size: var(--text-size-label);
      color: var(--text-color-ultra-dark);
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }

    .address-ellipsis {
      margin: 0;
      font-size: var(--text-size-label);
      color: var(--text-color-ultra-dark);
    }
  }

  .address-tooltip {
    position: absolute;
    top: calc(50% + 8px);
    left: 40%;
    z-index: 2;
    background-color: white;
    color: var(--text-color-ultra-dark);
    padding: 10px;
    border: 1px solid black;
    white-space: pre-line;
    font-size: var(--text-size-fineprint);
    max-width: 250px;
    min-width: auto;
    pointer-events: none;
    word-break: break-word;
  }

  .address-card-edit-button svg path {
    fill: var(--color-icon);
  }
  .address-card-delete-button svg rect,
  .address-card-delete-button svg path {
    stroke: var(--color-icon);
  }
}