/* ==========================================================================
   PRODUCT CARD (js/product-card.js)
   The one card for every product listing: home #our-coffee, shop grid, about, related on product.html.
   Loaded last, after brand.css / pages.css. The choice controls (.pc-opt) also sit in product.html's
   light buy box: colours come from the --pc-* tokens, which .pc-opts--light swaps.
   ========================================================================== */

.pcard,
.pc-opts {
  --pc-ink: #FFFFFF;
  --pc-muted: rgba(255, 255, 255, 0.6);
  --pc-faint: rgba(255, 255, 255, 0.42);
  --pc-line: rgba(255, 255, 255, 0.1);
  --pc-fill: rgba(255, 255, 255, 0.04);
  --pc-fill-hover: rgba(255, 255, 255, 0.09);
  --pc-on: rgba(237, 88, 47, 0.16);
  --pc-accent: var(--brand-ember, #ED582F);
}

.pc-opts--light {
  --pc-ink: #000000;
  --pc-muted: rgba(0, 0, 0, 0.62);
  --pc-faint: rgba(0, 0, 0, 0.5);
  --pc-line: rgba(0, 0, 0, 0.12);
  --pc-fill: #FFFFFF;
  --pc-fill-hover: #F5F5F5;
  --pc-on: rgba(237, 88, 47, 0.1);
}

/* ---------- Card shell ---------- */
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #121216;
  color: var(--pc-ink);
  font-family: var(--font-body);
  text-align: left;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.35s var(--ease-out, ease), box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: pointer; /* the whole card opens the product (js/product-card.js) */
}

.pcard .pc-opts { cursor: default; } /* gaps between the choices don't open it */

.pcard:hover {
  transform: translateY(-6px);
  border-color: rgba(237, 88, 47, 0.45);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.pcard.is-featured {
  padding-top: 30px;
  border: 2px solid rgba(237, 88, 47, 0.7);
  background: #16141A;
}

.pcard__flag {
  position: absolute;
  top: -15px;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(237, 88, 47, 0.8);
  background: #0B0B0E;
  color: var(--pc-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.pcard__flag .material-symbols-outlined { font-size: 14px; }

/* ---------- Top row ---------- */
.pcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pc-line);
}

.pcard__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pcard__label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pcard__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(237, 88, 47, 0.12);
  color: var(--pc-accent);
  font-size: 14px !important;
}

.pcard.is-featured .pcard__label { color: #FFFFFF; font-weight: 700; }
.pcard.is-featured .pcard__icon { background: var(--pc-accent); color: #000000; }

.pcard__status {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.pcard.is-featured .pcard__status,
.pcard[data-pcard^="the-drop"] .pcard__status {
  border-color: rgba(237, 88, 47, 0.35);
  background: rgba(237, 88, 47, 0.14);
  color: var(--pc-accent);
}

/* ---------- Photo stage ---------- */
.pc-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 230px;
  padding: 0; /* [damn_coffee] photo fills the stage edge to edge */
  overflow: hidden;
  border-radius: 20px;
  background: #EDEDEF;
  transition: box-shadow 0.35s ease;
}

.pc-stage__img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out, ease), opacity 0.16s ease;
}

.pc-stage__img.is-swapping { opacity: 0.2; transform: scale(0.96); }
.pcard:hover .pc-stage__img { transform: scale(1.04); }

/* Lifestyle photos fill the frame */
.pc-stage.is-cover { padding: 0; }
/* Square full-bleed product photos (custom field photo_fit = cover): a square frame, so the pack is never cropped */
.pcard .pc-stage.is-cover:not(.pc-stage--pair) { height: auto; aspect-ratio: 1 / 1; }
.pc-stage.is-cover .pc-stage__img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; filter: none; }
.pc-stage .pc-stage__shadow { display: none; }

.pc-stage--pair { gap: 4%; }
.pc-stage--pair img { position: relative; z-index: 2; width: 42%; max-height: 180px; object-fit: contain; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.22)); }

.pc-stage__shadow {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 1;
  width: 64%;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  filter: blur(6px);
  transform: translateX(-50%);
}

.pc-stage__chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 14, 0.86);
  color: #F0F0F3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.pc-stage__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pc-accent); }

.pc-stage__views {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 14, 0.8);
}

.pc-view {
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: 700 9px/1.2 var(--font-body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.pc-view:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); }
.pc-view.is-active { background: var(--pc-accent); color: #000000; }

/* ---------- Name, notes ---------- */
.pcard__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
}

.pcard__name {
  margin: 0;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.6vw, 1.45rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pcard__name a { color: inherit !important; text-decoration: none; }
.pcard__name a:hover { color: var(--pc-accent) !important; }

.pcard__format {
  margin: 4px 0 0;
  color: var(--pc-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.pcard__notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pcard__notes li {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--pc-line);
  background: var(--pc-fill);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

/* ---------- Choices ---------- */
.pc-opts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--pc-line);
}

.pc-opt {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pc-opt__head {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  line-height: 1.3;
}

.pc-opt__label {
  color: var(--pc-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pc-req { color: var(--pc-accent); }

.pc-opt__value {
  color: var(--pc-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.pc-opt__value--soft,
.pc-opt__value.is-empty {
  color: var(--pc-faint);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.pc-choices {
  display: grid;
  gap: 6px;
}

.pc-choices--1 { grid-template-columns: minmax(0, 1fr); }
.pc-choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pc-choices--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pc-choices--roast { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.pc-choice {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

.pc-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pc-choice > span {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--pc-line);
  background: var(--pc-fill);
  color: var(--pc-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pc-choice:hover > span { background: var(--pc-fill-hover); border-color: rgba(127, 127, 127, 0.45); }

.pc-choice input:checked + span {
  border-color: var(--pc-accent);
  background: var(--pc-on);
  color: var(--pc-accent);
  font-weight: 700;
}

.pc-choice input:focus-visible + span {
  outline: 2px solid var(--pc-accent);
  outline-offset: 2px;
}

/* Roast profiles: the number over its dots */
.pc-choice--roast > span {
  flex-direction: column;
  gap: 6px;
  min-height: 52px;
  padding: 8px 2px;
}

.pc-choice--roast b { font-size: 15px; font-weight: 700; line-height: 1; }

/* Roast level dots */
.pc-dots { display: inline-flex; align-items: center; gap: 2px; font-style: normal; }
.pc-dots > i { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--pc-line); }
.pc-dots > i.is-on { background: var(--pc-accent); }

/* A choice set by "How you brew" pulses once */
.pc-choice.is-suggested > span { animation: pc-suggest 0.9s var(--ease-out, ease); }

@keyframes pc-suggest {
  0% { box-shadow: 0 0 0 0 rgba(237, 88, 47, 0.55); }
  100% { box-shadow: 0 0 0 8px rgba(237, 88, 47, 0); }
}

.pc-opt.is-invalid .pc-choice > span { border-color: rgba(237, 88, 47, 0.75); }

.pc-opt__error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--pc-accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.pc-opt__error[hidden] { display: none; }

/* How you brew */
.pc-select { position: relative; display: block; }

.pc-select select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 14px;
  border-radius: 10px;
  border: 1px solid var(--pc-line);
  background: var(--pc-fill);
  color: var(--pc-ink);
  font: 500 13px/1.2 var(--font-body);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.pc-select select:hover { background: var(--pc-fill-hover); }
.pc-select select:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.pc-select select option { background: #FFFFFF; color: #000000; }

.pc-select svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--pc-muted);
  stroke-width: 2;
  pointer-events: none;
  transform: translateY(-50%);
}

/* ---------- Fixed facts (drip packs) ---------- */
.pc-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--pc-line);
}

.pc-info .pc-opt__head { margin: 0; }

.pc-info__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--pc-line);
  background: var(--pc-fill);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.45;
}

.pc-info__note .material-symbols-outlined { flex: 0 0 auto; color: var(--pc-accent); font-size: 16px; }

.pc-info__roast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: var(--pc-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pc-info__roast > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.pc-info__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pc-accent); }
.pc-info__roast .pc-dots { gap: 3px; }
.pc-info__roast .pc-dots > i { width: 6px; height: 6px; background: transparent; box-shadow: inset 0 0 0 1px var(--pc-accent); }
.pc-info__roast .pc-dots > i.is-on { background: var(--pc-accent); }

/* Light sections force dark text on every p / h3 / a with ID-level !important rules
   (e.g. "#our-coffee p"). :is(#our-coffee, .pcard) gives the card's own colours that same weight. */
:is(#our-coffee, .pcard) .pcard__name,
:is(#our-coffee, .pcard) .pcard__name a { color: #FFFFFF !important; }
:is(#our-coffee, .pcard) .pcard__name a:hover { color: var(--pc-accent) !important; }
:is(#our-coffee, .pcard) .pcard__format { color: var(--pc-muted) !important; }
:is(#our-coffee, .pcard) .pc-info__note { color: rgba(255, 255, 255, 0.8) !important; }
:is(#our-coffee, .pcard) .pc-info__roast,
:is(#our-coffee, .pcard) .pc-opt__head { color: var(--pc-muted) !important; }
:is(#our-coffee, .pcard) .pc-opt__error { color: var(--pc-accent) !important; }

/* ---------- Price + add ---------- */
.pcard__buy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--pc-line);
}

.pc-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.pc-price__now {
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.2vw, 1.9rem);
  font-weight: 700;
  line-height: 1;
}

.pcard.is-featured .pc-price__now { color: var(--pc-accent); }

.pc-price__meta { color: var(--pc-muted); font-size: 12px; }
.pc-price__meta s { color: var(--pc-faint); }

.pcard__add {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid #FFFFFF;
  background: #FFFFFF;
  color: #0A0A0E;
  font: 700 12px/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out, ease), background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.pcard__add .material-symbols-outlined { font-size: 18px; }
.pcard__add:hover { transform: translateY(-2px); border-color: var(--pc-accent); background: var(--pc-accent); color: #000000; }
.pcard__add:active { transform: scale(0.97); }

.pcard.is-featured .pcard__add { border-color: var(--pc-accent); background: var(--pc-accent); color: #000000; }
.pcard.is-featured .pcard__add:hover { border-color: #FFFFFF; background: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  .pcard, .pcard:hover, .pcard:hover .pc-stage__img, .pcard__add:hover { transform: none; }
  .pc-choice.is-suggested > span { animation: none; }
}

/* ==========================================================================
   Where the card is listed
   ========================================================================== */

/* Home #our-coffee: swipe row on phones/tablets, rows of three (centred) from 1024px */
/* Same layout for the hot row (home #hot-coffee, .home-shop) */
main #our-coffee .pcard-row,
main .home-shop .pcard-row {
  display: flex;
  gap: 24px;
  padding: 18px 2px 8px;
}

main #our-coffee .pcard-row > .pcard,
main .home-shop .pcard-row > .pcard {
  flex: 0 0 min(340px, calc(100vw - 48px));
  height: auto;
  scroll-snap-align: start;
}

main #our-coffee #pcard-carousel,
main .home-shop .home-shop__scroller { scroll-snap-type: x mandatory; scroll-padding-left: 2px; }

@media (min-width: 1024px) {
  main #our-coffee #pcard-carousel,
  main .home-shop .home-shop__scroller { overflow: visible !important; scroll-snap-type: none; }
  main #our-coffee .pcard-row,
  main .home-shop .pcard-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px 28px;
  }
  main #our-coffee .pcard-row > .pcard,
  main .home-shop .pcard-row > .pcard { flex: 0 0 calc((100% - 56px) / 3); }
}

/* Shop grid, related products, about: three across where 280px cards fit, the card fills its cell */
main.pg .shop-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 40px 24px; padding-top: 16px; }
main.pg .shop-grid > .shop-item,
main.pg .pcard-item { display: flex; list-style: none; }
main.pg .shop-grid > .shop-item > .pcard,
main.pg .pcard-item > .pcard { flex: 1 1 auto; width: 100%; min-width: 0; }
main.pg .pd-rel-grid,
main.pg .ab-lines { padding-top: 16px; row-gap: 40px; align-items: stretch; }

@media (max-width: 1023px) {
  main.pg .pd-rel-grid li:nth-child(3) { display: block; }
  main.pg .pd-rel-grid,
  main.pg .ab-lines { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); max-width: none; }
}

/* Product page buy box: the same choices on white */
main.pg-product .pc-opts--light { padding-top: 0; border-top: 0; }
