/**
 * File: yarn_module.css
 *
 * Every css rule is pre-fixed with .yarn-package to preserve
 * some sort of namespacing.
 *
 * Table of Content:
 *  1. Global Rules
 *  2. Product Package Title
 *  3. Datasheet
 *  4. Package Selector & Container
 *  5. Quantity Input
 *  6. Package Products List
 *  7. Price & Quantity
 *  8. Color Picker Container
 *  9. Misc. CSS Rules
 *  10. Attributes Selector and Attribute
 *  11. Package Product Price
 *  12. Package Total Price
 *
 */

/**
 * ================================================================
 * 1. Yarn product package - Global Rules
 * ================================================================
 */
.yarn-package {
    color: #222;
}

.yarn-package h1,
.yarn-package h2,
.yarn-package h3,
.yarn-package h4,
.yarn-package h5,
.yarn-package h6 {
    text-transform: none;
}

.yarn-package p {
    font-size: 16px;
}

.yarn-package table {
    margin-bottom: 0;
}

.yarn-package .font-bold {
    font-weight: bold;
}

/**
 * ================================================================
 * 2. Yarn product package - Title
 * ================================================================
 */
.yarn-package .product-package-title {
    font-size: .8em;
    display: flex;
    flex-direction: column;
}

.yarn-package .product-package-title > p:first-of-type {
    line-height: 1.4em;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 1.2em;
}

.yarn-package .product-package-title > p:nth-child(n+2):last-of-type {
    margin-top: auto;
    margin-bottom: 0;
}

/**
 * ================================================================
 * 3. Yarn product package - Datasheet
 * ================================================================
 */
.yarn-package .package-datasheet .product-buy-box {
    padding: 2em 1em;
}

.yarn-package .package-datasheet table td {
    border-top: none;
}

/**
 * ================================================================
 * 4. Yarn product package - Package Selector & Container
 * ================================================================
 */
.yarn-package .product-package-selector {
    padding: 15px 20px;
    border: 1px solid #888;
    background-color: #fff;
    border-radius: 2px;
    width: 100%;
}

.yarn-package .product-package-selector span {
    line-height: 1.1em;
    max-height: 1.1em;
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yarn-package .product-package-selector-container li.selected .product-package-selector {
    background-color: #eee;
}

/**
 * ================================================================
 * 5. Yarn product package - Quantity Input
 * ================================================================
 */
.yarn-package .product-package-products li input[type="number"] {
    padding: 5px 10px;
    font-size: 1em;
    line-height: 1em;
    border: 1px solid #222;
    border-radius: 2px;
    width: 100%;
}

@media (min-width: 767px) {
    .yarn-package .product-package-products li input[type="number"] {
        width: 60px;
        float: right;
    }
}

/**
 * ================================================================
 * 6. Yarn product package - Package Products List
 * ================================================================
 */
.yarn-package .product-package-products li {
    list-style: none;
    width: 100%;
    float: left;
    padding-top: 20px;
    padding-bottom: 20px;
    border-top: dashed 1px #ddd;
}

.yarn-package .product-package-products li > * {
    float: left;
}

.yarn-package .product-package-products li img {
    width: 100%;
}

.yarn-package .product-package-attribute-image-container {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (min-width: 430px) {
    .yarn-package .product-package-attribute-image-container {
        height: 70px;
    }
}

@media (min-width: 530px) {
    .yarn-package .product-package-attribute-image-container {
        height: 80px;
    }
}

@media (min-width: 630px) {
    .yarn-package .product-package-attribute-image-container {
        height: 100px;
    }
}

@media (min-width: 730px) {
    .yarn-package .product-package-attribute-image-container {
        height: 110px;
    }
}

@media (min-width: 992px) {
    .yarn-package .product-package-attribute-image-container {
        height: 40px;
    }
}

.yarn-package .product-package-products li .product-package-attribute-image-container img {
    width: 100%;
    height: auto;
}

/**
 * ================================================================
 * 7. Yarn product package - Price & Quantity
 * ================================================================
 */
.yarn-package .product-package-product-price {
    font-size: 1em;
}

.yarn-package .product-package-loading-qty {
    font-size: .7em;
}

/**
 * ================================================================
 * 8. Yarn product package - Color Picker & Container
 * ================================================================
 */
.yarn-package .open-color-picker {
    font-size: .8em;
    cursor: pointer;
}

@media (max-width: 768px) {
    .yarn-package .color-picker-parent {
        padding-left: 0;
    }
}

/**
 * ================================================================
 * 9. Yarn product package - Misc. CSS Rules
 * ================================================================
 */
.yarn-package .product-package-products-container {
    margin-top: 40px;
}

@media (max-width: 768px) {
    .yarn-package .product-package-products-container li > div[class^="col-"],
    .yarn-package .product-package-total > div[class^="col-"] {
        padding-left: 0;
        padding-right: 0;
    }
}

/**
 * ================================================================
 * 10. Yarn product package - Attributes Selector and Attribute
 * ================================================================
 */
.yarn-package .product-package-attributes-selector {
    display: inline-block;
    width: 100%;
    padding: 15px 0 0 0;
}

.yarn-package .product-package-attribute {
    float: left;
    cursor: pointer;
    padding-top: 15px;
    padding-bottom: 15px;
}

.yarn-package .product-package-attribute img {
    width: 100%;
}

.yarn-package .product-package-attribute p {
    margin-bottom: 0;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1em;
    max-height: 2em;
    overflow: hidden;
    height: 2em;
}

.yarn-package .product-package-attribute.selected {
    background-color: #eee;
}

/**
 * ================================================================
 * 10. Yarn product package - Attribute Selector Container
 * ================================================================
 */
.yarn-package .product-package-selector-container li {
    display: inline-block;
    margin-bottom: 2%;
    width: 31%;
    margin-right: 1%;
}

@media (min-width: 768px) {
    .yarn-package .product-package-selector-container li {
        width: 32%;
        margin-right: 1%;
    }
}

@media (min-width: 992px) {
    .yarn-package .product-package-selector-container li {
        width: 48%;
        margin-right: 1%;
    }
}

@media (min-width: 1200px) {
    .yarn-package .product-package-selector-container li {
        width: 30%;
        margin-right: 2%;
    }
}

@media (min-width: 1400px) {
    .yarn-package .product-package-selector-container li {
        width: 25%;
        margin-right: 3%;
    }
}

/**
 * ================================================================
 * 11. Yarn product package - Package Product Price
 * ================================================================
 */
.yarn-package .product-package-price {
    justify-content: flex-end;
    flex-direction: column;
    text-align: right;
    display: flex;
}

.yarn-package .product-package-price > *:last-child {
    margin-top: auto;
}

.yarn-package .product-package-price > *:last-child p {
    margin-bottom: 0;
}

/**
 * ================================================================
 * 12. Yarn product package - Package Total Price
 * ================================================================
 */
.yarn-package .product-package-total {
    margin-top: 15px;
    float: left;
    width: 100%;
}

.yarn-package .product-package-total p {
    float: left;
    font-weight: bold;
    line-height: 1.1em;
    font-size: 2em;
    margin: 0;
}

@media (max-width: 767px) {
    .yarn-package .product-package-total p {
        padding-bottom: 20px;
    }
}

.yarn-package .product-package-total button {
    margin-left: auto;
    padding: 0 40px;
}
