/* ==========================================================================
   Product card — Product Listing Page (PLP)
   Drop-in styles. All colours and sizes are tokens at the top.
   ========================================================================== */

:root {
  /* Colour */
  --pc-page-bg:        #F6F4EF;  /* website background */
  --pc-card-bg:        #FFFFFF;  /* product card */
  --pc-text:           #242424;  /* main text */
  --pc-text-secondary: #77736D;  /* brand, colour count, old price */
  --pc-border:         #E8E5DE;  /* card border */
  --pc-image-frame:    #F1EEE8;  /* fill behind images that don't fill the square */
  --pc-accent:         #354238;  /* hover state of product name */
  --pc-badge-bg:       #B85C4A;  /* discount badge */
  --pc-badge-text:     #FFFFFF;
  --pc-wishlist-on:    #B85C4A;  /* filled heart */

  /* Type */
  --pc-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;

  /* Layout */
  --pc-columns: 3;
  --pc-gap: 24px;
  --pc-radius: 8px;
  --pc-image-padding: 16px;
}

/* ---------- Grid ---------- */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(var(--pc-columns), minmax(0, 1fr));
  gap: var(--pc-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 1024px) { .pc-grid { --pc-columns: 2; } }
@media (max-width: 560px)  { .pc-grid { --pc-gap: 12px; --pc-image-padding: 10px; } }

/* ---------- Card ---------- */
.pc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--pc-card-bg);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  overflow: hidden;
  font-family: var(--pc-font);
  color: var(--pc-text);
}

/* ---------- Image ---------- */
.pc-media {
  position: relative;
  aspect-ratio: 1 / 1;              /* every card has the same square frame */
  background: var(--pc-image-frame);
  padding: var(--pc-image-padding);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pc-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;              /* never crop the product */
  mix-blend-mode: multiply;         /* white backgrounds melt into the frame */
  display: block;
}

/* ---------- Discount badge ---------- */
.pc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--pc-badge-bg);
  color: var(--pc-badge-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 4px;
}

/* ---------- Wishlist ---------- */
.pc-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;                       /* sits above the card-wide link */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(36, 36, 36, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--pc-text);
}
.pc-wishlist svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.pc-wishlist[aria-pressed="true"] { color: var(--pc-wishlist-on); }
.pc-wishlist[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Body ---------- */
.pc-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}
.pc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 18px;                     /* fixed: colour count never changes card height */
}
.pc-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pc-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-colours {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--pc-text-secondary);
}

/* Product name: always 2 lines tall, cut with "…" beyond that */
.pc-name {
  font-size: 15px;
  line-height: 22px;
  height: 44px;
  color: var(--pc-text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
/* The whole card is clickable (see .pc-name::after) */
.pc-name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pc-card:hover .pc-name,
.pc-name:focus-visible {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--pc-accent);
}
.pc-name:focus-visible { outline: none; }
.pc-card:has(.pc-name:focus-visible) { outline: 2px solid var(--pc-accent); outline-offset: 2px; }

/* ---------- Price ---------- */
.pc-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0; }
.pc-price-now { font-size: 16px; font-weight: 700; color: var(--pc-text); }
.pc-price-was { font-size: 13px; color: var(--pc-text-secondary); text-decoration: line-through; }

@media (prefers-reduced-motion: reduce) { .pc-name { transition: none; } }

/* ---------- FurnishFinder additions ---------- */
.pc-grid { width: 100%; }
.pc-price-from { font-size: 12px; font-weight: 400; color: var(--pc-text-secondary); margin-right: -4px; }
.pc-media .image-fallback { font: 12px var(--pc-font); color: var(--pc-text-secondary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Wishlist: "save to a room" pop-up, header link, product-page button ---------- */
.wish-pop { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--pc-border); border-radius: 10px; padding: 12px;
  box-shadow: 0 12px 32px rgba(36,36,36,.16); font-family: var(--pc-font); color: var(--pc-text); }
.wish-pop-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pc-text-secondary); }
.wish-pop-rooms { display: grid; gap: 4px; }
.wish-room { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--pc-border);
  border-radius: 8px; padding: 8px 10px; font: 500 14px var(--pc-font); color: var(--pc-text); cursor: pointer; }
.wish-room small { margin-left: auto; font-size: 11px; color: var(--pc-text-secondary); }
.wish-room:hover { border-color: var(--pc-accent); }
.wish-room.on { background: #EEF1EC; border-color: var(--pc-accent); color: var(--pc-accent); }
.wish-check { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--pc-image-frame); font-size: 12px; font-weight: 700; }
.wish-room.on .wish-check { background: var(--pc-accent); color: #fff; }
.wish-room:focus-visible, .wish-pop-link:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.wish-pop-link { display: block; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--pc-accent); }
.wish-link { white-space: nowrap; }
.wish-count:not(:empty) { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 2px; border-radius: 99px; background: var(--pc-badge-bg);
  color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wish-save { border: 1px solid var(--pc-border); background: #fff; border-radius: 999px; padding: 12px 18px; font: 600 14px var(--pc-font); cursor: pointer; color: var(--pc-text); }
.wish-save[aria-pressed="true"] { border-color: var(--pc-badge-bg); color: var(--pc-badge-bg); }
/* ---------- Wishlist page ---------- */
.wish-page { max-width: 1016px; margin: 0 auto; padding: 32px 20px 64px; font-family: var(--pc-font); color: var(--pc-text); }
.wish-eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pc-text-secondary); }
.wish-page h1 { font-family: "Playfair Display", Georgia, serif; font-size: 2.2rem; margin: 6px 0 4px; }
.wish-sub { margin: 4px 0 0; color: var(--pc-text-secondary); font-size: 14px; }
.wish-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; }
.wish-tab { border: 1px solid var(--pc-border); background: #fff; border-radius: 999px; padding: 7px 14px; font: 600 13px var(--pc-font); color: var(--pc-text); cursor: pointer; }
.wish-tab span { color: var(--pc-text-secondary); font-weight: 400; }
.wish-tab.on { background: var(--pc-text); border-color: var(--pc-text); color: #fff; }
.wish-tab.on span { color: #fff; }
.wish-room-sec { margin-top: 28px; }
.wish-room-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.wish-room-sec h2 { font-family: "Playfair Display", Georgia, serif; font-size: 1.5rem; margin: 0; }
.wish-drop { margin: 2px 0 0; font-size: 12px; font-weight: 700; color: var(--pc-accent); }
.wish-out { color: var(--pc-badge-bg); }
.wish-empty { margin-top: 32px; padding: 32px; background: #fff; border: 1px solid var(--pc-border); border-radius: 10px; text-align: center; }
.wish-gone { opacity: .7; }
.wish-remove { align-self: flex-start; border: 1px solid var(--pc-border); background: #fff; border-radius: 6px; padding: 6px 10px; font: 600 12px var(--pc-font); cursor: pointer; }
