/* ==========================================================================
   KTO — Brand showcase product grid
   Used on the *-maroc.html brand pages (FR + ar/) to list every product of a
   given brand (lunettes de vue + solaires) pulled from products-data.js.
   Self-contained + RTL-aware. Falls back to the page's CSS vars when present.
   ========================================================================== */

.kbp-showcase {
  margin: 8px 0 52px;
}
.kbp-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
}
.kbp-logo img {
  max-height: 66px;
  max-width: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.kbp-title {
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-weight: 700;
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.3;
  text-align: center;
  color: var(--black, #0a0a0a);
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  letter-spacing: 0;
  text-transform: none;
}

/* Category sub-heading (Lunettes de vue / Solaires) */
.kbp-cat {
  margin-top: 36px;
}
.kbp-cat:first-child { margin-top: 0; }
.kbp-cat-title {
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--kto-blue, #1a6fb8);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.kbp-cat-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200, #e8e8e8);
}
.kbp-cat-count {
  font-weight: 500;
  color: var(--gray-400, #737373);
  letter-spacing: 0.5px;
}

/* Grid */
.kbp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

/* Card */
.kbp-card {
  display: flex;
  flex-direction: column;
  background: var(--white, #fafafa);
  border: 1px solid var(--gray-200, #e8e8e8);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.kbp-card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
  transform: translateY(-3px);
  border-color: var(--gray-400, #737373);
}
.kbp-card:focus-visible {
  outline: 2px solid var(--kto-blue, #1a6fb8);
  outline-offset: 2px;
}

.kbp-imgwrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--gray-100, #f4f4f4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.kbp-imgwrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Badges */
.kbp-badges {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 2;
}
.kbp-badge {
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  color: #fff;
  text-transform: uppercase;
  width: max-content;
}
.kbp-badge.promo { background: #d30000; }
.kbp-badge.new   { background: var(--kto-blue, #1a6fb8); }

/* Sold-out overlay */
.kbp-card.sold-out .kbp-imgwrap img { opacity: .45; }
.kbp-soldout {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.kbp-soldout span {
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(10, 10, 10, .82);
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
}

.kbp-info {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.kbp-brand {
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--black, #0a0a0a);
  line-height: 1.3;
}
.kbp-ref {
  font-size: 12px;
  color: var(--gray-400, #737373);
}
.kbp-colors {
  font-size: 11px;
  color: var(--gray-400, #737373);
  margin-top: 1px;
}
.kbp-price {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--black, #0a0a0a);
}
.kbp-price .kbp-old {
  font-weight: 500;
  font-size: 12px;
  color: var(--gray-400, #737373);
  text-decoration: line-through;
  margin-inline-end: 6px;
}
.kbp-price .kbp-new { color: #d30000; }

.kbp-empty {
  text-align: center;
  color: var(--gray-600, #555);
  font-size: 15px;
  padding: 24px 0;
}

@media (max-width: 520px) {
  .kbp-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kbp-info { padding: 11px 11px 13px; }
  .kbp-brand { font-size: 12px; }
}
