/* =========================================================
   WC Products Grid (Pegasus) — RESPONSIVE CSS (NO CLAMP)
   - Uses a responsive container width (instead of fixed 80%)
   - Reserves space for controls below card
   - Keeps first-card alignment only on larger screens
   - Controls wrap cleanly on very small screens
   ========================================================= */

/* Section spacing + responsive container */
.wc-products-grid {
  /* Uses global Nelson gutters + max width when available */
  width: 100%;
  margin: 60px auto 100px auto;
  max-width:1280px;
}

.pegasus-shop-archive--baskets .wc-products-grid {
  /* Uses global Nelson gutters + max width when available */
  width: 100%;
  margin: 60px 0 100px 0;
  max-width:1280px;
}

/* Optional section heading */
.wc-products-grid__section-title {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 14px;
  margin: 0 0 34px;
}

/* Block */
.wc-products-grid__block {
  margin: 0 0 60px;
}

.wc-products-grid__block-title {
  margin: 0 0 18px;
  text-transform: uppercase;
  font-size: 28px;
}

/* Grid row */
.wc-products-grid__row {
  row-gap: 34px;
}

/* Columns */
.wc-products-grid__col {
  display: flex;         /* equal-height cards */
  margin-bottom: 0;      /* handled via reserved space below */
  padding-bottom: 100px;  /* ✅ reserves room for the controls “below the card” */
}

.pegasus-shop-archive--baskets .wc-products-grid__col {
  padding-bottom: 100px;  
}

/* Align first card with block title — only on tablet/desktop */
@media (min-width: 768px) {
  
  .wc-products-grid__block
    .wc-products-grid__row
    > [class*="col-"]:first-child {
    padding-left: 0;
  }



.wc-products-grid__block
.wc-products-grid__row
> [class*="col-"]:nth-child(4n) {
  padding-right: 0;
}

}

/* -------------------------
   Product card
   ------------------------- */

.wc-product-card {
  position: relative;
  border-radius: 10px;
  background: #202428;
  border: 1px solid #202428;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  overflow: visible;
  min-height: 400px;

  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Card overlay link */
.wc-product-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 10px;
}

/* Top content (LOCKED HEIGHT = key to equal cards) */
.wc-product-card__top {
  position: relative;
  z-index: 2;
  padding: 20px 20px 10px;
  text-align: center;
  min-height: 125px; /* allows 1–2 line titles naturally */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Prevent Woo's injected "View cart" link from breaking the card controls */
.wc-products-grid .wc-product-card__bottom a.added_to_cart.wc-forward {
  display: none !important;
}

/* Title (NO CLAMP) */
.wc-product-card__title {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.25;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  /* reserve space for two lines */
  min-height: calc(1.25em * 2);
  padding:0 20px;
}

/* Rating row */
.wc-product-card__rating {
  margin: 0 0 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pegasus-shop-archive .wc-product-card__rating {display:none; }

.wc-product-card .star-rating {
  position: relative;
  float: none;
  display: inline-block;
  width: 5em;
  height: 1.1em;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1;
  color: transparent;
}

.detergents .wc-product-card .star-rating {
  position: relative;
  float: none;
  display: inline-block;
  width: 5em;
  height: 1.1em;
  margin: 0;
  overflow: hidden;
  font-size: 22px;
  line-height: 1;
  color: transparent;
}

.wc-product-card .star-rating::before,
.wc-product-card .star-rating span::before {
  content: "★★★★★";
  position: absolute;
  top: 0;
  left: 0;
}

.wc-product-card .star-rating::before {
  color: rgba(255, 255, 255, 0.22);
}

.wc-product-card .star-rating span {
  position: absolute;
  top: 0;
  left: 0;
  height: 1em;
  overflow: hidden;
  white-space: nowrap;
}

.wc-product-card .star-rating span::before {
  color: #ffe000;
}

.wc-product-card__review-count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

/* Price (normalised height) */
.wc-product-card__price {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.92);
  font-weight:600;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wc-product-card__price del {
  opacity: 0.7;
}

.wc-product-card__price ins {
  text-decoration: none;
}

/* Image */
.wc-product-card__image {
  position: relative;
  z-index: 0;
  height: 194px;
  margin: 0 12px 16px;
  border-radius: 8px;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45));

  margin-top: auto; /* keeps vertical alignment */
}


/* -----------------------------------------
   Variant: image first (toggle)
   Adds a modifier class on the section: .wc-products-grid--image-first
   ----------------------------------------- */

.wc-products-grid--image-first .wc-product-card__image{
  margin-top: 20px;     /* remove push-to-bottom behaviour */
  margin-bottom: 10px;
  background-position: center center;
}

.wc-products-grid--image-first .wc-product-card__top{
  min-height: 0;        /* allow natural height when image is on top */
  padding-top: 6px;
  padding-bottom: 14px;
}


/* -----------------------------------------
   Controls BELOW card
   ----------------------------------------- */

.wc-product-card__bottom {
  position: absolute;
  left: 12px;            /* ✅ aligns with image/card inner padding */
  right: 12px;
  bottom: -55px;         /* ✅ slightly more breathing room */
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;            /* padding now handled by left/right */
}

/* Quantity */
.wc-product-card__qty {
  display: none;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.detergents .wc-product-card__qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}


.wc-qty-btn {
  width: 25px;
  height: 25px;
  border-radius: 999px;
  border: 0;
  background: #1b75d0;
  color: #fff;
  font-size: 18px;
  line-height: 22px;
  cursor: pointer;
}

.wc-qty-input {
  width: 25px;
  height: 25px;
  border-radius: 4px;
  border: 0;
  background: #fff;
  color: #111;
  font-size: 14px;
  text-align: center;
}

.wc-product-card__bottom--no-qty { gap: 0; }
.wc-product-card__bottom--no-qty .wc-product-card__add { width:100%; flex: 1 1 100%; }


/* Add to basket */
.wc-product-card__add {
  flex: 1 !important;
  height: 30px !important;
  padding: 0 5px !important;
  border-radius: 999px !important;
  background: #1b75d0 !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  min-width: 0 !important; /* ✅ prevents overflow in flex rows */
  max-width:80% !important;
  margin:auto !important;
  font-weight:500 !important;
}


/* Click safety */
.wc-product-card__bottom {
  pointer-events: none;
}
.wc-product-card__bottom * {
  pointer-events: auto;
}

/* -------------------------
   Responsive tuning
   ------------------------- */

/* Large tablets / small laptops */
@media (max-width: 991px) {
  .wc-products-grid {
    width: min(var(--nw-max-width, 1100px), calc(100% - (var(--nw-gutter, 18px) * 2)));
  }

  .wc-product-card__top {
    min-height: 160px;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .wc-products-grid {
    width: calc(100% - (var(--nw-gutter, 12px) * 2));
    margin: 46px auto 80px auto;
  }

  .wc-products-grid__block-title {
    font-size: 20px;
    text-align:center;
  }

  .wc-product-card {
    min-height: 310px;
  }

  .wc-product-card__image {
    height: 180px;
  }

  .wc-product-card__top {
    min-height: 150px;
  }

  .wc-products-grid__col {
    padding-bottom: 60px; /* a bit more room on mobile */
  }

  .wc-product-card__bottom {
    bottom: -42px;
    left: 10px;
    right: 10px;
  }
}

/* Very small phones: allow controls to wrap so nothing overflows */
@media (max-width: 390px) {
  .wc-product-card__bottom {
    flex-wrap: wrap;
    gap: 8px;
  }

  .wc-product-card__add {
    flex: 0 0 100%;
    width: 100%;
    height: 28px;
  }
}

/* -------------------------
   Hide Up and Down numeric arrows
   ------------------------- */

/* Chrome, Safari, Edge, Opera */
.wc-qty-input::-webkit-outer-spin-button,
.wc-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.wc-qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
}


