/*
 * BCW NCS Color-Picker — Sandbox CSS
 *
 * Selector-namespace: .bcw-ncs-* (wrapper) + .ncs-* (door PHP-provider gegenereerd)
 */

.bcw-ncs-picker-section {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 760px;
  margin: 24px auto 0;
}

/* ─── Teaser: kop + 5 grote strips als CTA (geen zwarte knop) ─── */

.bcw-ncs-teaser {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.bcw-ncs-teaser:hover {
  border-color: #c0c0c0;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

.bcw-ncs-teaser-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bcw-ncs-teaser-eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bcw-ncs-teaser-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f1f1f;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bcw-ncs-teaser-arrow {
  font-size: 18px;
  color: #999;
  transition: transform 0.2s ease, color 0.2s ease;
}

.bcw-ncs-teaser:hover .bcw-ncs-teaser-arrow {
  color: #1f1f1f;
  transform: translateX(6px);
}

.bcw-ncs-teaser-strips {
  display: flex;
  gap: 6px;
  width: 100%;
}

.bcw-ncs-teaser-strip {
  flex: 1;
  height: 56px;
  border: none;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  background-size: 100% 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.bcw-ncs-teaser-strip:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Hide teaser wanneer body open */
.bcw-ncs-picker-section.is-open .bcw-ncs-teaser {
  display: none;
}

@media (max-width: 520px) {
  .bcw-ncs-teaser {
    padding: 16px;
  }
  .bcw-ncs-teaser-title {
    font-size: 16px;
  }
  .bcw-ncs-teaser-strip {
    height: 48px;
  }
}

/* ─── Body wrapper (default verborgen) ─── */

.bcw-ncs-wrap {
  position: relative;
  margin-top: 12px;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.bcw-ncs-wrap[hidden] {
  display: none;
}

/* ─── Sluitknop (rechtsboven binnen body) ─── */

.bcw-ncs-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #555;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.bcw-ncs-close:hover {
  background: rgba(0,0,0,0.1);
}

/* ─── Input/zoekveld sectie ─── */

.ncs-input-section {
  padding: 16px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.ncs-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ncs-input-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.ncs-search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: #ffffff;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  margin: 0 !important;
}

.ncs-search-input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ncs-preview-area {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  min-height: 28px;
}

.ncs-preview-area.has-preview {
  border-color: #007cba;
}

.ncs-preview-text {
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

/* ─── Grid container — 6 kolommen vast ─── */

.ncs-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 16px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.ncs-color-grid::-webkit-scrollbar {
  width: 8px;
}
.ncs-color-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.ncs-color-grid::-webkit-scrollbar-thumb {
  background: #007cba;
  border-radius: 4px;
}
.ncs-color-grid::-webkit-scrollbar-thumb:hover {
  background: #005a87;
}

/* ─── Level 1: hoofdgroep-tegels (5 grote tegels met gradient + bottom-label) ─── */

.ncs-group-tile {
  position: relative;
  min-height: 90px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ncs-group-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.ncs-group-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 8px 10px;
  text-align: center;
}

.ncs-group-name {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  margin-bottom: 2px;
  line-height: 1.2;
}

.ncs-group-count {
  font-size: 11px;
  color: #666;
}

/* ─── Level 2: subgroep-header + tegels (flex row, gradient rechts) ─── */

.ncs-subcategory-header {
  padding: 16px 0 12px;
  grid-column: 1 / -1;
}

.ncs-subcategory-header h3 {
  margin: 0;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.ncs-subcategory-tile {
  display: flex;
  align-items: stretch;
  min-height: 70px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  grid-column: span 3;
}

.ncs-subcategory-tile:hover {
  border-color: #007cba;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

.ncs-subcategory-text {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.ncs-subcategory-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.ncs-subcategory-count {
  font-size: 12px;
  color: #666;
}

.ncs-subcategory-gradient {
  width: 120px;
  min-height: 70px;
  flex-shrink: 0;
  border-left: 1px solid #e0e0e0;
}

/* ─── Level 3: individuele swatches (6 kolommen, 45px hoog) ─── */

.ncs-colors-header {
  grid-column: 1 / -1;
  padding: 16px 0 12px;
}

.ncs-colors-header h3 {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.ncs-color-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.ncs-color-swatch {
  width: 100%;
  height: 45px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.ncs-color-wrapper:hover .ncs-color-swatch {
  transform: scale(1.05);
  border-color: #007cba;
  box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.ncs-color-wrapper.selected .ncs-color-swatch {
  border-color: #007cba;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.ncs-color-label {
  font-size: 10px;
  font-family: monospace;
  color: #666;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
  transition: color 0.2s ease;
}

.ncs-color-wrapper.selected .ncs-color-label {
  color: #007cba;
  font-weight: 600;
}

/* ─── Deselect-knop (✕) ─── */

.deselect-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #d63638;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  z-index: 2;
  cursor: pointer;
}

.ncs-color-wrapper.selected .deselect-btn {
  display: flex;
}

/* ─── Breadcrumb (boven grid) ─── */

.bcw-ncs-breadcrumb {
  padding: 10px 20px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  font-size: 13px;
  color: #666;
}

.bcw-ncs-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #007cba;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
}

.bcw-ncs-back:hover {
  background: #e6f4fb;
}

/* ─── Selectie-feedback onderaan ─── */

.bcw-ncs-selection {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #eee;
  background: #f8f9fa;
  min-height: 56px;
}

.bcw-ncs-selection-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
}

.bcw-ncs-selection-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bcw-ncs-selection-code {
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.bcw-ncs-selection-hint {
  font-size: 12px;
  color: #888;
}

.bcw-ncs-selection.is-empty .bcw-ncs-selection-code {
  color: #888;
  font-weight: 400;
  font-family: inherit;
}

/* ─── Loader ─── */

.bcw-ncs-loading {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

/* ─── Mobile (≤768px) ─── */

@media (max-width: 768px) {
  .bcw-ncs-wrap {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .ncs-color-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 12px 6px;
  }
  .ncs-subcategory-tile {
    grid-column: span 6;
  }
  .ncs-subcategory-gradient {
    width: 80px;
  }
  .ncs-group-tile {
    min-height: 75px;
  }
  .ncs-color-swatch {
    height: 40px;
  }
  .ncs-color-label {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .ncs-color-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .ncs-subcategory-tile {
    grid-column: span 4;
  }
}


/* ═══ Inline-mode v2 — "open layout" zonder panel-wrapper (shortcode op /ncs-kleuren/) ═══ */

.bcw-ncs-picker--inline {
  max-width: 1120px;
  margin: 40px auto 120px;
  padding: 0 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.bcw-ncs-picker--inline .bcw-ncs-section-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.bcw-ncs-picker--inline .bcw-ncs-section-lead {
  font-size: 15px;
  color: #666;
  margin: 0 0 22px;
  line-height: 1.55;
  max-width: 620px;
}

/* Sectie 1: zoekvak hero */
.bcw-ncs-search-hero {
  padding: 36px 0 28px;
  border-bottom: 1px solid #ececec;
}

.bcw-ncs-search-hero .bcw-ncs-search-wrap {
  max-width: 560px;
}

.bcw-ncs-picker--inline .ncs-search-input {
  width: 100%;
  font-size: 17px;
  padding: 16px 20px;
  border: 2px solid #d8d8d8;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.bcw-ncs-picker--inline .ncs-search-input:focus {
  outline: none;
  border-color: #135350;
  box-shadow: 0 0 0 3px rgba(19, 83, 80, 0.12);
}

/* Preview-area alleen tonen als er een live result is */
.bcw-ncs-picker--inline .ncs-preview-area {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  background: #f7f8f5;
  border-radius: 8px;
  font-size: 14px;
  color: #555;
}
.bcw-ncs-picker--inline .ncs-preview-area.has-preview {
  display: block;
}

/* Sectie 2: blader per kleurfamilie */
.bcw-ncs-browse {
  padding: 40px 0 20px;
}

.bcw-ncs-picker--inline .bcw-ncs-breadcrumb {
  margin-bottom: 16px;
  font-size: 14px;
  color: #555;
}

.bcw-ncs-picker--inline .ncs-color-grid.ncs-groups-view {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

/* Family-tiles groter dan PDP-versie */
.bcw-ncs-picker--inline .ncs-groups-view .ncs-group-tile {
  min-height: 160px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.bcw-ncs-picker--inline .ncs-groups-view .ncs-group-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.10);
}

/* Drilldown (subgroups + swatches) — meer ruimte, kleiner aantal kolommen voor leesbaarheid */
.bcw-ncs-picker--inline .ncs-color-grid.ncs-subgroups-view {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.bcw-ncs-picker--inline .ncs-color-grid.ncs-colors-view,
.bcw-ncs-picker--inline .ncs-color-grid.ncs-search-view {
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}

/* ─── Selectie sticky bottombar — verschijnt alleen bij keuze ─── */
.bcw-ncs-selection--sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: #ffffff;
  border-top: 1px solid #e3e3e3;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  padding: 14px 24px;
  transform: translateY(100%);
  transition: transform .25s ease;
}
/* Show when een selectie is gemaakt — JS verwijdert .is-empty class */
.bcw-ncs-selection--sticky:not(.is-empty):not([hidden]) {
  transform: translateY(0);
}
.bcw-ncs-selection--sticky[hidden] {
  display: none !important;
}

.bcw-ncs-selection-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.bcw-ncs-picker--inline + .bcw-ncs-selection--sticky .bcw-ncs-selection-swatch,
.bcw-ncs-selection--sticky .bcw-ncs-selection-swatch {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.bcw-ncs-selection--sticky .bcw-ncs-selection-info {
  flex: 1;
  min-width: 0;
}

.bcw-ncs-selection--sticky .bcw-ncs-selection-code {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.bcw-ncs-selection--sticky .bcw-ncs-selection-hint {
  font-size: 13px;
  color: #777;
  margin-top: 2px;
}

.bcw-ncs-selection-cta {
  background: #135350;
  color: #fff !important;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease;
  flex-shrink: 0;
}
.bcw-ncs-selection-cta:hover {
  background: #0E3E3C;
  color: #fff !important;
}

/* Responsive */
@media (max-width: 900px) {
  .bcw-ncs-picker--inline .ncs-color-grid.ncs-groups-view {
    grid-template-columns: repeat(3, 1fr);
  }
  .bcw-ncs-picker--inline .ncs-color-grid.ncs-subgroups-view {
    grid-template-columns: repeat(3, 1fr);
  }
  .bcw-ncs-picker--inline .ncs-color-grid.ncs-colors-view,
  .bcw-ncs-picker--inline .ncs-color-grid.ncs-search-view {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 600px) {
  .bcw-ncs-picker--inline {
    margin: 24px auto 140px;
    padding: 0 16px;
  }
  .bcw-ncs-picker--inline .bcw-ncs-section-title {
    font-size: 22px;
  }
  .bcw-ncs-picker--inline .ncs-color-grid.ncs-groups-view {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .bcw-ncs-picker--inline .ncs-groups-view .ncs-group-tile {
    min-height: 130px;
    font-size: 15px;
  }
  .bcw-ncs-picker--inline .ncs-color-grid.ncs-colors-view,
  .bcw-ncs-picker--inline .ncs-color-grid.ncs-search-view {
    grid-template-columns: repeat(4, 1fr);
  }
  .bcw-ncs-selection-inner {
    flex-wrap: wrap;
  }
  .bcw-ncs-selection-cta {
    width: 100%;
    text-align: center;
  }
}
/* ═══ Inline selection in-flow (sticky weg) + productkaartjes ═══ */

/* Override de oude sticky-styling */
.bcw-ncs-selection--inline {
  margin: 28px 0 0;
  padding: 18px 20px;
  background: #f7f8f5;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.bcw-ncs-selection--inline.is-empty {
  background: transparent;
  border-style: dashed;
  color: #888;
}

.bcw-ncs-selection--inline .bcw-ncs-selection-swatch {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.bcw-ncs-selection--inline .bcw-ncs-selection-info {
  flex: 1;
  min-width: 0;
}

.bcw-ncs-selection--inline .bcw-ncs-selection-code {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.bcw-ncs-selection--inline .bcw-ncs-selection-hint {
  font-size: 13px;
  color: #777;
  margin-top: 2px;
}

/* Productlijnen-blok onder picker */
.bcw-ncs-products {
  max-width: 1120px;
  margin: 56px auto 60px;
  padding: 0 24px;
}

.bcw-ncs-products .bcw-ncs-section-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 18px;
  line-height: 1.3;
}

.bcw-ncs-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.bcw-ncs-product-card {
  display: block;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  text-decoration: none !important;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.bcw-ncs-product-card:hover {
  border-color: #135350;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.bcw-ncs-product-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 4px;
}

.bcw-ncs-product-card-meta {
  font-size: 13px;
  color: #666;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .bcw-ncs-products-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ═══ Hide BCW's RAL-kleurenkaart helper-link op picker-PDPs ═══
 * mu-plugin oz-pdp-ral-helper injecteert deze link op alle product-pages.
 * Op onze 3 picker-PDPs (lavasteen 27736 / microcement 22760 / original 11161)
 * is hij overbodig: onze picker biedt visueel bladeren al. Hide via CSS — geen
 * DOM-edit (geen mutation-observer loop met mu-plugin). */
body.postid-27736 .oz-ral-helper-link,
body.postid-22760 .oz-ral-helper-link,
body.postid-11161 .oz-ral-helper-link {
  display: none !important;
}

/* ═══ Add-to-cart highlight na NCS-keuze (UX-route A) ═══
 * Klant kiest NCS-tint in picker → onze JS scrolt terug naar #addToCartBtn
 * en voegt deze class toe gedurende ~2.2s zodat de knop een teal-pulse krijgt
 * + check-icoon zonder dat we de bestaande BCW-styling beschadigen. */
#addToCartBtn.bcw-ncs-attention {
  animation: bcw-ncs-attention-pulse 0.9s ease-in-out 2;
  box-shadow: 0 0 0 4px rgba(19, 83, 80, 0.18);
  transition: box-shadow .25s ease;
}

@keyframes bcw-ncs-attention-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(19, 83, 80, 0.45); }
  40%  { box-shadow: 0 0 0 12px rgba(19, 83, 80, 0.00); }
  100% { box-shadow: 0 0 0 4px rgba(19, 83, 80, 0.18); }
}

/* Sticky-knop op mobile ook highlighten (optional, dezelfde class via JS later uit te breiden) */
#stickyBtn.bcw-ncs-attention,
#stickyDBtn.bcw-ncs-attention {
  animation: bcw-ncs-attention-pulse 0.9s ease-in-out 2;
}

/* ═══ Selection-note: hint over showroom/contact (niet getoond bij is-empty) ═══ */
.bcw-ncs-selection-note {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e8e8e8;
}

.bcw-ncs-selection-note a {
  color: #135350;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bcw-ncs-selection-note a:hover {
  color: #0E3E3C;
}

/* Verberg de note wanneer geen kleur gekozen is (is-empty state) */
.bcw-ncs-selection.is-empty .bcw-ncs-selection-note {
  display: none;
}
