/* ==========================================================================
   SEDDIR — kişiselleştirilebilir product page ("Kendi Yastığını Oluştur")
   Loaded only on that page (src/pages/customize.mjs): the live preview,
   the colour swatch cards, the production time and the ready products.
   ========================================================================== */

/* ---- preview: the real photo, then the painted canvas over it ------------- */
.kombin__stage { align-self: start; position: sticky; top: calc(var(--head-total) + 24px); }
.kombin__view {
  position: relative; margin: 0; aspect-ratio: 3 / 4; background: #fff; padding: 10px;
  box-shadow: 0 10px 40px rgb(0 0 0 / .12); overflow: hidden;
}
.kombin__view img, .kombin__view canvas { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: cover; }
.kombin__view canvas { animation: kombin-in .35s ease-out; }
@keyframes kombin-in { from { opacity: .4; } }
.kombin__caption { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }

/* ---- production time (made to order), before the buttons ------------------- */
.kombin__lead {
  margin-top: 16px; max-width: 520px; padding: 12px 14px;
  border-left: 4px solid var(--c-navy); background: rgb(25 50 94 / .06);
  font-size: 14px; line-height: 1.45;
}
.kombin__lead-title { font: 800 15px/1.2 var(--ff-display); margin-bottom: 4px; }

/* ---- the choice ------------------------------------------------------------------ */
.kombin__ui { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.kombin__title { font: 800 clamp(22px, 1.4vw + 12px, 30px)/1.05 var(--ff-display); font-stretch: var(--wdth-wide); }
.kombin__sub { margin-top: 6px; font-size: 15px; color: var(--ink-soft); }
.kombin__group { margin-top: 20px; }
.kombin__picked { text-transform: none; font-weight: 600; color: var(--ink-soft); }
.kombin__swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.kombin__sw { position: relative; display: grid; gap: 6px; justify-items: center; cursor: pointer; }
.kombin__sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kombin__chip {
  width: 100%; aspect-ratio: 1; border-radius: 6px;
  background-color: var(--sw); background-image: url('../img/kombin/doku.webp'); background-size: cover; background-blend-mode: overlay;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .16);
  outline: 2.5px solid transparent; outline-offset: 3px;
  transition: transform var(--dur) var(--ease-bounce), outline-color var(--dur-fast);
}
/* the piping: a cord of the colour across a pale cloth */
.kombin__group[data-kombin-group="piping"] .kombin__chip { position: relative; background: #E9E8E3; background-image: none; }
.kombin__group[data-kombin-group="piping"] .kombin__chip::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 26%; border-radius: 999px;
  transform: translateY(-50%) rotate(-28deg);
  background: url('../img/kombin/doku.webp') center / 220% auto, var(--sw); background-blend-mode: overlay;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14), inset 0 -3px 4px rgb(0 0 0 / .18), 0 2px 3px rgb(0 0 0 / .18);
}
.kombin__name { font: 700 12px/1.1 var(--ff-body); text-align: center; }
.kombin__chip, .kombin__name { pointer-events: none; }   /* the (invisible) radio covers the card: every click is its own */
.kombin__sw:hover .kombin__chip { transform: translateY(-2px); }
.kombin__sw input:checked + .kombin__chip { outline-color: var(--c-navy); }
.kombin__sw input:checked ~ .kombin__name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.kombin__sw input:focus-visible + .kombin__chip { outline: 3px solid var(--c-yellow); outline-offset: 3px; }

.kombin__summary { display: flex; align-items: center; gap: 12px; margin-top: 18px; font: 700 15px/1.3 var(--ff-display); }
.kombin__mini { display: none; width: 48px; height: 64px; flex: none; box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
.kombin__error { margin-top: 8px; font: 700 14px/1.35 var(--ff-body); color: var(--c-red); }
.kombin__error:empty { display: none; }
.kombin .buy__desc { margin-top: 28px; }

/* ---- Seddir’in hazır kombinasyonları -------------------------------------------- */
.kombin-ready__head { max-width: 1180px; margin: 0 auto 28px; }
.kombin-ready__head p { margin-top: 10px; max-width: 620px; font-size: 16px; line-height: 1.45; color: var(--ink-soft); }
.kombin-ready__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 32px; max-width: 1180px; margin: 0 auto; padding: 0; list-style: none; }
.kombin-ready__go {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font: 700 14px/1 var(--ff-body); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 2px;
}
.kombin-ready__card:hover .kombin-ready__go { color: var(--accent); }

@media (max-width: 1024.98px) {
  .kombin-ready__list { gap: 28px 20px; }
}
@media (max-width: 767.98px) {
  .kombin__stage { position: static; }
  .kombin__swatches { gap: 6px; }
  .kombin__name { font-size: 11px; }
  .kombin__mini:not([hidden]) { display: block; }
  .kombin-ready__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .kombin__view canvas { animation: none; }
}
