.customproduct {
    height: 100%;
    --dark-grey: #555;
    --dark: #293341;
    --red: #AF2020;
    --light-grey: #f5f5f5;
    --grey: #eee;
    --transition-time: .5s;
    --box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);

  & .customproduct__stage {
    display: flex;
    flex-direction: column;
    height: 100vh;

    @media (width > 780px) {
      overflow-y: hidden;
    }

    & > section {
      display: flex;
      flex-direction: column;
      height: 100%;

      @media (width > 780px) {
        flex-direction: row;
      }
    }

    & .customproduct__stage--header {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      width: 100%;

      & .customproduct__stage--header-top {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 65px;
        background-color: white;
        border-bottom: 3px solid var(--dark-grey);


        & > svg {
          position: absolute;
          top: 50%;
          left: 50%;
          display: none;
          transform: translate(-50%, -50%);

          @media (width > 780px) {
            display: block;
          }
        }

        & > div {
          &:nth-of-type(1) {
            height: 100%;
            padding: 7px;
            max-width: 51%;

            @media (width > 780px) {
              padding: 10px;
            }

            & h2 {
              margin: 0;
              font-size: 12px;

              & + small {
                position: relative;
                top: -4px;
                font-size: 11px;

                @media (width > 780px) {
                  position: static;
                  top: 0;
                  font-size: 13px;
                }
              }

              @media (width > 780px) {
                font-size: 16px;
              }
            }
          }

          &:nth-of-type(2) {
            display: flex;
            align-items: center;
            height: 100%;
            padding: 7px;

            @media (width > 780px) {
              padding: 10px;
            }

            & #customproductPrice {
              position: relative;

              & .price-wrapper {
                position: static;
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                justify-content: flex-end;
                align-items: baseline;
                margin-right: 10px;
                line-height: 1;

                & .price-old {
                  margin: 0 5px 0 0;
                }

                & .details__final--price {
                  font-size: 18px;
                  @media (width > 780px) {
                    font-size: 20px;
                  }

                }

                & .details__delivery {
                  display: none;
                  width: 100%;
                  margin-top: 0;

                  @media (width > 780px) {
                    display: flex;
                  }
                }
              }

              & .bonus.bonus__text {
                display: none;
              }
            }

            & .button {
              min-height: 100%;
              padding: 0 25px;
              border-radius: 5px;

              & svg {
                @media (width > 780px) {
                  width: 20px;
                  height: 20px;
                  margin-right: 10px;
                }
              }
            }
          }
        }
      }
    }
  }


  & .customproduct__stage-preview {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    background-color: white;
    overflow: hidden !important;


    & #canvasPreviewContent {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);


      & > img {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
      }

      & #canvasPreviewCanvas {
        position: absolute;
        left: 50%;
        box-shadow: 10px 10px 4px #999;
        outline: 7px solid var(--dark);
        transform: translateX(-50%);
        overflow: hidden;

        & img {
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
        }
      }
    }
  }


  & .customproduct__toolbar {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    display: flex;
    z-index: 2;
    flex-direction: column-reverse;
    order: 1;
    box-shadow: 0 -3px 4px #ddd;
    overflow: hidden;

    @media (width > 780px) {
      position: static;
      flex-direction: row;
      order: -1;
      height: 100%;
      box-shadow: 3px 0 4px #ddd;
    }

    &:has(.customproduct__toolbar--content > .is-open) {
      overflow: visible;
    }

    & .customproduct__toolbar--tabs {
      display: flex;
      flex-direction: row;
      background-color: var(--dark-grey);
      position: relative;
      z-index: 2;
      overflow-y: auto;

      @media (width > 780px) {
        flex-direction: column;
        overflow: hidden;
      }

      & > div {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 7px 10px;
        border-right: 1px solid white;
        cursor: pointer;
        color: white;
        user-select: none;
        min-width: 62px;

        @media (width > 780px) {
          padding: 10px 7px;
          border-right: 0;
          border-bottom: 1px solid white;
        }

        &:hover, &.active {
          background-color: var(--red);
        }

        & > span {
          display: block;
          margin-bottom: 5px;
          font-size: 26px;
          font-weight: 300;
        }

        & > small {
          font-size: 11px;
        }
      }
    }

    & .customproduct__toolbar--content {
      position: relative;
      top: 150px;
      z-index: 1;
      scrollbar-color: transparent transparent;
      scrollbar-width: thin;
      transition: all .3s ease-in-out;
      max-height: 0;

      @media (width > 780px) {
        scrollbar-color: var(--red) transparent;
        width: 0;
        top: 0;
        height: 100%;
      }

      &:has(>.is-open) {
        max-height: max-content;
        top: 0;

        @media (width > 780px) {
          width: 320px;
        }
      }

      & > div {
        background-color: white;
        height: 100%;

        &:not(.is-open) {
          display: none;
        }

        &.is-open {
          display: flex;
          flex-direction: column;
          justify-content: flex-start;
          height: 100%;
          padding: 15px 10px 10px 10px;

          @media (width > 780px) {
            padding-top: 10px;
          }

        }

        & > div:has(>div[id]) {
          overflow: hidden;

          @media (width > 780px) {
            overflow: auto;
            scrollbar-width: thin;
            max-height: 92.8%;
          }

          & > small {
            display: flex;
            align-items: flex-start;
            margin-bottom: 5px;
            user-select: none;

            &:has([type=checkbox]) {
              display: none;
              margin: 10px 0;
            }
          }

          & > *[id] {
            display: flex;
            max-width: 5000px;
            overflow: auto;
            scroll-behavior: smooth;
            flex-flow: nowrap;
            position: relative;

            @media (width > 780px) {
              overflow-x: hidden;
              max-width: 100%;
              flex-wrap: wrap;
            }

            & > div {
              flex: 0 0 21%;
              max-width: 21%;
              display: flex;
              flex-direction: column;
              justify-content: center;
              margin-right: 10px;
              cursor: pointer;

              @media (width > 780px) {
                margin-bottom: 10px;
                flex: 0 0 calc(33.33% - 10px);
                max-width: calc(33.33% - 10px);
              }

              & > small {
                display: block;
                margin-top: 3px;
                font-size: 11px;
              }
            }

            &#clipartsList {
              & > div {
                @media (width > 780px) {
                  flex: 0 0 calc(20% - 10px);
                  max-width: calc(20% - 10px);
                }
              }
            }

            &#backgroundColors {
              margin-bottom: 7px;

              & > label {
                cursor: pointer;
                display: flex;
                flex-direction: row-reverse;
                justify-content: flex-end;
                align-items: center;
                width: 100%;
                position: relative;
                top: -2px;
                padding-left: 1px;
                order: 1;

                @media (width > 780px) {
                  order: -1;
                  position: static;
                  margin-bottom: 7px;
                  padding-bottom: 3px;
                }

                & > small {
                  margin: 5px 5px 0 0;
                  font-weight: 300;
                  display: block;
                }

                & input {
                  margin-right: 5px;
                  cursor: pointer;
                  inline-size: 38px;
                  block-size: 38px;
                  box-shadow: 0 0.0625rem 0.1875rem 0 rgba(0, 0, 0, .35);
                  padding: 1px;
                  border-radius: 50%;
                }

                & input[type="color" i]::-webkit-color-swatch-wrapper {
                  padding: 1px;
                }

                & input[type="color" i]::-webkit-color-swatch {
                  padding: 1px;
                  border-radius: 50% !important;
                }
              }

              & > div {
                margin-bottom: 5px;
                flex: 0 0 31px;
                max-width: 31px;

                &.active {
                  border-radius: 50%;
                }
              }

              & div[style*=background] {
                display: flex;
                justify-content: center;
                align-items: center;
                width: 35px !important;
                height: 35px;
                box-shadow: 0 0.0625rem 0.1875rem 0 rgba(0, 0, 0, .35);
                border: 1px solid #fff;
                border-radius: inherit;
                font-weight: 500;
                line-height: 1.7;
                transition: all .3s;

                &[style*="#FFF"] {
                  height: 33px;
                  position: relative;
                  top: 1px;
                }
              }
            }

            &#backgroundGradients {
              margin-bottom: 7px;

              & > div {
                aspect-ratio: 1;
                border-radius: 5px;
              }
            }

            &#backgroundsList {
              & img {
                border: 1px solid transparent;

                &.active {
                  border-color: var(--red);
                }
              }
            }

          }
        }

        & [data-line] {
          height: 38px;
          margin-bottom: 10px;
          display: flex;
          align-items: center;
          cursor: pointer;

          & > svg {
            width: 100%;
          }
        }
      }


      & h2 {
        margin-top: 0;
        margin-bottom: 7px;
        font-size: 18px;
      }

      & p {
        font-size: 13px;
      }

      & label {
        font-weight: 500;
        --fs: 12px;

      }

      & input:not([type=checkbox]) {
        --fs: 14px;
        height: 45px;
      }

      & button {
        align-self: center;

        &:not([class*=close]) {
          max-height: 45px;
          min-height: 45px;
          --fs: 12px;

        }

        &[class*=close] {
          margin-top: 0;
          top: 0;
          right: 10px;
          width: 30px;
          height: 30px;
          border-radius: 5px;
          transform: translateY(-40%);
        }
      }

      #cliparts {

        & small:has(select) {
          display: flex;
          align-items: center;
          justify-content: space-between;
        }

        & #changeCliparts {
          margin-right: 10px;
          height: auto;
          margin-bottom: 7px;
          font-size: 14px;
        }

        img {
          max-height: 80px;
          outline: transparent !important;
        }

        label[ for="clipartsInput"] {
          position: relative;

          & button {
            position: absolute;
            top: 1px;
            right: 1px;
            height: 48px;
            margin: 0;
            background-color: white;
            cursor: pointer;
            aspect-ratio: 1;
          }
        }
      }

      & #images {
        &:has(#imagesList img) {
          & small {
            display: flex;

            & + small {
              border-bottom: 1px solid #ccc;
              padding-bottom: 7px;
            }
          }
        }
      }
    }
  }


  & .customproduct__canvas {
    position: relative;
    display: flex;
    z-index: 1;
    flex-direction: column;
    flex-grow: 1;
    background-color: #F3F9F9;

    & .customproduct__canvas--header {
      display: flex;
      justify-content: space-between;

      & .customproduct__stage--close {
        position: static;
        width: 43px;
        height: 43px;
        border-radius: 5px;
      }
    }

    & .customproduct__canvas--header-left,
    & .customproduct__canvas--header-right {
      display: flex;
      padding: 10px 14px;

      & > div {
        display: flex;
        justify-content: center;
        align-items: center;
        width: max-content;
        height: 44px;
        min-width: 50px;
        margin: 0 10px 0 0;
        background: white;
        border: 1px solid #ccc;
        border-radius: 5px;

        & > div:not(.customproduct__canvas--spacer) {
          display: flex;
          align-items: center;
          padding: 13px 10px;
          cursor: pointer;
          user-select: none;

          & small {
            margin-left: 3px;
          }
        }
      }

      & .customproduct__canvas--spacer {
        display: block;
        width: 1px;
        height: 20px;
        background: #ccc;
      }

      & .customproduct__canvas--history {
        & .customproduct__canvas--history--undo,
        & .customproduct__canvas--history--redo {
          opacity: .2;
        }
      }
    }


    & .customproduct__canvas--content {
      display: flex;
      flex-grow: 1;
      justify-content: center;
      align-items: flex-start;
      padding: 0 10px 100px 10px;
      overflow-y: auto;
      scrollbar-width: thin;

      @media (width > 780px) {
        padding: 0 10px 100px 10px;
      }

      &:has(#canvasLayerEditor.bottom > #colorLayer[style*=block]) {
        padding-bottom: 400px !important;
      }
    }
  }

  & #CustomProductCanvasWrapper {
    width: 100%;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15), 0 1px 3px rgba(0, 0, 0, .1);

    &.portrait {
      max-width: 600px;
    }


    &.landscape {
      max-width: 1000px;
    }

    &.grab::after {
      content: "";
      display: flex;
      pointer-events: none;
      width: 52px;
      aspect-ratio: 1;
      border-radius: 50%;
      position: absolute;
      z-index: 10;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: url("/modules/wallart/customproduct/out/img/move.svg") no-repeat center center var(--red);
      background-size: 80%;
    }


    canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      user-select: none;
      touch-action: none;
    }
  }

  #canvasGridOverlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(30, 167, 253, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 167, 253, 0.3) 1px, transparent 1px);
    background-size: 150px 150px;
    pointer-events: none;

    &::before {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: 1px;
      background: rgba(30, 167, 253, 0.7);
      transform: translateX(-50%);
      content: "";
    }

    &::after {
      position: absolute;
      top: 50%;
      right: 0;
      left: 0;
      height: 1px;
      background: rgba(30, 167, 253, 0.7);
      transform: translateY(-50%);
      content: "";
    }
  }

  & [data-action] {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: none;
    min-height: 45px;

    & span {
      display: block;
      font-size: 28px;
    }

    & small {
      font-size: 12px;
      font-weight: 400;
    }
  }

  & [data-action="editTextLayer"]:not(.show),
  & [data-action="colorLayer"]:not(.show),
  & [data-action="editImageLayer"]:not(.show),
  & [data-action="editQrLayer"]:not(.show) {
    display: none;
  }


  & #canvasLayerEditor {
    transition: opacity .2s;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;


    @media (width <= 780px) {
      position: relative;
      top: 0 !important;
      left: 0 !important;
    }

    @media (width > 780px) {
      border: 1px solid #ccc;
      position: absolute;
      z-index: 2000;
      box-shadow: var(--box-shadow);
    }

    &.hidden {
      display: none;
      opacity: 0;
      pointer-events: none;
    }

    & > section {
      display: flex;
      justify-content: center;
      padding: 6px;
      background: white;
    }

    & [data-action] {
      padding: 0 6px;
      cursor: pointer;

      &:hover, &.active {
        color: var(--red);

        & > span {
          opacity: 1;
        }
      }

      & > *:nth-of-type(1) {
        margin-top: 3px;
      }

      & > span {
        font-weight: 300;
      }

      & > div {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 28px;
        height: 28px;
      }


      & #colorPickerBtn {
        --color-hex: #000;

        &::before {
          display: block;
          width: 20px;
          height: 20px;
          background-color: var(--color-hex);
          content: "";
          overflow: hidden;
        }
      }

      &.spacer {
        border-right: 1px solid #ccc;
        padding-right: 9px;
        margin-right: 3px;
      }
    }

    & > [id] {
      display: none;
      z-index: 1;
      box-shadow: var(--box-shadow);
      background-color: white;
      border: 1px solid #ccc;
      overflow: hidden;

      @media (width > 780px) {
        border-radius: 0 0 5px 5px;
        position: absolute;
        right: 0;
        left: 0;
      }

    }

    &.bottom > [id] {
      top: 100%;
    }

    &.top > [id] {
      bottom: 100%;
    }


    & #colorLayer {
      &:not(:has(> .pcr-app[data-theme].visible)) {
        display: none !important;
      }

      & .pcr-app {
        --transition-time: .0001s;
        position: relative;
      }

      & > .pcr-app[data-theme].visible {
        top: 0 !important;
        left: 0 !important;
        width: auto;
        max-width: 100%;

        & .pcr-result {
          height: auto;
        }
      }
    }
  }

  #canvasAddTextLayer {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 45px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
    background-color: var(--dark);
    border-radius: 10px;
    cursor: pointer;
    color: white;
    transform: translateX(120%);
    aspect-ratio: 1;

    &:hover {
      background-color: var(--red);
    }

    & span {
      position: relative;
      top: 3px;
    }

    & small {
      font-weight: 500;
    }
  }

  & .customproduct__editor {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    z-index: 100;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    overflow-y: auto;
    scrollbar-width: thin;

    &:not(.is-open) {
      visibility: hidden;
      opacity: 0;
      pointer-events: none;
    }

    & .customproduct__editor--header {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      margin-bottom: 10px;

      & select {
        background-color: var(--light-grey);
        scrollbar-width: thin;
      }

      & > * {
        height: 50px !important;
      }

      & > *:not(:last-child) {
        margin-right: 10px;
      }

      & #textEditorAlignment {
        display: flex;
        justify-content: center;
        align-items: center;
        width: max-content;
        padding: 6px;
        background: #fff;
        border: 1px solid #ccc;
        margin-top: 10px;

        @media (width > 780px) {
          margin-top: 0;
        }


        & .spacer {
          display: block;
          width: 1px;
          height: 30px;
          margin: 0 5px;
          background: #ccc;
        }

        & > span {
          position: relative;
          top: 1px;
          cursor: pointer;
          font-size: 36px;
          font-weight: 200;

          &:hover {
            color: red;
          }
        }
      }
    }

    & > section {
      position: relative;
      display: flex;
      flex-direction: column;
      width: 100%;
      padding: 10px;
      background-color: hsl(0, 0%, 100%);


      @media (width > 780px) {
        width: 50%;
        padding: 20px;
      }

    }


    & .customproduct__editor--content {
      & textarea#textEditorTextArea {
        width: 100%;
        height: 380px;
        padding: 15px;
        background-color: var(--light-grey);
        overflow: auto;
        resize: none;
        scrollbar-width: thin;
        scrollbar-color: var(--red) transparent;
        color: var(--dark) !important;
      }
    }

    & .customproduct__editor--footer {
      display: flex;
      justify-content: flex-end;
      @media (width > 780px) {
        margin-top: 10px;
      }

    }
  }

  & .customproduct__editor--filter {
    display: flex;
    flex-direction: column;
    overflow: hidden;

    @media (width > 780px) {
      flex-direction: row;
    }

    & > div {
      position: relative;
      display: flex;
      flex-grow: 1;
      justify-content: center;
      align-items: center;
      background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');


      &:has(.cropper-modal) {
        &::before {
          position: absolute;
          top: 0;
          right: 0;
          bottom: 0;
          left: 0;
          display: block;
          background-color: #000;
          opacity: 0.5;
          content: "";
        }
      }


      & * {
        --transition-time: 0s !important;
      }

      & > img {
        max-height: 87vh;
      }
    }

    & aside {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      background-color: var(--light-grey);
      border-left: 1px solid var(--grey);
      overflow: hidden;
      padding: 10px;
      margin-bottom: 10px;


      @media (width > 780px) {
        flex: 0 0 25%;
        width: 25%;
        max-width: 25%;
        max-height: 87vh;
        margin-left: 20px;
      }


      & input[type="color" i] {
        margin-right: 5px;
        cursor: pointer;
        border-radius: 50%;
        inline-size: 38px;
        block-size: 38px;
        box-shadow: 0 0.0625rem 0.1875rem 0 rgba(0, 0, 0, .35);
        border: 1px solid #fff;
        padding: 1px;
        margin-top: 10px;
      }

      & input[type="color" i]::-webkit-color-swatch-wrapper {
        padding: 1px;
      }

      & input[type="color" i]::-webkit-color-swatch {
        padding: 1px;
        border-radius: 50% !important;
      }

    }


    & .filter-control {
      padding: 7px 0;
      border-bottom: 3px solid white;
      flex: 0 0 48%;
      width: 48%;
      max-width: 48%;


      @media (width > 780px) {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
      }

      & label {
        display: flex;
        justify-content: space-between;
        font-family: Roboto Slab, sans-serif;
        font-size: 14px;
        font-weight: 500;
      }
    }


    & input[type=range] {
      -webkit-appearance: none;
      width: 100%;
      margin: 10px 0;
      background: transparent;

      &:focus {
        outline: none;
      }

      &::-webkit-slider-runnable-track {
        width: 100%;
        height: 4px;
        background: #cacaca;
        cursor: pointer;
      }

      &::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        margin-top: -7px;
        background: white;
        border: 2px solid var(--red);
        border-radius: 50%;
        cursor: pointer;
        transition: background 0.3s, transform 0.3s;
      }

      &::-webkit-slider-thumb:hover {
        transform: scale(1.2);
      }
    }

    & .filter-reset-control {
      display: flex;
      justify-content: center;


      & > button {
        margin-top: 15px;
        margin-bottom: 5px;
        background-color: transparent;
        font-family: Roboto Slab, sans-serif;
        font-size: 14px;
        font-weight: 500;

        & > img {
          margin-bottom: 10px;
        }
      }
    }

  }

  & .crop-bar-legend {
    position: absolute;
    bottom: 0;
    left: 0;
    display: none;
    align-items: flex-end;
    font-weight: 400;
    font-size: 12px;
    transform: translateY(150%);

    @media (width > 780px) {
      bottom: auto;
      top: 0;
      transform: translateY(-150%);
    }

    &::before {
      border: 1px dotted rgba(255, 0, 0, 0.5);
      display: inline-block;
      content: "";
      width: 20px;
      aspect-ratio: 1;
      background-color: white;
      margin-right: 3px;
      background-image: repeating-linear-gradient(135deg, rgba(255, 0, 0, 0.15) 0, rgba(255, 0, 0, 0.15) 3px, transparent 3px, transparent 7px);
    }
  }

  & .crop-bar {
    position: absolute;
    display: none;
    z-index: 10;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    font-size: 11px;
    pointer-events: none;
    background-image: repeating-linear-gradient(
      135deg,
      rgba(255, 0, 0, 0.15) 0,
      rgba(255, 0, 0, 0.15) 10px,
      transparent 10px,
      transparent 20px
    );


    & > span {
      padding: 0 5px;
      background-color: #fff;
      border-radius: 5px;
      color: #333;
    }

    &.top {
      top: 0;
      right: 0;
      left: 0;
      width: 100%;
      border-bottom: 1px dotted rgba(255, 0, 0, 0.5);
    }

    &.bottom {
      right: 0;
      bottom: 0;
      left: 0;
      width: 100%;
      border-top: 1px dotted rgba(255, 0, 0, 0.5);
    }

    &.left {
      top: 0;
      bottom: 0;
      left: 0;
      width: 28px;
      height: 100%;
      background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 0, 0, 0.15) 0,
        rgba(255, 0, 0, 0.15) 10px,
        transparent 10px,
        transparent 20px
      );
      border-right: 1px dotted rgba(255, 0, 0, 0.5);

      & > span {
        transform: rotate(-90deg);
      }
    }

    &.right {
      top: 0;
      right: 0;
      bottom: 0;
      width: 28px;
      height: 100%;
      background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 0, 0, 0.15) 0,
        rgba(255, 0, 0, 0.15) 10px,
        transparent 10px,
        transparent 20px
      );
      border-left: 1px dotted rgba(255, 0, 0, 0.5);

      > span {
        transform: rotate(-90deg);
      }
    }

    &[style*='flex'] + .crop-bar-legend {
      display: flex;
    }
  }

  & button[class*="--close"] {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    z-index: 20;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background-color: var(--dark);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    transition: transform .15s ease-out;
  }

  .quality-box {
    display: none;
    position: absolute;
    z-index: 11;
    padding: 7px;
    box-shadow: 0 10px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    pointer-events: none;
    top: 15px;
    right: 15px;
    width: max-content;
    height: max-content;
    border: 0;
    border-radius: 0;
    opacity: 1;
    word-spacing: normal;
    white-space: nowrap;
    aspect-ratio: auto;

    &[data-quality] {
      justify-content: center;
      align-items: center;
      display: flex;
      color: white;
      font-weight: 500;
      font-size: 12px;
      line-height: 1.2;
      text-align: center;
      overflow: hidden;
      font-family: Roboto Slab, sans-serif;
    }

    &[data-quality=maximum],
    &[data-quality=optimal] {
      background: rgba(66, 132, 69, 1);
    }

    &[data-quality=ok],
    &[data-quality=minimal] {
      background: rgba(230, 180, 0, 1);
    }

    &[data-quality=bad] {
      background: rgba(175, 32, 32, 1);
    }
  }

  .w100 {
      width: 100%;
  }

}

body:has(.modal#CustomProductModal.is-open) {
    overflow-y: hidden;
}

#pswp-gallery {
  & > img[src^="data:image"] {
    margin-bottom: 14px;
    display: block;
  }
}

/* modal styles */
.modal#CustomProductModal {
    &:not(.is-open) {
        display: none;
    }
    & .modal__inner {
        width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
    }

    & .modal__content {
        padding: 0;
    }

    & .modal__close {
        top: 65px;
        display: none;
        transform: none;
    }
}
