@layer legacy-base, legacy-header-theme, legacy-grow, legacy-minimal, legacy-spacing, v4tokens, v4components, v4dark;
@layer legacy-base {
/* Product category pages: intro title, alternating bands, product link cards */
/* scope: #kg / #kgm pages and the product-category-main template */
html body .product-category-main:not(:has(> .hero-banner)) { padding-top: 72px; }
html body :is(#kg, #kgm, .product-category-main) .pcat-intro { padding: 28px 0 0; }
html body :is(#kg, #kgm, .product-category-main) .pcat-intro .sec-title {
  font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; line-height: 1.11;
  letter-spacing: normal; margin: 0 0 16px; text-transform: none; color: #333333;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-intro .sec-sub {
  font-size: 19px; font-weight:var(--kg-fw-regular); line-height: 1.45; max-width: none; margin: 0; color: #666666;
}
html body .product-category-main .category-container, html body .product-category-main .category-content, html body .product-category-main .page-container { padding-top: 0; margin-top: 0; }

/* rows: equal columns, alternating full-width bands */
html body :is(#kg, #kgm, .product-category-main) .pcat-stack { gap: 0; padding: 28px 0 72px; }
html body #kg .pcat-stack { padding-left: 24px; padding-right: 24px; }
html body .product-category-main .pcat-intro .wrap { max-width: 1440px; margin: 0 auto; padding-left: 24px; padding-right: 24px; box-sizing: border-box; }
html body :is(#kg, #kgm, .product-category-main) .pcat-row { padding: 56px 0; }
html body :is(#kg, #kgm, .product-category-main) .pcat-row:first-child { padding-top: 0; }
html body :is(#kg, #kgm, .product-category-main) .pcat-row:last-child { padding-bottom: 0; }
html body :is(#kg, #kgm, .product-category-main) .pcat-row:nth-child(even) {
  background: var(--color-surface, #FAFAFA); box-shadow: 0 0 0 100vmax var(--color-surface, #FAFAFA); clip-path: inset(0 -100vmax);
}
@media (min-width: 981px) {
  html body :is(#kg, #kgm, .product-category-main) .pcat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
}
@media (max-width: 900px) { html body :is(#kg, #kgm, .product-category-main) .pcat-row { padding: 40px 0; } }

/* product link cards */
html body :is(#kg, #kgm, .product-category-main) .pcat-links {
  display: grid; gap: 16px; margin-bottom: 32px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
html body :is(#kg, #kgm, .product-category-main) .pcat-links.pcat-links-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
html body :is(#kg, #kgm, .product-category-main) .pcat-links .pcat-link {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) 64px; grid-template-areas: "img img" "name arrow";
  align-items: end; gap: 10px 12px; aspect-ratio: 1 / 1;
  padding: 18px 18px 16px; border-radius: 12px;
  background: #fff; border: 1px solid #dfe7f0; box-shadow: 0 1px 2px rgba(22, 24, 29, .04);
  color: #E01920; font-size: 19px; font-weight:var(--kg-fw-semibold); line-height: 1.3; text-decoration: none;
  overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 .pcat-link {
  aspect-ratio: 4 / 5; grid-template-rows: minmax(0, 1fr) 56px; padding: 14px 14px 12px; font-size: 15px; border-radius: 12px;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-link .nm-link-img {
  grid-area: img; position: relative; display: block; min-height: 0; height: 100%; overflow: hidden;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-link .nm-link-img img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-link .nm-link-name {
  grid-area: name; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; align-self: end; min-width: 0; overflow-wrap: anywhere;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 .pcat-link .nm-link-name { -webkit-line-clamp: 3; }
html body :is(#kg, #kgm, .product-category-main) .pcat-link svg {
  grid-area: arrow; width: 64px; height: 64px; padding: 15px; box-sizing: border-box; border-radius: 50%;
  background: #E01920; fill: #fff; flex-shrink: 0; transition: transform .25s ease, background .2s;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 .pcat-link svg { width: 44px; height: 44px; padding: 11px; }
html body :is(#kg, #kgm, .product-category-main) .pcat-links .pcat-link:hover,
html body :is(#kg, #kgm, .product-category-main) .pcat-links .pcat-link:focus-visible {
  background: #fff; border-color: #E01920; box-shadow: 0 2px 5px rgba(0,0,0,.12); transform: translateY(-3px); color: #E01920;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-link:hover svg { transform: translateX(6px); background: #B0141B; }
html body :is(#kg, #kgm, .product-category-main) .pcat-row:nth-child(even) .pcat-link { background: transparent; }
@media (max-width: 680px) {
  html body :is(#kg, #kgm, .product-category-main) .pcat-links { gap: 12px; }
  html body :is(#kg, #kgm, .product-category-main) .pcat-links .pcat-link { padding: 12px; font-size: 14px; aspect-ratio: 4 / 5; grid-template-rows: minmax(0, 1fr) 56px; }
  html body :is(#kg, #kgm, .product-category-main) .pcat-link svg { width: 44px; height: 44px; padding: 11px; }
  html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) { html body :is(#kg, #kgm, .product-category-main) .pcat-stack { padding: 20px 0 44px; } html body #kg .pcat-stack { padding-left: 16px; padding-right: 16px; } html body .product-category-main .pcat-intro .wrap { padding-left: 16px; padding-right: 16px; } }

/* tall card grids: keep the photo in view next to them */
@media (min-width: 981px) {
  html body :is(#kg, #kgm, .product-category-main) .pcat-row:has(.pcat-links-3) { align-items: start; }
  html body :is(#kg, #kgm, .product-category-main) .pcat-row:has(.pcat-links-3) .pcat-media { position: sticky; top: 100px; }
}
/* category page without breadcrumb: clear the fixed header */
html body :is(#kgm,#kg) > .pcat-intro:first-child, html body :is(#kgm,#kg) > section.pcat-intro:first-child { padding-top: 100px; }

/* Subtler arrow button: outlined by default, solid on card hover */
html body :is(#kg, #kgm, .product-category-main) .pcat-links .pcat-link { grid-template-rows: minmax(0, 1fr) 48px; }
html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 .pcat-link { grid-template-rows: minmax(0, 1fr) 44px; }
html body :is(#kg, #kgm, .product-category-main) .pcat-link svg {
  width: 44px; height: 44px; padding: 12px; box-sizing: border-box; border-radius: 50%;
  background: #fff; border: 1.5px solid #E01920; fill: #E01920; transition: background .2s, fill .2s, transform .25s ease;
}
html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 .pcat-link svg { width: 36px; height: 36px; padding: 9px; }
html body :is(#kg, #kgm, .product-category-main) .pcat-link:hover svg,
html body :is(#kg, #kgm, .product-category-main) .pcat-link:focus-visible svg { background: #E01920; fill: #fff; transform: translateX(3px); }
@media (max-width: 680px) {
  html body :is(#kg, #kgm, .product-category-main) .pcat-links .pcat-link,
  html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 .pcat-link { grid-template-rows: minmax(0, 1fr) 44px; }
  html body :is(#kg, #kgm, .product-category-main) .pcat-link svg,
  html body :is(#kg, #kgm, .product-category-main) .pcat-links-3 .pcat-link svg { width: 36px; height: 36px; padding: 9px; }
}

/* technology pages: title block followed directly by the first content section */
html body :is(#kg, #kgm) .pcat-intro + .section,
html body :is(#kg, #kgm) .pcat-intro + .section-alt { padding-top: 56px; }

/* Legacy image-card blocks (Japanese brand pages): same outlined arrow as the other product cards */
html body .product-category-main .sc-block-item .item-inner { position: relative; }
html body .product-category-main .sc-block-item .item-img { position: static; }
html body .product-category-main .sc-block-item .item-info { padding-right: 76px; min-height: 76px; }
html body .product-category-main .sc-block-item .item-btn {
  position: absolute; left: auto; right: 16px; bottom: 16px; top: auto;
  transform: none; width: 44px; height: 44px; opacity: 1;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid #E01920; border-radius: 50%;
  transition: background .2s;
}
html body .product-category-main .sc-block-item .item-btn svg { width: 20px; height: 20px; margin: 0; fill: #E01920; transition: fill .2s, transform .25s ease; }
html body .product-category-main .sc-block-item .item-inner:hover .item-btn { background: #E01920; }
html body .product-category-main .sc-block-item .item-inner:hover .item-btn svg { fill: #fff; transform: translateX(3px); }

/* legacy sidebar layout (Japanese brand pages): breathing room under the title block */
html body .product-category-main .pcat-intro + .category-container:has(.page-aside) { padding-top: 28px; }

/* Page shell: keep .wrap inside its max-width and centred on wide screens.
   Several page templates set .wrap without `margin:auto`, so at viewports wider
   than 1440+padding the column grew to max-width+padding and stuck to the left
   edge (measured at 1920: 1536px wide, left 0). Declaring it once here replaces
   the per-page <style id="kn-center"> copies that used to live in 5 pages. */
html body :is(#kgm,#kg) .wrap {
  box-sizing: border-box;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

}
