/* =========================================================
   Furniture Hub Kenya - Product Card Component
   Loaded by [fh_product_card]
   Prefix: fh-
   ========================================================= */

.fh-product-card,
.fh-product-card * {
  box-sizing: border-box;
}

.fh-product-card {
  --fh-card-radius: 12px;
  --fh-card-border: rgba(231, 226, 221, 0.95);
  --fh-card-shadow: 0 8px 22px rgba(0, 0, 0, 0.055);
  --fh-card-shadow-hover: 0 16px 34px rgba(0, 0, 0, 0.105);

  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--fh-card-border);
  border-radius: var(--fh-card-radius);
  background: var(--fh-white, #ffffff);
  box-shadow: var(--fh-card-shadow);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.fh-product-card:hover,
.fh-product-card:focus-within {
  border-color: rgba(149, 27, 40, 0.28);
  box-shadow: var(--fh-card-shadow-hover);
  transform: translateY(-3px);
}

.fh-product-card__media-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--fh-grey-100, #f1efec);
  color: inherit;
  text-decoration: none !important;
}

.fh-product-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.76;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(149, 27, 40, 0.05), rgba(24, 24, 24, 0.03)),
    var(--fh-grey-100, #f1efec);
}

.fh-product-card__image {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 280ms ease;
}

.fh-product-card:hover .fh-product-card__image {
  transform: scale(1.035);
}

.fh-product-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(149, 27, 40, 0.42);
  background: var(--fh-grey-100, #f1efec);
}

.fh-product-card__placeholder svg {
  width: 54px;
  height: 54px;
}

.fh-product-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.fh-product-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--fh-red, #951b28);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.fh-product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  padding: 15px 15px 16px;
}

.fh-product-card__category {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 8px;
  color: var(--fh-red, #951b28);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
}

.fh-product-card__category:hover {
  color: var(--fh-red-dark, #6f111d);
}

.fh-product-card__title {
  margin: 0;
  min-height: 2.72em;
  color: var(--fh-charcoal, #181818);
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.36;
  letter-spacing: -0.025em;
}

.fh-product-card__title a {
  color: inherit;
  text-decoration: none !important;
}

.fh-product-card__title a:hover {
  color: var(--fh-red, #951b28);
}

.fh-product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--fh-grey-200, #e7e2dd);
}

.fh-product-card__price {
  display: block;
  color: var(--fh-red, #951b28);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.2;
}

.fh-product-card__stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--fh-grey-700, #4b4b4b);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1;
}

.fh-product-card__stock::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fh-success, #16803c);
}

.fh-product-card__stock--out::before {
  background: var(--fh-warning, #c47f1c);
}

.fh-product-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.fh-product-card__button,
.fh-product-card__button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.fh-product-card__button:hover,
.fh-product-card__button:focus {
  transform: translateY(-1px);
}

.fh-product-card__button--view {
  color: var(--fh-charcoal, #181818);
  background: var(--fh-grey-50, #f7f6f4);
  border-color: var(--fh-grey-200, #e7e2dd);
}

.fh-product-card__button--view:hover,
.fh-product-card__button--view:focus {
  color: var(--fh-red, #951b28);
  border-color: rgba(149, 27, 40, 0.28);
  background: #ffffff;
}

.fh-product-card__button--whatsapp {
  color: #ffffff !important;
  background: var(--fh-whatsapp, #25d366);
  border-color: var(--fh-whatsapp, #25d366);
}

.fh-product-card__button--whatsapp:hover,
.fh-product-card__button--whatsapp:focus {
  color: #ffffff !important;
  background: var(--fh-whatsapp-dark, #128c4a);
  border-color: var(--fh-whatsapp-dark, #128c4a);
}

.fh-product-card__button svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.fh-product-card--compact .fh-product-card__body {
  padding: 13px;
}

.fh-product-card--compact .fh-product-card__actions {
  grid-template-columns: 1fr;
}

@media (max-width: 767px) {
  .fh-product-card__media {
    aspect-ratio: 1 / 0.72;
  }

  .fh-product-card__body {
    padding: 13px;
  }

  .fh-product-card__title {
    font-size: 0.95rem;
  }

  .fh-product-card__actions {
    gap: 8px;
  }

  .fh-product-card__button {
    min-height: 39px;
    padding-inline: 9px;
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .fh-product-card__actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Product Section / Homepage Product Rows
   Used by [fh_product_section]
   ========================================================= */

.fh-product-section,
.fh-product-section * {
  box-sizing: border-box;
}

.fh-product-section {
  --fh-product-section-max: 1280px;
  position: relative;
  width: 100%;
  padding: clamp(44px, 5.6vw, 76px) var(--fh-page-padding-x, 24px);
  background: var(--fh-white, #ffffff);
}

.fh-product-section.fh-product-section--muted {
  background: var(--fh-grey-50, #f7f6f4);
}

.fh-product-section__inner {
  width: min(var(--fh-product-section-max), 100%);
  margin-inline: auto;
}

.fh-product-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.fh-product-section__copy {
  min-width: 0;
  max-width: 760px;
}

.fh-product-section__kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--fh-red, #951b28);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.fh-product-section__kicker::before {
  content: "";
  width: 24px;
  height: 2px;
  background: currentColor;
}

.fh-product-section__title {
  margin: 0;
  color: var(--fh-charcoal, #181818);
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.fh-product-section__subtitle {
  margin: 10px 0 0;
  max-width: 620px;
  color: var(--fh-grey-700, #4b4b4b);
  font-size: 0.98rem;
  line-height: 1.65;
}

.fh-product-section__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.fh-product-section__tabs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.fh-product-section__tab,
.fh-product-section__all {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 999px;
  color: var(--fh-charcoal, #181818);
  background: var(--fh-grey-50, #f7f6f4);
  border: 1px solid transparent;
  font-size: 0.83rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none !important;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.fh-product-section__tab:hover,
.fh-product-section__tab:focus,
.fh-product-section__tab.is-active {
  color: #ffffff;
  background: var(--fh-red, #951b28);
  border-color: var(--fh-red, #951b28);
}

.fh-product-section__all {
  background: #ffffff;
  border-color: var(--fh-grey-200, #e7e2dd);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.fh-product-section__all:hover,
.fh-product-section__all:focus {
  color: var(--fh-red, #951b28);
  border-color: rgba(149, 27, 40, 0.28);
  transform: translateY(-1px);
}

.fh-product-section__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.fh-product-section__grid .fh-product-card {
  --fh-card-radius: 10px;
  --fh-card-shadow: none;
  --fh-card-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.fh-product-section__grid .fh-product-card__media {
  aspect-ratio: 1 / 0.98;
  background: #ffffff;
}

.fh-product-section__grid .fh-product-card__image {
  object-fit: contain;
  padding: 14px;
  background: #ffffff;
}

.fh-product-section__grid .fh-product-card:hover .fh-product-card__image {
  transform: scale(1.025);
}

.fh-product-section__grid .fh-product-card__body {
  padding: 12px 13px 13px;
}

.fh-product-section__grid .fh-product-card__category {
  margin-bottom: 7px;
  color: var(--fh-grey-500, #8b8178);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}

.fh-product-section__grid .fh-product-card__title {
  min-height: 2.55em;
  font-size: 0.91rem;
  line-height: 1.28;
}

.fh-product-section__grid .fh-product-card__meta {
  margin-top: 10px;
  padding-top: 10px;
}

.fh-product-section__grid .fh-product-card__price {
  font-size: 0.92rem;
}

.fh-product-card__actions--minimal {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fh-product-card__actions--minimal .fh-product-card__button {
  min-width: 0;
  min-height: 35px;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 0.72rem;
}

.fh-product-card__actions--minimal .fh-product-card__button--whatsapp {
  width: auto;
  padding-inline: 8px;
}

.fh-product-card__actions--minimal .fh-product-card__button--whatsapp span {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .fh-product-section__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .fh-product-section__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .fh-product-section__tools,
  .fh-product-section__tabs {
    justify-content: flex-start;
  }

  .fh-product-section__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .fh-product-section {
    padding-block: 38px;
  }

  .fh-product-section__head {
    gap: 16px;
    margin-bottom: 18px;
  }

  .fh-product-section__tools {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .fh-product-section__tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .fh-product-section__tab,
  .fh-product-section__all {
    white-space: nowrap;
  }

  .fh-product-section__all {
    width: max-content;
  }

  .fh-product-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .fh-product-section__grid .fh-product-card__image {
    padding: 10px;
  }

  .fh-product-card__actions--minimal {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .fh-product-section__grid {
    grid-template-columns: 1fr;
  }
}

/* Inline filter behaviour for homepage/product sections */
.fh-product-section__tab {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
}

.fh-product-section.is-loading .fh-product-section__grid {
  position: relative;
  min-height: 260px;
  opacity: 0.48;
  pointer-events: none;
}

.fh-product-section.is-loading .fh-product-section__grid::after {
  content: "Loading products...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fh-charcoal, #181818);
  font-size: 0.9rem;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.62);
}

.fh-product-section__empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--fh-grey-300, #d8d1ca);
  border-radius: 10px;
  color: var(--fh-grey-700, #4b4b4b);
  background: var(--fh-grey-50, #f7f6f4);
  text-align: center;
  font-weight: 750;
}

/* =========================================================
   v0.3.4 - Product section tab color correction
   Purpose: prevent Elementor/theme button styles from making
   homepage category filter pills pink/outlined.
   ========================================================= */

.fh-product-section .fh-product-section__tabs {
  gap: 10px;
}

.fh-product-section .fh-product-section__tab,
.fh-product-section .fh-product-section__tab:not(:hover):not(:focus):not(.is-active),
.fh-product-section button.fh-product-section__tab,
.fh-product-section button.fh-product-section__tab:not(:hover):not(:focus):not(.is-active) {
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid var(--fh-grey-200, #e7e2dd) !important;
  border-radius: 999px;
  color: var(--fh-charcoal, #181818) !important;
  background: var(--fh-grey-50, #f7f6f4) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  outline: none;
}

.fh-product-section .fh-product-section__tab:hover,
.fh-product-section .fh-product-section__tab:focus,
.fh-product-section button.fh-product-section__tab:hover,
.fh-product-section button.fh-product-section__tab:focus {
  color: var(--fh-red, #951b28) !important;
  background: var(--fh-red-soft, #f8ecee) !important;
  border-color: rgba(149, 27, 40, 0.24) !important;
  box-shadow: none !important;
  transform: translateY(-1px);
}

.fh-product-section .fh-product-section__tab.is-active,
.fh-product-section button.fh-product-section__tab.is-active,
.fh-product-section .fh-product-section__tab.is-active:hover,
.fh-product-section .fh-product-section__tab.is-active:focus,
.fh-product-section button.fh-product-section__tab.is-active:hover,
.fh-product-section button.fh-product-section__tab.is-active:focus {
  color: #ffffff !important;
  background: var(--fh-red, #951b28) !important;
  border-color: var(--fh-red, #951b28) !important;
  box-shadow: 0 8px 18px rgba(149, 27, 40, 0.16) !important;
}

.fh-product-section .fh-product-section__all,
.fh-product-section .fh-product-section__all:visited {
  color: var(--fh-charcoal, #181818) !important;
  background: #ffffff !important;
  border: 1px solid var(--fh-grey-200, #e7e2dd) !important;
}

.fh-product-section .fh-product-section__all:hover,
.fh-product-section .fh-product-section__all:focus {
  color: var(--fh-red, #951b28) !important;
  background: #ffffff !important;
  border-color: rgba(149, 27, 40, 0.26) !important;
}

@media (max-width: 767px) {
  .fh-product-section .fh-product-section__tab,
  .fh-product-section button.fh-product-section__tab {
    min-height: 38px;
    padding: 9px 14px;
  }
}
