/* Scope every rule to the product gallery; checkout and descriptions are untouched. */
#itempage #img-box {
    min-width: 0;
}

#itempage #img-box .itemsubimg {
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    margin: 12px 0 0;
    padding: 4px 2px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

#itempage #img-box .itemsubimg > a,
#itempage #img-box .hataya-gallery-thumb {
    display: block;
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    min-height: 0;
    margin: 0;
    padding: 2px;
    float: none;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: none;
}

#itempage #img-box .itemsubimg img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#itempage #img-box .hataya-gallery-thumb[aria-pressed="true"] {
    border-color: #8a6d3b;
}

#itempage #img-box .hataya-gallery-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    min-width: 0;
}

#itempage #img-box .hataya-gallery-nav .itemsubimg {
    flex: 1;
    margin: 0;
}

#itempage #img-box .hataya-gallery-arrow {
    flex: 0 0 36px;
    width: 36px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid #c6b699;
    border-radius: 6px;
    background: #faf8f5;
    color: #4a3b2c;
    font: 28px/1 sans-serif;
    cursor: pointer;
}

#itempage #img-box .hataya-gallery-arrow:disabled {
    opacity: .35;
    cursor: default;
}

#itempage #img-box button:focus-visible {
    outline: 2px solid #4a3b2c;
    outline-offset: 2px;
}

#itempage #img-box .hataya-gallery-status {
    margin: 4px 0 0;
    color: #665a4e;
    font-size: 13px;
    text-align: center;
}

#itempage #img-box[data-hataya-gallery] .itemimg > a {
    display: block;
    aspect-ratio: 1;
    background: #fff;
}

#itempage #img-box[data-hataya-gallery] .itemimg > a > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
