/* Shared FYOOL product card (homepage + shop) */

.fy-slabel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.fy-stitle {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
}

.fy-ssub {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 8px;
}

.fy-products {
  background: #fff;
  padding: 80px 40px;
}

.fy-products-hd {
  max-width: 1200px;
  margin: 0 auto 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.fy-view-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}

.fy-pgrid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.fy-pcard {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative;
}

.fy-pcard:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.09);
  border-color: #cbd5e1;
}

.fy-pcard-img {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface);
}

.fy-pcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.fy-pcard:hover .fy-pcard-img img {
  transform: scale(1.04);
}

.fy-ptag {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.fy-ptag.l {
  left: 12px;
}

.fy-ptag.r {
  right: 12px;
}

.fy-ptag-save {
  background: var(--green);
  color: #052e16;
}

.fy-ptag-blue {
  background: var(--blue);
  color: #fff;
}

.fy-fbar {
  height: 4px;
  width: 100%;
}

.fy-pcbody {
  padding: 10px;
}

.fy-pcflavor {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.fy-pcname-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 10px;
}

.fy-pcname-link:hover .fy-pcname {
  color: var(--blue);
}

.fy-pcname {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: calc(1.2em * 2);
  margin: 0;
}

.fy-pcname-line {
  display: block;
  line-height: 1.2;
}

.fy-pcbadges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fy-pb {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--green-soft);
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.fy-pb.blue {
  background: var(--blue-soft);
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.fy-pcprice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.fy-pcprice-group {
  /* Stack the price: struck original on top, sale price below, both
     left-aligned. .fy-pcprice (sale) is first in the DOM and .fy-pcorig
     (original) second, so column-reverse renders original above sale.
     Reserve two lines (24px sale + 1px gap + 15.6px original) and pack to
     the bottom so the sale price sits on the same line whether or not an
     original price is present — keeping cards aligned across the grid. */
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1px;
  min-height: 41px;
  min-width: 0;
}

.fy-pcprice {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}

.fy-pcorig {
  font-size: 13px;
  line-height: 1.2;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 400;
}

/* WooCommerce price HTML fallback (if used) */
.fy-pcprice-row .price {
  /* del (original) is first, ins (sale) second — a normal column keeps the
     struck original on top and the sale price below, matching .fy-pcprice-group. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin: 0;
}

.fy-pcprice-row .price .woocommerce-Price-amount,
.fy-pcprice-row .price ins .woocommerce-Price-amount {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--text);
  text-decoration: none;
}

.fy-pcprice-row .price del,
.fy-pcprice-row .price del .woocommerce-Price-amount {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  opacity: 1;
}

.fy-pcprice-row .price ins {
  text-decoration: none;
}

.fy-pcstick {
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 3px 8px;
  text-align: center;
  flex-shrink: 0;
}

.fy-sval {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--blue);
  line-height: 1;
}

.fy-slbl {
  font-size: 8px;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.fy-pcbtn {
  width: 100%;
  background: linear-gradient(90deg, var(--blue), #1677d2);
  color: #fff;
  padding: 11px;
  border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: opacity 0.2s;
  display: block;
  text-align: center;
}

.fy-pcbtn:hover {
  opacity: 0.9;
  color: #fff;
}

/* On the WooCommerce shop/category archive the cards render inside
   .fy-woo-main, whose generic `a { color: var(--blue) }` link rule (higher
   specificity than .fy-pcbtn) would tint the button text blue-on-blue.
   Re-assert white with a winning selector. */
.fy-woo-main a.fy-pcbtn,
.fy-woo-main a.fy-pcbtn:hover {
  color: #fff;
}

/* Sending to cart. The button is an <a>, so pointer-events does the work that
   `disabled` would on a <button>; the class also guards re-entry in JS. Without
   this the add was silent, so shoppers clicked again and hit the drawer's
   busy guard. */
.fy-pcbtn.is-loading,
.fy-ocard-btn.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0.75;
  cursor: progress;
}

.fy-pcbtn.is-loading::after,
.fy-ocard-btn.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: fy-pcbtn-spin 0.6s linear infinite;
}

@keyframes fy-pcbtn-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .fy-pcbtn.is-loading::after,
  .fy-ocard-btn.is-loading::after { animation: none; opacity: 0.6; }
}

.fy-pcbtn.out,
.fy-woo-main a.fy-pcbtn.out {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

@media (max-width: 1024px) {
  .fy-products {
    padding-left: 24px;
    padding-right: 24px;
  }

  .fy-pgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .fy-products {
    padding: 48px 20px;
  }

  .fy-products-hd {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .fy-pgrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Uniform title height: always 3 lines tall; longer titles truncate to 3
     lines with an ellipsis (line 1 stays one line, line 2 clamps to two). */
  .fy-pcname {
    min-height: calc(1.2em * 3);
  }

  .fy-pcname-line:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fy-pcname-line:last-child {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }

  /* Keep the badges on a single line. */
  .fy-pcbadges {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .fy-pb {
    font-size: 9px;
    padding: 2px 5px;
    white-space: nowrap;
  }

  /* Price block: original (struck) on top, sale below, both left-aligned;
     per-stick badge stays to the right of it. */
  .fy-pcprice-row {
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }

  /* Match the reserved two-line price height to the smaller mobile fonts. */
  .fy-pcprice-group {
    min-height: 33px;
  }

  .fy-pcprice {
    font-size: 18px;
  }

  .fy-pcorig {
    font-size: 11px;
  }

  .fy-pcstick {
    padding: 2px 6px;
    flex-shrink: 0;
  }

  .fy-sval {
    font-size: 12px;
  }

  .fy-slbl {
    font-size: 7px;
  }
}

@media (max-width: 400px) {
  .fy-pgrid {
    grid-template-columns: 1fr;
  }

  /* Single column gives the card full width again — the price can breathe. */
  .fy-pcprice {
    font-size: 21px;
  }
}
