/* Ecom Kraken Edition -- product detail page (ek_product.php). Agent 3 lane, prefix ekp-. */

.ekp { padding-top: var(--ek-s4); padding-bottom: var(--ek-s8); }

.ekp-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--ek-s7);
  align-items: start;
  margin-top: var(--ek-s4);
}

/* Gallery */
.ekp-gallery { min-width: 0; }
.ekp-gallery__main {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--ek-well);
  border: 1px solid var(--ek-line);
  border-radius: var(--ek-r-lg);
  overflow: hidden;
}
.ekp-gallery__zoom {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 6%;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.ekp-gallery__zoom:focus-visible { outline: 3px solid var(--ek-focus); outline-offset: -3px; }
.ekp-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.ekp-gallery__hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ek-surface);
  border: 1px solid var(--ek-line);
  color: var(--ek-ink-2);
  box-shadow: var(--ek-shadow-1);
}
.ekp-gallery__hint svg { width: 18px; height: 18px; }
.ekp-gallery__ph { display: grid; place-items: center; width: 100%; height: 100%; }
.ekp-gallery__ph span {
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--ek-surface);
  border: 1px solid var(--ek-line);
  color: var(--ek-muted);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: .04em;
}
.ekp-thumbs {
  display: flex;
  gap: 10px;
  margin: var(--ek-s3) 0 0;
  padding: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}
.ekp-thumbs__btn {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding: 6px;
  border: 1.5px solid var(--ek-line);
  border-radius: var(--ek-r-sm);
  background: var(--ek-well);
  cursor: pointer;
}
.ekp-thumbs__btn img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.ekp-thumbs__btn.is-on { border-color: var(--ek-ink); box-shadow: inset 0 0 0 1px var(--ek-ink); }
.ekp-thumbs__btn:focus-visible { outline: 3px solid var(--ek-focus); outline-offset: 2px; }

/* Buy box */
.ekp-buy { position: sticky; top: calc(var(--ek-header-h) + 16px); min-width: 0; }
.ekp-brand { margin: 0 0 6px; font-size: var(--ek-fs-sm); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ekp-brand a { color: var(--ek-ink-2); text-decoration: none; }
.ekp-brand a:hover { text-decoration: underline; }
.ekp-title { margin: 0; overflow-wrap: anywhere; }
.ekp-sku { margin: var(--ek-s2) 0 0; color: var(--ek-muted); font-size: var(--ek-fs-sm); }
.ekp-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: var(--ek-s4) 0 0; }
.ekp-price__now { font-size: var(--ek-fs-xl); font-weight: 800; color: var(--ek-ink); font-variant-numeric: tabular-nums; }
.ekp-price__from { font-size: var(--ek-fs-base); font-weight: 600; color: var(--ek-ink-2); }
.ekp-price__msrp { color: var(--ek-muted); font-size: var(--ek-fs-sm); }
.ekp-price__none { font-size: var(--ek-fs-lg); font-weight: 700; color: var(--ek-ink-2); }
.ekp-unit { display: flex; align-items: center; gap: 8px; margin: var(--ek-s3) 0 0; padding: 10px 12px; background: var(--ek-surface-2); border-radius: var(--ek-r-sm); font-size: var(--ek-fs-sm); color: var(--ek-ink-2); }
.ekp-unit svg { width: 18px; height: 18px; flex: none; }
.ekp-stock { margin: var(--ek-s2) 0 0; font-size: var(--ek-fs-sm); font-weight: 700; }
.ekp-stock svg { width: 16px; height: 16px; vertical-align: -3px; }
.ekp-stock--in { color: var(--ek-ok); }
.ekp-stock--low { color: var(--ek-warn); }
.ekp-stock--out { color: var(--ek-sale); }

.ekp-form { margin-top: var(--ek-s5); }

/* Options */
.ekp-opt { margin: 0 0 var(--ek-s5); padding: 0; border: 0; min-width: 0; }
.ekp-opt__legend { padding: 0; margin: 0 0 var(--ek-s2); font-weight: 750; font-size: var(--ek-fs-base); color: var(--ek-ink); }
.ekp-opt__optional { font-weight: 500; color: var(--ek-muted); }
.ekp-opt__chosen { font-weight: 500; color: var(--ek-ink-2); }
.ekp-opt__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ekp-pill {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  min-width: 56px;
  padding: 8px 14px;
  border: 1.5px solid var(--ek-line-strong);
  border-radius: var(--ek-r-sm);
  background: var(--ek-surface);
  color: var(--ek-ink);
  font-size: var(--ek-fs-sm);
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  text-align: left;
}
.ekp-pill__in { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ekp-pill:hover { border-color: var(--ek-ink); }
.ekp-pill:has(.ekp-pill__in:checked) { border-color: var(--ek-ink); box-shadow: inset 0 0 0 1.5px var(--ek-ink); background: var(--ek-surface-2); }
.ekp-pill:has(.ekp-pill__in:checked) .ekp-pill__txt::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--ek-ink);
  vertical-align: 1px;
}
.ekp-pill:has(.ekp-pill__in:focus-visible) { outline: 3px solid var(--ek-focus); outline-offset: 2px; }
.ekp-pill.is-off { cursor: not-allowed; color: var(--ek-muted); background: var(--ek-surface-2); border-style: dashed; }
.ekp-pill.is-off .ekp-pill__txt { text-decoration: line-through; text-decoration-thickness: 1px; }
.ekp-pill__why { font-size: 12px; font-weight: 600; color: var(--ek-muted); }
.ekp-opt__select { width: 100%; min-height: var(--ek-ctl); }
.ekp-opt__err { margin: var(--ek-s2) 0 0; color: var(--ek-sale); font-size: var(--ek-fs-sm); font-weight: 600; }
.ekp-opt.is-invalid .ekp-pill:not(.is-off),
.ekp-opt.is-invalid .ekp-opt__select { border-color: var(--ek-sale); }

.ekp-entry { margin: 0 0 var(--ek-s5); }
.ekp-entry__label { display: block; margin-bottom: 6px; font-weight: 700; }
.ekp-entry__in { width: 100%; min-height: var(--ek-ctl); }

/* Quantity + add */
.ekp-actions { display: flex; align-items: flex-end; gap: var(--ek-s3); }
.ekp-qty { flex: none; }
.ekp-qty__label { display: block; margin-bottom: 6px; font-size: var(--ek-fs-sm); font-weight: 700; color: var(--ek-ink-2); }
.ekp-qty__ctl {
  display: inline-flex;
  align-items: stretch;
  height: var(--ek-ctl-lg);
  border: 1.5px solid var(--ek-line-strong);
  border-radius: var(--ek-r-sm);
  background: var(--ek-surface);
  overflow: hidden;
}
.ekp-qty__btn { display: grid; place-items: center; width: 44px; border: 0; background: none; color: var(--ek-ink); cursor: pointer; }
.ekp-qty__btn:hover { background: var(--ek-surface-2); }
.ekp-qty__btn svg { width: 18px; height: 18px; }
.ekp-qty__btn:focus-visible { outline: 3px solid var(--ek-focus); outline-offset: -3px; }
.ekp-qty__in {
  width: 56px;
  border: 0;
  border-left: 1px solid var(--ek-line);
  border-right: 1px solid var(--ek-line);
  text-align: center;
  font: inherit;
  font-weight: 700;
  font-size: var(--ek-fs-md);
  color: var(--ek-ink);
  background: transparent;
  -moz-appearance: textfield;
}
.ekp-qty__in::-webkit-outer-spin-button,
.ekp-qty__in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ekp-qty__in:focus-visible { outline: 3px solid var(--ek-focus); outline-offset: -3px; }
.ekp-add { flex: 1 1 auto; min-height: var(--ek-ctl-lg); gap: 10px; font-size: var(--ek-fs-md); }
.ekp-add svg { width: 20px; height: 20px; }
.ekp-add[aria-busy="true"] { opacity: .8; cursor: progress; }
.ekp-form__msg { min-height: 1.4em; margin: var(--ek-s2) 0 0; font-size: var(--ek-fs-sm); font-weight: 600; }
.ekp-form__msg.is-ok { color: var(--ek-ok); }
.ekp-form__msg.is-error { color: var(--ek-sale); }

.ekp-quote { padding: var(--ek-s4); border: 1px solid var(--ek-line); border-radius: var(--ek-r); background: var(--ek-surface-2); }
.ekp-quote p { margin: 0; }
.ekp-quote__acts { display: flex; flex-wrap: wrap; gap: var(--ek-s3); margin-top: var(--ek-s3) !important; }
.ekp-quote__acts .ek-btn { gap: 8px; }
.ekp-quote__acts svg { width: 18px; height: 18px; }

/* Fulfilment + help */
.ekp-ship { display: grid; gap: 10px; margin: var(--ek-s5) 0 0; padding: var(--ek-s4); list-style: none; border: 1px solid var(--ek-line); border-radius: var(--ek-r); }
.ekp-ship li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--ek-fs-sm); color: var(--ek-ink-2); line-height: 1.45; }
.ekp-ship svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--ek-ink); }
.ekp-help { margin: var(--ek-s4) 0 0; font-size: var(--ek-fs-sm); color: var(--ek-muted); }

/* Description + specs */
.ekp-info {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--ek-s7);
  margin-top: var(--ek-s8);
  padding-top: var(--ek-s6);
  border-top: 1px solid var(--ek-line);
}
.ekp-info > .ekp-sec:only-child { grid-column: 1 / -1; max-width: 75ch; }
.ekp-sec__h { margin: 0 0 var(--ek-s3); }
.ekp-desc { color: var(--ek-ink-2); line-height: 1.65; max-width: 72ch; overflow-wrap: anywhere; }
.ekp-desc p { margin: 0 0 1em; }
.ekp-desc ul, .ekp-desc ol { padding-left: 1.3em; }
.ekp-desc table { border-collapse: collapse; width: 100%; }
.ekp-desc td, .ekp-desc th { border: 1px solid var(--ek-line); padding: 6px 8px; text-align: left; }
.ekp-specs { margin: 0; border: 1px solid var(--ek-line); border-radius: var(--ek-r); overflow: hidden; }
.ekp-specs__row { display: grid; grid-template-columns: minmax(120px, 40%) minmax(0, 1fr); }
.ekp-specs__row:nth-child(odd) { background: var(--ek-surface-2); }
.ekp-specs dt, .ekp-specs dd { margin: 0; padding: 10px 14px; font-size: var(--ek-fs-sm); overflow-wrap: anywhere; }
.ekp-specs dt { color: var(--ek-ink-2); font-weight: 650; }
.ekp-specs dd { color: var(--ek-ink); }

.ekp-related { margin-top: var(--ek-s8); }

/* Not-found page */
.ekp-missing { padding-top: var(--ek-s7); padding-bottom: var(--ek-s8); }
.ekp-missing__ic { width: 36px; height: 36px; color: var(--ek-muted); display: block; margin: 0 auto var(--ek-s3); }
.ekp-missing__search { display: flex; gap: 8px; max-width: 460px; margin: 0 auto var(--ek-s4); }
.ekp-missing__search .ek-input { flex: 1 1 auto; min-height: var(--ek-ctl); }

/* Lightbox */
.ekp-lightbox {
  width: min(96vw, 1100px);
  max-height: 94vh;
  padding: var(--ek-s5);
  border: 0;
  border-radius: var(--ek-r-lg);
  background: var(--ek-surface);
  box-shadow: var(--ek-shadow-3);
}
.ekp-lightbox::backdrop { background: rgba(15, 23, 42, .7); }
.ekp-lightbox__img { display: block; width: 100%; height: auto; max-height: calc(94vh - 2 * var(--ek-s5)); object-fit: contain; }
.ekp-lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ek-line);
  border-radius: 50%;
  background: var(--ek-surface);
  color: var(--ek-ink);
  cursor: pointer;
}
.ekp-lightbox__close svg { width: 20px; height: 20px; }

/* Phone sticky buy bar: shown by ek-product.js only while the real Add button is off-screen. */
.ekp-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--ek-z-header) - 10);
  padding: 10px var(--ek-gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--ek-surface);
  border-top: 1px solid var(--ek-line);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform var(--ek-dur) var(--ek-ease), visibility 0s linear var(--ek-dur);
}
.ekp-sticky.is-on { transform: none; visibility: visible; transition: transform var(--ek-dur) var(--ek-ease), visibility 0s; }
.ekp-sticky__in { display: flex; align-items: center; gap: var(--ek-s3); max-width: var(--ek-max); margin: 0 auto; }
.ekp-sticky__txt { display: grid; min-width: 0; flex: 1 1 auto; }
.ekp-sticky__name { font-size: var(--ek-fs-sm); font-weight: 650; color: var(--ek-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ekp-sticky__price { font-size: var(--ek-fs-sm); color: var(--ek-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ekp-sticky__btn { flex: none; min-height: var(--ek-ctl); padding-left: 18px; padding-right: 18px; }
body.ekp-has-sticky { padding-bottom: 76px; }
@media (min-width: 961px) { .ekp-sticky { display: none; } body.ekp-has-sticky { padding-bottom: 0; } }

/* Tablet and phone */
@media (max-width: 960px) {
  .ekp-top { grid-template-columns: minmax(0, 1fr); gap: var(--ek-s5); }
  .ekp-buy { position: static; }
  .ekp-info { grid-template-columns: minmax(0, 1fr); gap: var(--ek-s6); margin-top: var(--ek-s7); }
  .ekp-gallery__main { max-width: 640px; margin: 0 auto; }
  .ekp-thumbs { justify-content: flex-start; }
}
@media (max-width: 420px) {
  .ekp-actions { flex-wrap: wrap; }
  .ekp-qty { width: 100%; }
  .ekp-qty__ctl { width: 100%; }
  .ekp-qty__in { flex: 1 1 auto; }
  .ekp-add { width: 100%; }
  .ekp-pill { flex: 1 1 calc(50% - 8px); }
}
@media (prefers-reduced-motion: reduce) {
  .ekp * { scroll-behavior: auto !important; }
}
