/**
 * データ入稿ページ用スタイル（ベーシック）
 *
 * テーマで上書きする場合の主なクラス:
 *   .wcop-data-submission-page  … ページ全体のラッパー
 *   .wcop-order-item-summary   … ご注文内容ブロック
 *   .wcop-data-submission-form … アップロードフォーム
 *   .wcop-submission-done-block … 完了メッセージ
 *   .wcop-btn .wcop-btn-primary … マイページに戻るボタン
 */

/* ==========================================================================
   注文完了画面：データ入稿へ進むボタン
   ========================================================================== */
.wcop-completion-submission-wrap {
	margin: 1.5em 0 0;
	text-align: center;
}

.wcop-completion-submission-btn {
	display: inline-block;
	padding: 0.6em 1.5em;
	font-size: 1em;
	line-height: 1.4;
	text-decoration: none;
	color: #fff;
	background: #2271b1;
	border: 1px solid #2271b1;
	border-radius: 4px;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.wcop-completion-submission-btn:hover,
.wcop-completion-submission-btn:focus {
	color: #fff;
	background: #135e96;
	border-color: #135e96;
	text-decoration: none;
}

.wcop-completion-submission-btn:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* ページラッパー */
.wcop-data-submission-page.wcop-submission-wrap {
	max-width: 800px;
	margin: 2em auto;
	padding: 0 1em;
}

.wcop-submission-title {
	margin-bottom: 1em;
	font-size: 1.5rem;
	border-bottom: 1px solid #ddd;
	padding-bottom: 0.5em;
}

/* ご注文内容ブロック */
.wcop-order-item-summary {
	margin-bottom: 2em;
	padding: 1.25em;
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
}

.wcop-order-item-heading {
	margin: 0 0 1em;
	font-size: 1.1rem;
	font-weight: 600;
}

.wcop-order-item-inner {
	display: flex;
	gap: 1.25em;
	align-items: flex-start;
}

.wcop-order-item-thumb {
	flex-shrink: 0;
}

.wcop-order-item-thumb img {
	display: block;
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 4px;
}

.wcop-order-item-detail {
	margin: 0;
	flex: 1;
	min-width: 0;
}

.wcop-order-item-detail dt {
	margin: 0 0 0.25em;
	font-size: 0.85em;
	color: #666;
	font-weight: 600;
}

.wcop-order-item-detail dd {
	margin: 0 0 0.75em;
}

.wcop-order-item-detail dd:last-child {
	margin-bottom: 0;
}

.wcop-order-item-name {
	font-weight: 500;
}

/* データ入稿画面：テンプレートダウンロード */
.wcop-submission-template-download {
	margin-top: 1em;
	flex-shrink: 0;
}

.wcop-submission-template-btn {
	display: inline-block;
	padding: 0.5em 1em;
	font-size: 0.95em;
	line-height: 1.4;
	text-decoration: none;
	color: #2271b1;
	background: #f0f6fc;
	border: 1px solid #2271b1;
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wcop-submission-template-btn:hover,
.wcop-submission-template-btn:focus {
	color: #fff;
	background: #2271b1;
	text-decoration: none;
}

.wcop-submission-template-btn:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* アップロードフォーム */
.wcop-data-submission-form {
	margin-bottom: 2em;
	padding: 1.25em;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
}

.wcop-upload-heading {
	margin: 0 0 0.5em;
	font-size: 1.1rem;
	font-weight: 600;
}

.wcop-upload-description {
	margin: 0 0 1em;
	color: #555;
}

.wcop-upload-form label {
	display: block;
	margin-bottom: 0.25em;
	font-weight: 500;
}

.wcop-upload-form input[type="file"] {
	display: block;
	margin-bottom: 0.5em;
	max-width: 100%;
}

.wcop-upload-form .description {
	display: block;
	margin-top: 0.25em;
	font-size: 0.9em;
	color: #666;
}

.wcop-upload-form button[type="submit"],
.wcop-upload-form .button {
	margin-top: 1em;
	padding: 0.5em 1.5em;
	cursor: pointer;
	background: #2271b1;
	color: #fff;
	border: 1px solid #2271b1;
	border-radius: 4px;
	font-size: 1em;
}

.wcop-upload-form button[type="submit"]:hover,
.wcop-upload-form .button:hover {
	background: #135e96;
	border-color: #135e96;
	color: #fff;
}

.wcop-upload-form button[type="submit"]:disabled,
.wcop-upload-form .button:disabled,
.wcop-upload-form .wcop-upload-submit-btn:disabled {
	background: #a7aaad;
	border-color: #a7aaad;
	color: #fff;
	cursor: not-allowed;
	opacity: 0.8;
}

/* 完了ブロック */
.wcop-submission-done-block {
	padding: 1.5em;
	background: #f0f6fc;
	border: 1px solid #c3e0ff;
	border-radius: 4px;
}

.wcop-submission-done {
	margin: 0 0 1em;
	font-size: 1.05em;
}

.wcop-submission-actions {
	margin: 1em 0 0;
}

.wcop-btn {
	display: inline-block;
	padding: 0.5em 1.5em;
	text-decoration: none;
	border-radius: 4px;
	font-size: 1em;
	transition: opacity 0.2s;
}

.wcop-btn:hover {
	opacity: 0.9;
}

.wcop-btn-primary {
	background: #2271b1;
	color: #fff;
	border: 1px solid #2271b1;
}

.wcop-btn-primary:hover {
	color: #fff;
}

/* 入稿済みメッセージ */
.wcop-already-submitted {
	margin: 1em 0;
	padding: 1em;
	background: #f9f9f9;
	border-left: 4px solid #72aee6;
}

/* 購入履歴：データ入稿列（入稿する / 入稿済み） */
.wcop-submission-cell {
	vertical-align: middle;
}

/* データ入稿の見出し（ボタン・バッジの前） */
.wcop-submission-label {
	display: inline;
	font-weight: 600;
	font-size: 0.9em;
	color: #444;
	margin-right: 0.35em;
}

/* 入稿する（これから入稿する）→ ボタン風リンク */
.wcop-submission-cell.wcop-submission-pending .wcop-submission-link {
	display: inline-block;
	padding: 0.35em 0.9em;
	font-size: 0.9em;
	text-decoration: none;
	color: #fff;
	background: #2271b1;
	border-radius: 4px;
	border: 1px solid #2271b1;
	transition: opacity 0.2s;
}

.wcop-submission-cell.wcop-submission-pending .wcop-submission-link:hover {
	opacity: 0.9;
	color: #fff;
}

/* 入稿済み（完了）→ バッジ風 */
.wcop-submission-cell.wcop-submission-done .wcop-submission-badge {
	display: inline-block;
	padding: 0.3em 0.65em;
	font-size: 0.85em;
	line-height: 1.3;
	color: #2c662d;
	background: #e7f7e7;
	border: 1px solid #a3c9a3;
	border-radius: 4px;
	white-space: nowrap;
}

/* 購入履歴：スマホ・狭い画面でのレスポンシブ（iPhone 12 等 〜767px）
 * テーマが .history-area 内で table に flex/grid を当てているため、
 * 同じセレクタで !important を使って上書き（テーマのCSSは触らない）
 */
@media screen and (max-width: 767px) {
	/* ========== 注文サマリ（対応状況・入金状況など）テーマの flex/33.33% を上書き ========== */
	#usces_history #history_head,
	#usces_history table#history_head,
	article.wc_member #memberinfo .history-area table#history_head {
		display: block !important;
		width: 100% !important;
		position: static !important;
	}

	#usces_history #history_head thead,
	#usces_history #history_head thead tr,
	article.wc_member #memberinfo .history-area table#history_head thead,
	article.wc_member #memberinfo .history-area table#history_head thead tr {
		display: none !important;
	}

	#usces_history #history_head tbody,
	#usces_history #history_head tbody tr.order_head_value,
	article.wc_member #memberinfo .history-area table#history_head tbody,
	article.wc_member #memberinfo .history-area table#history_head tbody tr.order_head_value {
		display: block !important;
		position: static !important;
		width: 100% !important;
		left: auto !important;
		top: auto !important;
	}

	#usces_history #history_head tbody tr.order_head_value td,
	article.wc_member #memberinfo .history-area table#history_head tbody tr.order_head_value td {
		display: block !important;
		width: 100% !important;
		box-sizing: border-box;
		padding: 0.4em 0.75em;
		border-bottom: 1px solid #eee;
		white-space: normal;
		word-break: break-all;
	}

	#usces_history #history_head tbody tr.order_head_value td::before,
	article.wc_member #memberinfo .history-area table#history_head tbody tr.order_head_value td::before {
		content: attr(data-label);
		display: inline-block;
		font-weight: 600;
		min-width: 7em;
		margin-right: 0.5em;
		color: #555;
		font-size: 0.9em;
		vertical-align: top;
	}

	#usces_history #history_head tbody tr.order_head_value td.rightnum,
	article.wc_member #memberinfo .history-area table#history_head tbody tr.order_head_value td.rightnum {
		text-align: left;
	}

	/* ========== 商品テーブル（.retail）テーマの grid 3列を上書きし、データ入稿を独立行に ========== */
	#usces_history table.retail tr,
	article.wc_member #memberinfo .history-area table.retail tr {
		display: grid !important;
		grid-template-columns: 20px 70px 1fr !important;
		grid-auto-rows: auto;
		gap: 5px 20px;
	}

	/* データ入稿セル：新しい行でフル幅表示（テーマの3列 grid の外に出す） */
	#usces_history table.retail tr td.wcop-submission-cell,
	article.wc_member #memberinfo .history-area table.retail tr td.wcop-submission-cell {
		grid-column: 1 / -1 !important;
		grid-row: 5 !important;
		width: 100% !important;
		box-sizing: border-box;
		padding: 0.6em 0.75em !important;
		white-space: normal;
		word-break: normal;
	}

	/* データ入稿ラベルとボタン・バッジを改行せず同一行に */
	.wcop-submission-cell .wcop-submission-label {
		display: inline !important;
		writing-mode: horizontal-tb !important;
		transform: none !important;
		font-size: 0.9em;
		color: #555;
		margin: 0 0.35em 0 0;
		padding: 0;
	}

	/* 入稿するリンク：横書き・回転解除（ラベルと同一行） */
	.wcop-submission-cell.wcop-submission-pending .wcop-submission-link {
		transform: none !important;
		writing-mode: horizontal-tb !important;
		display: inline-block;
		white-space: nowrap;
		margin-left: 0;
	}

	/* 入稿済みバッジ：ラベルと同一行 */
	.wcop-submission-cell.wcop-submission-done .wcop-submission-badge {
		white-space: nowrap;
		display: inline-block;
		margin-left: 0;
	}
}

/* ==========================================================================
   データ入稿ページ（SP・スマホ）レイアウト
   ========================================================================== */
@media screen and (max-width: 767px) {
	.wcop-data-submission-page.wcop-submission-wrap {
		padding: 0 0.75em;
		margin: 1em auto;
	}

	.wcop-data-submission-page .wcop-submission-title {
		font-size: 1.25rem;
	}

	/* ご注文内容：横並び → 縦積み */
	.wcop-data-submission-page .wcop-order-item-summary {
		padding: 1em;
		margin-bottom: 1.5em;
	}

	.wcop-data-submission-page .wcop-order-item-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 1em;
	}

	.wcop-data-submission-page .wcop-order-item-thumb {
		text-align: center;
	}

	.wcop-data-submission-page .wcop-order-item-thumb img {
		width: 100%;
		max-width: 200px;
		height: auto;
		margin: 0 auto;
	}

	.wcop-data-submission-page .wcop-order-item-detail {
		min-width: 0;
		word-break: break-word;
		overflow-wrap: break-word;
	}

	.wcop-data-submission-page .wcop-order-item-name {
		word-break: break-word;
		overflow-wrap: break-word;
	}

	/* テンプレートダウンロード：ブロック幅でタップしやすく */
	.wcop-data-submission-page .wcop-submission-template-download {
		width: 100%;
		margin-top: 0.75em;
		flex-shrink: 0;
	}

	.wcop-data-submission-page .wcop-submission-template-btn {
		display: block;
		width: 100%;
		box-sizing: border-box;
		text-align: center;
		padding: 0.6em 1em;
	}

	/* アップロードフォーム */
	.wcop-data-submission-page .wcop-data-submission-form {
		padding: 1em;
		margin-bottom: 1.5em;
	}

	.wcop-data-submission-page .wcop-upload-heading {
		font-size: 1rem;
	}

	.wcop-data-submission-page .wcop-upload-form input[type="file"] {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	.wcop-data-submission-page .wcop-upload-form .description {
		word-break: break-word;
		overflow-wrap: break-word;
		font-size: 0.85em;
	}

	.wcop-data-submission-page .wcop-upload-form textarea.wcop-submission-remarks {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		min-height: 6em;
	}

	.wcop-data-submission-page .wcop-upload-form button[type="submit"],
	.wcop-data-submission-page .wcop-upload-form .wcop-upload-submit-btn {
		display: block;
		width: 100%;
		box-sizing: border-box;
		padding: 0.65em 1em;
	}

	/* 完了メッセージ・マイページに戻る */
	.wcop-data-submission-page .wcop-submission-actions .wcop-btn {
		display: block;
		width: 100%;
		text-align: center;
		box-sizing: border-box;
	}
}

/* アップロード進捗オーバーレイ */
.wcop-upload-progress-wrap {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 4px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
}

.wcop-upload-progress-wrap.wcop-progress-hidden {
	opacity: 0;
	pointer-events: none;
}

.wcop-upload-progress-wrap.wcop-progress-visible {
	opacity: 1;
	pointer-events: auto;
}

.wcop-data-submission-form {
	position: relative;
}

.wcop-upload-progress-inner {
	width: 100%;
	max-width: 320px;
	padding: 1.5em;
}

.wcop-upload-progress-text {
	margin: 0 0 0.75em;
	font-weight: 500;
}

.wcop-upload-progress-bar {
	height: 8px;
	background: #e5e5e5;
	border-radius: 4px;
	overflow: hidden;
}

.wcop-upload-progress-fill {
	height: 100%;
	background: #2271b1;
	border-radius: 4px;
	transition: width 0.15s ease-out;
}

/* 入稿データ確認済み(確定)バッジと確認リンク */
.wcop-submission-cell.wcop-submission-confirmed .wcop-submission-badge {
	display: inline-block;
	padding: 0.3em 0.65em;
	font-size: 0.85em;
	line-height: 1.3;
	border-radius: 3px;
	white-space: nowrap;
}

.wcop-submission-badge--confirmed {
	background: #155724;
	color: #fff;
	border-color: #155724;
}

.wcop-submission-link--view {
	margin-left: 6px;
	font-size: 0.9em;
	text-decoration: underline;
}

.wcop-submission-confirmed-notice {
	border-left: 3px solid #155724;
	padding-left: 10px;
	font-weight: 600;
}

/* 未ログイン時のログイン誘導パネル */
.wcop-submission-login-required {
	max-width: 560px;
	margin: 8px 0 24px;
	padding: 24px;
	background: #f7faf8;
	border: 1px solid #dbe7e2;
	border-radius: 8px;
}

.wcop-submission-login-required__lead {
	margin: 0 0 8px;
	font-size: 1rem;
	font-weight: 700;
	color: #20342d;
	line-height: 1.8;
}

.wcop-submission-login-required__note {
	margin: 0 0 16px;
	color: #53655f;
	font-size: 0.9rem;
	line-height: 1.7;
}

/* 注文完了画面: WEBデザイン受付済みの案内 */
.wcop-completion-designed-note {
	max-width: 560px;
	margin: 1.5em auto 0;
	padding: 18px 22px;
	background: #f2f8f4;
	border: 1px solid #cfe4d8;
	border-radius: 8px;
	text-align: center;
}

.wcop-completion-designed-note p {
	margin: 0 0 10px;
	line-height: 1.8;
}

.wcop-completion-submission-btn--secondary {
	background: #fff;
	color: #2271b1;
}
