.modals-wrapper { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; display: flex; align-items: center; justify-content: center; &.modals-wrapper--open { z-index: 200; width: 100%; height: 100%; } } .modal { position: relative; display: none; background-color: rgba(255, 255, 255, 1); min-width: 60vw; max-width: 70vw; min-height: 100px; max-height: calc(100vh - 30px); border-radius: 2px; z-index: -1; color: var(--color-font); padding: 0 40px; overflow: auto; overscroll-behavior: contain; pointer-events: none; opacity: 0; &.modal--open { display: flex; opacity: 1; pointer-events: auto; z-index: 200; transition: opacity .2s .1s ease-in-out, transform .3s ease-in-out; } } @media (max-width: 1024px) { .modal { min-width: 80vw; } } @media (max-width: 768px) { .modal { min-width: 90vw; } } @media (max-width: 425px) { .modal { min-width: calc(100vw - 20px); } } .modal__overlay { position: fixed; left: 0; top: 0; height: 100%; width: 100%; background-color: transparent; z-index: -1; transition: all .2s ease; display: none; &.modal__overlay--open { display: block; z-index: 199; opacity: 1; background-color: rgba(0, 0, 0, 0.4); } } .modal__trigger { cursor: pointer; } .modal__trigger-label { font-style: italic; text-decoration: underline; } .modal__closer { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; background-color: var(--color-darker); border-radius: 2px; cursor: pointer; z-index: 20; &::before { content: '\f00d'; font-family: 'Font Awesome 5 Free'; color: white; } } .modal__content { margin: 20px 0; width: 100%; }