//
// @import "theme_variables";
// @import "vendor_variables";
@import "vendor/bootstrap/bootstrap/variables";

* {
  direction: rtl !important;
}

body {
  text-align: right !important;
}

@mixin calc-grid-column($index, $class, $type) {
  @if ($type == offset) {
    .col-#{$class}-offset-#{$index} {
      margin-right: percentage(($index / $grid-columns));
      margin-left: 0;
    }
  }
}

@mixin float-grid-columns($class, $i: 1, $list: ".col-#{$class}-#{$i}") {
  @for $i from (1 + 1) through $grid-columns {
    $list: "#{$list}, .col-#{$class}-#{$i}";
  }
  #{$list} {
    float: right;
  }
}

@mixin loop-grid-columns($columns, $class, $type) {
  @for $i from 0 through $columns {
    @include calc-grid-column($i, $class, $type);
  }
}

@include float-grid-columns(xs);

@media (min-width: $screen-sm-min) {
  @include float-grid-columns(sm);
  @include loop-grid-columns($grid-columns, sm, offset);
}

@media (min-width: $screen-md-min) {
  @include float-grid-columns(md);
}

@media (min-width: $screen-lg-min) {
  @include float-grid-columns(lg);
}

.navbar-brand {
  float: right;
}

@media (min-width: $screen-sm-min) {
  .navbar-header {
    float: right;
  }

  .navbar {
    & > {
      .container, .container-fluid {
        .navbar-brand {
          margin-right: -15px;
          margin-left: 0;
        }
      }
    }
  }

  .navbar-nav {
    float: right !important;
    & > {
      li {
        float: right;
      }
    }
  }

  .navbar-right {
    float: left !important;
    margin-left: -15px;
    margin-right: 0;
    .dropdown-menu {
      right: 0;
      left: auto;
      & > {
        li {
          a {
            text-align: right;
          }
        }
      }
    }
  }

  .productsSortForm {
    float: left;
    margin-left: 0;
    margin-right: 10px;
  }

  .product-count {
    float: right;
  }

  .compare-form {
    float: left;
    margin-left: 0;
    margin-right: 10px;
  }
}

.nav-tabs {
  & > {
    li {
      float: right;
      & > {
        a {
          margin-right: 0;
          margin-left: 5px;
        }
      }
    }
  }
}

th {
  text-align: right;
}

.close {
  float: left;
}

.product-label-container {
  right: 0;
  left: auto;
  .product-label {
    float: right;
  }
}

.product-label {
  margin: 4px 4px 0 0;
  font-weight: 700;
  &:last-of-type {
    margin-right: 4px;
    margin-left: 0;
  }
}

.breadcrumb > li + li:before {
  content: ">";
}

.price-percent-reduction {
  direction: ltr !important;
}

.pager {
  .previous {
    & > {
      a, span {
        float: right;
      }
    }
  }
  .next {
    & > {
      a, span {
        float: left;
      }
    }
  }
}

.radio label,
.checkbox label {
  padding-left: 0;
  padding-right: 20px;
}

.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
  margin-left: 0;
  margin-right: -20px;
}

.radio-inline, .checkbox-inline {
  padding-left: 0;
  padding-right: 20px;
}

.pull-right {
  float: left !important;
}

.pull-left {
  float: right !important;
}

.btn-group, .btn-group-vertical {
  & > {
    .btn {
      float: right;
    }
  }
}

.btn-group {
  .btn {
    & + {
      .btn, .btn-group {
        margin-left: 0;
        margin-right: -1px;
      }
    }
    &:first-child {
      margin-right: 0;
      margin-left: -1px;
    }
  }
  .btn-group {
    & + {
      .btn, .btn-group {
        margin-left: 0;
        margin-right: -1px;
      }
    }
  }
}

.block {
  .products-block {
    li {
      .products-block-image {
        float: right;
        margin-right: 0;
        margin-left: 15px;
      }
    }
  }
  .list-block li {
    padding: 6px 6px 6px 0;
  }
}

.rte ul {
  padding-left: 0;
  padding-right: 15px;
}

.cart_quantity_button {
  .btn {
    float: right;
    margin-right: 0;
    margin-left: 3px;
    &:last-of-type {
      margin-left: 0;
    }
  }
}

.alert {
  &.alert-warning, &.alert-danger {
    &:before {
      margin-right: 0;
      margin-left: 0.5em;
    }
  }
}

.fancybox-close {
  right: auto;
  left: -18px;
}

.bx-next {
  left: 10px;
  right: auto;
  &:before {
    content: "\f137";
  }
}

.bx-prev {
  right: 10px;
  left: auto;
  &:before {
    content: "\f138";
  }
}

.bx-wrapper .bx-controls-direction a:before {
  padding-left: 0;
  padding-right: 2px;
}

#reduction_percent, #reduction_amount {
  direction: ltr !important;
}

.attribute_list ul li {
  float: right;
  margin-right: 0;
  margin-left: 10px;
}

#color_to_pick_list li {
  float: right;
  margin: 0 0 3px 3px;
}

.quick-view {
  right: auto;
  left: 0;
  border-right: 1px solid #ccc;
  border-left: none;
}

.product-image-container .content_price {
  right: 0;
  left: auto;
}

.product_list.list .product-image-container, .product_list.list .product-description-container, .product_list.list .product-actions-container {
  float: right;
}

.product_list.grid {
  .functional-buttons {
    left: auto;
    right: 0;
    margin-left: 0;
    margin-right: -1px;
    & > div {
      float: right;
    }
  }
}

.sitemap_block ul ul, .categTree ul ul {
  padding-left: 0;
  padding-right: 2em;
}

/* Block search */
.ac_results {
  direction: rtl !important;
  text-align: right;
  li {
    direction: rtl !important;
    text-align: right;
  }
}

/* Top horizontal menu */
.sf-menu {
  & > {
    li {
      float: right;
      border-right: 0;
      border-left: 1px solid #d6d4d4;
      & > {
        ul {
          & > {
            li {
              float: right;
              padding-left: 15px;
              padding-right: 0;
              &.category-thumbnail {
                padding-left: 0;
                & > div {
                  float: right;
                  padding-right: 10px;
                  padding-left: 0;
                }
              }
            }
          }
        }
      }
    }
  }
  li {
    ul {
      right: 0;
      left: auto;
    }
    li {
      li {
        a {
          &:before {
            content: "\f104";
            padding-left: 10px;
            padding-right: 0;
          }
        }
      }
    }
  }
}

#block_top_menu {
  li {
    &.category-thumbnail {
      padding-left: 0;
      div {
        float: right;
      }
    }
  }
}

/* Block cart */
#blockcart-header:after {
  float: left;
}

.cart-images {
  float: right;
  margin-right: 0;
  margin-left: 5px;
}

.cart-info {
  padding-right: 0;
  padding-left: 10px;
}

.cart_block_list .remove_link {
  right: auto;
  left: 0;
}

.cart_block_shipping_cost,
.cart_block_tax_cost,
.cart_block_total,
.cart_block_wrapping_cost {
  float: left;
}

.layer_cart_cart {
  border-left: 0;
  border-right: 1px solid #ccc;
}

#layer_cart {
  right: 0;
  .cross {
    right: auto;
    left: 15px;
  }
}

/* Block categories */
.blockcategories {
  .list-group-item-wrapper {
    .list-group-item {
      margin-right: 0;
      margin-left: 32px;
    }
    .btn-toggle {
      right: auto;
      left: 0;
      border-right: none;
      border-left: 1px solid #ddd;
    }
  }
  .list-group-item {
    &.ilvl-2 {
      padding-left: 15px;
      padding-right: 25px;
    }
    &.ilvl-3 {
      padding-left: 15px;
      padding-right: 35px;
    }
  }
}

/* Block layered */
#layered_form {
  .layered_filter label a span {
    display: inline-block;
    margin-right: 5px;
  }
  #enabled_filters ul li a {
    float: left;
  }
}

.layered_slider_container {
  margin: 6px 10px 6px 0;
}

.icon-angle-right:before {
  content: "\f104";
}

.icon-angle-left:before {
  content: "\f105";
}

.icon-chevron-right:before {
  content: "\f053";
}

.icon-chevron-left:before {
  content: "\f054";
}

/* Fancybox */
.fancybox-button--left::after {
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

.fancybox-button--right::after {
  -webkit-transform: rotate(-135deg);
  -ms-transform: rotate(-135deg);
  transform: rotate(-135deg);
}

/* Product comments */
.star_content {
  .cancel, .start {
    float: right;
    margin-right: 0;
    margin-left: 0.15em;
  }
}

@media (min-width: $screen-sm-min) {
  .comment {
    .comment_details {
      border-right: 1px solid #d6d4d4;
      border-left: 0;
      padding-left: 0;
      padding-right: 15px;
    }
  }
}
