/* ==========================================================================
   DC EXPORT — Catalog (listing, product detail, quote)
   Quote-first B2G model. Depends on style.css tokens.
   ========================================================================== */

/* ----- Catalog layout: filter rail + results ----- */
.catalog { display: grid; grid-template-columns: 268px 1fr; gap: 36px; align-items: start; }
.catalog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.catalog-head .count { color: var(--muted); font-size: 0.9rem; }
.catalog-head .sort { display: flex; align-items: center; gap: 10px; }
.catalog-head .sort label { font-size: 0.85rem; color: var(--muted); }
.catalog-head select { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem; color: var(--ink); background: #fff; }

/* Filter rail */
.filters { position: sticky; top: 94px; }
.filters .f-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.filters .f-top h3 { font-size: 1rem; }
.filters .f-clear { font-size: 0.82rem; color: var(--waterworks); font-weight: 600; background: none; border: 0; padding: 0; }
.filters .f-clear:hover { text-decoration: underline; }
.fgroup { border-top: 1px solid var(--line); padding: 16px 0; }
.fgroup > button { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 0; font-family: var(--display); font-weight: 600; font-size: 0.92rem; color: var(--navy); }
.fgroup > button .chev { width: 16px; height: 16px; transition: transform .16s; color: var(--muted); }
.fgroup.closed > button .chev { transform: rotate(-90deg); }
.fgroup .f-opts { margin-top: 12px; display: grid; gap: 9px; }
.fgroup.closed .f-opts { display: none; }
.f-opt { display: flex; align-items: center; gap: 9px; font-size: 0.89rem; color: var(--ink-soft); cursor: pointer; }
.f-opt input { width: 16px; height: 16px; accent-color: var(--navy); flex: none; }
.f-opt:hover { color: var(--navy); }
.f-opt .fc-count { margin-left: auto; color: var(--muted); font-size: 0.8rem; }

/* Active filter chips */
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: var(--paper); border: 1px solid var(--line); color: var(--navy); font-size: 0.82rem; padding: 6px 10px; border-radius: 40px; }
.chip button { background: none; border: 0; color: var(--muted); display: grid; place-items: center; padding: 0; }
.chip button:hover { color: var(--red); }
.chip button svg { width: 13px; height: 13px; }

/* Results grid */
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pcard { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow .16s, transform .16s, border-color .16s; }
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #C3D1E3; }
.pcard .pimg { aspect-ratio: 4 / 3; background: repeating-linear-gradient(135deg, #EEF3F9 0 14px, #E7EEF6 14px 28px); display: grid; place-items: center; color: #7991AE; position: relative; }
.pcard .pimg .ph-label { font-size: 0.78rem; font-weight: 600; }
.pcard .badge { position: absolute; top: 10px; left: 10px; background: var(--navy); color: #fff; font-size: 0.68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 4px 9px; border-radius: 4px; }
.pcard .badge.ada { background: var(--procare); }
.pcard .pbody { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.pcard .pmeta { font-size: 0.74rem; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; margin-bottom: 6px; }
.pcard h3 { font-size: 1.02rem; line-height: 1.3; margin-bottom: 8px; }
.pcard h3 a:hover { color: var(--waterworks); }
.pcard .pattrs { font-size: 0.84rem; color: var(--ink-soft); margin-bottom: 14px; display: grid; gap: 3px; }
.pcard .pattrs span b { color: var(--navy); font-weight: 600; }
.pcard .pactions { margin-top: auto; display: flex; gap: 8px; }
.pcard .pactions .btn { flex: 1; justify-content: center; padding: 10px 12px; font-size: 0.86rem; }

.no-results { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); }
.no-results h3 { color: var(--navy); margin-bottom: 8px; }

/* Mobile filter toggle */
.filter-toggle { display: none; }

/* ----- Product Detail Page ----- */
.pdp { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: start; }
.gallery .main-img { aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); background: repeating-linear-gradient(135deg, #EEF3F9 0 16px, #E7EEF6 16px 32px); display: grid; place-items: center; color: #7991AE; margin-bottom: 14px; }
.gallery .main-img .ph-label { font-weight: 600; font-size: 0.9rem; }
.gallery .thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.gallery .thumbs .thumb { aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, #F2F6FB 0 10px, #EAF0F7 10px 20px); display: grid; place-items: center; padding: 6px; text-align: center; font-size: 0.6rem; color: #8097b3; line-height: 1.2; cursor: pointer; }
.gallery .thumbs .thumb.active, .gallery .thumbs .thumb:hover { border-color: var(--navy); }

.pdp-info .pdp-crumb-cat { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.pdp-info h1 { font-size: 1.7rem; margin: 8px 0 14px; }
.pdp-ids { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.pdp-ids b { color: var(--navy); font-weight: 600; }
.pdp-short { color: var(--ink-soft); margin-bottom: 20px; }
.pdp-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pdp-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; padding: 6px 11px; border-radius: 40px; border: 1px solid var(--line); color: var(--steel); background: var(--paper); }
.pdp-badge.on { color: var(--procare); border-color: #BfeBd4; background: #EAF7F0; }
.pdp-badge svg { width: 14px; height: 14px; }

.variant { margin-bottom: 16px; }
.variant .v-label { font-size: 0.82rem; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.variant .v-label span { color: var(--muted); font-weight: 400; }
.v-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.v-opt { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.86rem; color: var(--ink-soft); background: #fff; cursor: pointer; }
.v-opt.sel, .v-opt:hover { border-color: var(--navy); color: var(--navy); }
.v-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.v-swatch.sel { box-shadow: 0 0 0 2px var(--navy); }

.quote-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--paper); margin: 22px 0; }
.quote-box .qrow { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.quote-box .qrow label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.quote-box .qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.quote-box .qty button { width: 38px; height: 40px; background: #fff; border: 0; font-size: 1.1rem; color: var(--navy); }
.quote-box .qty button:hover { background: var(--paper-2); }
.quote-box .qty input { width: 54px; height: 40px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-family: inherit; font-size: 0.95rem; }
.quote-box .qactions { display: flex; gap: 10px; flex-wrap: wrap; }
.quote-box .qactions .btn { flex: 1; justify-content: center; min-width: 150px; }
.quote-note { font-size: 0.8rem; color: var(--muted); margin-top: 12px; display: flex; gap: 7px; align-items: flex-start; }
.quote-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--steel); }

/* PDP tabs */
.pdp-tabs { margin-top: 56px; border-top: 1px solid var(--line); }
.tabnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabnav button { padding: 15px 20px; background: none; border: 0; border-bottom: 2px solid transparent; font-family: var(--display); font-weight: 600; font-size: 0.95rem; color: var(--muted); margin-bottom: -1px; }
.tabnav button.active { color: var(--navy); border-bottom-color: var(--red); }
.tabpane { display: none; padding: 32px 0; }
.tabpane.active { display: block; }
.spec-group { margin-bottom: 28px; }
.spec-group h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.doc-list { display: grid; gap: 10px; max-width: 520px; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.doc-item:hover { border-color: #C3D1E3; background: var(--paper); }
.doc-item .dic { width: 34px; height: 34px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; color: var(--navy); flex: none; }
.doc-item .dic svg { width: 18px; height: 18px; }
.doc-item .dname { font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.doc-item .dmeta { font-size: 0.76rem; color: var(--muted); }
.doc-item .darrow { margin-left: auto; color: var(--muted); }

/* ----- Quote drawer (mini) ----- */
.quote-fab { position: fixed; right: 20px; bottom: 20px; z-index: 90; background: var(--navy); color: #fff; border: 0; border-radius: 40px; padding: 13px 20px; font-weight: 600; font-size: 0.9rem; box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; gap: 9px; }
.quote-fab:hover { background: var(--navy-600); }
.quote-fab .qcount { background: var(--red); color: #fff; border-radius: 40px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 0.78rem; padding: 0 6px; }
.quote-fab.hidden { display: none; }

/* ----- Quote page ----- */
.quote-items { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.quote-item { display: grid; grid-template-columns: 80px 1fr auto auto; gap: 18px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.quote-item:last-child { border-bottom: 0; }
.quote-item .qi-img { width: 80px; height: 60px; border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, #EEF3F9 0 10px, #E7EEF6 10px 20px); }
.quote-item h4 { font-size: 0.98rem; margin-bottom: 3px; }
.quote-item .qi-meta { font-size: 0.8rem; color: var(--muted); }
.quote-item .qi-remove { background: none; border: 0; color: var(--muted); font-size: 0.82rem; }
.quote-item .qi-remove:hover { color: var(--red); }
.quote-empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.quote-empty h2 { color: var(--navy); margin-bottom: 10px; }

@media (max-width: 1040px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
  .filter-toggle { display: inline-flex; }
  .pdp { grid-template-columns: 1fr; gap: 28px; }
  .results { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .results { grid-template-columns: 1fr; }
  .gallery .thumbs { grid-template-columns: repeat(4, 1fr); }
  .quote-item { grid-template-columns: 60px 1fr; }
  .quote-item .qi-img { width: 60px; height: 46px; }
}

/* ---- Real product photos (graceful fallback to the placeholder pattern) ---- */
.pcard .pimg { overflow: hidden; }
.pcard .pimg img,
.gallery .main-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.gallery .main-img { position: relative; overflow: hidden; }
.gallery .thumbs .thumb { position: relative; overflow: hidden; }
.gallery .thumbs .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Featured flag on product cards (top-right, mineral red) */
.pcard .badge.feat { left: auto; right: 10px; background: var(--red); }

/* Origin + lead time + long description on the product page */
.pdp-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 2px 0 16px; font-size: 0.86rem; color: var(--ink-soft); }
.pdp-facts span b { color: var(--ink); font-weight: 600; margin-right: 5px; }
.pdp-long { color: var(--ink-soft); margin: 4px 0 18px; line-height: 1.62; }
.pdp-long p { margin: 0 0 10px; }
.pdp-long p:last-child { margin-bottom: 0; }
.tcard-feat { display: inline-block; background: var(--red); color: #fff; font-size: 0.6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; vertical-align: middle; margin-left: 4px; }
