@use '_theme.scss';

.color-section {
  overflow-y: scroll;
  height: calc(100vh - var(--header-height-desktop));
  top: var(--header-height-desktop);
  position: fixed;
  right: 0;
  z-index: 10;
  background-color: #FFF;
  padding: 40px;
  min-width: 40%;
  width: 40%;
  max-width: 720px;

  @media (max-width: theme.$lg) {
    height: calc(100vh - var(--header-height-mobile));
    top: var(--header-height-mobile);
    padding: 30px;
  }

  .uedit-close {
    position: absolute;
    top: 30px;
    right: 30px;
    cursor: pointer;
    z-index: 11;
    @media (min-width: theme.$xl + 1) {
      top: 30px;
      right: 30px;
    }
    @media (max-width: theme.$md) {
      position: fixed;
      z-index: 11;
    }
  }

  .color-controls-title {
    margin-bottom: 30px;
    font-size: 20px;
    color: #000000;
  }

  @media (max-width: theme.$lg) {
    max-width: none;
    min-width: 386px;
    width: 40%;
    top: var(--header-height-mobile);
  }
  @media (min-width: theme.$xl + 1) {
    min-width: auto;
  }

  .chrome-picker {
    border: none !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--image-border-color) !important;
    padding-bottom: 30px;
    & > div:nth-child(2) {
      padding: 20px 0 0 !important;
      & > .flexbox-fix:first-child {
        & > div:first-child {
          display: none !important;
        }
        & > div:nth-child(2) {
          & > div {
            margin-bottom: 20px !important;
            height: 25px !important;
            & > div {
              height: 100%;
              border-radius: 12px !important;
              & > div {
                border-radius: 12px !important;
                & > div > div {
                  height: 26px !important;
                  width: 26px !important;
                  border-radius: 12px!important;
                  transform: translateX(-13px) !important;
                  background-color: transparent !important;
                  border: 3px solid #FFF;
                }
              }
            }
          }
        }
      }
      & > .flexbox-fix:nth-child(2) {
        padding-top: 0 !important;
        & > div:nth-child(2) {
          display: none;
        }
        & > div:first-child {
          input {
            text-align: left !important;
            padding: 8px 16px !important;
            font-size: 20px !important;
            color: #000000;
            border: 1px solid #CBCBCB !important;
            border-radius: 5px !important;
            height: auto !important;
            max-height: 40px;
          }
          label {
            display: none !important;
          }
        }
      }
    }
    & > div:first-child {
      height: 300px;
    }
  }
  .color-lists, .mobile-color-list {
    display: flex;
    flex-direction: column;
    @media (max-width: theme.$md) {
      display: none;
    }

    .recommended-colors {
      margin-bottom: 20px;
    }

    .recent-colors-title, .recommended-colors-title {
      font-size: 20px;
      color: #000000;
      margin-bottom: 20px;
      margin-top: 20px;
    }

    .recent-colors {
      border-top: 1px solid var(--image-border-color)
    }

    .color-swatch {
      display: flex;
      flex-direction: row;
      align-items: center;
      flex-wrap: wrap;
      flex: 1;
      overflow: hidden;
      max-height: 100px;
      @media ((min-width: theme.$lg + 1) and (max-width: theme.$xl)) or ((min-width: theme.$sm + 1) and (max-width: theme.$md)) {
        max-width: 100%;
      }

      .color-swatch-icon {
        padding: 3px;
        background-color: #fff;
        border-radius: 4px;
        margin-right: 16px;
        margin-bottom: 20px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        border:1px solid var(--color-line);

        .color {
          width: 32px;
          height: 32px;
          border: 1px solid #979797;
          border-radius: 5px;
        }
        @media ((min-width: theme.$lg + 1) and (max-width: theme.$xl)) or ((min-width: theme.$sm + 1) and (max-width: theme.$md)) {
          margin-right: 20px;
          margin-bottom: 20px;
        }
      }
    }

    .color-picker {
      position: relative;
      display: flex;
      justify-content: flex-end;
      background: #fff;
      border-radius: 4px;
      border:1px solid var(--color-line);
      box-sizing: border-box;
    }
  }
  @media (min-width: theme.$md + 1) {
    .mobile-color-list {
      display: none;
    }
  }
  @media (max-width: theme.$md) {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    min-width: initial;
    .mobile-color-list {
      margin-top: 30px;
      display: flex;
      .color-swatch {
        max-height: 220px;
      }
    }
    .uedit-close {
      position: absolute;
      top: 33px;
      right: 30px;
    }
  }
  .no-color {
    &:after {
      content: '';
      width: 46px;
      height: 2px;
      transform: rotate(135deg);
      background-color: #F53A4C;
      position: absolute;
    }
  }
}
