/* Include Default Variables & Mixins */
@import "variables.scss";
@import "mixins.scss";
/* End Variables & Mixins */

/**************************************************
* --
* - 0. Reset
* --
**************************************************/
ul {
  margin-right: 10px;
  margin-left: 0;
  li {
    margin-right: 10px;
    margin-left: 0;
  }
}
h1#page-title {
  margin-left: 0;
  margin-right: 10px;
}

/* Tweaks for Safari + Chrome. */
@media (-webkit-min-device-pixel-ratio: 0) {
  select,
  select[size] {
    background-image: url('../images/select-arrow-rtl.gif');
    background-position: left center;
    padding-left: 20px;
    padding-right: 3px;
  }
}
/* Override addressfield */
.addressfield-container-inline > div.form-item {
  float: right;
  margin-right: auto;
  margin-left: 1em;
}
/*******************************************
* 2.1.1. Region user first
*******************************************/
#region-user-first {
  float: right;
}
/* User menu */
.block-menu-user-menu .content {
  ul.menu {
    float: left;
    li {
      float: right;
    }
  }
}
/*******************************************
* 2.1.2. Region user second
*******************************************/
#region-user-second {
  float: left;
}
/**
* Cart block
*/
.block-shopping-cart-block {
  margin-left: 0 !important;
  margin-right: 50px !important;

  .content {
    background-position: 99% 48%;
    float: left;
    margin-left: 0px;
    padding-left: 0px;
    margin-right: -60px;
    padding-right: 50px;
    .view-shopping-cart {
      .view-content,
      .view-footer,
      .view-empty,
      .view-empty p,
      .line-item-summary,
      .line-item-total,
      ul.links {
        float: right !important;
      }
      ul.links {
        float: left !important;
        margin: 0 5px 0 0px !important;
      }
      .view-footer {
        float: none;
      }
    }
  }
}
/**********************************************
* 2.2. Zone branding
**********************************************/
/**
* Search block
*/
#block-views-exp-display-products-page .views-exposed-widgets {
  float: left !important;
  margin-right: 0 !important;
  margin-left: 10px;
}

#block-views-exp-display-products-page .form-text {
  padding: 5px 5px 5px 28px !important;
}
#block-views-exp-display-products-page .views-submit-button {
  right: auto !important; /* RTL */
  left: 5px;
  .form-submit {
    background-position: 2% 50% !important;
  }
}
/**********************************************
* 2.3. Zone menu
**********************************************/
/**
* Navigation
*/
.menu-toggle {
  left: auto;
  right: 10px;
  .toggle-help {
    left: auto;
    right: 45px;
  }
}
/**************************************************
* --
* 3. Section content
* --
**************************************************/
/**********************************************
* 3.1. Zone preface
**********************************************/
/**
* Pseudo Breadcrumb
*/
#region-breadcrumb {
  .pseudo-breadcrumb-total-results {
    margin: 0 10px 0 0;
  }

  .pseudo-breadcrumb {
    padding: 10px 5px 35px 21px;

    li {
      display: inline;
      float: right;
      a {
        float: right;
        margin: 0 0 0 5px;
      }
    }
  }
}
/**********************************************
* 3.2. Zone content
**********************************************/
.form-item-quantity {
  .ui-corner-tr {
    @include rounded-corners(4px 0 0 0);
  }
  .ui-corner-br {
    @include rounded-corners(0 0 0 4px);
  }
  .ui-icon-triangle-1-n {
    background-position: 2px -16px;
  }
}
/*******************************************
* 3.2.1. Sidebar first
*******************************************/
/* Search api facet blocks */
.region-sidebar-first .block-facetapi {
  direction: ltr;
  text-align: right;

  margin-right: 15px;
  margin-left: 0px !important;
  padding-right: 15px;
  padding-left: 0px !important;


}
/* Price range */
#search-api-ranges-block-slider-view-form {
  .range-box,
  label,
  #edit-range-from,
  #edit-range-to {
    float: right !important;
  }
}
/**********************************************
* 3.3. Zone postscript
**********************************************/
.region-postscript-third {
  margin-left: 0;
}
.zone-postscript .grid-8 {
  float: right !important;
}
#zone-postscript {
  .block-blog-block .block-inner {
    .block-title {
      background: transparent url('../images/bg_block_homepage_title-rtl.png') 118% 100% no-repeat;
      padding-right: 25px;
      padding-left: 0;
      left: auto;
      right: -1px;
      text-align: right;
    }
  }
}
/**************************************************
* --
* 4. Section footer
* --
**************************************************/
#zone-footer {
  direction: ltr;
}
/**********************************************
* 4.1. Zone footer
**********************************************/
/**
* Connect with us
*/
#block-menu-menu-social-connection {
  h2 {
    text-align: right;
  }
  .content ul.menu {
    li {
      a {
        background-position: 98% 50%;
        padding-left: 0;
        padding-right: 50px;
      }
    }
  }
}
/**********************************************
* 4.2. Zone footer2
**********************************************/
/**
* Payment blocks
*/
#block-menu-menu-payment-methods {
  ul.menu {
    li {
      float: right;
      &:first-child {
        padding-left: 0px;
        padding-right: 10px;
      }
    }
  }
}
/**************************************************
* --
* 5. Commerce specific
* --
**************************************************/
/**********************************************
* 5.1. Search & Collection page
**********************************************/
/**
* Collection page
*/
.view-collection-products .view-header,
.view-collection-taxonomy-term .view-header {
  .taxonomy-title {
    left: 0 !important;
    right: 10px;
  }
  .view-collection-products,
  .collection-terms {
    .view-content {
      .item-list {
        /* List of categories related to a collection */
        float: right !important;
        margin-right: 0 !important;
        margin-left: 6px;
      }
    }
  }
}

.view-collection-products .view-content .item-list .products-per-collection li,
.view-collection-taxonomy-term .view-content .item-list .products-per-collection li {
  &.views-row {
    float: right !important;
  }
  &.views-row.last {
    padding-left: 0 !important;
  }

  .field-name-field-color .vocabulary-color,
  .views-field-field-extractor-field-product ul li {
    float: right !important;
    margin: 0 0 0.5em 0.5em;
  }
}
/**********************************************
* 5.2. All products page
**********************************************/
.page-products {
  .view-display-products {
    li {
      &.views-row {
        float: right !important;
        padding-right: 0 !important;
        padding-left: 5px;
        &.last {
          padding-left: 0 !important;
        }
      }
      &:nth-child(3n) {
        padding-left: 0!important;
      }
      &:nth-child(3n+4) {
        clear: right !important;
        float: right !important;
      }
    }
  }
}
/**
* Search sort block
*/
.block-search-api-sorts {
  .block-inner {
    float: left;
    clear: left;

    h2.block-title {
      float: right;
      margin-right: 0 !important;
      margin-left: 5px;
    }
  }
  .content {
    float: right;
    ul.search-api-sorts {
      li {
        float: right;
        margin-right: 0 !important;
        margin-left: 5px;

        span a {
          right: auto;
          left: 0;
          margin-right: 0;
          margin-left: 5px;
        }
        .search-api-sort-active {
          padding-right: 12px;
          padding-left: 25px;

          .search-api-sort-remove {
            float: left;
            text-indent: -9999px;
          }
        }
      }
    }
  }
}
.page-products .view-display-products li {
  .field-name-field-color .vocabulary-color,
  .views-field-field-extractor-field-product ul li {
    float: right;
    margin: 0 0 0.5em 0.5em;
  }
}
/**********************************************
* 5.3. Product page
**********************************************/
/**
* Add to cart popin.
*/
div.messages.commerce-add-to-cart-confirmation {
  .message-inner {
    .added-product-title {
      padding: 10px 10px 10px 30px;
    }
    .view-confirm-message-product-display {

      .view-content {
        text-align: right;

        .views-field-commerce-product {
          .content {
            .field-name-field-images {
              right: 0;
              img {
                text-align: right;
              }
            }
            .commerce-product-sku .commerce-product-sku-label {
              float: right; /* RTL */
              padding-right: 0;
              padding-left: 5px;
            }
            .commerce-product-sku,
            .field {
              margin-right: 0;
              margin-left: 20px;
            }
            .commerce-product-title-label,
            .commerce-product-status-label {
              float: right; /* RTL */
            }
          }
        }
        .views-field-quantity {
          .views-label-quantity {
            float: right; /* RTL */
            padding-right: 0;
            padding-left: 5px;
          }
        }
        .views-field-commerce-total {
          .views-label-commerce-total {
            float: right;
            padding-right: 0;
            padding-left: 5px;
          }
          .field-content {
            float: left;
          }
        }
        .field-label {
          padding-right: 0;
          padding-left: 5px;
          float: right;
        }
      }
    }
    .commerce-add-to-cart-confirmation-close {
      right: auto;
      left: 15px;
    }
  }
  .views-field-title {
    text-align: right;
  }
}

.node-product-type {
  .field-name-body {
    .read-more a,
    .read-less a {
      background-position: right top;
      padding-right: 0;
      padding-left: 20px;

    }
  }
  .field-type-commerce-product-reference {
    form.commerce-add-to-cart {
      .attribute-widgets {
        .form-item {
          div#edit-attributes-field-color {
            float: right;
          }
        }
        .form-item-attributes-field-color {
          .form-item.form-item-attributes-field-color {
            float: right;
            margin-right: 0;
            margin-left: 5px;
          }
        }
      }
      label {
        float: right;
        margin-right: 0;
        margin-left: 5px;
      }
      .form-submit {
        background-position: 10% 50%;
        margin-right: 5px;
        margin-left: 0;
        padding: 5px 10px 5px 50px;
      }
    }
  }
}

.service-links {
  float: left;

  ul li {
    float: right;
    &:first {
      margin-right: 0;
      margin-left: inherit;
    }
  }
}
/**********************************************
* 5.4. Checkout process
**********************************************/
/**
* Checkout progress
*/
ul.inline.commerce-checkout-progress,
ol.inline.commerce-checkout-progress {
  margin-left: 10px;
  li {
    float: right; /* RTL */
    padding: 15px 35px 15px 15px;
    &:after {
      background: transparent url('../images/bg_checkout_progress-rtl.png') left center no-repeat;
      float: left;
      right: auto;
      left: -25px;
    }
    &.last:after {
      background: #efefef url('../images/bg_checkout_progress_last-rtl.png') left center no-repeat;
    }
    &.active,
    &.last.active {
      &:after {
        background: transparent url('../images/bg_checkout_progress_active-rtl.png') left center no-repeat;
      }
    }
  }
}
/**
* Shopping cart page
*/
#views-form-commerce-cart-form-default,
#commerce-checkout-form-checkout .view-commerce-cart-summary,
#commerce-checkout-form-review .view-commerce-cart-summary,
.page-user-orders .view-commerce-line-item-table /* Review completed order */,
.view-commerce-backoffice-user-orders {
  table {
    th {
      text-align: right;
    }
    td {
      &.views-field-nothing {
        .commerce-product-sku-label,
        .commerce-product-status-label {
          float: right; /* RTL */
        }
      }
    }
    .views-field-edit-delete,
    .views-field-commerce-total {
      text-align: left;
    }
  }

}
.page-user-orders .view-commerce-line-item-table table td {
  direction: ltr; /* RTL */
  text-align: right; /* RTL */
}
/* Order total table */
.field-name-commerce-order-total {
  .field-items {
    float: left;

    table.commerce-price-formatted-components {
      td {
        &.component-title {
          text-align: right;
        }
      }
    }
  }
}

/* Checkout button */
.page-checkout {
  #commerce-checkout-form-checkout,
  #commerce-checkout-form-shipping,
  #commerce-checkout-form-review {
    .checkout-buttons {
      input#edit-cancel,
      input#edit-back {
        margin: 0 5px 0 20px;
      }
      input#edit-continue {
        margin: 0 0 0 10px;
      }
    }
  }
}

.page-cart #views-form-commerce-cart-form-default {
  /* Button styling */
  .commerce-line-item-actions {
    input#edit-submit {
      margin-right: 0;
      margin-left: 20px;
    }
  }
}
/**
* Checkout page
* Review order page
* Checkout complete page
*/
.page-checkout {
  .checkout-help {
    margin: 0 10px 10px 0;
  }
  #commerce-checkout-form-checkout,
  #commerce-checkout-form-review {
    fieldset {
      &.customer_profile_billing,
      &.customer_profile_shipping {
        .locality-block {
          .form-item {
            float: right;

            label {
              float: none !important;
            }
          }
        }
      }
      legend {
        span {
          padding-right: 10px;
          padding-left: 0;
        }
      }
    }
  }
}
/**
* Shipping page
*/
.page-checkout-shipping .form-item-commerce-shipping-shipping-service {
  clear: right;
  float: right;

  label {
    padding: 0 10px 0 0;
  }

}
/**
* Review order page
*/
.page-checkout-review {
  #commerce-checkout-form-review {
    .checkout-help {
      margin: 0 10px 10px 0;
    }
    /* Payment information */
    fieldset.commerce_payment .fieldset-wrapper {
      label {
        float: none !important;
      }
    }
  }
}

/* Page user review order */
.page-user-orders {
  .field-name-commerce-customer-billing,
  .field-name-commerce-customer-shipping {
    float: right;
    margin: 5px 0 0 3%;
  }
}

/* Order history */
.view-commerce-backoffice-order-messages {
  th {
    text-align: right;
  }
}

/* Comment form */
#commerce-backoffice-order-message-form {
  fieldset {

    .fieldset-wrapper {

      .form-item label {
        float: right;
        padding-right: 0;
        padding-left: 8px;
        text-align: left;

      }
      .form-textarea-wrapper {
        float: right;
      }
    }
  }
}
/**************************************************
* --
* 7. Blog
* --
**************************************************/
/**************************************************
* --
* 8. Comments
* --
**************************************************/
article.comment {
  header em {
    float: left;
  }
}
/* Comment form */
.comment-wrapper {
}
.comment-form {
  .form-item {
    clear: right;
    label {
      float: right;
      padding-right: 0;
      padding-left: 8px;
      text-align: left;
      &:after {
        clear: both;
        content: ":";
      }
    }
    .form-radios,
    .form-checkboxes {
      float: right !important;
      label {
        float: inherit;
        text-align: inherit;
        width: auto;
      }
    }
  }
  .form-textarea-wrapper {
    float: right;
  }
}
/* Comment links */
.links.node-links {
  float: left;
  margin-right: 0px;
  margin-left: 15px;
}
/**************************************************
* --
* 9. User account
* --
**************************************************/
.page-user,
.page-checkout {
  /* Registration form */
  form#user-register-form,
  form#user-profile-form {
    .password-suggestions {
      ul {
        margin-right: 20px;
        margin-left: 0;

      }
    }
    .form-actions {
      .form-submit {
        float: right;
      }
      .back-to-login {
        float: left;
        .login-account {
          float: right;
        }
      }
    }
  }
  /* Password form */
  form#user-pass {
    .form-actions {
      float: right;
      margin-right: 0;
      margin-left: 20px;
    }
    .back-to-login {
      float: left;
    }
  }
}

/* User home */
.page-user {
  .profile {
    ul {
      &.user-information {
        li {
          float: right;
        }
      }
      &.user-recent-orders {
        list-style: none;
        list-style-image: none;

        li {
          list-style: none;
          list-style-image: none;
        }
      }
    }
  }
  .tabs ul {
    /* User primary menu/tabs */
    &.primary {
      li {
        float: right;
      }
    }
    /* User secondary menu/tabs */
    &.secondary {

      li {
        border-right: auto;
        border-left: 0 transparent;
        float: right;
      }
    }
  }
}

/* Address book */
.page-user-addressbook {
  .view-commerce-addressbook-defaults .views-field {
    float: right;
    margin: 0 0 20px 15px;
  }
  .view-commerce-addressbook td {

    .views-field {
      margin: 0 0 15px 15px;

      .ajax-progress-throbber { /* Positions the throbber */
        position: absolute;
        right: auto;
        left: 0;
      }
    }
  }
}
