@import "../../../style/mixin";

@include export-module('co-shopping-cart-preview-layout') {
  .co-shopping-cart-preview {
    display: block;
    font-family: $tp-shopping-cart-preview-font-family;
    font-size: $tp-shopping-cart-preview-font-size;
    padding: $tp-shopping-cart-preview-padding;
    border: none;
    box-shadow: none;
    &:not(.borderless) {
      border: $tp-shopping-cart-preview-border;
      box-shadow: $tp-shopping-cart-preview-box-shadow;
    }
    .cart-header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-content: center;
      font-family: $tp-shopping-cart-preview-header-font-family;
      font-size: $tp-shopping-cart-preview-header-font-size;
      margin: $tp-shopping-cart-preview-header-margin;
      text-transform: $tp-shopping-cart-preview-header-text-transform;
      font-weight: $tp-shopping-cart-preview-header-font-weight;

      .type-buttons {
        display: flex;
        flex-direction: row;
        column-gap: 5px;

        .co-button {
          height: 30px;
          width: 30px;
          .co-icon {
            height: 20px;
            width: 20px;
          }
        }

        .trans-type-selected {
          background-color: $tp-color-action;
          co-icon {
            svg { // for fontawesome icons
              fill: white;
            }
            & [fill] { // for own icons
              fill: white;
            }
          }
        }
      }
    }
    .cart-lines {
      max-height: $tp-shopping-cart-preview-cart-lines-height;
    }
    .co-image-display .no-image .no-image-label {
      font-size: 8px;
    }

    .co-transaction-line {
      padding: $tp-shopping-cart-preview-cart-lines-padding;
      .transaction-field-label {
        display: none;
      }
    }
    .preview-totals-wrapper {
      display: flex;
      justify-content: flex-end;
      margin: $tp-shopping-cart-preview-totals-margin;
      .co-transaction-totals {
        width: 250px;
      }
    }
    .cart-buttons {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      column-gap: $tp-shopping-cart-preview-buttons-column-gap;
      margin: $tp-shopping-cart-preview-buttons-margin;
    }
    .button-edit-cart {
      cursor: pointer;
    }
    .co-transaction-line-image-and-description {
      align-items: center;
      .transaction-line-description {
        height: auto;
      }
    }
    .co-transaction-base-line {
      .transaction-line-totals {
        display: flex;
        align-items: center;
        gap: 15px;
        .transaction-line-totals-price {
          border: none;
          padding: 0;
        }
        .transaction-line-totals-amount {
          height: 20px;
          max-width: 80px;
        }
        .transaction-line-totals-total {
          border: none;
        }
      }
      .transaction-line-section {
        margin-right: 0;
      }
      .transaction-base-line-section {
        flex: 2;
        &.preview-margin {
          flex: 1;
          justify-content: end;
        }
        .transaction-line-wrapper {
          justify-content: flex-end;
        }
      }
      .transaction-base-line-wrapper {
        flex-direction: column;
        gap: 15px;
      }
    }
  }
}
