/* KTC Colors — Cosentino-style browse & detail (uses products.css variables) */

.ktc-colors-page { background: #fff; }

.ktc-colors-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--ktc-border);
  background: #fff;
}
.ktc-colors-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ktc-colors-hero p {
  margin: 0;
  max-width: 640px;
  color: var(--ktc-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.ktc-colors-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--ktc-border);
}
.ktc-colors-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}
.ktc-colors-search {
  min-width: 220px;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid var(--ktc-border);
  border-radius: 4px;
  background: #fff;
}
.ktc-colors-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem 1.25rem;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}
.ktc-colors-tabs button {
  background: none;
  border: none;
  padding: 0.35rem 0;
  font-size: 0.92rem;
  color: var(--ktc-dark);
  border-bottom: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.ktc-colors-tabs button.active {
  border-bottom-color: var(--ktc-dark);
  font-weight: 600;
}
.ktc-colors-tabs button:hover { color: var(--ktc-green); }
.ktc-colors-sort {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid var(--ktc-border);
  border-radius: 4px;
  background: #fff;
}

.ktc-colors-meta {
  padding: 1rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--ktc-muted);
}

.ktc-colors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-bottom: 3rem;
}
@media (max-width: 991.98px) { .ktc-colors-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767.98px) { .ktc-colors-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479.98px) { .ktc-colors-grid { grid-template-columns: 1fr; } }

.ktc-color-swatch {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s;
}
.ktc-color-swatch:hover { transform: translateY(-3px); }
.ktc-color-swatch-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f0ebe3;
}
.ktc-color-swatch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s;
}
.ktc-color-swatch:hover .ktc-color-swatch-thumb img { transform: scale(1.05); }
.ktc-color-swatch-body { padding: 0.75rem 0.15rem 0.35rem; }
.ktc-color-swatch-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
}
.ktc-color-swatch-line {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--ktc-muted);
  letter-spacing: 0.03em;
}

/* Detail page */
.ktc-color-detail { padding: 2rem 0 3rem; background: #fff; }
.ktc-color-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 991.98px) {
  .ktc-color-detail-grid { grid-template-columns: 1fr; }
}
.ktc-color-detail-img {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f0ebe3;
  border: 1px solid var(--ktc-border);
}
.ktc-color-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ktc-color-tag {
  display: inline-block;
  margin-bottom: 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ktc-green);
}
.ktc-color-detail h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.ktc-color-detail-desc {
  margin: 0 0 1.5rem;
  color: var(--ktc-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}
.ktc-color-spec-block {
  margin-bottom: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ktc-border);
}
.ktc-color-spec-block h3 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ktc-color-spec-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ktc-color-spec-list li {
  padding: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--ktc-dark);
}
.ktc-color-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.ktc-color-slab {
  margin: 2.5rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--ktc-border);
  border-bottom: 1px solid var(--ktc-border);
}
.ktc-color-slab h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.ktc-color-slab img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f0ebe3;
}

.ktc-similar { padding-bottom: 3rem; }
.ktc-similar h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.ktc-similar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 767.98px) { .ktc-similar-grid { grid-template-columns: repeat(2, 1fr); } }

.ktc-color-why {
  padding: 2.5rem 0;
  background: var(--ktc-cream);
  border-top: 1px solid var(--ktc-border);
}
.ktc-color-why h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}
.ktc-color-why p {
  margin: 0;
  max-width: 720px;
  color: var(--ktc-muted);
  line-height: 1.65;
}

.ktc-colors-empty {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ktc-muted);
}

/* —— Brand / category / product colors upgrade —— */
.ktc-colors-page {
  background: var(--ktc-cream);
}
.ktc-colors-hero {
  background: linear-gradient(180deg, #fff 0%, var(--ktc-cream) 100%);
}
.ktc-colors-brands {
  padding: 1.25rem 0 0.5rem;
}
.ktc-colors-toolbar {
  position: sticky;
  top: 0.75rem;
  z-index: 40;
  margin: 1rem 0 0.5rem;
  padding: 0.9rem;
  border: 1px solid rgba(168, 140, 96, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 36px rgba(45, 42, 38, 0.06);
  animation: ktc-filter-in 0.55s ease both;
}
.ktc-colors-search-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
}
.ktc-colors-search-wrap .bi-search {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ktc-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.ktc-colors-search {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.85rem 0.55rem 2.1rem;
  border-radius: 999px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ktc-colors-search:focus {
  outline: none;
  border-color: var(--ktc-gold);
  box-shadow: 0 0 0 3px rgba(168, 140, 96, 0.18);
}
.ktc-colors-sort {
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.ktc-colors-sort:hover {
  border-color: var(--ktc-gold);
  transform: translateY(-1px);
}
.ktc-colors-clear {
  border-radius: 999px !important;
  border-color: var(--ktc-border) !important;
  color: var(--ktc-dark) !important;
}
.ktc-colors-clear:hover {
  border-color: var(--ktc-gold) !important;
  color: var(--ktc-green) !important;
}
.ktc-colors-tabs {
  gap: 0.35rem 0.85rem;
  margin-bottom: 0.15rem;
}
.ktc-palette-tab {
  position: relative;
  transition: color 0.2s;
}
.ktc-palette-tab.active {
  color: var(--ktc-green);
  border-bottom-color: var(--ktc-green) !important;
}
.ktc-colors-meta {
  display: inline-flex;
  margin: 1rem 0 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(168, 140, 96, 0.1);
  color: var(--ktc-dark);
  font-weight: 600;
}
.ktc-colors-grid {
  gap: 12px;
}
.ktc-color-swatch {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(168, 140, 96, 0.18);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, border-color 0.3s;
}
.ktc-color-swatch:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(45, 42, 38, 0.12);
  border-color: rgba(168, 140, 96, 0.35);
  color: inherit;
}
.ktc-color-swatch-thumb {
  position: relative;
  border-radius: 0;
}
.ktc-color-brand-pill {
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ktc-dark);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.ktc-color-swatch-body {
  padding: 0.75rem 0.85rem 0.9rem;
}
.ktc-color-swatch-tone {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ktc-gold);
}
.ktc-colors-brands .ktc-category-chips {
  margin-top: 1rem;
}

@media (max-width: 767.98px) {
  .ktc-colors-toolbar {
    top: 0.4rem;
    padding: 0.7rem;
    border-radius: 12px;
  }
  .ktc-colors-controls {
    justify-content: stretch;
  }
  .ktc-colors-sort,
  .ktc-colors-search-wrap {
    flex: 1 1 calc(50% - 0.4rem);
  }
}

/* Dark mode */
html[data-theme="dark"] .ktc-colors-page,
html[data-theme="dark"] .ktc-colors-hero,
html[data-theme="dark"] .ktc-color-why,
html[data-theme="dark"] .ktc-colors-brands {
  background: transparent;
  color: #e8e4dc;
}
html[data-theme="dark"] .ktc-colors-toolbar {
  background: rgba(28, 28, 28, 0.92);
  border-color: rgba(168, 140, 96, 0.28);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .ktc-colors-search,
html[data-theme="dark"] .ktc-colors-sort,
html[data-theme="dark"] .ktc-color-swatch {
  background: #1c1c1c;
  color: #e8e4dc;
  border-color: var(--ktc-border);
}
html[data-theme="dark"] .ktc-colors-tabs button {
  color: #e8e4dc;
}
html[data-theme="dark"] .ktc-palette-tab.active {
  color: #c9b07a;
  border-bottom-color: #c9b07a !important;
}
html[data-theme="dark"] .ktc-colors-meta {
  background: rgba(168, 140, 96, 0.16);
  color: #e8e4dc;
}
html[data-theme="dark"] .ktc-color-brand-pill {
  background: rgba(28, 28, 28, 0.92);
  color: #e8e4dc;
}
html[data-theme="dark"] .ktc-color-swatch-thumb {
  background: #111;
}
html[data-theme="dark"] .ktc-colors-clear {
  color: #e8e4dc !important;
  border-color: var(--ktc-border) !important;
}
