@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Serif+Display&display=swap');

/* ─────────────────────────────────────────────────
   WC Colors v2 — Mobile-First Redesign
   Aesthetic: Premium paint brand — clean, tactile,
   warm neutrals with ink-dark accents.
   ───────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Serif+Display&display=swap');

:root {
  --wcc-bg:          #f8f6f3;
  --wcc-surface:     #ffffff;
  --wcc-border:      #e2ddd8;
  --wcc-ink:         #1a1714;
  --wcc-ink-mid:     #5a534c;
  --wcc-ink-light:   #9e958c;
  --wcc-accent:      #2b2320;
  --wcc-accent-warm: #c0785a;
  --wcc-pill-bg:     #f0ece8;
  --wcc-shadow:      0 4px 24px rgba(26,23,20,0.10);
  --wcc-shadow-lg:   0 12px 48px rgba(26,23,20,0.18);
  --wcc-radius:      12px;
  --wcc-radius-sm:   8px;
  --wcc-font:        'DM Sans', sans-serif;
  --wcc-font-head:   'DM Serif Display', serif;
  --wcc-transition:  0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Trigger button ─────────────────────────────── */
#ex_color_button {
  font-family: var(--wcc-font);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--wcc-border);
  border-radius: var(--wcc-radius-sm);
  background: var(--wcc-surface);
  color: var(--wcc-ink-mid);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: border-color var(--wcc-transition), box-shadow var(--wcc-transition);
  margin-bottom: 16px;
  text-align: left;
}
#ex_color_button:hover {
  border-color: var(--wcc-accent);
  box-shadow: 0 0 0 3px rgba(43,35,32,0.07);
}
#ex_color_button .wcc-swatch-preview {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--wcc-border);
  flex-shrink: 0;
  background: var(--wcc-border);
  transition: background var(--wcc-transition);
}
#ex_color_button .wcc-btn-label { flex: 1; }
#ex_color_button .wcc-btn-arrow {
  font-size: 12px;
  color: var(--wcc-ink-light);
}

/* ── Inline colour picker (always visible, compact card) ── */
.overlay_colors {
  display: block;
  width: 100%;
  background: transparent;
}

/* ── The panel — fixed height card, nothing scrolls outside it ── */
.overlay-content {
  font-family: var(--wcc-font);
  background: var(--wcc-bg);
  width: 100%;
  height: 600px;
  border-radius: var(--wcc-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--wcc-shadow-lg);
  border: 1px solid var(--wcc-border);
}

@media (max-width: 480px) {
  .overlay-content { height: 520px; }
}
@media (min-width: 1024px) {
  .overlay-content { height: 640px; }
}

/* ── Panel header ───────────────────────────────── */
.wcc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--wcc-border);
  background: var(--wcc-surface);
  flex-shrink: 0;
}
.wcc-panel-title {
  font-family: var(--wcc-font-head);
  font-size: 20px;
  color: var(--wcc-ink);
  line-height: 1;
}
.wcc-panel-subtitle {
  font-size: 12px;
  color: var(--wcc-ink-light);
  margin-top: 3px;
  font-weight: 300;
}
.wcc-close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--wcc-border);
  background: var(--wcc-bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--wcc-ink-mid);
  transition: background var(--wcc-transition), border-color var(--wcc-transition);
  flex-shrink: 0;
}
.wcc-close-btn:hover {
  background: var(--wcc-ink);
  border-color: var(--wcc-ink);
  color: #fff;
}

/* ── Search bar ─────────────────────────────────── */
.wcc-search-bar {
  padding: 14px 20px;
  background: var(--wcc-surface);
  border-bottom: 1px solid var(--wcc-border);
  flex-shrink: 0;
}
.wcc-search-inner {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--wcc-bg);
  border: 1.5px solid var(--wcc-border);
  border-radius: 50px;
  padding: 0 6px 0 16px;
  transition: border-color var(--wcc-transition), box-shadow var(--wcc-transition);
}
.wcc-search-inner:focus-within {
  border-color: var(--wcc-accent);
  box-shadow: 0 0 0 3px rgba(43,35,32,0.07);
}
#search_ex_color {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--wcc-font);
  font-size: 14px;
  color: var(--wcc-ink);
  padding: 11px 0;
  outline: none;
}
#search_ex_color::placeholder { color: var(--wcc-ink-light); }
#button_search_color {
  flex-shrink: 0;
  height: 34px;
  padding: 0 16px;
  border-radius: 50px;
  border: none;
  background: var(--wcc-accent);
  color: #fff;
  font-family: var(--wcc-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--wcc-transition), transform var(--wcc-transition);
}
#button_search_color:hover  { background: var(--wcc-accent-warm); }
#button_search_color:active { transform: scale(0.96); }

/* ── Body layout ────────────────────────────────── */
.wcc-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar filters ────────────────────────────── */
.wcc-sidebar {
  width: 340px;
  min-width: 340px;
  background: var(--wcc-surface);
  border-right: 1px solid var(--wcc-border);
  overflow-y: auto;
  padding: 16px 14px 20px;
  flex-shrink: 0;
  display: none; /* hidden on mobile by default */
}
.wcc-sidebar h5 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--wcc-ink, #1a1a1a);
  margin: 20px 0 8px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--wcc-border, #e5e5e5);
}
.wcc-sidebar h5:first-child {
  margin-top: 0;
}
.wcc-sidebar::-webkit-scrollbar { width: 4px; }
.wcc-sidebar::-webkit-scrollbar-thumb {
  background: var(--wcc-border);
  border-radius: 99px;
}

@media (min-width: 768px) {
  .wcc-sidebar { display: block; }
}

/* Mobile: filters as horizontal chip bar */
.wcc-mobile-filters {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--wcc-border);
  background: var(--wcc-surface);
  flex-shrink: 0;
  scrollbar-width: none;
}
.wcc-mobile-filters::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .wcc-mobile-filters { display: none; }
}

.wcc-chip {
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px;
  border-radius: 50px;
  border: 1.5px solid var(--wcc-border);
  background: var(--wcc-bg);
  font-family: var(--wcc-font);
  font-size: 12px;
  font-weight: 500;
  color: var(--wcc-ink-mid);
  cursor: pointer;
  transition: all var(--wcc-transition);
  white-space: nowrap;
}
.wcc-chip.active,
.wcc-chip:hover {
  background: var(--wcc-accent);
  border-color: var(--wcc-accent);
  color: #fff;
}

/* Sidebar filter sections */
.wcc-filter-section { margin-bottom: 20px; }
.wcc-filter-heading {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wcc-ink-light);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--wcc-border);
}

.color-collection-filter,
.color-family-filter {
  list-style: none!important;
  margin: 0!important;
  padding: 0!important;
}
.color-collection-filter li,
.color-family-filter li {
  margin-bottom: 2px;
}
.color-collection-filter label,
.color-family-filter label {
  display: block;
  padding: 5px 6px;
  border-radius: var(--wcc-radius-sm);
  font-size: 12.5px;
  color: var(--wcc-ink-mid);
  cursor: pointer;
  transition: background var(--wcc-transition), color var(--wcc-transition);
  line-height: 1.3;
}
.color-collection-filter label:hover,
.color-family-filter label:hover {
  background: var(--wcc-pill-bg);
  color: var(--wcc-ink);
}
.color-collection-filter input[type="checkbox"],
.color-family-filter input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--wcc-accent);
  vertical-align: middle;
  margin-right: 8px;
  cursor: pointer;
}

/* ── Color grid area ────────────────────────────── */
.wcc-grid-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.wcc-grid-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
}
.wcc-grid-scroll::-webkit-scrollbar { width: 5px; }
.wcc-grid-scroll::-webkit-scrollbar-thumb {
  background: var(--wcc-border);
  border-radius: 99px;
}

/* ── Color grid ─────────────────────────────────── */
#ex_color_dialog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

@media (min-width: 480px) {
  #ex_color_dialog { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (min-width: 768px) {
  #ex_color_dialog { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
}

/* ── Color swatch card ──────────────────────────── */
.ex_color_div {
  border-radius: var(--wcc-radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1 / 1.25;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  box-shadow: 0 1px 4px rgba(26,23,20,0.10);
  transition: transform var(--wcc-transition), box-shadow var(--wcc-transition);
  border: 2px solid transparent;
}
.ex_color_div:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 20px rgba(26,23,20,0.18);
}
.ex_color_div.wcc-selected {
  border-color: var(--wcc-accent) !important;
  box-shadow: 0 0 0 3px rgba(43,35,32,0.18), 0 8px 20px rgba(26,23,20,0.18);
  transform: translateY(-3px) scale(1.03);
}
/* Active tap feedback on mobile */
.ex_color_div:active { transform: scale(0.97); }

/* Label at bottom of swatch */
.wc_ex_color_labels {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 18px 6px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.62) 0%, transparent 100%);
  text-align: center;
}
.color-name {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#number label {
  display: block;
  font-size: 9px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
  cursor: pointer;
}

/* Swatch checkmark on selection */
.ex_color_div.wcc-selected::after {
  content: '✓';
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--wcc-accent);
  color: #fff;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  line-height: 20px;
  text-align: center;
  font-weight: 700;
}

/* ── Selected color strip ───────────────────────── */
.wcc-selected-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--wcc-surface);
  border-top: 1px solid var(--wcc-border);
  flex-shrink: 0;
  min-height: 58px;
}
.wcc-strip-swatch {
  width: 40px; height: 40px;
  border-radius: var(--wcc-radius-sm);
  border: 1.5px solid var(--wcc-border);
  flex-shrink: 0;
}
.wcc-strip-info { flex: 1; min-width: 0; }
.wcc-strip-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--wcc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wcc-strip-number {
  font-size: 12px;
  color: var(--wcc-ink-light);
  margin-top: 1px;
}
.wcc-confirm-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--wcc-radius-sm);
  border: none;
  background: var(--wcc-accent);
  color: #fff;
  font-family: var(--wcc-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--wcc-transition), transform var(--wcc-transition);
}
.wcc-confirm-btn:hover  { background: var(--wcc-accent-warm); }
.wcc-confirm-btn:active { transform: scale(0.97); }

/* ── Pagination footer ──────────────────────────── */
.wcc-pagination-footer {
  padding: 10px 16px 12px;
  background: var(--wcc-surface);
  border-top: 1px solid var(--wcc-border);
  flex-shrink: 0;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none!important;
  margin: 0!important;
  padding: 0!important;
}
.pagination li a,
.pagination li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--wcc-radius-sm);
  background: var(--wcc-pill-bg);
  color: var(--wcc-ink-mid);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--wcc-transition), color var(--wcc-transition);
  font-family: var(--wcc-font);
}
.pagination li a:hover    { background: var(--wcc-border); color: var(--wcc-ink); }
.pagination li.active a   { background: var(--wcc-accent); color: #fff; }

/* ── Loading overlay ────────────────────────────── */
#loader-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(248,246,243,0.82);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
#loader-wrapper.wcc-loading { display: flex; }
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--wcc-ink-mid);
  font-family: var(--wcc-font);
  font-size: 14px;
}
#loading img { width: 48px; opacity: 0.7; }

/* Grid inner loader */
.wc-color-color-selection-loader {
  position: absolute;
  inset: 0;
  background: rgba(248,246,243,0.75);
  backdrop-filter: blur(2px);
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
}
.wc-color-color-selection-loader img {
  width: 48px;
}

/* ── Empty state ────────────────────────────────── */
.wcc-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--wcc-ink-light);
  font-family: var(--wcc-font);
  text-align: center;
  gap: 10px;
}
.wcc-empty-icon { font-size: 36px; opacity: 0.4; }
.wcc-empty-text { font-size: 15px; }
.wcc-empty-sub  { font-size: 13px; opacity: 0.7; }

/* ── Result count badge ─────────────────────────── */
.wcc-result-count {
  font-size: 12px;
  color: var(--wcc-ink-light);
  padding: 6px 16px 0;
  font-family: var(--wcc-font);
  flex-shrink: 0;
}

/* ── Hidden family filter items (keep v1 compat) ── */
.color-family-filter .cs_13,
.color-family-filter .cs_14,
.color-family-filter .cs_15,
.color-family-filter .cs_16,
.color-family-filter .cs_17,
.color-family-filter .cs_18 { display: none; }

/* NOTE: the sidebar width + h5 heading spacing fixes now live on
   .wcc-sidebar above — the .col-md-3/.col-md-9 Bootstrap columns those
   rules used to target get discarded by buildShellDOM() in
   wc_colors_front.js on page load, so styling them here never actually
   applied. .wcc-sidebar is the real element in the rendered DOM. */

/* ── WooCommerce compat ─────────────────────────── */
.wcexcolors_buttons { position: relative; margin-bottom: 8px; }
.woocommerce div.product form.cart div.quantity { clear: both; }

/* ── Scrollbar drag handle (mobile) ─────────────── */
.wcc-drag-handle {
  width: 40px; height: 4px;
  background: var(--wcc-border);
  border-radius: 99px;
  margin: 10px auto 0;
}

/* ── Try on Wall button ───────────────────────────── */
.wcc-try-wall-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--wcc-radius-sm);
  border: 1.5px solid var(--wcc-border);
  background: var(--wcc-bg);
  color: var(--wcc-ink-mid);
  font-family: var(--wcc-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--wcc-transition), border-color var(--wcc-transition), color var(--wcc-transition);
  white-space: nowrap;
}
.wcc-try-wall-btn:hover {
  background: var(--wcc-accent);
  border-color: var(--wcc-accent);
  color: #fff;
}
.wcc-try-wall-btn:active { transform: scale(0.97); }

/* ── Wall visualiser panel ───────────────────────── */
#wcc-wall-vis {
  font-family: var(--wcc-font);
}


/* ── Hide modal-only elements in inline mode ─────── */
.wcc-drag-handle,
.wcc-close-btn,
.wcc-try-wall-btn + .wcc-confirm-btn { display: none !important; }

/* ── Wall visualiser — fixed overlay (appended to body) ── */
#wcc-wall-vis {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999995 !important;
}

/* ── Panel header — compact inline mode ──────────── */
.wcc-panel-header {
  padding: 12px 16px 10px;
}
.wcc-panel-title { font-size: 17px; }
.wcc-panel-subtitle { font-size: 11px; }

/* Hide close btn in inline mode */
.wcc-close-btn { display: none !important; }

/* ── Mobile filter rows — two separate scrollable rows ── */
.wcc-chip-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--wcc-ink-light);
  align-self: center;
  padding-right: 4px;
  white-space: nowrap;
}
.wcc-collection-filters {
  border-top: none;
  border-bottom: 1px solid var(--wcc-border);
  padding-top: 6px;
  padding-bottom: 8px;
}
