/*
* Template Customizer Style
**/

$customizer-width: 400px;
$customizer-width-sm: 300px;
$customizer-hide-width: 1200px;
$customizer-spacer: 20px;
$customizer-font-size: inherit;

$open-btn-size: 38px;
$open-btn-spacer: 0;
$open-btn-font-size: 18px;
$open-btn-top: 180px;
$open-btn-top-md: 145px;

$open-btn-bg: var(--bs-primary);
$open-btn-bg-dark: var(--bs-primary);
$open-btn-color: #fff;
$open-btn-border-radius: 0.375rem;
$open-customizer-primary-color: var(--bs-primary);

#template-customizer {
  font-family: 'Open Sans', BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
    'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
  font-size: $customizer-font-size !important;
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  z-index: 99999999;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  width: $customizer-width;
  -webkit-box-shadow: 0px 0.3125rem 1.375rem 0px rgba(34, 48, 62, 0.18);
  box-shadow: 0px 0.3125rem 1.375rem 0px rgba(34, 48, 62, 0.18);
  -webkit-transition: all 0.2s ease-in;
  -o-transition: all 0.2s ease-in;
  transition: all 0.2s ease-in;
  -webkit-transform: translateX($customizer-width + $customizer-spacer);
  -ms-transform: translateX($customizer-width + $customizer-spacer);
  transform: translateX($customizer-width + $customizer-spacer);

  .dark-style & {
    -webkit-box-shadow: 0px 0.3125rem 1.375rem 0px rgba(20, 20, 29, 0.26);
    box-shadow: 0px 0.3125rem 1.375rem 0px rgba(20, 20, 29, 0.26);
  }

  h5 {
    position: relative;
    font-size: 11px;
  }

  > h5 {
    flex: 0 0 auto;
  }

  .disabled {
    color: #d1d2d3 !important;
  }
  .form-label {
    font-size: 0.9375rem;
    font-weight: 500;
  }
  .form-check-label {
    font-size: 0.8125rem;
  }
  &.template-customizer-open {
    -webkit-transition-delay: 0.1s;
    -o-transition-delay: 0.1s;
    transition-delay: 0.1s;
    -webkit-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;

    .custom-option.checked {
      color: $open-customizer-primary-color;
      border-width: 2px;
      margin: 0;
    }
  }

  .template-customizer-header {
    a:hover {
      color: inherit !important;
    }
  }
  // Customizer button

  .template-customizer-open-btn {
    position: absolute;
    top: $open-btn-top;

    @media (max-width: 991.98px) {
      top: $open-btn-top-md;
    }
    left: 0;
    z-index: -1;
    display: block;
    width: $open-btn-size;
    height: $open-btn-size;
    border-top-left-radius: $open-btn-border-radius;
    border-bottom-left-radius: $open-btn-border-radius;
    background: $open-btn-bg;
    box-shadow: 0px 0.125rem 0.25rem 0px rgba(105, 108, 255, 0.4);
    color: $open-btn-color !important;
    text-align: center;
    font-size: $open-btn-font-size !important;
    line-height: $open-btn-size;
    opacity: 1;
    -webkit-transition: all 0.1s linear 0.2s;
    -o-transition: all 0.1s linear 0.2s;
    transition: all 0.1s linear 0.2s;
    -webkit-transform: translateX(-($open-btn-size + $customizer-spacer + $open-btn-spacer));
    -ms-transform: translateX(-($open-btn-size + $customizer-spacer + $open-btn-spacer));
    transform: translateX(-($open-btn-size + $customizer-spacer + $open-btn-spacer));

    .dark-style & {
      background: $open-btn-bg-dark;
    }
    &::before {
      content: '';
      width: 22px;
      height: 22px;
      display: block;
      background-size: 100% 100%;
      position: absolute;
      background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABClJREFUaEPtmY1RFEEQhbsjUCIQIhAiUCNQIxAiECIQIxAiECIAIpAMhAiECIQI2vquZqnZvp6fhb3SK5mqq6Ju92b69bzXf6is+dI1t1+eAfztG5z1BsxsU0S+ici2iPB3vm5E5EpEDlSVv2dZswFIxv8UkZcNy+5EZGcuEHMCOBeR951uvVDVD53vVl+bE8DvDu8Pxtyo6ta/BsByg1R15Bwzqz5/LJgn34CZwfnPInI4BUB6/1hV0cSjVxcAM4PbcBZjL0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WPt/MSFwklprYItwt6cmvpWJ2IVcQBCz6bLysSCv3SaANCiTsnaNRrNRqMXVVT1/BrAqz/buu/Y38Ad3KC5PARej0QAAAABJRU5ErkJggg==');
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }

    // Customizer Hidden
    .customizer-hide & {
      display: none;
    }

    [dir='rtl'] & {
      border-radius: 0;
      border-top-right-radius: $open-btn-border-radius;
      border-bottom-right-radius: $open-btn-border-radius;

      &::before {
        margin-left: -2px;
      }
    }
  }

  &.template-customizer-open .template-customizer-open-btn {
    opacity: 0;
    -webkit-transition-delay: 0s;
    -o-transition-delay: 0s;
    transition-delay: 0s;
    -webkit-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
  }

  // Customizer inner
  .template-customizer-inner {
    position: relative;
    overflow: auto;
    -webkit-box-flex: 0;
    -ms-flex: 0 1 auto;
    flex: 0 1 auto;
    opacity: 1;
    -webkit-transition: opacity 0.2s;
    -o-transition: opacity 0.2s;
    transition: opacity 0.2s;

    > div:first-child {
      > hr:first-of-type {
        display: none !important;
      }
      > h5:first-of-type {
        padding-top: 0 !important;
      }
    }
  }

  // Theme
  .template-customizer-themes-inner {
    position: relative;
    opacity: 1;
    -webkit-transition: opacity 0.2s;
    -o-transition: opacity 0.2s;
    transition: opacity 0.2s;
  }

  .template-customizer-theme-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    align-items: center;
    -ms-flex-align: center;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 100%;
    flex: 1 1 100%;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 24px;
    width: 100%;
    cursor: pointer;

    input {
      position: absolute;
      z-index: -1; // Put the input behind the label so it doesn't overlay text
      opacity: 0;
    }

    input ~ span {
      opacity: 0.25;
      -webkit-transition: all 0.2s;
      -o-transition: all 0.2s;
      transition: all 0.2s;
    }

    .template-customizer-theme-checkmark {
      display: inline-block;
      width: 6px;
      height: 12px;
      border-right: 1px solid;
      border-bottom: 1px solid;
      opacity: 0;
      -webkit-transition: all 0.2s;
      -o-transition: all 0.2s;
      transition: all 0.2s;
      -webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
      transform: rotate(45deg);

      [dir='rtl'] & {
        border-right: none;
        border-left: 1px solid;
        -webkit-transform: rotate(-45deg);
        -ms-transform: rotate(-45deg);
        transform: rotate(-45deg);
      }
    }

    input:checked:not([disabled]) ~ span,
    &:hover input:not([disabled]) ~ span {
      opacity: 1;
    }

    input:checked:not([disabled]) ~ span .template-customizer-theme-checkmark {
      opacity: 1;
    }
  }

  .template-customizer-theme-colors {
    span {
      display: block;
      margin: 0 1px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) inset;
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) inset;
    }
  }

  &.template-customizer-loading .template-customizer-inner,
  &.template-customizer-loading-theme .template-customizer-themes-inner {
    opacity: 0.2;

    &::after {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 999;
      display: block;
    }
  }
}
@media (max-width: $customizer-hide-width) {
  #template-customizer {
    display: none;
    visibility: hidden !important;
  }
}
@media (max-width: 575.98px) {
  #template-customizer {
    width: $customizer-width-sm;
    -webkit-transform: translateX($customizer-width-sm + $customizer-spacer);
    -ms-transform: translateX($customizer-width-sm + $customizer-spacer);
    transform: translateX($customizer-width-sm + $customizer-spacer);
  }
}

.layout-menu-100vh #template-customizer {
  height: 100vh;
}

// RTL
//

[dir='rtl'] {
  #template-customizer {
    right: auto;
    left: 0;
    -webkit-transform: translateX(-($customizer-width + $customizer-spacer));
    -ms-transform: translateX(-($customizer-width + $customizer-spacer));
    transform: translateX(-($customizer-width + $customizer-spacer));
  }

  #template-customizer .template-customizer-open-btn {
    right: 0;
    left: auto;
    -webkit-transform: translateX($open-btn-size + $customizer-spacer + $open-btn-spacer);
    -ms-transform: translateX($open-btn-size + $customizer-spacer + $open-btn-spacer);
    transform: translateX($open-btn-size + $customizer-spacer + $open-btn-spacer);
  }

  #template-customizer .template-customizer-close-btn {
    right: auto;
    left: 0;
  }
}

#template-customizer .template-customizer-layouts-options[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

// ! FIX: mode switch position in RTL
[dir='rtl'] {
  .template-customizer-t-style_switch_light {
    padding-right: 0 !important;
  }
}
