/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow: hidden;
    /* マウスホイールイベントを確実に処理するための設定 */
    touch-action: pan-y;
}

body {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow: hidden;
    /* max-width: 580px; */
    height: 100dvh;
    margin: 0 auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================================================
   Layout Structure - ヘッダー、スライダー、CTA、フッター
   ========================================================================== */

/* ヘッダー */
.header {
    position: relative;
    height: 52px;
    background-color: #fff;
    /* border-bottom: 1px solid #e0e0e0; */
    display: flex;
    align-items: center;
    justify-content: center;
    /* max-width: 580px; */
    /* margin: 0 auto; */
}

.header__logo {
    width: 70%;
    max-width: 348px;
    height: auto;
    object-fit: contain;
    object-position: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* Main Layout */
.main {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main__wrap {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: transparent;
}

.main__step-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

@media (min-width: 580px) {
    .main__wrap.fullScreen {
        max-width: unset;
        width: 56vh;
    }
}

/* スライダーエリア（残りの高さを占める） */
.main-swiper {
    flex: 1;
    width: 100%;
    background-color: #fff;
    overflow: hidden;
    position: relative;
    margin-left: auto;
    margin-right: auto;
    z-index: 1;
    display: block;
    /* マウスホイールイベントを確実に受け取るための設定 */
    pointer-events: auto;
    user-select: none;
}

.swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    transition-timing-function: ease-out;
    box-sizing: content-box;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    overflow: hidden;
}

/* 奇数番目のスライドの背景色 */
.swiper-slide:nth-child(odd) {
    background: linear-gradient(to right, #FFB84D 20%, #fbfbfb 20%);
}

/* 偶数番目のスライドの背景色 */
.swiper-slide:nth-child(even) {
    background: linear-gradient(to right, #86C9C9 20%, #fbfbfb 20%);
}

/* Swiper Pagination */
.swiper-pagination {
    position: static;
    text-align: center;
    transition: 300ms opacity;
    transform: none;
    z-index: 10;
    box-sizing: border-box;
    margin: auto;
    padding: 1.3333333333vw 0;
    flex: 0 0 auto;
}

@media (min-width: 580px) {
    .swiper-pagination {
        padding: 5px 0;
    }
}

.swiper-pagination-bullet {
    width: 1.6vw;
    height: 1.6vw;
    display: inline-block;
    border-radius: 50%;
    background: #e0e0e0;
    opacity: 1;
    margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 2px);
    cursor: pointer;
}

@media (min-width: 580px) {
    .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
    }
}

.swiper-pagination-bullet-active {
    background: #0098fe;
}

/* CTAボタン */
.cta {
    width: 100%;
    position: relative;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.cta__title {
    font-size: 3.7333333333vw;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin: 0;
    line-height: 1.2;
    padding: 5px 0;
}

@media (min-width: 580px) {
    .cta__title {
        font-size: 14px;
    }
}

.cta__buttons {
    display: flex;
    width: 100%;
    max-width: 580px;
    height: 60px;
    margin-bottom: 5px;
    gap: 5px;
    padding: 0 5px;
}

.cta__button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 8px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 3.7333333333vw;
    transition: transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: 5px;
}

.cta__button img {
    height: 100%;
    padding: 8px 0;
}

@media (min-width: 580px) {
    .cta__button {
        font-size: 14px;
    }
}

.cta__button:active {
    transform: scale(0.98);
}

.cta__button--phone {
    background: linear-gradient(to bottom, #ffb84d 0%, #ff6b35 100%);
        box-shadow: 0 3px #423426;
}

.cta__button--phone:hover {
    filter: brightness(0.7)
}

.cta__button--line {
    background: linear-gradient(to bottom, #05b34c 0%, #048b3b 100%);
    box-shadow: 0 3px #003A38;
}

.cta__button--line:hover {
    filter: brightness(0.7)
}

.cta__icon {
    font-size: 1.2em;
}

.cta__text {
    font-size: 1em;
}

/* フッター */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 8px 0;
    width: 100%;
    z-index: 1000;
    flex-shrink: 0;
    margin-top: auto;
}

.footer__text {
    font-size: 2.6666666667vw;
    line-height: 1.2;
    margin: 0;
}

@media (min-width: 580px) {
    .footer__text {
        font-size: 10px;
    }
}

/* ==========================================================================
   Slide Components
   ========================================================================== */

.slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.slide__container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    /* padding: 20px; */
}

.slide__image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* ==========================================================================
   Swiper Scrollbar
   ========================================================================== */

.progress-bar {
    position: absolute;
    top: 0;
    right: 4px;
    z-index: 1000;
    width: 4px;
    height: 100%;
    background: rgba(128, 128, 128, 0.3);
    border-radius: 0;
}

.progress-bar .swiper-scrollbar-drag {
    width: 100%;
    background: #808080;
    border-radius: 10px;
    cursor: default;
}

/* ==========================================================================
   Responsive Design - 580px最重要ブレークポイント
   ========================================================================== */

/* Responsive Design */
@media (min-width: 580px) {
    .main__wrap {
        max-width: 580px;
        margin: 0 auto;
    }

    .main__wrap.fullScreen {
        max-width: unset;
        width: 56vh;
    }

    /* .cta__buttons {
        gap: 15px;
        padding: 0px;
    } */

    /* .cta__button {
        padding: 15px 20px;
    } */

    .progress-bar {
        right: 4px;
        width: 5px;
    }
}

/* 580px以下（スマートフォン） */
@media (max-width: 580px) {
    body {
        max-width: 100%;
    }

    .header {
        height: 50px;
    }

    .header__logo {
		width: 71.4666666667vw;
		/* max-width: 200px; */
		height: auto;
    }
    .cta__title {
        font-size: 0.85rem;
    }

    .cta__button {
        /* height: 40px; */
        font-size: 0.8rem;
        min-width: 80px;
        gap: 3px;
    }

    .footer__text {
        font-size: 0.5rem;
    }

    .progress-bar {
        right: 4px;
        width: 3px;
    }
}

/* スマホ横向き対応 */
@media (max-width: 1000px) and (orientation: landscape) {
    .header {
        height: 40px;
    }
	.header__logo {
		max-width: 200px;
		width: 100%;
	}
    .cta__title {
        font-size: 9px;
    }

    .cta__button {
        /* padding: 6px 8px; */
        font-size: 10px;
        /* min-height: 32px; */
        gap: 4px;
        white-space: nowrap;
    }

    .cta__icon {
        font-size: 1em;
    }

    .cta__text {
        font-size: 0.9em;
    }

    .footer {
        padding: 6px 0;
    }

    .footer__text {
        font-size: 8px;
    }

    .progress-bar {
        right: 4px;
        width: 3px;
    }
}

/* より大きなスマホ横向き対応 */
@media (min-width: 667px) and (max-width: 896px) and (orientation: landscape) {
    .cta__buttons {
        height: 40px;
    }
    .cta__button {
        /* padding: 8px 10px; */
        font-size: 0.7rem;
        min-width: 65px;
        gap: 2px;
    }

    .cta__title {
        font-size: 0.65rem;
    }

    .cta__icon {
        font-size: 0.9em;
    }

    .footer__text {
        font-size: 0.5rem;
    }

    .progress-bar {
        right: 4px;
        width: 3px;
    }
}

/* さらに低い画面（高さ400px以下）の場合 */
@media (orientation: landscape) and (max-height: 400px) {
    .header {
        height: 35px;
    }

    .header__logo {
        width: 100%;
		max-width: 200px;
    }

    .cta {
        height: 55px;
    }
    .cta__title {
        padding: 0;
    }
    .cta__buttons {
        height: 40px;
    }

    .cta__button {
        /* height: 28px; */
        font-size: 0.65rem;
        min-width: 55px;
        gap: 1px;
        padding: 0 10px;
    }
    

    .cta__title {
        font-size: 0.6rem;
    }

    .cta__icon {
        font-size: 0.8em;
    }

    .footer__text {
        font-size: 0.5rem;
    }

    .progress-bar {
        right: 4px;
        width: 2px;
    }
}

/* 極小画面（360px以下） */
@media (max-width: 360px) {
    .header {
        height: 45px;
    }

    .header__logo {
        width: 65%;
        max-width: 100px;
    }

    .progress-bar {
        width: 4px;
        right: 2px;
    }

    .cta {
        height: 70px;
    }

    .cta__button {
        height: 42px;
        font-size: 0.75rem;
        min-width: 70px;
        gap: 2px;

    }

    .cta__title {
        font-size: 0.75rem;
    }

    .cta__icon {
        font-size: 1em;
    }

    .footer {
        height: 35px;
    }

    .footer__text {
        font-size: 0.5rem;
    }
}

/* ==========================================================================
   Swiper Customization
   ========================================================================== */

.swiper-slide-active {
    z-index: 10;
}

.swiper-slide-next,
.swiper-slide-prev {
    z-index: 5;
}

.main-swiper .swiper-slide {
    transition: transform 0.6s ease-in-out;
}

.slide__image {
    transition: transform 0.6s ease-in-out;
}

/* Swiperの初期化時のトランジション問題を修正 */
.swiper-wrapper {
    transition: transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.swiper-slide {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Swiper v11の強制スタイルを上書き */
.main-swiper .swiper-wrapper {
    transition-duration: 600ms !important;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    transition-property: transform !important;
}

/* ==========================================================================
   Accessibility & Performance
   ========================================================================== */

@media (min-width: 1200px) {
    /* 大画面用の設定（必要に応じて追加） */
}

@media (prefers-reduced-motion: reduce) {
    .main-swiper .swiper-slide {
        transition: none;
    }

    .cta__button {
        transition: none;
    }
}
