/* =====================================================================
   OneSource — Home v2  ·  Sections 5 & 6 + Card A
   .ec-pcard  — vertical product card (replaces the .ecom-card collision)
   .ec-sbc    — Shop By Categories (pills + scrollable strip)
   .ec-discount — Discounted Products grey band
   ===================================================================== */

/* ═══════════ CARD A — vertical product card ═══════════ */
.ec-pcard {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--ec-line);
  border-radius: 10px;
  padding: 12px 12px 14px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.ec-pcard:hover {
  /*border-color: var(--ec-coral);*/
  /*box-shadow: 0 6px 18px rgba(16,27,92,.08);*/
  /*transform: translateY(0px);*/
}
.ec-pcard.is-out { opacity: .72; }

.ec-pcard__badge {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 21;
  background: var(--ec-coral); color: #fff;
  font-size: 11px; font-weight: var(--ecom-fw-bold);
  padding: 3px 9px; border-radius: var(--ecom-radius-pill);
  line-height: 1.5;
}

.ec-pcard__media {
  display: grid; place-items: center;
  height: 150px; margin-bottom: 12px;
  padding: 6px;
}
.ec-pcard__media img { max-width: 100%; max-height: 144px; object-fit: contain; }
/*.ec-pcard__media img { max-width: 100%; max-height: 100%; object-fit: contain; }*/

.ec-pcard__body { display: flex; flex-direction: column; flex: 1; gap: 3px; }

.ec-pcard__name {
  font-size: 13.5px; font-weight: var(--ecom-fw-medium);
  color: var(--ec-ink); line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ec-pcard__name:hover { color: var(--ec-navy); }

.ec-pcard__pack { font-size: 11.5px; color: var(--ec-muted); }

.ec-pcard__pricerow {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  margin-top: 6px;
}
.ec-pcard__price {
  font-size: 17px; font-weight: var(--ecom-fw-bold);
  color: var(--ec-ink); line-height: 1.2;
}
.ec-pcard__orig {
  font-size: 12.5px; color: var(--ec-muted);
  text-decoration: line-through;
}
.ec-pcard__vat { font-size: 10.5px; color: var(--ec-muted); margin-top: 1px; }

.ec-pcard__stock {
  margin-top: 5px; font-size: 11.5px;
  font-weight: var(--ecom-fw-bold); color: var(--ecom-danger);
}
.ec-pcard__stock--low { color: var(--ec-coral); }

.ec-pcard__form { margin-top: 12px; }
.ec-pcard__addbtn {
  width: 100%; height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ec-navy); color: #fff;
  border: 0; border-radius: 7px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: var(--ecom-fw-medium);
  transition: background .18s ease;
}
.ec-pcard__addbtn i { font-size: 14px; }
.ec-pcard__addbtn:hover { background: var(--ec-navy-dark); }
.ec-pcard__addbtn.is-disabled,
.ec-pcard__addbtn:disabled { background: #C9CDD6; cursor: not-allowed; }

/* shared 6-up grid */
.ec-pgrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

/* ═══════════ 5 · SHOP BY CATEGORIES ═══════════ */
.ec-sbc { background: #fff; padding: 8px 0 34px; }
.ec-sbc__inner {
  max-width: var(--ecom-container);
  margin-inline: auto;
  padding-inline: 24px;
}

.ec-sbc__head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 18px;
}
.ec-sbc__title {
  margin: 0; flex: 0 0 auto;
  font-size: 22px; font-weight: var(--ecom-fw-bold); color: var(--ec-ink);
}

.ec-sbc__pills {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0; overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}
.ec-sbc__pills::-webkit-scrollbar { display: none; }

.ec-pill {
  flex: 0 0 auto;
  height: 34px; padding: 0 18px;
  background: var(--ec-navy-soft); color: var(--ec-navy);
  border: 0; border-radius: var(--ecom-radius-pill); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: var(--ecom-fw-medium);
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.ec-pill:hover { background: #E1E6FF; }
.ec-pill.is-active { background: var(--ec-navy); color: #fff; }

.ec-sbc__arrows { display: flex; gap: 8px; flex: 0 0 auto; }
.ec-arrow {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: #fff; color: var(--ec-navy);
  border: 1px solid var(--ec-line); border-radius: 8px; cursor: pointer;
  font-size: 12px;
  transition: background .18s ease, border-color .18s ease;
}
.ec-arrow:hover { background: var(--ec-navy-soft); border-color: var(--ec-navy); }

/* scrollable strip */
.ec-strip-wrap { position: relative; min-height: 120px; }
.ec-strip-wrap.is-loading .ec-strip { opacity: .35; pointer-events: none; }
.ec-strip-spinner {
  position: absolute; inset: 0; z-index: 3;
  display: none; align-items: center; justify-content: center;
  font-size: 26px; color: var(--ec-navy);
}
.ec-strip-wrap.is-loading .ec-strip-spinner { display: flex; }

.ec-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 5 * 16px) / 6);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 8px;
  transition: opacity .18s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--ec-line) transparent;
}
.ec-strip > .ec-pcard { scroll-snap-align: start; }
.ec-strip::-webkit-scrollbar { height: 6px; }
.ec-strip::-webkit-scrollbar-thumb { background: var(--ec-line); border-radius: 99px; }
.ec-strip::-webkit-scrollbar-track { background: transparent; }

.ec-strip__empty {
  grid-column: 1 / -1;
  padding: 40px 0; text-align: center;
  color: var(--ec-muted); font-size: 14px;
}

/* ═══════════ 6 · DISCOUNTED PRODUCTS ═══════════ */
.ec-discount { background: var(--ec-grey-band); padding: 36px 0 44px; }
.ec-discount__inner {
  max-width: var(--ecom-container);
  margin-inline: auto;
  padding-inline: 24px;
}
.ec-discount__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.ec-discount__title {
  margin: 0;
  font-size: 22px; font-weight: var(--ecom-fw-bold); color: var(--ec-ink);
}
.ec-discount__all {
  font-size: 13px; font-weight: var(--ecom-fw-medium);
  color: var(--ec-coral); text-decoration: underline; text-underline-offset: 3px;
  white-space: nowrap;
}
.ec-discount__all:hover { color: var(--ec-coral-dark); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1280px) {
  .ec-pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ec-strip { grid-auto-columns: calc((100% - 3 * 16px) / 4); }
}
@media (max-width: 1024px) {
  .ec-sbc__head { flex-wrap: wrap; }
  .ec-sbc__title { flex: 1 1 100%; }
  .ec-pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ec-strip { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
}
@media (max-width: 768px) {
  .ec-sbc__arrows { display: none; }
  .ec-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ec-strip { grid-auto-columns: calc((100% - 12px) / 2); gap: 12px; }
  .ec-sbc__inner, .ec-discount__inner { padding-inline: 16px; }
  .ec-sbc__title, .ec-discount__title { font-size: 19px; }
  .ec-pcard__media { height: 120px; }
  .ec-pcard__media img {
    height: 113px;
  }
  div#ecom-toast-host {
    left: 50% !important;
  }
}
@media (max-width: 420px) {
  .ec-discount__head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

