/* ===== Byakko DC フロントエンド共通 ===== */

.byakko-dc-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ===== 商品グリッド ===== */
.byakko-dc-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 640px) {
    .byakko-dc-product-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 商品カード ===== */
.byakko-dc-product-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s;
    display: flex;
    flex-direction: column;
}

.byakko-dc-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.byakko-dc-product-card.out-of-stock {
    opacity: .7;
}

.byakko-dc-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.byakko-dc-card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: #f3f4f6;
    overflow: hidden;
}

.byakko-dc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.byakko-dc-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #9ca3af;
    font-size: 48px;
}

.byakko-dc-sold-out-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
}

.byakko-dc-card-body {
    padding: 14px 16px 8px;
    flex: 1;
}

.byakko-dc-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.4;
}

.byakko-dc-card-excerpt {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 8px;
    line-height: 1.5;
}

.byakko-dc-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.byakko-dc-card-footer {
    padding: 12px 16px 16px;
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.byakko-dc-card-footer .byakko-dc-btn,
.byakko-dc-card-footer .byakko-dc-cart-form {
    flex: 1;
    text-align: center;
}
.byakko-dc-card-footer .byakko-dc-cart-form .byakko-dc-btn {
    width: 100%;
}

/* ===== 商品詳細 ===== */
.byakko-dc-single-product {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}


.byakko-dc-product-image img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.byakko-dc-product-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
}

.byakko-dc-product-excerpt {
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.6;
}

.byakko-dc-purchase-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-top: 48px;
    margin-bottom: 45px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.byakko-dc-purchase-bar .byakko-dc-add-to-cart {
    margin: 0;
}

.byakko-dc-product-price {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0;
    white-space: nowrap;
}

.byakko-dc-tax-label {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    margin-left: 6px;
}

.byakko-dc-stock-status {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 3px 12px;
    border-radius: 12px;
}

.byakko-dc-stock-status.in-stock {
    background: #d1fae5;
    color: #065f46;
}

.byakko-dc-stock-status.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

.byakko-dc-add-to-cart {
    margin: 20px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: stretch;
}
.byakko-dc-add-to-cart > .byakko-dc-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.byakko-dc-add-to-cart .byakko-dc-cart-form {
    flex: 1;
    display: flex;
}
.byakko-dc-add-to-cart .byakko-dc-cart-form .byakko-dc-btn {
    flex: 1;
}

.byakko-dc-product-content {
    margin-top: 24px;
    line-height: 1.7;
    color: #374151;
}

/* ===== ボタン ===== */
.byakko-dc-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, opacity .15s;
}

.byakko-dc-btn-primary {
    background: #2563eb;
    color: #fff;
}

.byakko-dc-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.byakko-dc-btn-disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.byakko-dc-btn-full {
    width: 100%;
    text-align: center;
    display: block;
}

/* ===== ページネーション ===== */
.byakko-dc-pagination {
    margin-top: 32px;
    text-align: center;
}

.byakko-dc-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin: 0 2px;
    text-decoration: none;
    color: #374151;
}

.byakko-dc-pagination .page-numbers.current {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* ===== アーカイブタイトル ===== */
.byakko-dc-archive-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 24px;
}

.byakko-dc-no-products {
    text-align: center;
    color: #6b7280;
    padding: 48px 0;
}

/* ===== 認証フォーム ===== */
.byakko-dc-auth-wrap {
    max-width: 480px;
}

.byakko-dc-auth-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

.byakko-dc-auth-desc {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
}

.byakko-dc-auth-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}

.byakko-dc-tab-btn {
    background: none;
    border: none;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}

.byakko-dc-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.byakko-dc-auth-form {
    display: none;
}

.byakko-dc-auth-form.active {
    display: block;
}

/* ===== フォームフィールド ===== */
.byakko-dc-field {
    margin-bottom: 18px;
}

.byakko-dc-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #374151;
}

.byakko-dc-field-note {
    font-weight: 400;
    color: #9ca3af;
    font-size: 12px;
}

.byakko-dc-field input[type="text"],
.byakko-dc-field input[type="email"],
.byakko-dc-field input[type="password"],
.byakko-dc-field input[type="number"],
.byakko-dc-field textarea,
.byakko-dc-field select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}

.byakko-dc-field input:focus,
.byakko-dc-field textarea:focus,
.byakko-dc-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.byakko-dc-auth-link {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}

.byakko-dc-auth-link a {
    color: #2563eb;
    text-decoration: none;
}

/* ===== 通知メッセージ ===== */
.byakko-dc-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.byakko-dc-notice-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.byakko-dc-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.byakko-dc-notice-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===== カート ===== */
.byakko-dc-cart-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.byakko-dc-cart-empty {
    text-align: center;
    color: #6b7280;
    padding: 48px 0;
}

.byakko-dc-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.byakko-dc-cart-table th,
.byakko-dc-cart-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.byakko-dc-cart-table thead th {
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.byakko-dc-cart-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.byakko-dc-cart-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.byakko-dc-col-price { text-align: right; font-weight: 600; }
.byakko-dc-col-remove { text-align: right; width: 40px; }

.byakko-dc-remove-item {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color .15s;
}
.byakko-dc-remove-item:hover { color: #ef4444; }

.byakko-dc-cart-summary {
    display: flex;
    justify-content: flex-end;
}

.byakko-dc-total-table {
    width: 280px;
    border-collapse: collapse;
}
.byakko-dc-total-table th,
.byakko-dc-total-table td {
    padding: 8px 4px;
    text-align: right;
}
.byakko-dc-total-row th,
.byakko-dc-total-row td {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid #111827;
    padding-top: 12px;
}

.byakko-dc-cart-actions {
    margin-top: 16px;
    text-align: right;
}

/* ===== チェックアウト ===== */
.byakko-dc-checkout-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.byakko-dc-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.byakko-dc-coupon-input-row {
    display: flex;
    gap: 8px;
}

.byakko-dc-coupon-input-row input[type="text"] {
    flex: 1;
}

.byakko-dc-coupon-message {
    font-size: 13px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 4px;
}

.byakko-dc-coupon-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.byakko-dc-coupon-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.byakko-dc-discount-amount {
    color: #16a34a;
    font-weight: 600;
}

@media (max-width: 640px) {
    .byakko-dc-checkout-grid { grid-template-columns: 1fr; }
}

.byakko-dc-order-summary h3,
.byakko-dc-payment-form h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.byakko-dc-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.byakko-dc-summary-table td,
.byakko-dc-summary-table th {
    padding: 8px 4px;
    vertical-align: middle;
}
.byakko-dc-summary-price { text-align: right; white-space: nowrap; }
.byakko-dc-summary-name  { font-size: 14px; }
.byakko-dc-summary-divider th,
.byakko-dc-summary-divider td { border-top: 1px solid #e5e7eb; }
.byakko-dc-grand-total { font-size: 20px; font-weight: 700; text-align: right; }

.byakko-dc-customer-info {
    background: #f9fafb;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #374151;
}

#byakko-dc-card-container {
    min-height: 52px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px;
}

.byakko-dc-card-errors {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
    padding: 8px 10px;
    background: #fee2e2;
    border-radius: 4px;
}

.byakko-dc-btn-lg { padding: 14px 28px; font-size: 16px; }

.byakko-dc-payment-note {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin-top: 10px;
}

/* ===== 購入完了 ===== */
.byakko-dc-complete-header {
    text-align: center;
    padding: 32px 0 24px;
}

.byakko-dc-complete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #d1fae5;
    color: #059669;
    font-size: 32px;
    border-radius: 50%;
    margin-bottom: 16px;
}

.byakko-dc-complete-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.byakko-dc-complete-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
}

.byakko-dc-dl-expire-note {
    font-size: 13px;
    color: #d97706;
    margin-bottom: 14px;
}

.byakko-dc-dl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.byakko-dc-btn-download {
    background: #059669;
    color: #fff;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background .15s;
}
.byakko-dc-btn-download:hover { background: #047857; color: #fff; }

.byakko-dc-dl-icon { font-size: 18px; }

.byakko-dc-complete-footer { text-align: center; }

.byakko-dc-btn-secondary {
    background: #fff;
    color: #2563eb;
    border: 2px solid #2563eb;
}
.byakko-dc-btn-secondary:hover {
    background: #2563eb;
    color: #fff;
}

.byakko-dc-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ===== マイページ ===== */
.byakko-dc-mypage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.byakko-dc-mypage-greeting {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.byakko-dc-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.byakko-dc-tab-link {
    display: inline-block;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}

.byakko-dc-tab-link:hover {
    color: #2563eb;
    text-decoration: none;
}

.byakko-dc-tab-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.byakko-dc-mypage-downloads,
.byakko-dc-mypage-account {
    margin-top: 8px;
}

.byakko-dc-empty {
    text-align: center;
    color: #6b7280;
    padding: 48px 0;
}

/* ===== 注文ブロック ===== */
.byakko-dc-order-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.byakko-dc-order-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.byakko-dc-order-id {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
}

.byakko-dc-order-date {
    font-size: 13px;
    color: #6b7280;
}

/* ===== ダウンロードテーブル ===== */
.byakko-dc-dl-table {
    width: 100%;
    border-collapse: collapse;
}

.byakko-dc-dl-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.byakko-dc-dl-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    vertical-align: middle;
}

.byakko-dc-dl-table tr:last-child td {
    border-bottom: none;
}

.byakko-dc-expired {
    color: #dc2626;
}

.byakko-dc-dl-disabled {
    color: #9ca3af;
    font-size: 13px;
}

/* ===== アカウント設定フォーム ===== */
.byakko-dc-mypage-account {
    max-width: 520px;
}

.byakko-dc-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}

.byakko-dc-field-required {
    font-weight: 400;
    color: #dc2626;
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

/* ===== Google ログイン ===== */
.byakko-dc-social-login {
    margin-top: 24px;
}

.byakko-dc-social-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #9ca3af;
    font-size: 13px;
}

.byakko-dc-social-divider::before,
.byakko-dc-social-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #e5e7eb;
}

.byakko-dc-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    font-weight: 500;
}

.byakko-dc-btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c9cc;
    color: #3c4043;
}

/* ===== レスポンシブ（マイページ） ===== */
@media (max-width: 640px) {
    .byakko-dc-dl-table { font-size: 12px; }
    .byakko-dc-dl-table th { display: none; }
    .byakko-dc-dl-table td {
        display: block;
        padding: 6px 12px;
        border-bottom: none;
    }
    .byakko-dc-dl-table td:last-child { border-bottom: 1px solid #f3f4f6; }
    .byakko-dc-dl-table tr { display: block; border-bottom: 1px solid #e5e7eb; }
    .byakko-dc-order-meta { gap: 8px; }
}

/* ===== 購読ステータスバッジ ===== */
.byakko-dc-sub-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.byakko-dc-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.byakko-dc-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.byakko-dc-status-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== 購読テーブルのラベル列 ===== */
.byakko-dc-sub-label {
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
    width: 130px;
}

/* ===== 準備中メッセージ ===== */
.byakko-dc-sub-waiting {
    padding: 12px 16px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
}

/* ===== 認証情報セクション ===== */
.byakko-dc-sub-cred-section {
    border-top: 2px solid #e5e7eb;
}

.byakko-dc-sub-cred-heading {
    padding: 10px 16px;
    background: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.byakko-dc-sub-mono {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    font-size: 13px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: .03em;
}

.byakko-dc-sub-text-content {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
}

/* ===== AIチャット（Suzaku-AI 埋め込み） ===== */
.byakko-dc-chat-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.byakko-dc-chat-inline {
    margin-top: 40px;
}
