/* チャット購入フォーム - 1sec.coffee風デザイン */

/* ==================== 
   コンテナ 
==================== */
.cpf-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    min-height: 600px;
    border-radius: 8px;
}

/* ==================== 
   メッセージエリア 
==================== */
.cpf-messages {
    padding: 20px 0;
    overflow-y: auto;
    max-height: 500px;
}

.cpf-message {
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ボットメッセージ */
.cpf-message.bot {
    text-align: left;
}

.cpf-message-content.bot {
    display: inline-block;
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 20px;
    max-width: 80%;
    line-height: 1.6;
    border: 1px solid #333333;
}

/* ユーザーメッセージ */
.cpf-message.user {
    text-align: right;
}

.cpf-message-content.user {
    display: inline-block;
    background-color: #ffffff;
    color: #000000;
    padding: 15px 20px;
    border-radius: 20px;
    max-width: 80%;
    line-height: 1.6;
}

/* ==================== 
   商品カード 
==================== */
.cpf-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cpf-product-card {
    background-color: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.cpf-product-card:hover {
    border-color: #ffffff;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.cpf-product-card.selected {
    border-color: #ffffff;
    background-color: #2a2a2a;
}

.cpf-product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: #0a0a0a;
}

.cpf-product-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ffffff;
}

.cpf-product-price {
    font-size: 18px;
    color: #cccccc;
    margin-bottom: 10px;
}

.cpf-product-description {
    font-size: 12px;
    color: #999999;
    line-height: 1.4;
}

/* ==================== 
   入力エリア 
==================== */
.cpf-input-area {
    padding: 20px 0;
    border-top: 1px solid #333333;
}

.cpf-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cpf-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cpf-label {
    font-size: 14px;
    color: #cccccc;
    font-weight: 500;
}

.cpf-input,
.cpf-select,
.cpf-textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    transition: border-color 0.3s;
}

.cpf-input:focus,
.cpf-select:focus,
.cpf-textarea:focus {
    outline: none;
    border-color: #ffffff;
}

.cpf-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.cpf-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cpf-input-small {
    max-width: 150px;
}

/* ==================== 
   ボタン 
==================== */
.cpf-button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cpf-button {
    flex: 1;
    padding: 15px 30px;
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cpf-button:hover {
    background-color: #000000;
    color: #ffffff;
}

.cpf-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cpf-button-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #333333;
}

.cpf-button-secondary:hover {
    border-color: #ffffff;
    background-color: #1a1a1a;
}

/* ==================== 
   数量セレクター 
==================== */
.cpf-quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cpf-quantity-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.cpf-quantity-btn:hover {
    border-color: #ffffff;
    background-color: #2a2a2a;
}

.cpf-quantity-value {
    font-size: 24px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

/* ==================== 
   確認画面 
==================== */
.cpf-confirmation-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.cpf-confirmation-table th,
.cpf-confirmation-table td {
    padding: 15px;
    border-bottom: 1px solid #333333;
    text-align: left;
}

.cpf-confirmation-table th {
    background-color: #1a1a1a;
    color: #cccccc;
    font-weight: 500;
    width: 30%;
}

.cpf-confirmation-table td {
    color: #ffffff;
}

.cpf-total-row {
    font-size: 20px;
    font-weight: bold;
}

.cpf-total-row th,
.cpf-total-row td {
    border-top: 2px solid #ffffff;
    padding-top: 20px;
}

/* ==================== 
   ローディング 
==================== */
.cpf-loading {
    text-align: center;
    padding: 20px;
}

.cpf-loading-dots {
    display: inline-flex;
    gap: 8px;
}

.cpf-loading-dots span {
    width: 10px;
    height: 10px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.cpf-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.cpf-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ==================== 
   完了メッセージ 
==================== */
.cpf-success-message {
    text-align: center;
    padding: 40px 20px;
}

.cpf-success-icon {
    font-size: 60px;
    color: #ffffff;
    margin-bottom: 20px;
}

.cpf-success-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.cpf-success-text {
    font-size: 16px;
    color: #cccccc;
    line-height: 1.6;
}

.cpf-order-number {
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 18px;
    border: 1px solid #333333;
}

/* ==================== 
   エラーメッセージ 
==================== */
.cpf-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 5px;
}

.cpf-input.error,
.cpf-select.error,
.cpf-textarea.error {
    border-color: #ff6b6b;
}

/* ==================== 
   ラジオボタン & チェックボックス 
==================== */
.cpf-radio-group,
.cpf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cpf-radio-label,
.cpf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: #ffffff;
}

.cpf-radio-label:hover,
.cpf-checkbox-label:hover {
    border-color: #ffffff;
    background-color: #2a2a2a;
}

.cpf-radio-label input[type="radio"],
.cpf-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cpf-radio-label input[type="radio"]:checked,
.cpf-checkbox-label input[type="checkbox"]:checked {
    accent-color: #ffffff;
}

/* ==================== 
   レスポンシブ 
==================== */
@media (max-width: 768px) {
    .cpf-container {
        padding: 15px;
    }
    
    .cpf-product-grid {
        grid-template-columns: 1fr;
    }
    
    .cpf-input-row {
        grid-template-columns: 1fr;
    }
    
    .cpf-button-group {
        flex-direction: column;
    }
    
    .cpf-message-content.bot,
    .cpf-message-content.user {
        max-width: 90%;
    }
}

/* ==================== 
   スクロールバー 
==================== */
.cpf-messages::-webkit-scrollbar {
    width: 8px;
}

.cpf-messages::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.cpf-messages::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

.cpf-messages::-webkit-scrollbar-thumb:hover {
    background: #555555;
}
