/* チェックアウトページスタイル */
.checkout-container {
    min-height: 100vh;
    background: #f8f8f8;
}

/* 決済方法選択 */
.checkout-method-selector {
    background: var(--white);
    padding: 30px;
    border: 3px solid var(--black);
    border-radius: 12px;
    box-shadow: 6px 6px 0 var(--shadow);
    margin-bottom: 30px;
}

.checkout-method-selector h2 {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    color: var(--black);
    margin-bottom: 20px;
    text-align: center;
}

.method-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.method-option {
    display: block;
    cursor: pointer;
}

.method-option input[type="radio"] {
    display: none;
}

.method-card {
    padding: 25px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: var(--white);
    transition: all 0.3s ease;
}

.method-option input[type="radio"]:checked + .method-card {
    background: var(--yellow);
    box-shadow: 4px 4px 0 var(--shadow);
    transform: translateY(-2px);
}

.method-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--black);
}

.method-card ul {
    list-style: none;
    padding: 0;
}

.method-card li {
    padding: 5px 0;
    font-size: 0.95rem;
    color: #666;
}

.method-card li:before {
    content: "✓ ";
    color: var(--accent);
    font-weight: bold;
}

/* 保存されたカード */
.saved-cards {
    margin-bottom: 20px;
}

.saved-cards select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: var(--white);
}

.save-card-option {
    margin-top: 15px;
}

/* ヘッダー */
.checkout-header {
    background: var(--yellow);
    padding: 30px 0;
    text-align: center;
    border-bottom: 4px solid var(--black);
}

.checkout-logo {
    font-family: 'Bebas Neue', cursive;
    font-size: 3rem;
    color: var(--black);
    margin: 0;
}

.checkout-subtitle {
    font-size: 1rem;
    color: var(--black);
    margin-top: 5px;
}

/* メインコンテンツ */
.checkout-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

/* フォームセクション */
.checkout-form-section {
    background: var(--white);
    padding: 40px;
    border: 3px solid var(--black);
    border-radius: 12px;
    box-shadow: 6px 6px 0 var(--shadow);
}

.form-section {
    margin-bottom: 40px;
}

.section-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    color: var(--black);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--black);
}

.account-section-note {
    margin: -8px 0 20px;
    color: #6a5a4a;
    line-height: 1.7;
    font-size: 0.95rem;
}

.account-auth-status {
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 2px solid var(--black);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--shadow);
    font-weight: 700;
    line-height: 1.7;
    background: #fff5d7;
}

.account-auth-status.pending {
    background: #fff5d7;
}

.account-auth-status.verified {
    background: #e8faf4;
}

.account-auth-button {
    width: 100%;
    padding: 16px 18px;
    border: 3px solid var(--black);
    border-radius: 10px;
    background: var(--black);
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--shadow);
    transition: background 0.2s ease, transform 0.2s ease;
}

.account-auth-button:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.account-auth-help {
    margin: 12px 0 0;
    color: #6a5a4a;
    line-height: 1.7;
    font-size: 0.92rem;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--black);
}

.required {
    color: var(--red);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: var(--white);
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

/* 配送オプション */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shipping-option {
    display: block;
    cursor: pointer;
}

.shipping-option input[type="radio"] {
    display: none;
}

.option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: var(--white);
    transition: all 0.3s ease;
}

.shipping-option input[type="radio"]:checked + .option-content {
    background: var(--accent);
    color: var(--white);
    box-shadow: 4px 4px 0 var(--shadow);
}

/* 配送方法通知 */
.shipping-notice {
    text-align: center;
}

.shipping-notice .option-content {
    background: var(--accent);
    color: var(--white);
    padding: 20px;
    border: 2px solid var(--black);
    border-radius: 8px;
    box-shadow: 4px 4px 0 var(--shadow);
}

.shipping-notice .option-content.selected {
    cursor: default;
}

.shipping-policy-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    text-align: left;
}

.shipping-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* 配送日時入力 */
input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: var(--white);
    transition: all 0.3s ease;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9rem;
}

.option-name {
    font-weight: 700;
}

.option-price {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.5rem;
}

.option-description {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.5;
}

.option-subnote {
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: 700;
}

/* Stripe Elements */
.stripe-element {
    padding: 15px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: var(--white);
    transition: all 0.3s ease;
}

.stripe-element--focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

.stripe-element--invalid {
    border-color: var(--red);
}

.error-message {
    color: var(--red);
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

/* チェックボックス */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    font-size: 0.9rem;
    cursor: pointer;
    gap: 8px;
    user-select: none;
    padding: 10px 8px;
    border: 2px dashed transparent;
    border-radius: 8px;
}

.checkbox-label:hover {
    border-color: var(--accent);
    background: rgba(78,205,196,0.08);
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--accent);
}

.checkbox-label span { cursor: pointer; }

.checkbox-label a {
    color: var(--accent);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.checkout-legal-note {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(141, 28, 44, 0.08);
    border: 1px solid rgba(141, 28, 44, 0.18);
    color: #2b2622;
}

.checkout-legal-note strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #8d1c2c;
}

.checkout-legal-note p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.checkout-legal-note p + p {
    margin-top: 8px;
}

.payment-guide-card {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(78,205,196,0.08);
    border: 2px solid rgba(78,205,196,0.2);
    line-height: 1.8;
    color: #2b2622;
}

.payment-guide-card p {
    margin: 0;
    font-size: 0.95rem;
}

.payment-guide-card p + p {
    margin-top: 8px;
}

/* 送信ボタン */
.submit-button {
    width: 100%;
    padding: 20px;
    background: var(--black);
    color: var(--white);
    font-family: 'Bebas Neue', cursive;
    font-size: 1.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-top: 30px;
}

.submit-button:hover:not(:disabled) {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--shadow);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-button[data-shipping-blocked="true"] {
    background: var(--red);
}

/* アクションボタンラップ（中央寄せ・縦並び） */
.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    width: 70%;
    max-width: 420px;
    background: var(--white);
    color: var(--black);
    border: 3px solid var(--black);
    border-radius: 8px;
    box-shadow: 6px 6px 0 var(--shadow);
    font-weight: 900;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.home-button:hover {
    transform: translateY(-2px);
}

/* スピナー */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 注文サマリー */
.order-summary {
    background: var(--white);
    padding: 30px;
    border: 3px solid var(--black);
    border-radius: 12px;
    box-shadow: 6px 6px 0 var(--shadow);
    position: sticky;
    top: 20px;
}

.order-items {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.checkout-empty-state {
    padding: 24px 20px;
    border: 2px solid var(--black);
    border-radius: 12px;
    background: #fff7d7;
    box-shadow: 4px 4px 0 var(--shadow);
    text-align: center;
}

.checkout-empty-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--black);
}

.checkout-empty-message {
    margin: 0 0 16px;
    line-height: 1.7;
    color: #5f5245;
}

.checkout-empty-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border: 3px solid var(--black);
    border-radius: 10px;
    background: var(--yellow);
    color: var(--black);
    font-weight: 900;
    text-decoration: none;
    box-shadow: 4px 4px 0 var(--shadow);
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.item-name {
    font-weight: 700;
}

.item-quantity {
    color: #666;
    font-size: 0.9rem;
}

.item-price {
    font-weight: 700;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.shipping-policy-note {
    margin: 12px 0 18px;
    padding: 14px 16px;
    background: #fff8df;
    border: 2px solid var(--black);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--shadow);
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 700;
}

.free-shipping-row {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 2px solid var(--black);
    border-radius: 10px;
    background: #f5fffb;
    box-shadow: 4px 4px 0 var(--shadow);
    align-items: flex-start;
}

.free-shipping-row span:last-child {
    text-align: right;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
}

.summary-row.total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--black);
    font-size: 1.5rem;
    font-weight: 700;
}

/* セキュリティ情報 */
.security-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

.security-info svg {
    color: var(--accent);
}

/* レスポンシブ */
@media (max-width: 968px) {
    .checkout-content {
        grid-template-columns: 1fr;
        margin: 28px auto;
        gap: 24px;
    }
    
    .order-summary {
        position: static;
    }
    
    .method-options {
        grid-template-columns: 1fr;
    }

    .order-summary-section {
        order: -1;
    }

    .is-empty-checkout .checkout-form-section {
        display: none;
    }
}

@media (max-width: 640px) {
    .checkout-container {
        padding: 0 8px 18px;
    }

    .checkout-content {
        margin: 18px auto;
        padding: 0;
        gap: 18px;
    }

    .checkout-header {
        padding: 16px 12px;
    }

    .checkout-logo {
        font-size: 2.15rem;
    }

    .checkout-form-section,
    .checkout-method-selector,
    .order-summary {
        padding: 18px 14px;
        box-shadow: 4px 4px 0 var(--shadow);
    }

    .checkout-method-selector h2,
    .section-title {
        font-family: 'Noto Sans JP', sans-serif;
        font-size: 1.55rem;
        line-height: 1.35;
        letter-spacing: 0.02em;
        word-break: keep-all;
        overflow-wrap: normal;
    }

    .method-card {
        padding: 16px 14px;
    }

    .method-card h3 {
        font-size: 1.08rem;
        line-height: 1.45;
        word-break: keep-all;
    }

    .method-card li {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .option-content,
    .shipping-notice .option-content {
        padding: 14px;
    }

    .shipping-card-head,
    .summary-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .option-price {
        font-size: 1.35rem;
    }

    .home-button {
        width: 100%;
    }

    .order-summary.is-empty-cart .shipping-policy-note,
    .order-summary.is-empty-cart .online-price-applied,
    .order-summary.is-empty-cart .summary-row,
    .order-summary.is-empty-cart .security-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .checkout-form-section {
        padding: 16px 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .option-content {
        flex-direction: column;
        align-items: start;
        gap: 5px;
    }

    .submit-button {
        font-size: 1.5rem;
        padding: 18px 16px;
    }

    .shipping-policy-note {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

/* オンライン特別価格バナー（表示のみ・金額計算には影響しません） */
.online-price-applied {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 2px solid #8d1c2c;
    border-left: 6px solid #8d1c2c;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbf3e2 0%, #fdf8ef 100%);
    box-shadow: 4px 4px 0 rgba(141, 28, 44, 0.18);
}

.online-price-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #8d1c2c;
    color: #fdf8ef;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.online-price-badge::before {
    content: "\1F389";
    margin-right: 6px;
}

.online-price-applied-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #4a3b30;
}

.online-price-applied-text strong {
    color: #8d1c2c;
    font-weight: 900;
}

@media (max-width: 640px) {
    .online-price-applied {
        padding: 12px 14px;
    }

    .online-price-badge {
        font-size: 0.78rem;
    }

    .online-price-applied-text {
        font-size: 0.86rem;
    }
}
