/* ========================================
   モバイル専用デザイン修正
   ======================================== */

@media (max-width: 768px) {
    
    /* ===== ヘッダーの改善 ===== */
    .site-header-modern {
        position: sticky;
        top: 0;
        z-index: 999;
    }
    
    .header-main {
        padding: 12px 16px;
    }
    
    .site-logo-modern {
        font-size: 20px;
    }
    
    .logo-icon {
        display: flex;
        gap: 4px;
    }
    
    .logo-brain,
    .logo-horse {
        font-size: 20px;
    }
    
    .logo-text {
        display: flex;
        flex-direction: column;
    }
    
    .logo-main {
        font-size: 18px;
        font-weight: 700;
    }
    
    .logo-sub {
        font-size: 10px;
        opacity: 0.9;
    }
    
    /* ===== ナビゲーションの改善 ===== */
    .main-nav-modern {
        display: none; /* モバイルでは非表示 */
    }
    
    /* ハンバーガーメニューボタン */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        color: white;
        font-size: 24px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* ===== ヒーローセクションの改善 ===== */
    .hero-section-new {
        padding: 24px 16px 32px;
    }
    
    .hero-title-main {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    
    .hero-title-sub {
        font-size: 16px !important;
    }
    
    .hero-description {
        font-size: 14px !important;
        line-height: 1.6 !important;
        margin: 16px 0 !important;
    }
    
    .hero-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 20px 0;
    }
    
    .stat-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .stat-item > * {
        flex: 0 0 auto;
    }
    
    .stat-icon {
        font-size: 24px !important;
    }
    
    .stat-value {
        font-size: 20px !important;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 12px !important;
    }
    
    .stat-accent {
        font-size: 11px !important;
        padding: 2px 6px;
        background: var(--color-accent);
        color: white;
        border-radius: 4px;
    }
    
    /* ===== コンテンツセクションの改善 ===== */
    .container {
        padding: 0 16px;
    }
    
    .section {
        padding: 32px 0;
    }
    
    .section-title {
        font-size: 24px !important;
        margin-bottom: 20px;
    }
    
    .section-subtitle {
        font-size: 14px !important;
        margin-bottom: 24px;
    }
    
    /* ===== カードレイアウトの改善 ===== */
    .card-grid,
    .feature-grid,
    .results-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .card,
    .feature-card,
    .result-card {
        padding: 16px !important;
    }
    
    .card-title {
        font-size: 18px !important;
    }
    
    .card-description {
        font-size: 14px !important;
    }
    
    /* ===== フッターの改善 ===== */
    .site-footer-modern {
        padding-bottom: 80px; /* ボトムナビの高さ分 */
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-features {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 16px;
    }
    
    .feature-badge {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 12px;
        background: var(--color-bg-light);
        border-radius: 8px;
        font-size: 14px;
    }
    
    .footer-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        text-align: left;
    }
    
    .footer-link {
        font-size: 14px !important;
        padding: 6px 0 !important;
    }
    
    /* ===== フォームの改善 ===== */
    .form-group {
        margin-bottom: 16px;
    }
    
    label {
        font-size: 14px;
        margin-bottom: 4px;
        display: block;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        width: 100%;
        font-size: 16px !important; /* iOS ズーム防止 */
    }
    
    /* ===== モバイル固定CTAの改善 ===== */
    .mobile-fixed-cta {
        position: fixed;
        bottom: 60px; /* ボトムナビの上 */
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--color-accent), #B45309);
        padding: 8px 12px;
        z-index: 998;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-cta-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    
    .mobile-cta-text {
        display: flex;
        flex-direction: column;
        color: white;
    }
    
    .cta-title {
        font-size: 14px;
        font-weight: 700;
    }
    
    .cta-subtitle {
        font-size: 11px;
        opacity: 0.9;
    }
    
    .mobile-cta-btn {
        background: white;
        color: var(--color-accent);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
    }
    
    /* ===== テーブルの改善 ===== */
    table {
        font-size: 14px;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* ===== 画像の最適化 ===== */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* ===== スクロールバーのスタイル ===== */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    ::-webkit-scrollbar-track {
        background: var(--color-bg-light);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--color-border);
        border-radius: 3px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--color-text-muted);
    }
    
    /* ===== タップハイライトの無効化 ===== */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* ===== セーフエリア対応（iPhone X以降） ===== */
    .bottom-navigation {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-fixed-cta {
        bottom: calc(60px + env(safe-area-inset-bottom));
    }
}