:root {
    --primary-red: #8c1d18;
    --bg-cream: #f9f6f0;
    --text-black: #2d2926;
    --gold-accent: #b89c5e;
    --gold-light: #d4af37;
    --card-radius: 12px;
    --font-main: "Shippori Mincho", serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-cream);
    margin: 0;
    padding-bottom: calc(env(safe-area-inset-bottom) + 120px);
    color: var(--text-black);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 700;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ヘッダー */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 3px solid var(--primary-red);
}
.header-left, .header-right { display: flex; align-items: center; }
.logo-image-text { height: 28px; width: auto; display: block; }
.logo-image-icon { height: 35px; width: auto; display: block; }

/* クイックアクション */
.quick-actions { 
    display: flex; 
    justify-content: space-around; 
    gap: 6px;
    padding: 10px 5px; 
    background: #fff; 
    margin-bottom: 5px; 
}
.action-item { flex: 1; cursor: pointer; text-decoration: none; }
.icon-capsule {
    height: 34px; border-radius: 17px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); white-space: nowrap;
}
.bg-dark { background: #444; }
.bg-brown { background: #a52a2a; }
.bg-primary { background: var(--primary-red); }
.bg-gold { background: var(--gold-accent); }

/* メインバナー */
.main-banner {
    height: 180px; position: relative; border-radius: var(--card-radius);
    overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.15); margin: 10px 0 20px;
}
.banner-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; opacity: 0;
    animation: slide-show 12s infinite;
}
.img-1 { background-image: url('images/gt-r_before.png'); animation-delay: 0s; }
.img-2 { background-image: url('images/gt-r_after.png'); animation-delay: 4s; }
.img-3 { background-image: url('images/gt-r_after02.png'); animation-delay: 8s; }

@keyframes slide-show {
    0% { opacity: 0; }
    10% { opacity: 1; }
    33% { opacity: 1; }
    43% { opacity: 0; }
    100% { opacity: 0; }
}

.banner-overlay {
    position: absolute; top: 50%; left: 5%; transform: translateY(-50%); z-index: 10; color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8); pointer-events: none;
}
.catch-main { font-size: 1.5rem; font-weight: 700; margin-bottom: 2px; }
.catch-sub { font-size: 0.8rem; letter-spacing: 0.1em; }

/* メニュー */
.grid-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.menu-card {
    border-radius: var(--card-radius); padding: 18px 2px; color: white;
    text-align: center; font-weight: 700; font-size: 13px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-accent));
    cursor: pointer;
}

/* キャンペーン */
.campaign-banner {
    display: block; margin: 10px 0 25px 0; border-radius: 8px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-decoration: none;
}
.campaign-banner img { width: 100%; height: auto; display: block; }

/* コンセプト */
.concept-section {
    padding: 30px 15px; text-align: center; background-color: #fff;
    border-radius: var(--card-radius); margin: 0px 0;
}
/* style.css */

.concept-title { 
    color: var(--primary-red); 
    /* font-size の第2引数を 7.5vw → 6.8vw に下げます。
       これにより、画面幅が狭いスマホでも文字が端に当たる前に縮小が始まります。
    */
    font-size: clamp(1.2rem, 6.8vw, 2.5rem); 
    margin: 20px 0; 
    font-weight: 900; 
    text-align: center;
    width: 100%;
    /* 文字間隔を 0 にすることで、横幅の「はみ出し」を物理的に防ぎます */
    letter-spacing: 0; 
    line-height: 1.2;
    /* 念のため、親要素からはみ出さない設定を追加 */
    box-sizing: border-box;
    padding: 0 5px;
}

.no-wrap {
    white-space: nowrap;
    display: inline-block;
    /* ここが重要：文字がどんなに大きくても、
       親要素（画面幅）を100%としてそれ以上広がらないように強制します。
    */
    max-width: 100%;
}
.concept-text { 
    font-size: 1rem; line-height: 1.8; color: #444; 
    text-align: left; max-width: 600px; margin: 0 auto;
}

/* オーダーセクション共通 */
.order-section {
    background: #fff; padding: 20px; border-radius: var(--card-radius);
    margin: 30px 0; border: 1px solid #ddd;
}
.section-title {
    color: var(--primary-red); border-bottom: 2px solid #eee;
    padding-bottom: 8px; margin-bottom: 15px; font-weight: 700; font-size: 18px;
}
.input-full { width: 100%; margin-bottom: 15px; box-sizing: border-box; }
.text-area-msg { height: 100px; }

/* ボタン */
.submit-btn {
    width: 100%; padding: 16px; border: none; border-radius: 40px;
    font-size: 18px; font-weight: 700; color: white; background: #ccc;
    margin-top: 15px; font-family: var(--font-main); cursor: pointer;
}
.btn-gold-submit { background: var(--gold-accent); opacity: 1; }
.btn-primary-payment { background: var(--primary-red); opacity: 1; }

/* 積算オーダー */
.total-display {
    background: var(--text-black); color: var(--gold-light);
    padding: 15px; text-align: center; border-radius: 8px;
    font-size: 1.3rem; font-weight: 700;
}
.order-label { margin-bottom: 8px; font-weight: bold; }
.order-select {
    width: 100%; padding: 15px; margin-bottom: 10px; border-radius: 8px;
    font-size: 16px; font-family: var(--font-main);
}
.bonus-msg-style { display: none; color: var(--primary-red); font-size: 0.85rem; margin-bottom: 20px; font-weight: bold; }
.frame-options-style { display: none; margin-top: 10px; }
.stores-payment-info { margin-top: 20px; }
.stores-text { font-size: 0.85rem; color: #666; margin-bottom: 10px; }

/* ギャラリー */
.gallery-section { padding: 30px 5px; }
.gallery-note { text-align: center; font-size: 1.1rem; font-weight: 700; margin-bottom: 30px; color: var(--gold-accent); }
.section-headline {
    text-align: center; color: var(--primary-red); font-size: 1.4rem;
    margin-bottom: 25px; position: relative; padding-bottom: 10px;
}
.section-headline::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%); width: 50px; height: 2px; background: var(--gold-accent);
}
.section-subtext { text-align: center; font-size: 0.9rem; color: #666; margin-top: -20px; margin-bottom: 25px; }
.gallery-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.gallery-item { 
    background: var(--bg-cream); border-radius: var(--card-radius); 
    overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
    cursor: pointer; transition: 0.3s; position: relative; border: 1px solid #eee;
}
.gallery-item:active { transform: scale(0.98); }
.gallery-img { 
    width: 100%; height: auto; display: block; aspect-ratio: 4/3; 
    object-fit: contain; background: var(--bg-cream); transition: opacity 0.5s ease-in-out; 
}
.gallery-info { padding: 12px 15px; }
.gallery-title { margin-bottom: 0; font-weight: 700; }
.gallery-desc { display: none; }
.badge { font-size: 0.6rem; background: var(--gold-accent); color: white; padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 5px; }

.ba-status-label {
    position: absolute; top: 10px; left: 10px; background: rgba(140, 29, 24, 0.85); 
    color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: bold; z-index: 5;
}

/* カルーセル */
.process-carousel-section { padding: 40px 0; background: #fff; margin: 20px 0; }
.carousel-wrapper { overflow-x: auto; padding: 0 15px 20px 15px; scrollbar-width: none; }
.carousel-wrapper::-webkit-scrollbar { display: none; }
.carousel-container { display: flex; gap: 15px; width: max-content; }
.carousel-item { width: 260px; flex-shrink: 0; }
.carousel-img-box {
    position: relative; border-radius: var(--card-radius); overflow: hidden;
    aspect-ratio: 3/4; background: #eee; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.carousel-img-box img { width: 100%; height: 100%; object-fit: cover; }
.carousel-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white; padding: 20px 15px 10px; font-weight: bold; font-size: 1.1rem;
}
.carousel-desc { font-size: 0.85rem; color: #555; padding: 0 5px; line-height: 1.5; }
.swipe-hint { font-size: 1.05rem; font-weight: 700; margin-top: 10px; color: var(--primary-red); text-align: center; width: 100%; display: block; }



/* 制作の流れ */
.flow-section { padding: 40px 10px; }
.flow-container { max-width: 600px; margin: 0 auto; }
.flow-step { display: flex; align-items: center; background: #fff; border-radius: var(--card-radius); overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); margin-bottom: 5px; }
.flow-content { padding: 15px; flex: 1; }
.flow-num { font-size: 0.8rem; color: var(--gold-accent); font-weight: bold; margin-bottom: 2px; }
.flow-title { font-weight: 700; font-size: 1.1rem; color: var(--primary-red); margin-bottom: 5px; }
.flow-text { font-size: 0.85rem; color: #666; line-height: 1.4; }
.flow-arrow { text-align: center; font-size: 24px; color: var(--gold-accent); margin-bottom: 5px; font-weight: bold; }

/* 購入手順（アコーディオン） */
.purchase-steps-container { max-width: 600px; margin: 0 auto; }
.p-step-card {
    background: #fff; border: 2px solid #d6d3d1; border-radius: 12px; padding: 15px 20px;
    cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); position: relative;
}
.p-step-card:hover, .p-step-card.active { border-color: var(--primary-red); transform: translateY(-2px); }
.p-step-header { display: flex; align-items: center; justify-content: space-between; }
.p-step-title-box { display: flex; align-items: center; }
.p-step-num {
    display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    background: var(--primary-red); color: #fff; border-radius: 50%; font-weight: bold; margin-right: 15px;
}
.p-step-title { font-size: 1.1rem; margin: 0; color: var(--text-black); }
.p-step-icon { width: 20px; height: 20px; color: #a8a29e; transition: transform 0.3s ease; }
.p-step-card.active .p-step-icon { transform: rotate(180deg); color: var(--primary-red); }
.p-step-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; padding: 0; font-size: 0.95rem; color: #555; }
.p-step-card.active .p-step-content { max-height: 200px; padding-top: 15px; }
.p-step-arrow-box { text-align: center; font-size: 24px; color: var(--gold-accent); font-weight: bold; padding: 10px 0; }

/* AIチャット */
#ai-floating-container { position: fixed; bottom: 110px; right: 20px; z-index: 1000; }
#chat-trigger {
    width: 65px; height: 65px; background: #ffffff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); cursor: pointer; transition: 0.3s;
    border: 1px solid #eee; overflow: hidden;
}
#chat-trigger:hover { transform: scale(1.1); }
#chat-trigger img { width: 70%; height: 70%; object-fit: contain; }

#chat-window {
    width: 320px; height: 450px; background: white; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2); display: none; flex-direction: column;
    overflow: hidden; margin-bottom: 15px;
}
.chat-header { background: var(--primary-red); color: white; padding: 12px; display: flex; justify-content: space-between; font-weight: bold; }
.chat-close-btn { background: none; border: none; color: white; cursor: pointer; }
.chat-box { background: var(--bg-cream); padding: 15px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; font-size: 0.9rem; }
.msg { max-width: 85%; margin-bottom: 12px; padding: 10px; border-radius: 12px; line-height: 1.5; }
.ai-msg { background: #fff; align-self: flex-start; border: 1px solid #eee; color: var(--text-black); }
.user-msg { background: var(--primary-red); color: white; align-self: flex-end; }
.chat-input-area { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee; background: #fff; }
.chat-input { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 12px 15px; font-family: var(--font-main); font-size: 16px; }
.chat-send-btn { background: var(--primary-red); color: white; border: none; border-radius: 50%; width: 35px; height: 35px; cursor: pointer; }

/* レスポンシブ (PC) */
@media (min-width: 768px) {
    body { font-size: 18px; }
    .container { max-width: 900px; padding: 0 20px; }
    .header { padding: 20px 40px; }
    .logo-image-text { height: 45px; }
    .logo-image-icon { height: 60px; }
    .main-banner { height: 500px; margin: 30px 0 50px; }
    .catch-main { font-size: 4.2rem; }
    .catch-sub { font-size: 1.6rem; }
    .grid-menu { gap: 20px; margin: 50px 0 20px; }
    .menu-card { padding: 40px 10px; font-size: 22px; }
    .concept-section, .order-section { padding: 40px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    #chat-window { width: 350px; height: 500px; }
    .swipe-hint { display: none; }
    .process-carousel-section { padding: 60px 20px; text-align: center; }
    .carousel-wrapper { display: flex; justify-content: center; overflow-x: visible; }
    .carousel-item { width: 300px; }
}

.bottom-spacer { position: fixed; bottom: 0; left: 0; width: 100%; height: calc(env(safe-area-inset-bottom) + 20px); background: var(--bg-cream); z-index: 990; pointer-events: none; }