/* ============================================================
   GPW PRODUCT UI
   New renderer only.
   ============================================================ */


/* ============================================================
   BASE
   ============================================================ */

.gpw2-shell,
.gpw2-shell * {
  box-sizing: border-box;
}

#gpw2-category-shell.gpw2-shell {
  display: block;

  width: 100%;
  min-width: 0;

  margin: 0;
  padding: 24px 28px 36px;

  background: #fff !important;
  color: #222 !important;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  text-align: left;
}

.gpw2-shell img {
  display: block;

  max-width: 100%;
  height: auto;
}

.gpw2-shell button,
.gpw2-shell input,
.gpw2-shell select {
  font: inherit;
}


/* ============================================================
   HEADER
   ============================================================ */

.gpw2-header {
  display: flex;

  align-items: baseline;

  width: 100%;

  margin: 0 0 18px 0;
  padding: 0;

  gap: 12px;

  background: transparent !important;

  text-align: left !important;
}

.gpw2-header__title {
  flex: 1 1 auto;

  margin: 0 !important;
  padding: 0 !important;

  color: #222 !important;

  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;

  text-align: left !important;
}

.gpw2-header__meta {
  flex: 0 0 auto;

  color: #777;

  font-size: 12px;

  text-align: right;
}


/* ============================================================
   CATEGORY GRID
   ============================================================ */

.gpw2-category-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(190px, 1fr)
    );

  gap: 12px;
}

.gpw2-category-card {
  display: flex;

  align-items: center;
  justify-content: center;

  min-height: 90px;

  padding: 15px;

  border: 1px solid #ddd;

  background: #fff;

  color: #222;

  text-align: center;

  cursor: pointer;

  transition:
    transform 250ms ease,
    border-color 250ms ease;
}

.gpw2-category-card:hover {
  border-color: #999;

  transform:
    translateY(-2px);
}


/* ============================================================
   PRODUCTS + FILTERS
   ============================================================ */

.gpw2-products-layout {
  display: grid;

  grid-template-columns:
    180px minmax(0, 1fr);

  gap: 24px;

  width: 100%;

  align-items: start;
}

.gpw2-products-main {
  min-width: 0;
}


/* ============================================================
   FILTERS
   ============================================================ */

.gpw2-filters {
  width: 180px;

  padding: 0;

  background: #fff;

  color: #222;
}

.gpw2-filters__title {
  margin:
    0 0 7px 0;

  padding: 0;

  color: #222;

  font-size: 18px;
  font-weight: 700;

  text-align: left;
}

.gpw2-filter-select {
  display: block;

  width: 100%;
  height: 38px;

  margin:
    0 0 10px 0;

  padding:
    0 14px;

  border:
    1px solid #c8c8c8;

  border-radius: 0;

  background: #fff;

  color: #222;

  font-size: 13px;

  cursor: pointer;
}


/* ============================================================
   PRODUCT GRID
   ============================================================ */

.gpw2-product-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(245px, 1fr)
    );

  gap: 14px;

  width: 100%;
}


/* ============================================================
   PRODUCT CARD
   ============================================================ */

.gpw2-product-card {
  position: relative;

  display: flex;
  flex-direction: column;

  min-width: 0;

  border:
    1px solid rgba(0, 0, 0, .08);

  background: #fff;

  color: #222;

  /*
   * Matches original GPW category card movement.
   */
  transition:
    all 500ms;
}

.gpw2-product-card:hover {
  z-index: 10;

  transform:
    scale(1.05);

  transition:
    all 500ms;
}

.gpw2-product-card[hidden] {
  display: none !important;
}


/* ============================================================
   IMAGE
   ============================================================ */

.gpw2-product-card__media {
  position: relative;

  display: flex;

  align-items: center;
  justify-content: center;

  width: 100%;
  height: 260px;

  padding: 12px;

  overflow: hidden;

  background: #fff;
}

.gpw2-product-card__media a {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;
}

.gpw2-product-card__image {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
}


/* ============================================================
   CARD BODY
   ============================================================ */

.gpw2-product-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;

  min-width: 0;

  padding:
    10px 10px 0;
}

.gpw2-product-card__title {
  display: block;

  min-height: 38px;

  margin:
    0 0 10px 0;

  color: #38109b;

  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;

  text-decoration: none;

  text-align: left;
}

.gpw2-product-card__title:hover {
  text-decoration: underline;
}

.gpw2-product-card__part,
.gpw2-product-card__info {
  margin-bottom: 4px;

  color: #666;

  font-size: 13px;
  line-height: 1.4;

  text-align: left;
}

.gpw2-product-card__part strong,
.gpw2-product-card__info strong {
  color: #000;
}


/* ============================================================
   PRICING
   ============================================================ */

.gpw2-price {
  margin-top: 4px;

  text-align: left;
}

.gpw2-price__label {
  color: #111;

  font-size: 13px;
  font-weight: 700;
}

.gpw2-price__value {
  color: #555;

  font-size: 14px;
  font-weight: 400;
}

.gpw2-price--rrp
.gpw2-price__value {
  color: red;

  font-weight: 700;
}


/* ============================================================
   AVAILABILITY
   ============================================================ */

.gpw2-availability {
  position: relative;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  width: auto;
  min-width: 74px;
  height: 26px;

  padding:
    4px 10px;

  border: 0;
  border-radius: 3px;

  color: #fff;

  font-size: 12px;
  font-weight: 700;
  line-height: 1;

  white-space: nowrap;

  cursor: help;
}

.gpw2-availability--0 {
  background: #55a9df;
}

.gpw2-availability--1 {
  background: #f39c12;
}

.gpw2-availability--2 {
  background: #2ecc71;
}

.gpw2-availability--3 {
  background: #bd10e0;
}

.gpw2-availability--4 {
  background: #d9534f;
}


/* ============================================================
   AVAILABILITY TOOLTIP
   ============================================================ */

.gpw2-availability::after {
  position: absolute;

  left: 50%;
  bottom: calc(100% + 8px);

  z-index: 100;

  width: 280px;

  padding: 7px 9px;

  transform:
    translateX(-50%);

  border:
    2px solid transparent;

  border-radius: 4px;

  background: #111;

  color: #fff;

  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;

  text-align: left;

  white-space: normal;

  opacity: 0;
  visibility: hidden;

  pointer-events: none;

  transition:
    opacity .15s ease;
}

.gpw2-availability:hover::after {
  opacity: 1;
  visibility: visible;
}

.gpw2-availability--0::after {
  content:
    'We are possibly out of stock, please call for ETA or alternate products.';

  border-color:
    #55a9df;
}

.gpw2-availability--1::after {
  content:
    'We are running low on stock. We suggest placing an order to secure stock.';

  border-color:
    #f39c12;
}

.gpw2-availability--2::after {
  content:
    'We currently have good stock to order.';

  border-color:
    #2ecc71;
}

.gpw2-availability--3::after {
  content:
    'Stock is available ex-east for overnight airfreight or road/rail freight.';

  border-color:
    #bd10e0;
}

.gpw2-availability--4::after {
  content:
    'This product is nil stock. Please use the replacement part shown in the description.';

  border-color:
    #d9534f;
}


/* ============================================================
   CART
   ============================================================ */

.gpw2-cart {
  display: flex;

  align-items: center;

  gap: 5px;

  width: 100%;

  margin-top: auto;
  padding-top: 8px;
}

.gpw2-cart__qty {
  width: 58px;
  height: 26px;

  padding: 3px 5px;

  border:
    1px solid #aaa;

  background: #fff;

  color: #111;

  text-align: left;
}

.gpw2-cart__add {
  min-width: 68px;
  height: 26px;

  padding:
    3px 10px;

  border: 0;
  border-radius: 2px;

  background: #2196df;

  color: #fff;

  font-size: 13px;
  font-weight: 700;

  cursor: pointer;
}

.gpw2-cart__add:hover {
  background: #087fc4;
}

.gpw2-cart__add:disabled {
  background: #aaa;

  cursor: default;
}


/* ============================================================
   MORE INFO
   ============================================================ */

.gpw2-more-info {
  display: block;

  width: calc(100% + 20px);

  margin:
    8px -10px 0;

  padding:
    4px 6px;

  background: #000;

  color: #fff !important;

  font-size: 13px;
  font-weight: 700;

  text-align: center;

  text-decoration: none;
}

.gpw2-more-info:hover {
  color: #fff !important;

  text-decoration: none;
}


/* ============================================================
   REPLACEMENT
   ============================================================ */

.gpw2-replacement {
  margin-top: 10px;

  padding: 10px;

  border:
    1px solid #d9534f;

  background: #fff7f7;
}

.gpw2-replacement__link {
  font-weight: 700;

  text-decoration: underline;
}


/* ============================================================
   STATUS
   ============================================================ */

.gpw2-status {
  width: 100%;

  padding:
    30px 15px;

  background: #fff;

  color: #666;

  text-align: center;
}

.gpw2-status--error {
  color: #b00000;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media
(max-width: 768px) {

  #gpw2-category-shell.gpw2-shell {
    padding:
      15px 10px 30px;
  }

  .gpw2-products-layout {
    display: block;
  }

  .gpw2-filters {
    width: 100%;

    margin-bottom: 14px;
  }

  .gpw2-filters__title {
    margin-bottom: 8px;
  }

  .gpw2-filter-select {
    width: 100%;
  }

  .gpw2-product-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 8px;
  }

  .gpw2-product-card:hover {
    transform: none;
  }

  .gpw2-product-card__media {
    height: 200px;
  }

  .gpw2-product-card__body {
    padding:
      9px 9px 0;
  }

}


@media
(max-width: 420px) {

  .gpw2-product-grid {
    gap: 5px;
  }

  .gpw2-product-card__media {
    height: 160px;

    padding: 6px;
  }

  .gpw2-product-card__title {
    font-size: 12px;
  }

  .gpw2-cart {
    flex-wrap: wrap;
  }

}
