/* ==========================================================================
   FULLMING — Listing pages (category / search / special)
   Owned by the listing group. Tokens only — no raw colours, no px font sizes.
   Depends on: tokens.css, base.css, components.css
   ========================================================================== */

/* ---------- Hero ---------- */
.dd-listing-hero .dd-breadcrumb {
  padding-top: 0;
  padding-bottom: var(--sp-6);
}
.dd-listing-hero .dd-page-hero-inner { align-items: start; }
.dd-listing-hero-copy { min-width: 0; }

.dd-listing-desc {
  max-width: 58ch;
  color: var(--fm-ink-2);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.dd-listing-desc p { margin: 0 0 var(--sp-2); }
.dd-listing-desc p:last-child { margin-bottom: 0; }
.dd-listing-desc a {
  color: var(--fm-rose-deep);
  border-bottom: 1px solid var(--fm-rose-soft);
}
.dd-listing-desc a:hover { border-bottom-color: var(--fm-rose); }
.dd-listing-desc img { max-width: 100%; border-radius: var(--r-sm); }
.dd-listing-desc ul, .dd-listing-desc ol { list-style: disc; padding-left: var(--sp-5); }
.dd-listing-desc ol { list-style: decimal; }

/* search field inside the search-page hero */
.dd-searchbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  max-width: 44rem;
}
.dd-searchbar input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  border-radius: var(--r-pill);
  padding-inline: var(--sp-5);
  background: var(--fm-surface);
}
.dd-searchbar .dd-btn {
  flex: 0 0 auto;
  min-height: 46px;
}

/* ---------- Body ---------- */
.dd-listing-body {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-20);
}

/* ---------- Toolbar ---------- */
.dd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-bottom: var(--sp-5);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--fm-line);
}
.dd-toolbar-results {
  font-family: var(--fm-font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--fm-ink-3);
}
.dd-toolbar-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.dd-toolbar-field { display: flex; align-items: center; min-width: 0; }
.dd-toolbar-field .dd-select {
  width: auto;
  min-width: 10.5rem;
  max-width: 100%;
  min-height: 40px;
  padding-block: 0;
  font-size: var(--fs-xs);
  color: var(--fm-ink-2);
  background-color: var(--fm-surface);
}

/* ---------- Product grid ---------- */
.dd-listing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-6) var(--sp-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.dd-listing-item { display: flex; min-width: 0; }
.dd-listing-item > .dd-card { width: 100%; }

/* ---------- Wholesale card ---------- */
.dd-pcard-media-link {
  display: block;
  width: 100%;
  height: 100%;
}
.dd-pcard-media-link:focus-visible { outline-offset: -3px; }

.dd-pcard .dd-card-body {
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-4) var(--sp-4);
  min-width: 0;
}

.dd-pcard-name {
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
  min-height: calc(var(--fs-h4) * var(--lh-snug) * 2);
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dd-pcard-name a { display: block; }

/* No reserved height: the card footer is pushed to the bottom of the card by
   margin-top:auto, so an empty subtitle no longer leaves a blank band. */
.dd-pcard-sub {
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.dd-pcard .dd-card-price-row { gap: var(--sp-2); }
.dd-pcard .dd-card-price { font-size: var(--fs-h3); line-height: var(--lh-tight); }
/* No unit price on the storefront — the card shows a label that holds the
   same line box so every card in a row still lines up. */
.dd-card-price--por,
.dd-pcard .dd-card-price--por {
  font-family: var(--fm-font-mono);
  font-size: var(--fs-sm);
  letter-spacing: .04em;
  line-height: var(--lh-tight);
  color: var(--fm-ink-2);
}

.dd-pcard-price-note {
  font-family: var(--fm-font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--fm-ink-3);
  min-height: 0;
}

/* B2B meta row: MOQ · lead time · FOB port */
.dd-pcard-meta {
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  padding-top: var(--sp-3);
  margin-top: auto;
}
.dd-pcard .dd-card-moq {
  color: var(--fm-ink);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.dd-pcard-meta-item {
  font-family: var(--fm-font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .02em;
  color: var(--fm-ink-3);
  white-space: nowrap;
}
.dd-pcard-meta .dd-badge { font-size: var(--fs-eyebrow); }

/* Actions */
.dd-pcard-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-3);
}
.dd-pcard-specs {
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tr-wide);
  color: var(--fm-ink-3);
  border-bottom-color: transparent;
  padding: var(--sp-3) 0; /* taller tap target */
  display: inline-block;
}
.dd-pcard-specs:hover { color: var(--fm-rose-deep); border-bottom-color: var(--fm-rose); }

/* Stars as characters (no inline SVG in the card) */
.dd-pcard .dd-card-stars {
  font-size: var(--fs-sm);
  line-height: 1;
  letter-spacing: 1px;
  color: var(--fm-gold);
}
.dd-pcard .dd-card-rating-num { color: var(--fm-ink-2); font-weight: var(--fw-medium); }

/* ---------- Pagination / empty ---------- */
.dd-listing-pagination { margin-top: var(--sp-10); }
.dd-listing-pagination .pagination { margin: 0; }

.dd-listing-body .dd-empty { padding-block: var(--sp-16); }
.dd-listing-body .dd-empty .dd-h2 { font-size: var(--fs-h2); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .dd-listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-5) var(--sp-4);
  }
  .dd-listing-hero .dd-page-hero-inner { gap: var(--sp-8); }
}

@media (max-width: 768px) {
  .dd-listing-body { padding-top: var(--sp-6); }
  .dd-toolbar { gap: var(--sp-3); }
  .dd-toolbar-controls { width: 100%; }
  .dd-toolbar-field { flex: 1 1 0; }
  .dd-toolbar-field .dd-select { width: 100%; min-width: 0; }
}

@media (max-width: 560px) {
  .dd-listing-grid { gap: var(--sp-4) var(--sp-3); }

  .dd-pcard .dd-card-body {
    gap: var(--sp-1);
    padding: var(--sp-3);
  }
  .dd-pcard .dd-card-eyebrow {
    font-size: var(--fs-eyebrow);
    letter-spacing: .08em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dd-pcard-name {
    font-size: var(--fs-body);
    min-height: calc(var(--fs-body) * var(--lh-snug) * 2);
  }
  .dd-pcard-sub {
    font-size: var(--fs-eyebrow);
    line-height: 1.5;
    min-height: calc(var(--fs-eyebrow) * 3);
  }
  .dd-pcard .dd-card-price { font-size: var(--fs-h4); }
  .dd-pcard .dd-card-price--por { font-size: var(--fs-xs); }
  .dd-pcard .dd-card-price-old { font-size: var(--fs-xs); }
  .dd-pcard-price-note { font-size: var(--fs-eyebrow); letter-spacing: .06em; }

  .dd-pcard-meta {
    gap: var(--sp-1) var(--sp-2);
    padding-top: var(--sp-2);
  }
  /* the price note already states the FOB port on narrow cards */
  .dd-pcard-meta-fob { display: none; }
  .dd-pcard .dd-card-moq,
  .dd-pcard-meta-item { font-size: var(--fs-eyebrow); }
  .dd-pcard-actions { margin-top: var(--sp-2); gap: var(--sp-1); }
  .dd-pcard .dd-btn-sm {
    /* 44px: the shop's own touch-target floor. 34px saved a little card
       height but shrinks the primary action below the accessibility
       minimum on the devices where every tap is a thumb. */
    min-height: 44px;
    padding-inline: var(--sp-2);
    font-size: var(--fs-eyebrow);
    letter-spacing: .06em;
  }
  .dd-pcard .dd-card-wish { width: 44px; height: 44px; }
  .dd-pcard .dd-card-flag { font-size: var(--fs-eyebrow); padding: 3px 6px; }

  .dd-searchbar { flex-wrap: wrap; }
  .dd-searchbar input[type="search"] { flex: 1 1 100%; }
  .dd-searchbar .dd-btn { flex: 1 1 100%; }

  .dd-listing-body .dd-empty { padding-block: var(--sp-12); }
}

/* ------------------------------------------------- mobile product card
   At 169px wide the card was carrying seven lines of type: the category and
   the product name both ended in an ellipsis, "FOB GUANGZHOU · PER UNIT"
   wrapped to two lines, and the MOQ / lead-time chips stacked. The trade
   details that matter on a phone are price and MOQ — the rest lives on the
   product page. */
@media (max-width: 560px) {
  .dd-pcard .dd-card-body { padding: var(--sp-3); gap: 4px; }

  .dd-pcard-sub {
    font-size: 9px;
    letter-spacing: .05em;
    min-height: 1.5em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dd-pcard-price-note { display: none; }

  /* Two chips never fit side by side in a 147px card body, so they stacked
     into 58px of pill chrome. As plain stacked rows the same two facts take
     half that and stop competing with the price. */
  .dd-pcard-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding-top: var(--sp-2);
  }
  .dd-pcard-meta .dd-card-moq { font-size: 10px; line-height: 1.35; white-space: nowrap; }
  .dd-pcard-meta .dd-pcard-meta-item,
  .dd-pcard-meta .dd-badge {
    background: none;
    border: 0;
    padding: 0;
    font-size: 9px;
    line-height: 1.35;
    letter-spacing: .02em;
    white-space: nowrap;
  }

  .dd-pcard-actions .dd-btn { font-size: 10px; min-height: 40px; }
  .dd-pcard-actions { margin-top: var(--sp-2); }
}

/* ====================== Card footer ======================
   Editorial look: quiet ink caption left, ghost outline action right.
   The bright pill + solid rose dot read as consumer-retail chrome and
   fought the serif catalogue typography, so both are replaced. */
.dd-pcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-3);
  padding-bottom: 6px;
  border-top: 1px solid var(--fm-line);
}
.dd-pcard-foot .dd-card-price--por {
  white-space: nowrap;
  font-family: var(--fm-font-body);
  font-size: 12.5px;
  font-weight: var(--fw-medium, 500);
  letter-spacing: .01em;
  color: var(--fm-ink);
}
.dd-pcard-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--fm-line-strong, #E3D4D8);
  border-radius: var(--r-pill, 999px);
  background: transparent;
  color: var(--fm-ink-2);
  font-family: var(--fm-font-body);
  font-size: 11.5px;
  font-weight: var(--fw-medium, 500);
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.dd-pcard-add svg { width: 13px; height: 13px; }
.dd-pcard-add::before { content: none; }   /* drop the legacy expanded hit ring; the control itself is now the target */
.dd-pcard-add:hover,
.dd-pcard-add:focus-visible {
  border-color: var(--fm-rose-deep);
  color: var(--fm-rose-deep);
  background: var(--fm-rose-tint, #FBEEF1);
}
.dd-pcard-add:active { transform: scale(.97); }
.dd-pcard-add.is-busy { opacity: .55; pointer-events: none; }
.dd-pcard-add.is-added {
  border-color: var(--fm-rose-deep);
  background: var(--fm-rose-deep);
  color: #fff;
}

/* Inline confirmation, so adding from the grid never scrolls the page away. */
.dd-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: calc(100vw - 32px);
  padding: var(--sp-3) var(--sp-5);
  white-space: nowrap;
  background: var(--fm-ink-band);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  box-shadow: var(--sh-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}
.dd-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@media (max-width: 560px) {
  .dd-pcard-foot {
    gap: 6px;
    padding-right: 4px;
  }
  .dd-pcard-foot .dd-card-price--por { font-size: 10.5px; letter-spacing: 0; min-width: 0; }
  .dd-pcard-add { height: 30px; padding: 0 9px; font-size: 10px; letter-spacing: .02em; gap: 4px; }
  .dd-pcard-add svg { width: 11px; height: 11px; }
}
.dd-toast a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 900px) {
  .dd-toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* ====================== Chrome-free product tile ======================
   On a rose page a grid of white tiles reads as stickers laid on top.
   Dropping the card frame leaves the image, the title and one quiet price
   row — the grid keeps its rhythm because the price rows stay aligned. */
.dd-pcard {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.dd-pcard:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}
.dd-pcard .dd-card-media { border-radius: var(--r-md); }
.dd-pcard .dd-card-body {
  padding: var(--sp-3) 2px 0;
  gap: var(--sp-2);
}
.dd-pcard .dd-pcard-name {
  font-size: 17px;
  line-height: 1.3;
  min-height: calc(17px * 1.3 * 2);
}
.dd-pcard .dd-pcard-foot { padding-top: var(--sp-2); }.dd-pcard:hover .dd-card-img { transform: scale(1.03); }

@media (max-width: 560px) {
  .dd-pcard .dd-pcard-name { font-size: 15.5px; min-height: calc(15.5px * 1.3 * 2); }
}

/* The tile has no frame, so the label and the add control used to sit on the
   very edge of the column. A small inset lines them up with the image. */
.dd-pcard .dd-card-body { padding-inline: 10px; }
