/*
 * Product card (store). Markup: resources/views/store/elements/product_card_content.blade.php
 * Loaded on its own, after the main stylesheet, so it needs no asset build.
 * Everything is scoped to .product_card.pc2 so the older card styles keep working elsewhere
 * (the wishlist page).
 *
 * Layout: photo on a tinted panel (sale badge, heart, round "+" add-to-cart button on it),
 * stars, name, then the price on the start side and the brand logo on the end side.
 */
.product_card.pc2 {
  display: flex;
  flex-direction: column;
  /* as tall as its content; cards in the same row are stretched to the tallest one (see the
     end of this file), so there is no reserved empty space between the name and the price */
  height: auto;
  min-height: 0;
  max-height: none;
  width: 100%;
  padding: 12px 12px 0;
  border: 1px solid #e6e8f0;
}
.product_card.pc2:hover {
  border-color: #3881ef;
}

/* photo panel */
.product_card.pc2 .pc2_media {
  position: relative;
  flex: 0 0 auto;
  background: #f3f5fb;
  border-radius: 14px;
}
.product_card.pc2 .card_icon {
  height: 190px;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
}
.product_card.pc2 .card_icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;   /* a white photo background blends into the tinted panel */
}
/* placeholder shown when a product photo is missing */
.product_card.pc2 .card_icon img.pc2_noimg {
  mix-blend-mode: normal;
}

/* sale badge: start corner of the photo */
.product_card.pc2 .pc2_badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  background: #e53935;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* wishlist heart: end corner of the photo */
.product_card.pc2 .heart {
  top: 6px;
  right: auto;
  left: auto;
  inset-inline-end: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}
.product_card.pc2 .heart i {
  transition: color 0.15s ease-in-out, transform 0.15s ease-in-out;
}
.product_card.pc2 .heart:hover i {
  transform: scale(1.15);
}
/* liked: written out plainly here, because the site's own rule for it uses nested CSS that
   older browsers ignore, leaving a liked heart grey */
.product_card.pc2 .heart i.active {
  color: #e53935 !important;
}

/* add to cart: round "+" button overlapping the bottom end corner of the photo */
.product_card.pc2 .addtocart_icon {
  top: auto;
  left: auto;
  right: auto;
  bottom: -22px;
  inset-inline-end: 12px;
  z-index: 3;
}
.product_card.pc2 .addtocart_icon button {
  width: 52px;
  height: 52px;
  box-sizing: border-box;
  border: 3px solid #fff;
  background-color: #010d77;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out;
}
.product_card.pc2 .addtocart_icon button:hover {
  background-color: #3881ef;
  transform: scale(1.06);
}
.product_card.pc2 .addtocart_icon button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}
.product_card.pc2 .pc2_out {
  position: absolute;
  bottom: 8px;
  inset-inline-end: 10px;
  z-index: 2;
  background: #fff;
  border-radius: 20px;
  padding: 2px 10px;
  color: #d32f2f;
  font-size: 0.8rem;
  font-weight: 600;
}

.product_card.pc2 .card_body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  text-decoration: none;
}

/* stars under the photo */
.product_card.pc2 .pc2_stars {
  height: 20px;
  margin-top: 14px;
}
/* Five stars, filled up to the rating (--r, 0 to 5 in half steps), in the reading direction.
   Plain characters coloured by a gradient: no icon font and a single element per card. */
.product_card.pc2 .pc2_rating {
  display: inline-block;
  font-size: 17px;
  line-height: 20px;
  letter-spacing: 1px;
  background: linear-gradient(to right, #f5a623 calc(var(--r) / 5 * 100%), #d5d9e6 calc(var(--r) / 5 * 100%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.product_card.pc2 .pc2_rating::before {
  content: "\2605\2605\2605\2605\2605";
}
/* Arabic: the stars fill from the right */
.product_card.pc2 .pc2_rating.pc2_rating_rtl {
  background: linear-gradient(to left, #f5a623 calc(var(--r) / 5 * 100%), #d5d9e6 calc(var(--r) / 5 * 100%));
  -webkit-background-clip: text;
  background-clip: text;
}

/* name: two lines at most */
.product_card.pc2 .pc2_name {
  font-size: 0.95rem;
  line-height: 1.35;
  max-height: 2.7em;
  margin: 4px 0 0;
  -webkit-line-clamp: 2 !important;
}

/* price on the start side, brand logo on the end side */
.product_card.pc2 .pr_footer {
  margin-top: auto;   /* in a row with taller cards, the price stays at the bottom */
  border-top: 0;
  padding: 10px 0 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.product_card.pc2 .pc2_price {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}
.product_card.pc2 .pc2_old {
  color: #8a8a8a;
  font-size: 0.78rem;
  line-height: 1.3;
  text-decoration: line-through;
  white-space: nowrap;
}
.product_card.pc2 .pc2_now {
  color: #010d77;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.product_card.pc2 .pc2_off {
  color: #1a8f3c;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.product_card.pc2 .pc2_brand {
  flex: 0 0 auto;
  width: 64px;
  height: 44px;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
}
.product_card.pc2 .pc2_brand img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* brand without a logo: its name, in the same box */
.product_card.pc2 .pc2_brand_text {
  color: #444;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  word-break: break-word;
}

/* tablets and small laptops */
@media (max-width: 1100px) {
  .product_card.pc2 .card_icon img {
    width: 100%;
  }
  .product_card.pc2 .pc2_now {
    font-size: 1.15rem;
  }
}

/* phones: two cards per row */
@media (max-width: 600px) {
  .product_card.pc2 {
    padding: 8px 8px 0;
    margin: 0 5px;
  }
  .product_card.pc2 .card_icon {
    height: 140px;
    padding: 8px;
  }
  .product_card.pc2 .card_icon img {
    width: 100%;
  }
  .product_card.pc2 .pc2_badge {
    top: 8px;
    inset-inline-start: 8px;
    font-size: 0.7rem;
    padding: 4px 8px;
  }
  .product_card.pc2 .heart {
    top: 3px;
    inset-inline-end: 4px;
  }
  .product_card.pc2 .addtocart_icon {
    bottom: -18px;
    inset-inline-end: 8px;
  }
  .product_card.pc2 .addtocart_icon button {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .product_card.pc2 .pc2_name {
    font-size: 0.9rem;
  }
  .product_card.pc2 .pc2_now {
    font-size: 1.1rem;
  }
  .product_card.pc2 .pc2_old,
  .product_card.pc2 .pc2_off {
    font-size: 0.75rem;
  }
  .product_card.pc2 .pc2_brand {
    width: 44px;
    height: 32px;
    border-radius: 8px;
    padding: 3px;
  }
}
@media (max-width: 380px) {
  .product_card.pc2 .card_icon img {
    width: 100%;
  }
  .product_card.pc2 .pc2_now {
    font-size: 1rem;
  }
}


/* ------------------------------------------------------------------------------------------
 * Equal heights: every card in a row is as tall as the tallest card of that row
 * ------------------------------------------------------------------------------------------ */
/* sliders (home page, related products) */
[class*="products_section_slider"] .slick-track {
  display: flex;
}
[class*="products_section_slider"] .slick-slide {
  display: flex;
  height: auto;
}
[class*="products_section_slider"] .slick-slide > div {
  display: flex;
  width: 100%;
}
[class*="products_section_slider"] .slider_item {
  display: flex !important;
  width: 100%;
}
/* products list: the columns of a row already share one height */
#product-list .row > [class*="col-"] {
  display: flex;
}
