/*
 * TOPページ専用スタイル。
 * resources/views/index.blade.php だけで使うカルーセル、カテゴリ、特集、お知らせをまとめる。
 */

/* お知らせバー */
.information-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 8px 0 16px;
    padding-block: 16px;
    padding-inline: clamp(12px, 4vw, 24px);
    border-radius: var(--site-radius-sm);
    box-sizing: border-box;
    background: var(--site-color-surface);
    color: var(--site-color-brand-dark);
}

.information-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.information-bar .information-bar__head h2 {
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--site-color-brand-dark) !important;
    font-size: 20px;
    font-weight: 700;
}

.information-bar .information-bar__head h2 span {
    margin-right: 8px;
    color: inherit;
}

.information-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.information-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.information-item::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--site-color-brand);
    content: '';
    flex-shrink: 0;
}

.information-item__text {
    max-width: 100%;
    overflow: hidden;
    color: var(--site-color-brand-dark);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 新着クーポンのカルーセル */
.carousel-wrapper {
    padding: 20px 0;
}

.swiper-container {
    position: relative;
    overflow: hidden;
}

.swiper-button-next,
.swiper-button-prev {
    position: absolute;
    top: 50%;
    z-index: 10;
    transform: translateY(-50%);
}

.swiper-button-prev {
    left: 10px;
}

.swiper-button-next {
    right: 10px;
}

.js-home-carousel .swiper-pagination {
    position: relative;
    margin-top: 14px;
}

.js-home-carousel .swiper-pagination-bullet-active {
    background: var(--site-color-brand);
}

.swiper-wrapper {
    padding: 0;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    padding-right: 5px;
    padding-left: 5px;
}

/* カルーセル内のクーポンカード */
.card {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 12px;
    border: 1px solid #dddddd;
    border-radius: var(--site-radius-sm);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.coupon-card-image-frame {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 6px;
    background: #fff8f0;
}

.card img,
.coupon-card-placeholder {
    width: 100%;
    height: 100%;
}

.card img {
    object-fit: cover;
    display: block;
}

.card p {
    margin: 6px 0;
}

/* カルーセル画像が未設定・未配置のときの代替表示 */
.coupon-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    border: 1px dashed #d9c6b1;
    border-radius: 6px;
    background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
    color: var(--site-color-brand);
    text-align: center;
}

.coupon-card-placeholder__title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.coupon-card-placeholder__text {
    color: var(--site-color-muted);
    font-size: 13px;
    font-weight: 700;
}

/* カード上の割引・PR表示 */
.discount-card-label {
    margin: 10px 0 6px;
    padding: 7px 10px;
    overflow: hidden;
    border-radius: var(--site-radius-sm);
    background: #fff1f2;
    color: var(--site-color-danger);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discount-card-label span {
    margin: 0 6px;
}

.pr-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    padding: 4px 6px;
    border-radius: 4px;
    background-color: rgba(255, 0, 0, 0.9);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

/* TOPページのクーポン一覧と、その一覧を見るための補助導線 */
.home-coupon-list-section {
    margin: 30px 0 50px;
}

.home-coupon-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaded2;
}

.home-coupon-list-title {
    margin: 0;
    color: var(--site-color-brand-dark);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}

.home-coupon-list-nav {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.home-coupon-list-nav__link,
.home-coupon-list-nav__link:link,
.home-coupon-list-nav__link:visited {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--site-color-brand);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.home-coupon-list-nav__link::after {
    content: ">";
    color: var(--site-color-brand);
    font-weight: 800;
}

.home-coupon-list-nav__link:hover,
.home-coupon-list-nav__link:focus-visible {
    color: var(--site-color-brand);
    opacity: 0.75;
}

.home-coupon-list-section .coupon-list {
    margin-top: 0;
}

/* カテゴリ検索の横スクロールリスト */
.category-search-section {
    margin: 50px 0;
    padding: 0 5px;
}

.category-scroll {
    position: relative;
}

.category-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-top: 5px;
    padding-right: 42px;
    padding-bottom: 5px;
    padding-left: 42px;
    background-color: #ffffff;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.category-list::-webkit-scrollbar {
    height: 6px;
}

.category-list::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
}

.category-item {
    flex: 0 0 auto;
    width: 140px;
    color: var(--site-color-text);
    font-size: 12px;
    text-align: center;
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-item:hover,
.category-item:focus-visible {
    color: var(--site-color-brand);
}

/* カテゴリ検索の左右送りボタン。操作方向を分かりやすく示す。 */
.category-scroll-button {
    top: 54px;
    z-index: 20;
    width: 44px;
    height: 64px;
    border: none;
    background: transparent;
    box-shadow: none;
    color: #007aff;
}

.category-scroll-button::after {
    color: currentColor;
    font-family: Arial, sans-serif;
    font-size: 42px;
    font-weight: 500;
    line-height: 1;
}

.category-scroll-button--prev::after {
    content: "<";
}

.category-scroll-button--next::after {
    content: ">";
}

.category-scroll-button:hover,
.category-scroll-button:focus-visible {
    color: #0062cc;
}

.category-scroll-button--prev {
    left: 0;
}

.category-scroll-button--next {
    right: 0;
}

.category-scroll-button:disabled {
    opacity: 0.25;
    pointer-events: none;
}

.category-item img {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 4px;
    border-radius: 50%;
    object-fit: cover;
}

.category-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 特集カード一覧 */
.feature-section {
    margin-top: 50px;
}

.feature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #dddddd;
    border-radius: var(--site-radius-md);
    background: #ffffff;
    box-shadow: var(--site-shadow-sm);
}

.feature-card img {
    width: 200px;
    height: 200px;
    border-radius: var(--site-radius-sm);
    object-fit: cover;
}

.feature-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* 未ログイン時の会員登録・ログイン導線 */
.bottom-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding: 24px 0;
    border-radius: 20px;
    background: #e5e7eb;
}

.bottom-buttons .btn-register,
.bottom-buttons .btn-login {
    display: inline-block;
    padding: 14px 40px;
    border-radius: 9999px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}

.bottom-buttons .btn-register {
    background: var(--site-color-brand);
    color: #ffffff;
}

.bottom-buttons .btn-login {
    background: #ffffff;
    color: var(--site-color-muted);
    box-shadow: 0 0 0 1px #cccccc inset;
}

/* TOPページのスマホ表示調整 */
@media (max-width: 767px) {
    .information-bar {
        margin: 8px 0 12px;
        padding-block: 12px;
        padding-inline: 16px;
    }

    .home-coupon-list-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .home-coupon-list-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .home-coupon-list-nav__link {
        flex: 1 1 0;
        justify-content: center;
    }

    /* カテゴリ検索：スマホではボタンを隠し、横スワイプで素早く探せるようにする */
    .category-scroll-button {
        display: none;
    }

    .category-list {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding-top: 5px;
        padding-right: 0;
        padding-left: 0;
        -webkit-overflow-scrolling: touch;
    }

    .category-list::-webkit-scrollbar {
        height: 6px;
    }

    .category-list::-webkit-scrollbar-thumb {
        border-radius: 3px;
        background: rgba(0, 0, 0, 0.2);
    }

    .category-item {
        flex: 0 0 120px;
    }

    .category-item img {
        width: 108px;
        height: 108px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}
