/* ========================================
   モーダル起動ボタン
======================================== */
.acs-modal-trigger-wrapper {
    text-align: center;
    margin: 40px 0;
}

.acs-modal-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.acs-modal-open-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.acs-modal-open-btn:active {
    transform: translateY(0);
}

.acs-btn-icon {
    font-size: 24px;
}

/* ========================================
   モーダルオーバーレイ
======================================== */
.acs-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   モーダルコンテナ
======================================== */
.acs-modal-container {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   モーダルヘッダー
======================================== */
.acs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-height: 5vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 16px 16px 0 0;
}

.acs-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
}

.acs-header-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #fff;
}

.acs-modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s ease;
}

.acs-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   チャットログエリア（LINE風）
======================================== */
.acs-chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    max-height: calc(100vh - 55vh);
}

/* カスタムスクロールバー */
.acs-chat-log::-webkit-scrollbar {
    width: 8px;
}

.acs-chat-log::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.acs-chat-log::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.acs-chat-log::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   メッセージ（LINE風吹き出し）
======================================== */
.acs-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* アイコン画像 */
.acs-message-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

/* 吹き出し本体 */
.acs-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
}

/* システム（ボット）メッセージ */
.acs-message.acs-system {
    justify-content: flex-start;
}

.acs-message.acs-system .acs-message-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ユーザーメッセージ */
.acs-message.acs-user {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

.acs-message.acs-user .acs-message-bubble {
    background: #667eea;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ========================================
   タイピングインジケーター
======================================== */
.acs-typing-indicator {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 0 20px 16px 20px;
    background: #f5f5f5;
}

.acs-typing-dots {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
}

.acs-typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.acs-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.acs-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* ========================================
   入力エリア（選択肢ボタン）
======================================== */
.acs-input-area {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    max-height: 45vh;
    overflow-y: auto;
}

.acs-choice-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 選択肢が多い場合は2列グリッド */
.acs-choice-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.acs-choice-btn {
    padding: 12px;
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.acs-choice-btn:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.acs-choice-btn:active {
    transform: translateY(0);
}

/* 馬力選択ボタンの特殊スタイル */
.acs-choice-btn .hp-label {
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.acs-choice-btn .hp-area {
    display: block;
    font-size: 11px;
    font-weight: normal;
    opacity: 0.8;
    line-height: 1.4;
}

/* ========================================
   動的エリア（商品一覧など）
======================================== */
.acs-dynamic-area {
    padding: 0;
    background: #f5f5f5;
}

/* 商品一覧 */
.acs-product-list {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-height: 320px;
    overflow-y: auto;
}

.acs-product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.acs-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.acs-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.acs-product-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.acs-product-card-info {
    flex: 1;
    min-width: 0;
}

.acs-product-card h3 {
    font-size: 14px;
    margin: 0 0 6px 0;
    font-weight: 600;
    line-height: 1.2;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acs-product-card .model,
.acs-product-card .maker {
    font-size: 12px;
    color: #666;
    margin: 2px 0;
    line-height:1.2;
}

.acs-product-card .price {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
    margin-top: 6px;
    line-height:1.2;
}

/* 定価表示 */
.acs-product-card .price-list {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin: 2px 0;
    line-height: 1.2;
}

/* 販売価格表示 */
.acs-product-card .price-sale {
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    margin-top: 2px;
}

/* 一覧ページへ遷移ボタン */
.acs-view-all-btn {
    display: block;
    margin: 0 20px 20px 20px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.acs-view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 該当なしメッセージ */
.acs-no-results {
    padding: 40px 20px;
    text-align: center;
}

.acs-no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.acs-no-results h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
}

.acs-no-results p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.acs-contact-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.acs-contact-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   スマホ最適化（768px以下）
======================================== */
@media (max-width: 768px) {
    .acs-modal-overlay {
        padding: 0;
    }
    
    .acs-modal-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .acs-modal-header {
        border-radius: 0;
        max-height: 5vh;
    }
    
    .acs-chat-log {
        max-height: calc(100vh - 50vh);
    }

    .acs-input-area {
        max-height: 40vh;
    }
    
    .acs-modal-open-btn {
        width: 90%;
        max-width: 320px;
    }
    
    .acs-message-bubble {
        max-width: 75%;
        font-size: 14px;
    }
    
    .acs-message-icon {
        width: 36px;
        height: 36px;
    }
    
    /* 選択肢は1列表示 */
    .acs-choice-buttons-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   さらに小さい画面（480px以下）
======================================== */
@media (max-width: 480px) {
    .acs-modal-open-btn {
        font-size: 16px;
        padding: 16px 32px;
    }
    
    .acs-message-bubble {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .acs-choice-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* ========================================
   SEOページ用スタイル（既存のまま維持）
======================================== */
.acs-seo-list {
    max-width: 1200px;
    margin: 0;
    padding: 0 20px;
}

.acs-seo-list h1 {
    font-size: 28px;
    margin-bottom: 30px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
}

.acs-seo-conditions {
    background: #f8f9fa;
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 6px;
}

.acs-seo-conditions p {
    margin: 5px 0;
    font-size: 14px;
}

.acs-seo-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.acs-seo-product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    position: relative;
}

.acs-seo-product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

.acs-seo-product-card h2 {
    font-size: 18px;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.acs-seo-product-card p {
    font-size: 14px;
    color: #333;
    margin: 3px 0;
    line-height: 1.2;
}

.acs-seo-product-card .price, .acs-seo-product-card .price-sale {
    font-size: 20px;
    font-weight: bold;
    color: #28a745;
    margin: 10px 0;
}

.acs-seo-product-card a {
    display: block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;;
}

.acs-seo-product-card a:hover {
    background: #0056b3;
}

.acs-seo-no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

.acs-seo-detail {
    max-width: 1200px;
    margin: 0px auto;
    padding: 0 20px;
}

.acs-seo-detail-header {
    margin-bottom: 30px;
}

.acs-seo-detail h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.acs-seo-detail-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.acs-seo-detail-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 40px;
}

.acs-seo-detail-image img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.acs-seo-detail-info h2 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

.acs-seo-detail-info h2:first-child {
    margin-top: 0;
}

.acs-seo-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.acs-seo-spec-table th,
.acs-seo-spec-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.acs-seo-spec-table th {
    background: #f8f9fa;
    font-weight: bold;
    width: 30%;
}

.acs-seo-price-box {
    margin-bottom: 20px;
}

.acs-seo-price-box .price {
    font-size: 28px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 10px;
    line-height: 1.8;
}

.acs-seo-price-box .note {
    font-size: 14px;
    color: #666;
}

.acs-seo-comment {
    line-height: 1.8;
    color: #333;
}

.acs-seo-contact {
    background: #e7f3ff;
    padding: 3rem 2rem;
    border-radius: 8px;
    text-align: center;
}

.acs-seo-contact h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.acs-seo-contact p {
    margin-bottom: 20px;
}

.acs-seo-contact form {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.acs-seo-contact .form-group {
    margin-bottom: 15px;
}

.acs-seo-contact label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.acs-seo-contact input,
.acs-seo-contact textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.acs-seo-contact button {
    width: 100%;
    padding: 15px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.acs-seo-contact button:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .acs-seo-detail-content {
        grid-template-columns: 1fr;
    }
    
    .acs-seo-products {
        grid-template-columns: 1fr;
    }
}

.recommended-badge{
    background-color: #F18F10;
    color:#fff;
    position: absolute;
    line-height: 1;
    padding: 8px 14px;
    font-size:.8rem;
    margin-top:-1rem;
    margin-left:-1rem;
    border-radius: 8px;
}