/* Product frame from prototip/index.html:472–491 and pdpCols. */
.k-product {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 16px 0;
}

.k-product__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--typo-secondary);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.k-product__crumbs li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.k-product__crumbs a { color: inherit; }
.k-product__crumbs [aria-current="page"] { color: var(--typo-primary); font-weight: 500; }

.k-product__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 3.9cqw, 56px);
}

.k-product__gallery,
.k-product-tabs__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 600;
  overflow: hidden;
  border-radius: clamp(28px, 2.8cqw, 40px);
  background: var(--k-tint-raspberry);
}

.k-product__gallery::before,
.k-product-tabs__frame::before {
  content: "";
  position: absolute;
  left: 17%;
  top: 15%;
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-brand-surface);
}

.k-product__photo,
.k-product-tabs__image {
  position: absolute;
  left: 12.5%;
  top: 10%;
  width: 75%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(115, 26, 31, .25));
}

.k-product__badge {
  position: absolute;
  inset-block-start: 24px;
  inset-inline-start: 24px;
}

.k-product__gallery .k-tile__fav {
  inset-block-start: 24px;
  inset-inline-end: 24px;
  width: 48px;
  height: 48px;
}

.k-product__info,
.k-product__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.k-product__meta,
.k-product__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--typo-secondary);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.k-product__maker { font-weight: 500; }

.k-product__stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: var(--bg-success-surface);
  color: var(--typo-success);
  font-size: 12px;
  font-weight: 600;
}

.k-product__stock--preorder {
  background: var(--bg-warning-surface);
  color: var(--typo-warning);
}

.k-product__title {
  margin: 0;
  font: 400 clamp(28px, 2.8cqw, 40px) / 1.2 'Yeseva One', serif;
  letter-spacing: -.01em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.k-product__prices { align-items: flex-end; gap: 12px; }

.k-product__price {
  color: var(--typo-primary);
  font-size: clamp(24px, 2.2cqw, 32px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.01em;
}

.k-product__price--sale { color: var(--typo-brand); }
.k-product__old-price { font-size: 16px; line-height: 24px; }
.k-product__pack { color: var(--typo-secondary); font-size: 14px; line-height: 20px; padding-bottom: 4px; }

.k-product__options { display: grid; gap: 12px; }

.k-product__choices {
  display: grid;
  gap: 8px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.k-product__choices legend { margin-block-end: 4px; }
.k-product__form [data-product-error]:empty { display: none; }
.k-product__row { display: none; }

/* Delivery and feature cards, prototip/index.html:519–548, 2518–2524. */
.k-product-delivery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.k-product-delivery__rows,
.k-product-card {
  border-radius: 20px;
  background: var(--bg-default);
  box-shadow: inset 0 0 0 1px var(--bg-border);
}

.k-product-delivery__rows {
  margin: 0;
  padding: 4px 20px;
  list-style: none;
}

.k-product-delivery__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-block: 12px;
}

.k-product-delivery__row:not(:last-child) { border-block-end: 1px solid var(--bg-border); }

.k-product-delivery__icon {
  display: flex;
  justify-content: center;
  flex: 0 0 24px;
  color: var(--typo-brand);
}

.k-product-delivery__text,
.k-product-card__text {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px 16px;
}

.k-product-delivery__title { font-weight: 600; }
.k-product-delivery__subtitle { color: var(--typo-secondary); }

.k-product-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  color: var(--typo-primary);
  text-decoration: none;
}

.k-product-card__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
}

.k-product-card--ozon { transition: box-shadow .15s ease; }
.k-product-card__arrow { transition: background .15s ease; }
.k-product-card--ozon:hover { color: var(--typo-primary); box-shadow: inset 0 0 0 1.5px var(--typo-brand); }
.k-product-card--ozon:hover .k-product-card__arrow { background: var(--bg-brand-surface); }

.k-product-card--brand {
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-tertiary);
  box-shadow: none;
}

.k-product-card--brand .k-product-card__icon { background: var(--bg-default); }

@media (width < 768px) {
  /* The mobile purchase bar still needs the form, but an empty form must not add a flex gap. */
  .k-product__form:has(+ .k-product-delivery):not(:has(.k-product__options, [data-product-error]:not(:empty))) {
    display: contents;
  }
}

@media (768px <= width < 1200px) {
  .k-product-delivery__row .k-product-delivery__subtitle { font-size: 13px; line-height: 18px; }
}

.k-product-tabs {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.k-product-tabs__list {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--bg-border);
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.k-product-tabs__tab {
  flex: none;
  padding: 12px 4px;
  margin-inline-end: 16px;
  color: var(--typo-secondary);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.k-product-tabs__tab:focus-visible { outline-offset: -2px; }
.k-product-tabs__tab[aria-selected="true"] {
  color: var(--typo-primary);
  box-shadow: inset 0 -2px 0 0 var(--typo-primary);
}

.k-product-tabs__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  color: var(--typo-primary);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
  scroll-margin-top: calc(2 * var(--k-hdr-top) + var(--k-hdr-h));
}

/* Core Bootstrap enforces [hidden] even without JS. Apply it only after tabs initialize. */
.k-product-tabs__panel[hidden],
:root[data-theme] .k-product-tabs__panel[data-tab-inactive] { display: none; }
@media (width < 768px) {
  .k-product-tabs__panel { scroll-margin-top: 72px; }
}
.k-product-tabs__panel p { margin: 0; }
.k-product-tabs__panel#opisanie p { font-size: 16px; line-height: 24px; }
.k-product-tabs__panel#sostav p { line-height: 22px; }
.k-product-tabs__rows,
.k-product-tabs__row dd { margin: 0; }

.k-product-tabs__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
  border-bottom: 1px solid var(--bg-border);
}

#opisanie .k-product-tabs__row { padding-block: 12px; }
.k-product-tabs__row dt { color: var(--typo-secondary); font-weight: 400; }
#hranenie .k-product-tabs__row dt { flex-shrink: 0; max-width: 70%; }
.k-product-tabs__row dd { min-width: 0; text-align: end; font-weight: 500; }
.k-product-tabs__images { display: grid; gap: 12px; }

.k-product-tabs__allergens,
.k-product-tabs__advice {
  display: flex;
  align-items: flex-start;
}

.k-product-tabs__allergens { gap: 8px; color: var(--typo-warning); }
.k-product-tabs__allergens svg,
.k-product-tabs__advice svg { flex: none; }
.k-product-tabs__nutrition { margin: 0; padding-bottom: 4px; font-size: 16px; font-weight: 600; }
.k-product-tabs__advice {
  gap: 10px;
  padding: 14px 16px;
  border-radius: calc(var(--rounded-lg) * 1px);
  background: var(--bg-tertiary);
}
.k-product-tabs__advice p + p { margin-top: 8px; }

/* Demo pdpRelTop and relGap. The page gap already contributes 24px above the block. */
.k-product-related {
  --related-title-size: clamp(32px, 3.9cqw, 56px);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-block: clamp(48px, 6.7cqw, 96px) clamp(48px, 8.3cqw, 120px);
}

.k-product-related__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.k-product-related__head h2 {
  margin: 0;
  font: 400 var(--related-title-size) / 1.14 'Yeseva One', serif;
  letter-spacing: -.01em;
}

.k-product-related__arrows {
  display: flex;
  gap: 8px;
}

.k-product-related__arrows button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--typo-primary);
}

.k-product-related__arrows button:last-child {
  background: var(--control-primary-bg);
  color: var(--control-primary-typo);
}

.k-product-related__tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 16px;
}

@media (width < 768px) {
  /* The short product body must not pull the toast away from the action bar. */
  .k-product > .k-sticky-toast {
    position: fixed;
    inset-inline: 0;
  }
}

@media (min-width: 768px) {
  .k-product__grid { grid-template-columns: minmax(0, 454fr) minmax(0, 443fr); }

  .k-product-related {
    --related-top: 6.667cqw;
    padding-block-start: calc(var(--related-top) - 24px - max(0px, (48px - var(--related-title-size) * 1.14) / 2));
  }

  .k-product-related__tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.778cqw 1.667cqw;
  }

  .k-product__row {
    --pdp-size: clamp(48px, calc(48px + (100cqw - 768px) * .05263), 56px);
    --pdp-inner: calc(var(--pdp-size) - 8px);
    --pdp-qty: clamp(28px, calc(28px + (100cqw - 768px) * .02632), 32px);
    --pdp-gap: clamp(6px, calc(6px + (100cqw - 768px) * .03947), 12px);
    --pdp-step-gap: clamp(2px, calc(2px + (100cqw - 768px) * .01316), 4px);
    --pdp-label-size: clamp(14px, calc(14px + (100cqw - 768px) * .01316), 16px);
    --pdp-label-start: clamp(12px, calc(12px + (100cqw - 768px) * .02632), 16px);
    display: flex;
    gap: var(--pdp-gap);
    align-items: center;
  }

  .k-product__stepper {
    display: flex;
    align-items: center;
    height: var(--pdp-size);
    gap: var(--pdp-step-gap);
    padding: 4px;
    border-radius: 999px;
    background: var(--bg-tertiary);
  }

  .k-product__stepper button,
  .k-product__add,
  .k-product__arrow {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
  }

  .k-product__stepper button {
    width: var(--pdp-inner);
    height: var(--pdp-inner);
    padding: 0;
    background: var(--bg-default);
    color: var(--typo-primary);
    cursor: pointer;
  }

  .k-product__stepper button:disabled { color: var(--warm-400); cursor: default; }
  .k-product__stepper output { width: var(--pdp-qty); text-align: center; font-weight: 600; }

  .k-product__add {
    position: relative;
    flex: 1;
    min-width: 0;
    height: var(--pdp-size);
    padding: 0 calc(var(--pdp-inner) + 12px) 0 var(--pdp-label-start);
    background: var(--control-primary-bg);
    color: var(--control-primary-typo);
    font: inherit;
    font-size: var(--pdp-label-size);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
  }

  .k-product__add:not([aria-disabled="true"], :disabled):hover { background: var(--control-primary-bg-hover); }
  .k-product__add:is([aria-disabled="true"], :disabled) { cursor: default; }

  .k-product__arrow {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;
    width: var(--pdp-inner);
    height: var(--pdp-inner);
    background: var(--k-gradient-accent);
  }

  .k-product__row .k-tile__fav {
    position: static;
    flex: none;
    width: var(--pdp-size);
    height: var(--pdp-size);
    background: var(--bg-tertiary);
  }

  .k-product__row .k-tile__fav:hover { background: var(--bg-tertiary-hover); }
}

@media (min-width: 1200px) {
  .k-product__grid { grid-template-columns: minmax(0, 640px) minmax(0, 1fr); }
  .k-product__row { --pdp-label-start: clamp(16px, calc(16px + (100cqw - 1200px) * .0917), 38px); }
  .k-product-delivery__row { align-items: center; }
  .k-product-delivery__text { flex-direction: row; justify-content: space-between; }
  .k-product-delivery__row .k-product-delivery__subtitle { text-align: right; }

  .k-product-related { --related-top: 96px; }
  .k-product-related__tiles { gap: 40px 24px; }
}
