/*
    Template Name:  Search
    Template URI:   http://en.michaeluno.jp
    Author:         Michael Uno
    Author URI:     http://en.michaeluno.jp
    Description:    Displays Amazon products for search units.
    Version:        1.3.0
    License:        GNU General Public License v2 or later
    Licedisplay: inline-block;nse URI:    http://www.gnu.org/licenses/gpl-2.0.html
    Tags:           default
    Text Domain:    amazon-auto-links
*/
.amazon-products-container-search {
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  padding-right: 1em;

  a {
    text-decoration: none;
  }

  .amazon-product-container {

    width: 100%;
    display: table;
    clear: both;
    margin-bottom: 20px;
    font-size: 100%;

    // Descriptions
    /// Word-wrap
    .amazon-product-description {
      // These are technically the same, but use both
      overflow-wrap: break-word;
      word-wrap: break-word;

      -ms-word-break: break-all;
      // This is the dangerous one in WebKit, as it breaks things wherever
      word-break: break-all;
      // Instead use this non-standard one:
      word-break: break-word;

      // Adds a hyphen where the word breaks, if supported (No Blink
      -ms-hyphens: auto;
      -moz-hyphens: auto;
      -webkit-hyphens: auto;
      hyphens: auto;

      // For the disclaimer to continue
      display: inline;
      margin-right: 0.5em;

      vertical-align: middle;
    }

    // Meta
    .amazon-product-meta {
      display: inline;
      margin-right: 0.4em;
      vertical-align: middle;
    }

  }

  // Thumbnails
  .amazon-product-thumbnail-container {
    width: 100%;
  }
  .amazon-product-thumbnail {
    margin: 20px auto;
    text-align: center;
    img {
      max-width: 100%;
      margin-left: auto;
      margin-right: auto;
    }
  }

  // Prices
  .amazon-product-author,
  .amazon-product-price,
  .amazon-product-discounted-price,
  .amazon-product-lowest-new-price,
  .amazon-product-lowest-used-price {
    font-size: 92%;
  }
  .amazon-product-lowest-new-price-value,
  span.offered-price {
    color: #B12704;
    font-weight: bold;
  }

  // Discounts
  .amazon-prices,
  .amazon-discount {
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
  }

  // Customer Reviews
  .amazon-customer-reviews {
    word-break: break-all;
    .review-date {
      font-size: 92%;
    }
    .review-title {
      font-weight: bold;
    }
    .review-image-tile {
      display: inline-block;
      max-height: 140px;
      max-width: 200px;
      margin: 0.2em;
    }
  }
  .crIFrameNumCustReviews {
    display: inline-block;
  }

  // Rating Stars
  span.asinReviewsSummary > a > img,
  .amazon-customer-reviews img,
  span.crVotingButtons > nobr > a > img {
    display: inline-block;
  }
  .reviews-voting-stripe {
    border-right: 0 !important;
  }
  .amazon-customer-rating-stars {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    font-size: 100%;
    img {
      // Prevents rating stars from being wrapped
      display: inline-block;
      // In some themes the rating number and the star image do not align. This is for the fix.
      vertical-align: middle;
    }
  }
  .crIFrameNumCustReviews .crAvgStars {
    white-space: nowrap;
  }
  .review-stars svg {
    vertical-align: bottom;
  }

  // Sub-images
  .sub-image-container {
    display: inline-block;
    clear: none;
    margin: 1em;
  }

  // Buttons
  .amazon-auto-links-button-container {
    width: 100%;
    margin-top: 1em;
    margin-bottom: 1em;
  }

  // Pricing Disclaimer
  .pricing-disclaimer {
    a.amazon-disclaimer-tooltip {
      outline: none;
      strong {
        line-height: 30px;
      }
      > span.amazon-disclaimer-tooltip-content {
        > .amazon-disclaimer-tooltip-content-text {
          z-index: 999;
          display: none;
          padding: 14px 20px;
          margin-top: -30px;
          margin-left: 28px;
          width: 300px;
          line-height: 16px;
          border-radius: 4px;
          box-shadow: 5px 5px 8px #CCC;
        }
      }
    }
    a.amazon-disclaimer-tooltip:hover {
      text-decoration: none;

      > span.amazon-disclaimer-tooltip-content {
        display: inline;
        position: relative;

        > .amazon-disclaimer-tooltip-content-text {
          display: inline;
          float: right;
          position: absolute;
          color: #111;
          border: 1px solid #DCA;
          background: #fffAF0;

          // Adjust the pop up element position
          margin-left: -100px;
          margin-top: -140px;
        }
      }
    }
  }

  // Contents %content%
  .amazon-product-content * {
    width: auto !important;
    max-width: 100% !important;
  }

  // Similar Products
  .amazon-similar-products .amazon-similar-product {
    display: inline-block;
    margin: 1em;
    > img {
      max-width: 100%;
      margin-left: auto;
      margin-right: auto;
      vertical-align: middle;
    }
  }

  // Prime Icon
  .amazon-prime {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    padding-top: 2px;
    svg {
      height: 1.4em;
      margin-right: 0.2em;
    }
  }
  .prime-icon {
    display: inline-block;
    width: 68px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom;
    position: relative;
    /*top: 2px;*/
  }

  // Categories
  ul.categories {
    list-style-type: none;
    margin: 0.4em 0;
  }

  // Features
  ul.features {
    margin: 0.4em 0;
  }

}

// Widgets
/// Sub-images
.widget-area .amazon-products-container-search .sub-image-container {
  margin: 0.4em 0.4em 0 0;
}
/// Contents
.widget .amazon-products-container-search .amazon-product-content * {
  width: auto;
  display: inline-block;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;

}