/* スマホ表示の全体的な調整 */
@media (max-width: 768px) {
    /* セクション全体の中央揃え */
    .credentials-section,
    .enhanced-quality-section,
    .science-section,
    .detailed-ingredients-section {
        text-align: center;
    }
    
    /* フレックスボックス要素の調整 */
    .sales-achievements,
    .expert-team,
    .safety-measures,
    .ingredient-categories {
        justify-content: center;
    }
    
    /* 売上実績のモバイル調整 */
    .sales-achievements {
        background-image: url('https://page.gensparksite.com/v1/base64_upload/c7e4ec35e9978e5b461e29d7def8b7f0') !important;
        background-size: cover !important;
        background-position: center !important;
        padding: 30px 20px !important;
    }
    
    .sales-achievements::before {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.9) 0%, 
            rgba(248, 249, 250, 0.85) 100%) !important;
    }
    
    /* 特別価格セクションのモバイル調整 */
    .special-pricing {
        position: relative !important;
        overflow: hidden;
        margin-top: 20px !important;
    }
    
    .special-badge {
        top: -10px !important;
        right: 10px !important;
        font-size: 14px !important;
        padding: 8px 16px !important;
        z-index: 10 !important;
    }
    
    .price-breakdown {
        gap: 20px !important;
    }
    
    .achievement-item {
        min-width: 100px !important;
        padding: 15px 10px !important;
        margin-bottom: 10px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        z-index: 3 !important;
    }
    
    /* グリッド要素の調整 */
    .technology-grid,
    .symptoms-grid {
        justify-items: center;
        text-align: center;
    }
    
    /* 症状カードの統一 */
    .symptom-card {
        width: 100% !important;
        max-width: none !important;
        min-height: 160px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    /* テキストの改行最適化 */
    .symptom-card h5 {
        word-break: keep-all !important;
        line-height: 1.3 !important;
    }
    
    .symptom-card p {
        word-break: keep-all !important;
        line-height: 1.4 !important;
        hyphens: auto !important;
    }
    
    .symptom-card .symptom-icon {
        margin-bottom: 12px !important;
    }
    
    .symptom-card h5 {
        flex-shrink: 0 !important;
        margin-bottom: 8px !important;
    }
    
    .symptom-card p {
        flex-grow: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    /* 比較テーブルの調整 */
    .enhanced-comparison-table {
        text-align: center;
        overflow: hidden;
        padding: 10px !important;
        margin: 0 5px !important;
        width: calc(100% - 10px) !important;
        box-sizing: border-box !important;
    }
    
    .comparison-container {
        overflow: hidden;
        width: 100% !important;
        gap: 10px !important;
    }
    
    .comparison-side {
        min-width: 0 !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        padding: 15px !important;
        min-height: 300px !important;
        justify-content: space-between !important;
    }
    
    .comparison-content {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 !important;
    }
    
    .feature-list {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    
    .feature-list li {
        font-size: 12px !important;
        line-height: 1.3 !important;
        padding: 6px 8px !important;
        overflow-wrap: break-word !important;
        word-break: keep-all !important;
    }
    
    .side-header h4 {
        font-size: 16px !important;
        line-height: 1.2 !important;
        overflow-wrap: break-word !important;
    }
    
    /* 品質管理とヒアルロン酸のタイトル調整 */
    .quality-subtitle p {
        font-size: 14px !important;
        line-height: 1.3 !important;
        text-align: center !important;
        padding: 0 10px !important;
    }
    
    .problem-symptoms h4 {
        font-size: 18px !important;
        line-height: 1.3 !important;
        text-align: center !important;
        padding: 0 10px !important;
    }
    
    /* モニター調査の注記調整 */
    .survey-note-single {
        font-size: 10px !important;
        bottom: 10px !important;
        right: 15px !important;
    }
}
}

/* 固定CTAのレスポンシブ対応 */
@media (max-width: 768px) {
    .fixed-cta {
        padding: 10px 10px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        margin: 0 !important;
    }
    
    .fixed-cta-btn {
        padding: 12px 15px !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
        justify-content: space-between !important;
        margin: 0 !important;
        border-radius: 25px !important;
    }
    
    .cta-content {
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .coupon-badge {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .cta-text {
        font-size: 16px;
        text-align: center;
    }
    
    .cta-price {
        font-size: 16px;
        padding: 4px 12px;
    }
}

/* STEP番号の視認性を確保 */
.step-number {
    color: #333 !important;
    background: linear-gradient(45deg, #d4896b, #b8664a) !important;
    border: 2px solid #8b4513 !important;
    font-weight: 700 !important;
    text-shadow: none;
}

/* 使用方法セクション全体の調整 */
.how-to-use .step-number {
    color: #333 !important;
    background: linear-gradient(45deg, #d4896b, #b8664a) !important;
    border: 2px solid #8b4513 !important;
}

/* レスポンシブな改行制御 */
.title-line1::after {
    content: "";
}

.break-mobile {
    display: none;
}

/* スマホでの改行最適化 */
@media (max-width: 768px) {
    .title-line1::after {
        content: "\A";
        white-space: pre;
    }
    
    .break-mobile::before {
        content: "\A";
        white-space: pre;
    }
    
    .hero-title {
        line-height: 1.3;
        font-size: 28px;
        text-align: center;
    }
    
    .testimonial-text {
        line-height: 1.5;
        font-size: 14px;
    }
    
    .testimonial-text br {
        display: block;
        margin: 8px 0;
    }
    
    /* 長いテキストの改行改善 */
    .problem-insight p {
        line-height: 1.6;
        font-size: 15px;
        text-align: left;
    }
    
    .insight-item span {
        line-height: 1.4;
        word-break: keep-all;
        overflow-wrap: break-word;
    }
}

/* より小さい画面での最適化 */
@media (max-width: 480px) {
    .hero-title {
        font-size: 26px;
        line-height: 1.2;
    }
    
    .testimonial-text {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .problem-insight p {
        font-size: 14px;
    }
}

/* 横スクロール防止の全体設定 */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

/* 絶対スクロール防止 */
html {
    overflow-x: hidden;
    width: 100% !important;
    max-width: 100% !important;
}

body {
    overflow-x: hidden;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 全要素の幅制限強化 */
*, *::before, *::after {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* セクションとコンテナの幅制限 */
section, .container, .section, div {
    max-width: 100% !important;
    overflow-x: hidden;
}

/* 特に問題となりやすい要素 */
.enhanced-comparison-table,
.comparison-container,
.survey-stats,
.fixed-cta,
.hero,
header,
footer,
.trace-flow,
.trace-step,
.traceability {
    overflow-x: hidden;
    max-width: 100% !important;
    width: 100% !important;
}

/* トレーサビリティセクションの確実な制御 */
@media (max-width: 768px) {
    .trace-flow {
        gap: 20px !important;
        padding: 0 15px !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .trace-step {
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        margin: 0 auto 20px !important;
        overflow-wrap: break-word !important;
        word-break: keep-all !important;
    }
    
    .trace-arrow {
        display: none !important;
    }
    
    .trace-step h4 {
        font-size: 16px !important;
        line-height: 1.2 !important;
        margin-bottom: 8px !important;
    }
    
    .trace-step p {
        font-size: 13px !important;
        line-height: 1.4 !important;
        overflow-wrap: break-word !important;
    }
    
    .traceability h3 {
        font-size: 18px !important;
        line-height: 1.3 !important;
        text-align: center !important;
        padding: 0 10px !important;
    }
}

/* コンテナとセクションのはみ出し防止 */
.container, section, div {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* モバイルでの全体的なはみ出し防止 */
@media (max-width: 768px) {
    * {
        max-width: 100% !important;
        overflow-x: hidden;
    }
    
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* テキスト要素のはみ出し防止 */
    p, h1, h2, h3, h4, h5, h6, span, div {
        word-break: keep-all !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
    }
    
    /* 特に長いタイトルの処理 */
    .solution-explanation h3 {
        font-size: 16px !important;
        padding: 0 15px !important;
        line-height: 1.3 !important;
    }
    
    /* ヒアルロン酸タイトルも同様に */
    .hyaluronic-chart-section h3 {
        font-size: 16px !important;
        padding: 0 15px !important;
        line-height: 1.3 !important;
    }
    
    /* 画像のはみ出し防止 */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* テーブルのはみ出し防止 */
    table, .table-container {
        width: 100% !important;
        overflow-x: visible !important;
        display: block !important;
        white-space: normal;
    }
    
    /* フレックスアイテムのはみ出し防止 */
    .flex, [style*="display: flex"], [class*="flex"] {
        flex-wrap: wrap !important;
        overflow: hidden;
    }
    
    /* グリッドアイテムのはみ出し防止 */
    .grid, [style*="display: grid"], [class*="grid"] {
        overflow: hidden;
    }
    
    /* 固定幅要素の調整 */
    .manufacturing-images {
        min-width: 200px !important;
    }
    
    .product-image {
        width: 250px !important;
        max-width: 90% !important;
    }
    
    /* ヘッダーとフッターのはみ出し防止 */
    .header, .footer, nav {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    /* フッターの中央揃え */
    .footer {
        text-align: center !important;
    }
    
    .footer-content {
        align-items: center !important;
        justify-content: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .footer-bottom {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* CTA要素のはみ出し防止 */
    .btn-cta-main, .btn-cta-small {
        max-width: 90% !important;
        overflow: hidden;
        white-space: normal !important;
        text-overflow: clip !important;
    }
    
    /* 固定CTAの確実な全幅設定 */
    .fixed-cta {
        width: 100%;
        max-width: 100%;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    
    .fixed-cta-btn {
        width: calc(100% - 0px) !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }
}

/* 480px以下でのさらなる制限 */
@media (max-width: 480px) {
    .manufacturing-images {
        min-width: 150px !important;
        gap: 10px !important;
    }
    
    .product-image {
        width: 200px !important;
        max-width: 85% !important;
    }
    
    /* 長いテキストの強制的な制御 */
    .hero-title, .section-title {
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }
    
    /* 解決策説明のタイトル修正 */
    .solution-explanation h3 {
        font-size: 18px !important;
        line-height: 1.4 !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 0 10px !important;
        overflow-wrap: break-word !important;
        word-break: keep-all !important;
        max-width: 100% !important;
    }
    
    .solution-explanation i {
        font-size: 20px !important;
        margin-bottom: 5px !important;
    }
    
    .solution-title-text {
        display: block !important;
        text-align: center !important;
    }
    
    .mobile-break {
        display: block !important;
    }
    
    /* ヒアルロン酸チャートセクションのタイトル修正 */
    .hyaluronic-chart-section h3 {
        font-size: 18px !important;
        line-height: 1.4 !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 0 10px !important;
        overflow-wrap: break-word !important;
        word-break: keep-all !important;
        max-width: 100% !important;
    }
    
    .hyaluronic-chart-section i {
        font-size: 20px !important;
        margin-bottom: 5px !important;
    }
    
    .hyaluronic-title-text {
        display: block !important;
        text-align: center !important;
    }
    
    /* ヒーローセクションのh3も調整 */
    .hero-problems h3 {
        font-size: 16px !important;
        line-height: 1.3 !important;
        text-align: center !important;
        padding: 0 10px !important;
    }
    
    /* 3項目インサイトのモバイル調整 */
    .chart-insight-balanced .insight-item {
        padding: 15px !important;
        margin-bottom: 10px !important;
        border-radius: 10px !important;
        background: rgba(255, 255, 255, 0.8) !important;
    }
    
    .chart-insight-balanced .insight-item i {
        font-size: 16px !important;
        margin-right: 8px !important;
        width: 18px !important;
    }
    
    /* 使用方法の画像見切れ修正 */
    .step {
        min-height: auto !important;
        padding: 20px 15px !important;
        align-items: center !important;
    }
    
    .step-image {
        width: 100% !important;
        height: 160px !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 15px !important;
        flex-shrink: 0 !important;
    }
    
    .step-img {
        object-fit: contain !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 10px !important;
    }
    
    /* 使用方法セクションのタイトル美化 */
    .how-to-use .section-title {
        font-size: 34px !important;
        font-weight: 300 !important;
        letter-spacing: 0.1em !important;
        margin-bottom: 40px !important;
    }
    
    /* サイエンスセクションサブタイトル調整 */
    .science-subtitle p {
        font-size: 14px !important;
        line-height: 1.3 !important;
        padding: 0 10px !important;
    }
    
    /* 美容系フォント強制適用 */
    h1, h2, h3, h4, h5, h6, .section-title, .hero-title {
        font-family: 'Noto Serif JP', 'Crimson Text', serif !important;
        font-weight: 300 !important;
        letter-spacing: 0.05em !important;
    }
    
    .section-title {
        font-size: 30px !important;
        font-weight: 400 !important;
        letter-spacing: 0.08em !important;
    }
}

/* デスクトップでは改行を非表示 */
@media (min-width: 769px) {
    .mobile-break {
        display: none;
    }
}

/* ヒアルロン酸チャートのモバイル中央配置 */
@media (max-width: 768px) {
    .hyaluronic-chart {
        justify-content: center !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        width: 100% !important;
    }
    
    .chart-bars {
        justify-content: space-evenly !important;
        margin: 0 auto !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
        max-width: 100% !important;
    }
    
    .chart-container {
        overflow: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}