/* =========================================================
   YUPPY QUOKKA
   商品ページ：モデル写真ギャラリー
   Flatsome標準 Flickity 使用
========================================================= */

:root {
    /* 見出し */
    --yq-gallery-title-color: #5a1300;

    /* ギャラリー全体・写真間の背景色 */
    --yq-gallery-area-bg: #f7f5f0;

    /* 矢印ボタン */
    --yq-gallery-arrow-bg: #5a1300;
    --yq-gallery-arrow-hover-bg: #7a2200;
    --yq-gallery-arrow-color: #ffffff;
}


/* =========================================================
   ギャラリー全体
========================================================= */

.single-product .yq-model-gallery-section {
    clear: both;
    width: 100%;
    margin: 70px 0 80px;
    overflow: hidden;
    background-color: var(--yq-gallery-area-bg);
}

.single-product .yq-model-gallery-inner {
    width: 100%;
    margin: 0 auto;
    background-color: var(--yq-gallery-area-bg);
}


/* =========================================================
   見出し
========================================================= */

.single-product .yq-model-gallery-title {
    margin: 0 0 35px;
    color: var(--yq-gallery-title-color);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-align: center;
}


/* =========================================================
   スライダー本体
========================================================= */

.single-product .yq-model-gallery-slider {
    position: relative;
    display: block;
    width: 100%;
    min-height: 100px;
    background-color: var(--yq-gallery-area-bg);
}

/* Flickity初期化前 */
.single-product
.yq-model-gallery-slider:not(.flickity-enabled) {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
}


/* =========================================================
   各スライド
========================================================= */

/* PC：3枚表示 */
.single-product
.yq-model-gallery-slider
.yq-model-gallery-slide {
    width: 33.333333% !important;
    min-width: 33.333333% !important;
    max-width: 33.333333% !important;
    padding: 0 8px !important;
    box-sizing: border-box;
    background-color: var(--yq-gallery-area-bg);
}

/* Flickity初期化後も3枚表示を維持 */
.single-product
.yq-model-gallery-slider.flickity-enabled
.yq-model-gallery-slide {
    width: 33.333333% !important;
    min-width: 33.333333% !important;
    max-width: 33.333333% !important;
}


/* =========================================================
   写真
========================================================= */

.single-product .yq-model-gallery-link {
    display: block;
    width: 100%;
    overflow: hidden;
    background-color: var(--yq-gallery-area-bg);
}

.single-product .yq-model-gallery-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    object-position: center;
    background-color: var(--yq-gallery-area-bg);
    transition: transform 0.4s ease;
}

@media (hover: hover) {

    .single-product
    .yq-model-gallery-link:hover
    .yq-model-gallery-image {
        transform: scale(1.02);
    }
}


/* =========================================================
   Flickity
========================================================= */

.single-product
.yq-model-gallery-slider
.flickity-viewport {
    width: 100%;
    overflow: hidden;
    background-color: var(--yq-gallery-area-bg);
}

.single-product
.yq-model-gallery-slider
.flickity-slider {
    width: 100%;
    background-color: var(--yq-gallery-area-bg);
}


/* =========================================================
   左右矢印ボタン
========================================================= */

.single-product
.yq-model-gallery-slider
.flickity-prev-next-button {
    position: absolute !important;
    top: 50% !important;
    bottom: auto !important;

    display: block !important;

    width: 64px;
    height: 64px;

    margin: 0 !important;
    padding: 0 !important;

    background-color: var(--yq-gallery-arrow-bg) !important;
    border: 0 !important;
    border-radius: 6px;
    box-shadow: none !important;

    opacity: 1 !important;
    visibility: visible !important;

    transform: translate3d(0, -50%, 0) !important;

    animation: none !important;
    z-index: 50;
    cursor: pointer;

    transition:
        background-color 0.2s ease !important;
}

/* Hover・Focus・クリック時も位置を固定 */
.single-product
.yq-model-gallery-slider:hover
.flickity-prev-next-button,
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:hover,
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:focus,
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:focus-visible,
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:active {
    top: 50% !important;
    bottom: auto !important;

    margin: 0 !important;

    transform: translate3d(0, -50%, 0) !important;

    animation: none !important;
    background-color: var(--yq-gallery-arrow-hover-bg) !important;
}


/* 左ボタン */
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button.previous,
.single-product
.yq-model-gallery-slider:hover
.flickity-prev-next-button.previous {
    left: 8px !important;
    right: auto !important;
}


/* 右ボタン */
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button.next,
.single-product
.yq-model-gallery-slider:hover
.flickity-prev-next-button.next {
    right: 8px !important;
    left: auto !important;
}


/* =========================================================
   矢印アイコン
========================================================= */

/* Flatsome標準SVGを非表示 */
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button
.flickity-button-icon {
    display: none !important;
}

/* CSSで矢印を作成 */
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    margin: 0 !important;

    border-top: 2px solid var(--yq-gallery-arrow-color);
    border-right: 2px solid var(--yq-gallery-arrow-color);

    animation: none !important;
}

/* 左矢印 */
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button.previous::after {
    left: 54%;
    transform: translate(-50%, -50%) rotate(-135deg);
}

/* 右矢印 */
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button.next::after {
    left: 46%;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Hover・Focus・クリック時も矢印を固定 */
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:hover::after,
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:focus::after,
.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:active::after {
    margin: 0 !important;
    animation: none !important;
}


/* =========================================================
   無効状態
========================================================= */

.single-product
.yq-model-gallery-slider
.flickity-prev-next-button:disabled {
    opacity: 0.3 !important;
    cursor: default;
}


/* =========================================================
   ドット非表示
========================================================= */

.single-product
.yq-model-gallery-slider
.flickity-page-dots {
    display: none !important;
}


/* =========================================================
   商品タブとの間隔
========================================================= */

.single-product
.yq-model-gallery-section
+ .woocommerce-tabs {
    margin-top: 0;
}


/* =========================================================
   タブレット：2枚表示
========================================================= */

@media screen and (min-width: 550px) and (max-width: 849px) {

    .single-product .yq-model-gallery-section {
        margin-top: 60px;
        margin-bottom: 65px;
    }

    .single-product .yq-model-gallery-title {
        margin-bottom: 30px;
        font-size: 27px;
    }

    .single-product
    .yq-model-gallery-slider
    .yq-model-gallery-slide,
    .single-product
    .yq-model-gallery-slider.flickity-enabled
    .yq-model-gallery-slide {
        width: 50% !important;
        min-width: 50% !important;
        max-width: 50% !important;
        padding: 0 7px !important;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button {
        width: 56px;
        height: 56px;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button.previous {
        left: 7px !important;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button.next {
        right: 7px !important;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button::after {
        width: 13px;
        height: 13px;
    }
}


/* =========================================================
   スマートフォン
   1枚＋次の写真を少し表示
========================================================= */

@media screen and (max-width: 549px) {

    .single-product .yq-model-gallery-section {
        margin-top: 45px;
        margin-bottom: 50px;
    }

    .single-product .yq-model-gallery-title {
        margin-bottom: 22px;
        font-size: 24px;
    }

    .single-product
    .yq-model-gallery-slider
    .yq-model-gallery-slide,
    .single-product
    .yq-model-gallery-slider.flickity-enabled
    .yq-model-gallery-slide {
        width: 88% !important;
        min-width: 88% !important;
        max-width: 88% !important;
        padding: 0 5px !important;
    }

    .single-product .yq-model-gallery-image {
        aspect-ratio: 3 / 4;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button {
        width: 46px;
        height: 46px;
        border-radius: 4px;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button.previous {
        left: 5px !important;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button.next {
        right: 5px !important;
    }

    .single-product
    .yq-model-gallery-slider
    .flickity-prev-next-button::after {
        width: 11px;
        height: 11px;
    }
}