@import '_theme.scss';

.item-box-container {
  display: flex;
  position: relative;
  max-height: 1000px;
  transition: max-height 1s 2s;

  &.close-item {
    overflow: hidden;
    max-height: 0;
  }

  .item-box {
    width: 100%;
    padding: 20px;
    border-bottom: 2px solid var(--color-line);
    flex-direction: column;
    position: relative;
    transition: left 1.1s;
    left: 0;
    display: inline-grid;
    grid-template-columns: 20px min-content auto min-content;
    grid-template-rows: min-content min-content;
    grid-column-gap: 20px;
    grid-row-gap: 0;

    @media (min-width: $lg) {
      &:not(.has-selection)  {
        grid-template-columns: min-content auto min-content;
      }
    }

    @media (max-width: $lg) {
      padding: 20px 30px;
      grid-template-columns: min-content auto min-content;
      grid-template-rows: min-content min-content min-content;
      grid-column-gap: 20px;
      grid-row-gap: 12px;
    }

    @media (max-width: $md) {
      grid-template-columns: min-content min-content;
      grid-template-rows: min-content min-content min-content min-content;
      grid-column-gap: 20px;
      grid-row-gap: 12px;
    }
    &.move-right {
      left: 110%;
    }

    .cart-item-checkbox-cell {
      align-self: center;

      @media (max-width: $md) {
        display: none;
      }

      @media (max-width: $lg) {
        display: none;
      }

    }

    .item-description {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      height: 100%;

      @media (max-width: $md) {
        grid-row: 2;
        grid-column: 2 / span 2;
        width: 100%;
      }

      .title-box {
        order: 1;
        @media (max-width: $lg) {
          display: none;
        }
      }

      .price {
        display: none;
        order: 2;

        @media (max-width: $md) {
          display: block;
          font-size: var(--text-size-label);
          margin-bottom: 8px;
        }
      }

      .cart-item-properties {
        order:4;
      }

      .total {
        font-size: var(--text-size-regular);
        color: var(--text-color-ultra-dark);
        position: relative;
        top: 5px;
        flex: 1;
        display: flex;
        align-items: flex-end;
        order:5;

        @media (max-width: $md) {
          order:3;
          top:0;
          font-size: var(--text-size-fineprint);
          color: var(--text-color-dark);
          flex:0;
          padding-bottom: 8px;
          .total-quantity, .quantity-units, .total-label, .product-units-singular {
            display: none;
          }
        }
      }
    }

    .item-actions {
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      width: 160px;
      min-width: 160px;

      @media (max-width: $md) {
        grid-row: 3;
        grid-column: 1 / span 3;
        width: 100%;
        justify-content: space-around;
        flex-direction: row;

        .bracket-open, .quantity, .quantity-base, .dividing-slash, .pack-singular, .bracket-close {
          display: none;
        }
      }

      .total {
        display: none;
        color: var(--text-color-ultra-dark);

        @media (max-width: $md) {
          display: block;
          position: unset;
          width: 100%;
        }
      }

      .price {
        font-size: var(--text-size-label);
        align-self: flex-end;
        margin: 0;

        @media (max-width: $md) {
          display: none;
        }

        &.highlight {
          font-size: var(--text-size-h4);
          color: var(--color-highlight);

          @media (max-width: $lg) {
            font-size: var(--text-size-h4);
          }
        }
      }

    }

    .cart-item-warning-error-messages {
      grid-column: 3;
      grid-row: 2;

      &.warning-in-list-mode{
        grid-column: 2;

        @media (max-width: $lg) {
          grid-column: 1 / span 3;
        }

      }

      @media (max-width: $lg) {
        grid-column: 1 / span 3;
        grid-row: 3;
      }

      @media (max-width: $md) {
        grid-row: 4;
      }

      @media (min-width: $lg) {
        padding-top: 15px;
      }

    }

    .mobile-title-container {
        display: none;

      @media (max-width: $lg) {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        grid-row:1;
        grid-column: 1 / span 3;

        .mobile-product-name {
          display: flex;

          .cart-item-checkbox-cell {
            margin-top: 5px;
            display: block;
          }

          .nickname-box {
            display: none;
          }
        }


      }
    }
  }
}

.wish-list {
  .item-box {
    .cart-item-warning-error-messages {
      @media (min-width: $lg) {
        grid-column: 2;
      }
    }
  }
}
