@import 'moda-themes/themes';
@import '../shared/constants/breakpoints.scss';

.grid-cell {
  padding: 8px;
  vertical-align: top;

  * {
    box-sizing: border-box;
  }

  .grid-cell-content {
    position: relative;
  }

  &.variant-cell.hover {
    .grid-cell-content {
      box-shadow: 0 7px 11px 0 rgba(black, 0.1);

      @media print, screen and (max-width: 900px) {
        border: 1px solid transparent;
      }

      .grid-cell-image-container {
        .promo-label {
          background-color: rgba(0, 0, 0, 0.3);
        }
      }
    }

    .product-details-wrapper {
      &.product-details-wrapper--quick-add-to-bag {
        .product-availability {
          visibility: hidden;
        }
      }

      .product-details {
        .quickshop-wrapper {
          visibility: visible;
        }

        .QuickAddToBag {
          visibility: visible;
        }

        .description {
          visibility: hidden;
        }
      }
    }
  }
}

// TODO: Redo these classes to use BEM...
.grid-cell.variant-cell {
  position: relative;
  text-align: center;

  .favorite-icon {
    position: absolute;
    z-index: 2;
    right: 8px;
    top: 8px;
    color: color('nokia');
    cursor: pointer;
  }

  .unlike-confirmation-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background-color: rgba(white, 0.9);
    border: 1px solid color('elephant');
    padding-top: 50%;

    > span {
      display: inline-block;
      width: 75%;
      margin: 0 auto;
      font-family: font-family('sans');
      font-size: 12px;
    }

    .mo-display-button {
      width: 75%;
      margin: 20px auto;
    }
  }

  .product-details-wrapper {
    position: relative;

    &.product-details-wrapper--quick-add-to-bag {
      margin-bottom: space(6);
    }

    .QuickAddToBag {
      visibility: hidden;
      margin-top: -12px;
    }

    .product-availability {
      color: color('burnt-orange');
      text-transform: capitalize;
      height: 18px;
      padding: 3px 10px 0;
      overflow: visible;
    }

    .product-details {
      position: relative;
      z-index: 2;

      .product-details-spacer {
        height: 1px;
      }

      .quickshop-wrapper {
        visibility: hidden;
        position: relative;

        .designer-name {
          margin-top: 6px;
        }

        .size-slider {
          margin: 7px 20px;
        }

        .carousel {
          margin: 4px 0px;
        }

        .product-price {
          margin: 0px 0px 4px;
        }

        .variant-color-picker {
          margin: 13px 0 12px;
        }
      }

      .product-name {
        color: color('black');
      }

      .description {
        position: absolute;
        top: 7px;
        left: 0;
        right: 0;

        .variant-tag {
          border: 1px solid color('nokia');
          display: inline-block;
          width: auto;
          margin-top: 4px;
          padding: 3px 10px;
          color: color('nokia');
          text-transform: uppercase;
        }
      }
    }
  }

  .grid-cell-image-container {
    position: relative;
    padding-bottom: 160%;
    overflow: hidden;

    .promo-label {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 17px;
      padding: 2px 0;
      line-height: 1.08;
      font-size: font-size('sm');
      letter-spacing: letter-spacing('lg');
      color: color('white');
      text-align: center;
      text-transform: uppercase;
      z-index: 1;

      &--forest-green {
        background-color: color('forest-green');
      }

      &--brick {
        background-color: color('brick');
      }
    }

    .image-rotate {
      position: absolute;
      display: block;
      top: 0px;
      left: 0px;
      width: 100%;
      opacity: 0;
      transition: opacity 0.6s ease;

      &[data-image-active='true'] {
        opacity: 1;
      }
    }
  }

  .designer-name {
    font-family: font-family('sans');
    font-size: 12px;
    line-height: 1.66;
    color: color('black');
    text-transform: uppercase;
    letter-spacing: letter-spacing('wide');
  }

  .product-badges {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .promo-badge-30 {
    font-family: font-family('sans');
    align-items: center;
    letter-spacing: 1px;
    color: color('fuchsia');
    border: 1px solid color('fuchsia');
    margin: 0 auto;
    margin-top: 4px;
    margin-bottom: 4px;
    width: fit-content;

    @media only screen and (max-width: 700px) {
      letter-spacing: 0px;
    }
  }

  .variant-badge {
    width: fit-content;
    margin: 0 auto;
    margin-top: 4px;
    margin-bottom: 4px;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

