.ns-product-gallery {
    width: 100%;
    max-width: 600px;
    margin-inline: auto;
    text-align: center;
}
.ns-gallery-main {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    touch-action: pan-y pinch-zoom;
}
.ns-gallery-zoom {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ns-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 12px;
}
.ns-gallery-thumb {
    width: 54px;
    height: 54px;
    padding: 2px;
    border: 1px solid #ded8cf;
    border-radius: 6px;
    background: #fff;
}
.ns-gallery-thumb[aria-pressed="true"] { outline: 2px solid #806332; }
.ns-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }

#div_size { position: relative; margin-block: 16px; }
.ns-size-label { display: block; font-weight: 600; margin-bottom: 8px; }
.ns-size-options:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
#div_size > .ns-size-source,
.ns-size-option input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.ns-size-option span {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 46px;
    padding: 6px 9px;
    border: 1px solid #d8cdbb;
    border-radius: 7px;
    background: #faf8f4;
    color: #2d251a;
    line-height: 1.3;
    text-align: start;
}
.ns-size-option span::before {
    content: "";
    box-sizing: border-box;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 1px solid #876c42;
    border-radius: 50%;
}
.ns-size-option input:checked + span { background: #efe4d2; border-color: #806332; }
.ns-size-option input:checked + span::before { border: 4px solid #806332; background: #fff; }
.ns-size-option input:focus-visible + span { outline: 2px solid #634719; outline-offset: 2px; }
.ns-size-option input:disabled + span { opacity: .55; }
.ns-product-specs {
    width: 100%;
    margin-block: 20px 4px;
    border: 1px solid #e7dfd5;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 9px;
    overflow: hidden;
    text-align: start;
    font-size: .94rem;
    line-height: 1.45;
}
.ns-product-specs th,
.ns-product-specs td {
    padding: 9px 10px;
    border-bottom: 1px solid #ebe4da;
    vertical-align: top;
    overflow-wrap: anywhere;
}
.ns-product-specs th { width: 39%; background: #f7f3ed; font-weight: 600; }
.ns-product-specs tr:last-child > * { border-bottom: 0; }
.ns-product-specs .ns-spec-size { display: block; }
.ns-related-wrap { width: 90%; margin: 16px auto 0; }
.ns-related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ns-related-card {
    min-width: 0;
    padding: 7px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #fff;
    color: #211c17;
}
.ns-related-card .product_list { width: 100%; height: 100%; margin: 0; padding: 0; }
.ns-related-card .product_image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    background-position: center;
    background-size: cover;
    border-radius: 4px;
}
.ns-related-card .product_data { padding: 7px 1px 3px; text-align: center; }
.ns-related-card .product_data a { overflow-wrap: anywhere; color: inherit; font-size: .90rem; line-height: 1.3; }

.ns-gallery-dialog {
    box-sizing: border-box;
    width: min(calc(100% - 20px), 760px);
    max-width: none;
    max-height: calc(100dvh - 20px);
    padding: 8px;
    border: 1px solid #ded8cf;
    border-radius: 10px;
    background: #fff;
    color: #2d251a;
}
.ns-gallery-dialog::backdrop { background: rgb(32 27 22 / .72); }
.ns-gallery-dialog img { display: block; width: 100%; max-height: calc(100dvh - 82px); object-fit: contain; }
.ns-gallery-close {
    display: block;
    min-width: 44px;
    min-height: 44px;
    margin: 0 0 3px auto;
    border: 1px solid #d8cdbb;
    border-radius: 6px;
    background: #faf8f4;
    color: inherit;
    font-size: 1.6rem;
    line-height: 1;
}
.ns-gallery-dialog :focus-visible,
.ns-product-gallery :focus-visible { outline: 2px solid #634719; outline-offset: 2px; }
