/**
 * サブインデックスページ用スタイル
 * 簡単注文ハダタイなどのカード型インデックス
 * 自動販売機ボタン風デザイン
 */

/* ページタイトル */
.page-title {
    color: var(--color-text, #3d3d3d);
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--color-primary, #B85A30);
}

/* コンテンツラッパー */
.content-float-wrapper {
    position: relative;
}

/* イントロセクション - 背景画像付き */
.intro-section {
    position: relative;
    margin-bottom: 1.5rem;
}

/* 背景画像（右側50%に配置） */
.intro-section::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    max-width: 400px;  /* レティナ対策 */
    height: 100%;
    background-image: var(--intro-bg);
    background-size: cover;
    background-position: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 0;
}

/* 白い半透明オーバーレイ（画像を25%程度に薄く） */
.intro-section::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    max-width: 400px;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

/* イントロテキスト */
.intro-text {
    position: relative;
    width: 48%;
    z-index: 2;
}

/* 製品セクション */
.products-section {
    position: relative;
    z-index: 1;
}

.intro-text .lead {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.intro-text .intro-link {
    margin-bottom: 0.3rem;
}

.intro-text a {
    color: var(--color-link, #e07145);
}

.intro-text a:hover {
    color: var(--color-hover, #ffb866);
}

/* レスポンシブ: モバイル（イントロ画像+テキスト重ね） */
@media (max-width: 767.98px) {
    /* 背景画像を全幅に */
    .intro-section::before,
    .intro-section::after {
        width: 100%;
        max-width: none;
    }

    /* テキストを全幅、画像の上に */
    .intro-text {
        width: 100%;
        min-height: 250px;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .intro-text .lead {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .intro-text p {
        margin-bottom: 0.5rem;
    }
}

/* ============================================
   自動販売機ボタン風デザイン
   ============================================ */

/* 製品セクション - flexboxで配置 */
.products-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 製品カード - 自販機ボタン */
.card-product {
    display: block;
    position: relative;
    width: calc(33.333% - 0.67rem);
    background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 100%);
    border: none;
    border-radius: 8px;
    box-shadow:
        0 4px 0 #999,
        0 6px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.1s ease;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.card-product:hover {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 #999,
        0 4px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-decoration: none;
    color: inherit;
}

.card-product:active {
    transform: translateY(4px);
    box-shadow:
        0 0 0 #999,
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 商品画像エリア - ショーケース風 */
.card-product .card-img-top {
    height: 160px;
    object-fit: cover;
    border-bottom: 3px solid #ccc;
    background: #fff;
    padding: 8px;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* カード本体 */
.card-product .card-body {
    padding: 0.75rem;
    text-align: center;
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
}

/* 商品名 */
.card-product .card-title {
    color: #333;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 説明文 */
.card-product .card-text {
    color: #555;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* 選択ボタン - 光るボタン風 */
.card-product .btn-outline-primary {
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    border: 2px solid #2E7D32;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow:
        0 2px 0 #1B5E20,
        0 3px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
}

.card-product:hover .btn-outline-primary {
    background: linear-gradient(180deg, #66BB6A 0%, #43A047 100%);
    box-shadow:
        0 2px 0 #2E7D32,
        0 3px 8px rgba(76, 175, 80, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* バッジ - 人気商品ランプ */
.card-product .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    font-size: 0.7rem;
    padding: 0.3em 0.6em;
    background: linear-gradient(180deg, #ff5252 0%, #d32f2f 100%) !important;
    border: 2px solid #b71c1c;
    border-radius: 4px;
    box-shadow:
        0 0 8px rgba(255, 82, 82, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(255, 82, 82, 0.6); }
    50% { opacity: 0.8; box-shadow: 0 0 16px rgba(255, 82, 82, 0.9); }
}

/* レスポンシブ: タブレット */
@media (max-width: 991.98px) {
    .card-product {
        width: calc(50% - 0.5rem);
    }
}

/* レスポンシブ: モバイル */
@media (max-width: 575.98px) {
    .products-section {
        gap: 0.75rem;
    }

    .card-product {
        width: calc(50% - 0.375rem);
    }

    .card-product .card-img-top {
        height: 120px;
        padding: 4px;
    }

    .card-product .card-title {
        font-size: 0.85rem;
    }

    .card-product .card-text {
        font-size: 0.7rem;
        margin-bottom: 0.3rem;
    }

    .card-product .btn-outline-primary {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }

    .card-product .card-body {
        padding: 0.5rem;
    }
}
