/* ================================================================
   NEKOJIMA THEME RC12.30
   Responsive product title + horizontal thumbnail carousel.
================================================================ */

/* Product title: keep impact on large displays, but avoid oversized
   headings on common 15–17 inch laptop/desktop viewports. */
body.single-product .summary.entry-summary .product_title,
body.single-product .neko-single-product__summary .product_title {
    font-size: clamp(2.15rem, 2.65vw, 3.65rem) !important;
    line-height: 1.06 !important;
    overflow-wrap: anywhere;
}

@media (min-width: 1100px) and (max-width: 1599px) {
    body.single-product .summary.entry-summary .product_title,
    body.single-product .neko-single-product__summary .product_title {
        font-size: clamp(2.15rem, 2.9vw, 3rem) !important;
        line-height: 1.08 !important;
        letter-spacing: -0.018em !important;
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
    body.single-product .summary.entry-summary .product_title,
    body.single-product .neko-single-product__summary .product_title {
        font-size: clamp(2rem, 5vw, 2.7rem) !important;
    }
}

@media (max-width: 767px) {
    body.single-product .summary.entry-summary .product_title,
    body.single-product .neko-single-product__summary .product_title {
        font-size: clamp(1.8rem, 8vw, 2.35rem) !important;
        line-height: 1.1 !important;
    }
}

/* Thumbnail carousel. The JS wrapper is intentionally small and leaves
   WooCommerce/FlexSlider in charge of selecting the active thumbnail. */
body.single-product .woocommerce-product-gallery .neko-thumb-carousel {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
}

body.single-product .woocommerce-product-gallery .neko-thumb-carousel__viewport {
    min-width: 0;
    overflow: hidden;
}

body.single-product .woocommerce-product-gallery ol.flex-control-thumbs,
body.single-product div.product .flex-control-thumbs {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 2px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x;
}

body.single-product .woocommerce-product-gallery ol.flex-control-thumbs::-webkit-scrollbar {
    display: none;
}

body.single-product .woocommerce-product-gallery ol.flex-control-thumbs > li,
body.single-product div.product .flex-control-thumbs > li {
    display: block !important;
    flex: 0 0 82px !important;
    width: 82px !important;
    max-width: 82px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    scroll-snap-align: start;
}

body.single-product .woocommerce-product-gallery ol.flex-control-thumbs img,
body.single-product div.product .flex-control-thumbs img {
    display: block !important;
    width: 82px !important;
    height: 82px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border: 2px solid transparent !important;
    border-radius: 14px !important;
    opacity: .72 !important;
    transition: opacity .18s ease, border-color .18s ease, transform .18s ease;
}

body.single-product .woocommerce-product-gallery ol.flex-control-thumbs img.flex-active,
body.single-product .woocommerce-product-gallery ol.flex-control-thumbs img:hover,
body.single-product .woocommerce-product-gallery ol.flex-control-thumbs img:focus-visible {
    opacity: 1 !important;
    border-color: var(--color-primary, #d8688c) !important;
}

body.single-product .neko-thumb-carousel__button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--color-border, #eadfe3);
    border-radius: 999px;
    background: var(--color-surface, #fff);
    color: var(--color-text, #4f4349);
    box-shadow: 0 5px 16px rgba(58, 44, 52, .08);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

body.single-product .neko-thumb-carousel__button:hover,
body.single-product .neko-thumb-carousel__button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--color-primary, #d8688c);
    background: var(--color-surface-soft, #fff6f8);
    outline: none;
}

body.single-product .neko-thumb-carousel__button[disabled] {
    opacity: .3;
    cursor: default;
    transform: none;
}

body.single-product .neko-thumb-carousel__button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Hide carousel navigation when there is nothing to scroll. */
body.single-product .neko-thumb-carousel--static {
    grid-template-columns: minmax(0, 1fr);
}

body.single-product .neko-thumb-carousel--static .neko-thumb-carousel__button {
    display: none;
}

@media (max-width: 767px) {
    body.single-product .woocommerce-product-gallery .neko-thumb-carousel {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        gap: 7px;
    }

    body.single-product .neko-thumb-carousel__button {
        width: 34px;
        height: 34px;
    }

    body.single-product .woocommerce-product-gallery ol.flex-control-thumbs > li,
    body.single-product div.product .flex-control-thumbs > li {
        flex-basis: 68px !important;
        width: 68px !important;
        max-width: 68px !important;
    }

    body.single-product .woocommerce-product-gallery ol.flex-control-thumbs img,
    body.single-product div.product .flex-control-thumbs img {
        width: 68px !important;
        height: 68px !important;
        border-radius: 12px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.single-product .woocommerce-product-gallery ol.flex-control-thumbs {
        scroll-behavior: auto;
    }
}
