// .modal-open      - body class for killing the scroll
// .modal           - container to scroll within
// .modal-dialog    - positioning shell for the actual modal
// .modal-content   - actual modal w/ bg and corners and stuff

/*==================================*/
/* Category
/* =================================*/
.category::after {
  clear: both;
  content: "";
  display: block;
}
.category-left {
  float: left;
  width: 247px;
  background: #fff;
  padding: 30px 15px 15px 15px;
}
.category-right {
  margin-left: 248px;
}
.category-nav {
  font-size: .8em;
}
.category-nav li {
  margin-bottom: 7px;
}
.category-nav,
.category-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.category-nav ul {
  padding-left: 10px;
  margin-top: 7px;
  display: none;
}
.category-nav ul ul {
  padding-left: 20px;
}
.category-nav > .active > ul,
.category-nav > li > ul > .active > ul {
  display: block;
}
.category-nav a {
  color: #333;
}
.category-nav a:hover {
  color: #fea500;
}
.category-nav .active > a {
  font-weight: 600;
}
.category-nav > li > a::before,
.category-nav > li > ul > li > a::before {
  content: "";
  display: inline-block;
  vertical-align: .1em;
  border-top: .3em solid transparent;
  border-bottom: .3em solid transparent;
  border-right: 0;
  border-left: .3em solid #999;
  width: 15px;
}
.category-nav > li.active > a::before,
.category-nav > li > ul > li.active > a::before {
  content: "";
  display: inline-block;
  vertical-align: .255em;
  border-top: .3em solid #999;
  border-bottom: 0;
  border-right: .3em solid transparent;
  border-left: .3em solid transparent;
  width: 8px;
  margin-right: 7px;
}
.category-nav .total {
  color: #999;
  font-size: .7em;
}
.category-head {
  display: flex;
  flex-wrap: wrap;
  padding: 20px 15px 10px 15px;
  margin-bottom: 5px;
}
.category-head .heading {
  flex: 0 0 75%;
  margin-bottom: 0;
}
.category-head .category-filter {
  flex: 0 0 25%;
  text-align: right;
  display: table;
}
.category-filter-li {
  display: table-cell
}
.category-filter-li:last-child {
  display: none;
  text-align: right;
}
.category-filter-right {
  border: 1px solid #ddd;
    color: #999;
    font-size: .9em;
    position: relative;
    padding-right: 60px;
    border-radius: 0;
}
.category-filter-right .fas {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 35px;
    border-left: 1px solid #ddd;
}
.category-filter-right .fas:before {
    height: 30px;
    line-height: 35px;
}
.category-banner {
  margin-bottom: 20px;
}
.category-hotlink {
  padding: 15px;
}
.category-hotlink .hotlink-ul-4 .hotlink-li a span {
    font-size: 1.3em;
}
.category-hotlink .hotlink-ul-4 .hotlink-li a {
  height: 120px;
}
.category-wrap {
  background: #fff;
}
.category-wrap .products-wrap {
  padding-bottom: 60px;
}
.category-wrap .products-li {
  flex: 0 0 25%;
}
.category-merchant {
  display: none;
  padding: 15px 30px;
  border-bottom: 1px solid #ddd;
}
.merchant-title {
  font-size: 1.5em;
  margin: 10px 0;
}
.merchant-title .fa-certificate {
  color: #fea500;
  font-size: 1.2em;
}
.merchant-since {
  color: #808080;
  margin-bottom: 5px;
}
.merchant-rating {
  color: #808080;
  font-size: .8em;
}
.merchant-rating .fas {
  color: #E1E1E1;
}
.merchant-rating .active {
  color: #fea500;
}
.merchant-meta {
  margin-top: 5px;
}
.merchant-meta label {
  margin: 0;
  font-weight: 500;
}
.merchant-meta a {
  color: #333;
}
.merchant-meta a:hover {
  color: #fea500;
}
.certificate-ul {
  display: flex;
  flex-wrap: wrap;
  padding: 30px 15px;
}
.certificate-li {
  flex: 25%;
  padding-left: 15px;
  padding-right: 15px;
}
.certificate-item {
  position: relative;
  padding-left: 50px;
}
.certificate-item .fas {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 2em;
  color: #fea500;
}
.certificate-title {
  font-size: 1em;
  margin: 0 0 5px;
}
.certificate-intro {
  color: #999;
}
.merchant-certificate-ul {
  display: block;
  padding: 0;
  margin-top: 20px;
}
.merchant-certificate-ul .certificate-li {
  display: block;
  flex: 100%;
  padding: 0;
  margin-top: 15px;
}
.merchant-certificate-ul .certificate-item .fas {
  font-size: 1.3em;
}
.merchant-certificate-ul .certificate-item {
  padding-left: 35px;
}
.category-filter-mobile {
  position: fixed;
  right: -100%;
  top: 0;
  height: 100%;
  width: 247px;
  background-color: #fff;
  overflow-y: scroll;
  z-index: 1000;
  box-shadow: 0px 10px 10px #111;
}
.category-filter-mobile aside {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}
.category-filter-mobile .aside-title {
  padding: 6px 12px;
  background: #FFA600;
  color: #fff;
  margin: 0;
}
.category-filter-mobile .aside-title .icon {
  float: right;
}
.category-filter-mobile-content {
  padding: 12px;
  display: none;
}
.category-filter-mobile .aside-category .category-filter-mobile-content {
  display: block;
}

/*==================================*/
/* Modal Product
/* =================================*/
.modal-product {
  max-width: 1000px;
}
.modal-product .modal-content,
.modal-product .modal-header {
  border-radius: 0;
}
.modal-product .main-name {
  font-weight: 500;
}
.modal-product .note{
  color: #f00;
  font-size: 13px;
  text-transform: none;
  font-style: italic;
}
.modal-product .products-item {
  margin: 10px;
}
.modal-product .owl-prev {
    left: 0;
    top: 55%;
}
.modal-product .owl-next {
    right: 0;
    top: 55%;
}
.modal-product .modal-header {
  border-bottom: 0;
}
.modal-product .modal-header .close {
  background: #fea500;
  color: #fff;
  opacity: 1;
  padding: .6em 1em;
}
.modal-product-ul {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}
.modal-product-li {
  flex: 60%;
  padding-left: 15px;
  padding-right: 15px;
}
.modal-product-li+.modal-product-li {
  flex: 40%;
}
.modal-product-li i {
  margin-right: 5px;
}
.modal-product-li .fa-check-square {
  color: #8CC63F;
}
.modal-product-li .fa-info-circle {
  color: #999;
}
.modal-product-ul .mobile {
  display: none;
}
.modal-product-sku,
.modal-product-li .count {
  color: #999;
  font-size: .7em;
}
.modal-product-wrap {
  border-top: 1px solid #f3f3f3;
  border-bottom: 1px solid #f3f3f3;
  margin: 10px 0 20px 0;
}
.modal-product-wrap .modal-product-li {
  padding-top: 15px;
  padding-bottom: 15px;
}
.modal-product-wrap .modal-product-li:first-child {
  padding-left: 0;
  padding-right: 15px;
}
.modal-product-wrap .modal-product-li:last-child {
  padding-left: 15px;
  padding-right: 0;
  border-left: 1px solid #f3f3f3;
}
.modal-product-img {
  border: 1px solid #f3f3f3;
  float: left;
  width: 100px;
  height: 100px;
  margin-right: 10px;
  padding: 5px;
}
.modal-product-title a {
  color: #333;
}
.modal-product-title a:hover {
  color: #FFA500;
}
.modal-product-sku {
  margin: 10px 0 5px;
}
.modal-product-price {
  color: #FFA500;
  font-size: 1.2em;
  font-weight: 500;
}
.modal-product-total {
  margin: 10px 0;
}
.modal-product-sub-total span {
  font-weight: 500;
  color: #000;
  float: right;
}
.modal-product-total {
  margin: 10px 0;
  font-weight: 500;
  color: #000;
}
.modal-product-total span {
  color: #FFA500;
  font-size: 1.2em;
  float: right;
}
.modal-product-vat {
  text-align: right;
  color: #666;
  margin-bottom: 10px;
  font-style: italic;
}
.modal-product-action {
  text-align: right;
}
.modal-product-action .btn-link {
  border: 1px solid #ddd;
}
.modal-product-action .btn-link:hover {
  text-decoration: none;
}

.modal-open {
  // Kill the scroll on the body
  overflow: hidden;

  .modal {
    overflow-x: hidden;
    overflow-y: auto;
  }
}

// Container that the modal scrolls within
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: $zindex-modal;
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  // Prevent Chrome on Windows from adding a focus outline. For details, see
  // https://github.com/twbs/bootstrap/pull/10951.
  outline: 0;
  // We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a
  // gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
  // See also https://github.com/twbs/bootstrap/issues/17695
}

// Shell div to position the modal with bottom padding
.modal-dialog {
  position: relative;
  width: auto;
  margin: $modal-dialog-margin;
  // allow clicks to pass through for custom click handling to close modal
  pointer-events: none;

  // When fading in the modal, animate it to slide down
  .modal.fade & {
    @include transition($modal-transition);
    transform: $modal-fade-transform;
  }
  .modal.show & {
    transform: $modal-show-transform;
  }
}

.modal-dialog-scrollable {
  display: flex; // IE10/11
  max-height: calc(100% - #{$modal-dialog-margin * 2});

  .modal-content {
    max-height: calc(100vh - #{$modal-dialog-margin * 2}); // IE10/11
    overflow: hidden;
  }

  .modal-header,
  .modal-footer {
    flex-shrink: 0;
  }

  .modal-body {
    overflow-y: auto;
  }
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - #{$modal-dialog-margin * 2});

  // Ensure `modal-dialog-centered` extends the full height of the view (IE10/11)
  &::before {
    display: block; // IE10
    height: calc(100vh - #{$modal-dialog-margin * 2});
    content: "";
  }

  // Ensure `.modal-body` shows scrollbar (IE10/11)
  &.modal-dialog-scrollable {
    flex-direction: column;
    justify-content: center;
    height: 100%;

    .modal-content {
      max-height: none;
    }

    &::before {
      content: none;
    }
  }
}

// Actual modal
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
  // counteract the pointer-events: none; in the .modal-dialog
  color: $modal-content-color;
  pointer-events: auto;
  background-color: $modal-content-bg;
  background-clip: padding-box;
  border: $modal-content-border-width solid $modal-content-border-color;
  @include border-radius($modal-content-border-radius);
  @include box-shadow($modal-content-box-shadow-xs);
  // Remove focus outline from opened modal
  outline: 0;
}

// Modal background
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: $zindex-modal-backdrop;
  width: 100vw;
  height: 100vh;
  background-color: $modal-backdrop-bg;

  // Fade for backdrop
  &.fade { opacity: 0; }
  &.show { opacity: $modal-backdrop-opacity; }
}

// Modal header
// Top section of the modal w/ title and dismiss
.modal-header {
  display: flex;
  align-items: flex-start; // so the close btn always stays on the upper right corner
  justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
  padding: $modal-header-padding;
  border-bottom: $modal-header-border-width solid $modal-header-border-color;
  @include border-top-radius($modal-content-border-radius);

  .close {
    padding: $modal-header-padding;
    // auto on the left force icon to the right even when there is no .modal-title
    margin: (-$modal-header-padding-y) (-$modal-header-padding-x) (-$modal-header-padding-y) auto;
  }
}

// Title text within header
.modal-title {
  margin-bottom: 0;
  line-height: $modal-title-line-height;
}

// Modal body
// Where all modal content resides (sibling of .modal-header and .modal-footer)
.modal-body {
  position: relative;
  // Enable `flex-grow: 1` so that the body take up as much space as possible
  // when should there be a fixed height on `.modal-dialog`.
  flex: 1 1 auto;
  padding: $modal-inner-padding;
}

// Footer (for actions)
.modal-footer {
  display: flex;
  align-items: center; // vertically center
  justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
  padding: $modal-inner-padding;
  border-top: $modal-footer-border-width solid $modal-footer-border-color;
  @include border-bottom-radius($modal-content-border-radius);

  // Easily place margin between footer elements
  > :not(:first-child) { margin-left: .25em; }
  > :not(:last-child) { margin-right: .25em; }
}

// Measure scrollbar width for padding body during modal show/hide
.modal-scrollbar-measure {
  position: absolute;
  top: -9999px;
  width: 50px;
  height: 50px;
  overflow: scroll;
}

// Scale up the modal
@include media-breakpoint-up(sm) {
  // Automatically set modal's width for larger viewports
  .modal-dialog {
    max-width: $modal-md;
    margin: $modal-dialog-margin-y-sm-up auto;
  }

  .modal-dialog-scrollable {
    max-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2});

    .modal-content {
      max-height: calc(100vh - #{$modal-dialog-margin-y-sm-up * 2});
    }
  }

  .modal-dialog-centered {
    min-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2});

    &::before {
      height: calc(100vh - #{$modal-dialog-margin-y-sm-up * 2});
    }
  }

  .modal-content {
    @include box-shadow($modal-content-box-shadow-sm-up);
  }

  .modal-sm { max-width: $modal-sm; }
}

@include media-breakpoint-up(lg) {
  .modal-lg,
  .modal-xl {
    max-width: $modal-lg;
  }
}

@include media-breakpoint-up(xl) {
  .modal-xl { max-width: $modal-xl; }
}
