/*
 * K4U Product Content
 * Global component library for long product descriptions in Shoptet Classic.
 * Version: 1.2.0
 */

/* All tokens are scoped to the opt-in wrapper so other Shoptet content is untouched. */
.k4u-product-content {
  --k4u-product-bg: #fff;
  --k4u-product-bg-soft: #f7f7f7;
  --k4u-product-bg-hover: #fbfbfb;
  --k4u-product-border: #e5e5e5;
  --k4u-product-border-strong: #d4d8d8;
  --k4u-product-text: #242626;
  --k4u-product-muted: #666;
  --k4u-product-accent: #168579;
  --k4u-product-accent-bg: #f1f8f7;
  --k4u-product-accent-border: #b8dcd7;
  --k4u-product-tip-bg: #fbf8ee;
  --k4u-product-tip-border: #e7dcc2;
  --k4u-product-tip-icon: #b68526;
  --k4u-product-warning: #a65d49;
  --k4u-product-warning-bg: #fff8f4;
  --k4u-product-radius: 7px;
  --k4u-product-gap: 12px;

  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  color: inherit;
  font-size: 1.04em;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.k4u-product-content *,
.k4u-product-content *::before,
.k4u-product-content *::after {
  box-sizing: border-box;
}

.k4u-product-content > :first-child {
  margin-top: 0;
}

.k4u-product-content > :last-child {
  margin-bottom: 0;
}

.k4u-product-content h2 {
  margin-top: 34px;
  line-height: 1.3;
}

.k4u-product-content h3 {
  margin-top: 22px;
  line-height: 1.35;
}

.k4u-product-content img,
.k4u-product-content svg,
.k4u-product-content video,
.k4u-product-content iframe {
  max-width: 100%;
}

.k4u-product-content img,
.k4u-product-content video {
  height: auto;
}

.k4u-product-content a:focus-visible,
.k4u-product-content summary:focus-visible,
.k4u-product-table-wrap[tabindex]:focus-visible {
  outline: 2px solid var(--k4u-product-accent);
  outline-offset: 3px;
}

/* Opening paragraph below the main content heading. */
.k4u-product-intro {
  margin: 0 0 22px;
  font-size: 1.08em;
}

/* Shared grid foundation. The two modifiers cover layouts used by the pilot. */
.k4u-product-benefits,
.k4u-product-icons,
.k4u-product-routine,
.k4u-product-ingredients,
.k4u-product-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--k4u-product-gap);
  width: 100%;
  max-width: 100%;
  margin: 18px 0 28px;
}

.k4u-product-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.k4u-product-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.k4u-product-benefit,
.k4u-product-icon,
.k4u-product-routine > li,
.k4u-product-routine > div,
.k4u-product-ingredient,
.k4u-product-fact {
  min-width: 0;
  padding: 16px;
  border-radius: var(--k4u-product-radius);
  background: var(--k4u-product-bg-soft);
}

.k4u-product-benefit > :first-child,
.k4u-product-icon > :first-child,
.k4u-product-routine > li > :first-child,
.k4u-product-routine > div > :first-child,
.k4u-product-ingredient > :first-child,
.k4u-product-fact > :first-child {
  margin-top: 0;
}

.k4u-product-benefit > :last-child,
.k4u-product-icon > :last-child,
.k4u-product-routine > li > :last-child,
.k4u-product-routine > div > :last-child,
.k4u-product-ingredient > :last-child,
.k4u-product-fact > :last-child {
  margin-bottom: 0;
}

.k4u-product-benefit strong,
.k4u-product-ingredient strong,
.k4u-product-fact strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.06em;
}

/*
 * Icon items use inline SVG supplied by the product HTML. Keep SVG meaning in a
 * visible text label; decorative SVG should use aria-hidden="true".
 */
.k4u-product-icon {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
}

.k4u-product-icon svg {
  display: block;
  width: 28px;
  height: 28px;
  color: var(--k4u-product-accent);
}

.k4u-product-icon__label {
  display: block;
  min-width: 0;
  font-weight: 700;
  line-height: 1.4;
}

.k4u-product-icon__text {
  display: block;
  margin-top: 3px;
  color: var(--k4u-product-muted);
  line-height: 1.5;
}

/* Highlighted sales, testing or decision-support information. */
.k4u-product-highlight,
.k4u-product-note,
.k4u-product-warning {
  width: 100%;
  max-width: 100%;
  margin: 22px 0 28px;
  padding: 18px 20px;
  border-radius: var(--k4u-product-radius);
}

.k4u-product-highlight {
  background: var(--k4u-product-bg-soft);
}

/* One high-value decision point per product page; content supplies the meaning. */
.k4u-product-highlight.k4u-product-highlight--accent {
  border: 1px solid var(--k4u-product-accent-border);
  border-left: 3px solid var(--k4u-product-accent);
  background: var(--k4u-product-accent-bg);
}

.k4u-product-highlight--important {
  border-left: 3px solid var(--k4u-product-accent);
}

.k4u-product-note {
  border: 1px solid var(--k4u-product-tip-border);
  background: var(--k4u-product-tip-bg);
}

.k4u-product-warning {
  border: 1px solid #ead8d1;
  border-left: 3px solid var(--k4u-product-warning);
  background: var(--k4u-product-warning-bg);
}

.k4u-product-highlight > :first-child,
.k4u-product-note > :first-child,
.k4u-product-warning > :first-child {
  margin-top: 0;
}

.k4u-product-highlight > :last-child,
.k4u-product-note > :last-child,
.k4u-product-warning > :last-child {
  margin-bottom: 0;
}

.k4u-product-highlight > strong:first-child,
.k4u-product-note > strong:first-child,
.k4u-product-warning > strong:first-child {
  display: block;
  margin-bottom: 8px;
  font-size: 1.08em;
}

.k4u-product-note > strong:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Decorative Tabler Icons "bulb" (MIT); the visible heading carries meaning. */
.k4u-product-note > strong:first-child::before {
  display: inline-block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  background-color: var(--k4u-product-tip-icon);
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%2012h1m8-9v1m8%208h1m-15.4-6.4l.7.7m12.1-.7l-.7.7'/%3E%3Cpath%20d='M9%2016a5%205%200%201%201%206%200a3.5%203.5%200%200%200-1%203a2%202%200%200%201-4%200a3.5%203.5%200%200%200-1-3'/%3E%3Cpath%20d='M9.7%2017h4.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%2012h1m8-9v1m8%208h1m-15.4-6.4l.7.7m12.1-.7l-.7.7'/%3E%3Cpath%20d='M9%2016a5%205%200%201%201%206%200a3.5%203.5%200%200%200-1%203a2%202%200%200%201-4%200a3.5%203.5%200%200%200-1-3'/%3E%3Cpath%20d='M9.7%2017h4.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Ordered application steps and routine blocks remain semantic lists. */
.k4u-product-steps {
  margin: 18px 0 28px;
  padding-left: 1.5em;
}

.k4u-product-steps > li {
  margin-bottom: 9px;
  padding-left: 3px;
}

.k4u-product-steps > li:last-child {
  margin-bottom: 0;
}

.k4u-product-routine {
  padding: 0;
  list-style: none;
  counter-reset: k4u-product-routine;
}

.k4u-product-routine > li {
  position: relative;
  padding-left: 52px;
  counter-increment: k4u-product-routine;
}

.k4u-product-routine > li::before {
  position: absolute;
  top: 15px;
  left: 16px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--k4u-product-accent);
  color: #fff;
  content: counter(k4u-product-routine);
  font-size: 0.86em;
  font-weight: 700;
  line-height: 1;
}

/* Facts use an outlined treatment to distinguish them from benefit cards. */
.k4u-product-fact {
  border: 1px solid var(--k4u-product-border);
  background: var(--k4u-product-bg);
}

/* FAQ works with plain article blocks or semantic <details> elements. */
.k4u-product-faq {
  width: 100%;
  max-width: 100%;
  margin: 18px 0 28px;
  border-top: 1px solid var(--k4u-product-border);
}

.k4u-product-faq__item {
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--k4u-product-border);
}

.k4u-product-faq__item > :first-child {
  margin-top: 0;
}

.k4u-product-faq__item > :last-child {
  margin-bottom: 0;
}

.k4u-product-faq__item > h3:first-child,
.k4u-product-faq__item > summary:first-child {
  margin: 0;
  font-size: 1.06em;
  font-weight: 700;
  line-height: 1.4;
}

details.k4u-product-faq__item > summary {
  cursor: pointer;
}

details.k4u-product-faq__item[open] > summary {
  margin-bottom: 10px;
}

.k4u-product-small,
.k4u-product-inci {
  color: var(--k4u-product-muted);
  font-size: 0.92em;
}

.k4u-product-inci {
  word-break: break-word;
}

/* Global semantic comparison tables for product descriptions. */
.k4u-product-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 18px 0 28px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--k4u-product-border);
  border-radius: var(--k4u-product-radius);
  background: var(--k4u-product-bg);
  -webkit-overflow-scrolling: touch;
}

.k4u-product-table {
  width: 100% !important;
  max-width: 100%;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: auto;
  background: var(--k4u-product-bg) !important;
  color: var(--k4u-product-text);
  font-size: 1em;
  line-height: 1.5;
}

.k4u-product-table caption {
  padding: 0 0 10px;
  color: inherit;
  font-weight: 700;
  text-align: left;
}

.k4u-product-table th,
.k4u-product-table td {
  padding: 13px 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--k4u-product-border) !important;
  background: var(--k4u-product-bg) !important;
  vertical-align: top !important;
  overflow-wrap: anywhere;
  text-align: left !important;
}

.k4u-product-table thead th {
  border-bottom-color: var(--k4u-product-border-strong) !important;
  background: var(--k4u-product-bg-soft) !important;
  font-weight: 700;
}

.k4u-product-table tbody tr:last-child > th,
.k4u-product-table tbody tr:last-child > td {
  border-bottom: 0 !important;
}

.k4u-product-table tbody tr:hover > th,
.k4u-product-table tbody tr:hover > td {
  background: var(--k4u-product-bg-hover) !important;
}

@media (max-width: 991px) {
  .k4u-product-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .k4u-product-content {
    font-size: 1em;
    line-height: 1.65;
  }

  .k4u-product-content h2 {
    margin-top: 28px;
  }

  .k4u-product-intro {
    font-size: 1.05em;
  }

  .k4u-product-benefits,
  .k4u-product-icons,
  .k4u-product-routine,
  .k4u-product-ingredients,
  .k4u-product-facts,
  .k4u-product-grid--2,
  .k4u-product-grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .k4u-product-benefit,
  .k4u-product-icon,
  .k4u-product-routine > li,
  .k4u-product-routine > div,
  .k4u-product-ingredient,
  .k4u-product-fact {
    padding: 15px;
  }

  .k4u-product-routine > li {
    padding-left: 50px;
  }

  .k4u-product-routine > li::before {
    top: 14px;
    left: 15px;
  }

  .k4u-product-highlight,
  .k4u-product-note,
  .k4u-product-warning {
    padding: 16px;
  }

  .k4u-product-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .k4u-product-table:not(.k4u-product-table--scroll) {
    display: block !important;
    background: transparent !important;
  }

  .k4u-product-table:not(.k4u-product-table--scroll) thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
  }

  .k4u-product-table:not(.k4u-product-table--scroll) tbody {
    display: grid !important;
    width: 100%;
    gap: var(--k4u-product-gap);
  }

  .k4u-product-table:not(.k4u-product-table--scroll) tbody tr {
    display: block !important;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--k4u-product-border);
    border-radius: var(--k4u-product-radius);
    background: var(--k4u-product-bg);
  }

  .k4u-product-table:not(.k4u-product-table--scroll) tbody th,
  .k4u-product-table:not(.k4u-product-table--scroll) tbody td {
    display: block !important;
    width: 100% !important;
    padding: 11px 14px !important;
    border-bottom: 1px solid var(--k4u-product-border) !important;
    background: var(--k4u-product-bg) !important;
    font-size: 1em;
    font-weight: 400;
  }

  .k4u-product-table:not(.k4u-product-table--scroll)
    tbody
    [data-label] {
    display: grid !important;
    grid-template-columns: minmax(88px, 36%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .k4u-product-table:not(.k4u-product-table--scroll)
    tbody
    [data-label]::before {
    color: var(--k4u-product-muted);
    content: attr(data-label);
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.4;
  }

  .k4u-product-table:not(.k4u-product-table--scroll)
    tbody
    tr
    > :first-child {
    background: var(--k4u-product-bg-soft) !important;
    color: var(--k4u-product-text);
    font-size: 1.05em;
    font-weight: 700;
  }

  .k4u-product-table:not(.k4u-product-table--scroll)
    tbody
    tr
    > :last-child {
    border-bottom: 0 !important;
  }

  .k4u-product-table.k4u-product-table--scroll {
    display: table !important;
    width: 100% !important;
    min-width: 680px;
    overflow: hidden;
    border: 1px solid var(--k4u-product-border) !important;
    border-radius: var(--k4u-product-radius);
    background: var(--k4u-product-bg) !important;
  }

  .k4u-product-table.k4u-product-table--scroll thead th {
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .k4u-product-table:not(.k4u-product-table--scroll)
    tbody
    [data-label] {
    grid-template-columns: minmax(76px, 34%) minmax(0, 1fr);
    gap: 8px;
  }
}
