
.kun-product { --kun-gold: #cfb482; margin-inline: auto; max-width: 1080px; }
.kun-gallery { max-width: 800px; margin-inline: auto; }
.kun-gallery-track { display: flex; align-items: stretch; aspect-ratio: 1; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; background: #101513; }
.kun-gallery-track::-webkit-scrollbar { display: none; }
.kun-gallery-slide { margin: 0; flex: 0 0 100%; min-width: 0; aspect-ratio: 1; align-self: flex-start; position: relative; scroll-snap-align: start; }
.kun-gallery-slide img { width: 100%; height: 100% !important; position: absolute; inset: 0; object-fit: cover; display: block; }
.kun-gallery-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: .65rem; }
.kun-gallery-controls[hidden] { display: none; }
.kun-gallery-controls button { min-width: 44px; min-height: 44px; border: 1px solid currentColor; color: var(--kun-gold); background: transparent; font-size: 1.55rem; }
.kun-gallery-controls button:disabled { opacity: .4; }
.kun-product-copy { max-width: 800px; margin-inline: auto; padding: 1.2rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.kun-product-copy h1 { margin-block: 0 .8rem; font-size: clamp(2rem, 6vw, 3.5rem); }
.kun-price { font-size: 1.45rem; color: var(--kun-gold); }
.kun-product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; }
.kun-product-actions button { min-width: 9rem; min-height: 44px; background: #d1b581; color: #101513; border: 0; font: inherit; opacity: .7; }
.kun-product-actions a, #kun-full-story a { color: var(--kun-gold); text-decoration: underline; text-underline-offset: .2em; }
#kun-checkout-note { margin-top: .6rem; }
#kun-full-story { margin-top: 2.5rem; scroll-margin-top: 5rem; }
[data-kun-product-card] img { display: block; width: 100%; height: auto; }
[data-kun-product-card] h3 span { display: block; }
@media (max-width: 720px) {
  /* A classic scrollbar gutter otherwise shifts the viewport-sized gallery. */
  html:has(.kun-product) { scrollbar-width: none; }
  .kun-gallery, [data-kun-product-card] { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); }
  [data-kun-product-card] { grid-column: 1 / -1; padding-inline: 0; border-inline: 0; }
  [data-kun-product-card] h3 { padding-inline: 1rem; }
}

.kun-product { background: #0d100f; }
.kun-product-copy { color: #efebe4; }
.kun-product-actions { display: grid; grid-template-columns: minmax(105px, 1fr) minmax(140px, 1.7fr); align-items: stretch; gap: .55rem; max-width: 480px; }
.kun-product-actions .kun-buy { width: 100%; min-width: 0; min-height: 48px; background: #c5ab7e; color: #121311; opacity: 1; }
.kun-product-actions .kun-quantity { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; text-align: center; border-radius: 2rem; color: #24211d; background: #efebe4; }
.kun-product-actions .kun-quantity button { min-width: 0; min-height: 44px; padding: 0; background: transparent; color: inherit; }
.kun-editorial { margin-top: 2rem; padding-top: 1.35rem; border-top: 1px solid #393a34; }
.kun-editorial h2, #kun-full-story h2 { margin: 0 0 .8rem; font-size: 1.12rem; font-weight: 650; }
.kun-editorial p, .kun-material-list, #kun-full-story p { color: #ccc7bc; line-height: 1.75; }
.kun-material-list { margin: 0; }
.kun-material-list div { display: flex; flex-wrap: wrap; gap: .3rem .65rem; margin-block: .5rem; }
.kun-material-list dt { font-weight: 650; color: #efebe4; }
.kun-material-list dd { margin: 0; }
.kun-material-source a { color: var(--kun-gold); text-decoration: underline; }
.kun-story-link { display: flex; justify-content: space-between; padding: .9rem 1rem; border-inline-start: 2px solid var(--kun-gold); color: var(--kun-gold); background: #1b1d19; }

.kun-recommended { max-width: 800px; margin: 0 auto; padding: 1.6rem clamp(1rem, 4vw, 2.5rem) 2.5rem; border-top: 1px solid #393a34; }
.kun-recommended h2 { margin: 0 0 .65rem; font-size: 1.25rem; }
.kun-recommended p { margin: 0; color: #ccc7bc; }
.kun-recommended-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.kun-recommended-grid a { display: grid; gap: .45rem; color: inherit; }
.kun-recommended-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.kun-recommended-price { color: var(--kun-gold); }
@media (max-width: 720px) {
    .kun-recommended-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .kun-product {
        max-width: none;
    }

    .kun-product-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .kun-product-copy {
        grid-area: 1 / 1;
        position: sticky;
        top: var(--wp-admin--admin-bar--height, 0px);
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        padding: clamp(2rem, 4vw, 4rem) clamp(2rem, 3.3vw, 3.75rem) 3rem;
    }

    @media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
        .single-product .kun-product-copy {
            position: static;
        }
    }

    .kun-gallery {
        grid-area: 1 / 2;
        width: 100%;
        max-width: none;
    }

    .kun-gallery-track {
        display: grid;
        aspect-ratio: auto;
        overflow: visible;
        gap: 2px;
        scroll-snap-type: none;
    }

    .kun-gallery-slide {
        width: 100%;
    }

    .kun-gallery-controls {
        display: none;
    }

    .kun-recommended {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        padding-inline: clamp(2rem, 3.3vw, 3.75rem);
    }
}

.kun-product-actions input.qty {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: .4rem .8rem;
    border: 0;
    border-radius: 2rem;
    background: #efebe4;
    color: #24211d;
    font: inherit;
    text-align: center;
}
.kun-product-actions .kun-buy { cursor: pointer; }

/* Keep the shop Kun card inside its grid; preserve the product gallery and home hero. */
.gemwisp-shop-products [data-kun-product-card] { width: 100%; max-width: 100%; min-width: 0; margin-inline: 0; }


/* Desktop product pages: sticky details and a full-height vertical gallery. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
    :is(.postid-172, .postid-190, .postid-197, .postid-204, .postid-211, .postid-238, .postid-239, .postid-263) .kun-product-copy {
        position: sticky;
        top: var(--wp-admin--admin-bar--height, 0px);
    }

    :is(.postid-172, .postid-190, .postid-197, .postid-204, .postid-211, .postid-238, .postid-239, .postid-263) .kun-gallery-track,
    :is(.postid-172, .postid-190, .postid-197, .postid-204, .postid-211, .postid-238, .postid-239, .postid-263) .gw-pg .gw-pg-stage > .kun-gallery-track {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        aspect-ratio: auto;
        overflow: visible;
        scroll-snap-type: none;
    }

    :is(.postid-172, .postid-190, .postid-197, .postid-204, .postid-211, .postid-238, .postid-239, .postid-263) .kun-gallery-slide {
        aspect-ratio: 1;
        min-width: 0;
    }

    .postid-172 .kun-gallery-slide:nth-child(1),
    .postid-172 .kun-gallery-slide:nth-child(4),
    .postid-190 .kun-gallery-slide:nth-child(1),
    .postid-238 .kun-gallery-slide:nth-child(1),
    .postid-238 .kun-gallery-slide:nth-child(4),
    .postid-238 .kun-gallery-slide:nth-child(5),
    .postid-239 .kun-gallery-slide:nth-child(1),
    .postid-263 .kun-gallery-slide:nth-child(1),
    .postid-263 .kun-gallery-slide:nth-child(3) { aspect-ratio: 980 / 654; }

    .postid-172 .kun-gallery-slide:nth-child(2),
    .postid-238 .kun-gallery-slide:nth-child(2),
    .postid-239 .kun-gallery-slide:nth-child(2) { aspect-ratio: 936 / 1024; }

    .postid-172 .kun-gallery-slide:nth-child(3),
    .postid-190 .kun-gallery-slide:nth-child(2),
    .postid-197 .kun-gallery-slide:nth-child(2),
    .postid-204 .kun-gallery-slide:nth-child(2),
    .postid-239 .kun-gallery-slide:nth-child(4) { aspect-ratio: 683 / 1024; }

    .postid-172 .kun-gallery-slide:nth-child(5) { aspect-ratio: 980 / 955; }

    .postid-172 .kun-gallery-slide:nth-child(6),
    .postid-238 .kun-gallery-slide:nth-child(3),
    .postid-239 .kun-gallery-slide:nth-child(5),
    .postid-239 .kun-gallery-slide:nth-child(6) { aspect-ratio: 980 / 735; }

    .postid-197 .kun-gallery-slide:nth-child(1),
    .postid-204 .kun-gallery-slide:nth-child(1),
    .postid-211 .kun-gallery-slide:nth-child(1) { aspect-ratio: 980 / 653; }

    .postid-239 .kun-gallery-slide:nth-child(3) { aspect-ratio: 768 / 1024; }

    .postid-263 .kun-gallery-slide:nth-child(2) { aspect-ratio: 980 / 896; }

    .postid-263 .kun-gallery-slide:nth-child(4) { aspect-ratio: 624 / 627; }

    :is(.postid-172, .postid-190, .postid-197, .postid-204, .postid-211, .postid-238, .postid-239, .postid-263) .gw-pg .gw-pg-stage .kun-gallery-slide img {
        object-fit: contain;
    }

    :is(.postid-172, .postid-190, .postid-197, .postid-204, .postid-211, .postid-238, .postid-239, .postid-263) .gw-pg .gw-pg-stage .gw-pg-control,
    :is(.postid-172, .postid-190, .postid-197, .postid-204, .postid-211, .postid-238, .postid-239, .postid-263) .gw-pg .gw-pg-thumbs {
        display: none;
    }
}
