/* ============================================================
   Woocom-Pay — Public Styles
   Mobile-first, breakpoints: 480 | 768 | 1024
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
	--wcp-blue:      #3498db;
	--wcp-blue-dark: #2980b9;
	--wcp-green:     #27ae60;
	--wcp-green-lt:  #2ecc71;
	--wcp-red:       #e74c3c;
	--wcp-navy:      #1a1a2e;
	--wcp-navy-lt:   #16213e;
	--wcp-text:      #2c3e50;
	--wcp-muted:     #666;
	--wcp-border:    #e0e0e0;
	--wcp-radius:    10px;
	--wcp-gap:       clamp(12px, 3vw, 24px);
	--wcp-pad-x:     clamp(16px, 4vw, 30px);
	--wcp-pad-y:     clamp(16px, 3vw, 24px);
	--wcp-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Wrapper ───────────────────────────────────────────────── */
.wcp-payment-wrap {
	width: 100%;
	max-width: 700px;
	margin: clamp(16px, 4vw, 40px) auto;
	padding: 0 clamp(10px, 3vw, 20px);
	box-sizing: border-box;
	font-family: var(--wcp-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--wcp-text);
}

.wcp-payment-card {
	background: #fff;
	border: 1px solid var(--wcp-border);
	border-radius: var(--wcp-radius);
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ── Header ────────────────────────────────────────────────── */
.wcp-payment-header {
	background: linear-gradient(135deg, var(--wcp-navy) 0%, var(--wcp-navy-lt) 100%);
	padding: var(--wcp-pad-y) var(--wcp-pad-x);
	text-align: center;
	color: #fff;
	position: relative;
}

.wcp-header-home-btn {
	position: absolute;
	top: 14px;
	left: 16px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	border: 1px solid rgba(255,255,255,0.3);
	border-radius: 20px;
	color: rgba(255,255,255,0.85);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.wcp-header-home-btn:hover {
	background: rgba(255,255,255,0.15);
	border-color: rgba(255,255,255,0.6);
	color: #fff;
}

.wcp-logo {
	display: block;
	max-height: 48px;
	max-width: 160px;
	width: auto;
	object-fit: contain;
	margin: 0 auto 10px;
}

.wcp-payment-header h2 {
	margin: 0;
	font-size: clamp(17px, 4vw, 22px);
	font-weight: 700;
	color: #fff;
}

.wcp-header-sub {
	margin: 5px 0 0;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.7);
}

/* ── Amount Box ────────────────────────────────────────────── */
.wcp-amount-box {
	background: #f8f9ff;
	border-bottom: 1px solid #e8e8f0;
	padding: var(--wcp-pad-y) var(--wcp-pad-x);
	text-align: center;
}

.wcp-amount-label {
	margin: 0 0 4px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--wcp-muted);
}

.wcp-amount-value {
	margin: 0;
	font-size: clamp(26px, 6vw, 38px);
	font-weight: 800;
	color: var(--wcp-text);
	line-height: 1.1;
}

.wcp-summary-table {
	width: 100%;
	border-collapse: collapse;
	font-size: clamp(13px, 3vw, 15px);
	text-align: left;
}

.wcp-summary-table td {
	padding: 5px 0;
	border: none;
	vertical-align: middle;
}

.wcp-summary-table td:last-child {
	text-align: right;
	font-weight: 700;
	white-space: nowrap;
}

.wcp-pay-now-row td {
	color: var(--wcp-green);
	font-size: clamp(14px, 3.5vw, 17px);
	font-weight: 700;
}

.wcp-balance-row td {
	color: var(--wcp-red);
}

/* ── UPI Destination Box ───────────────────────────────────── */
.wcp-upi-dest-box {
	padding: var(--wcp-pad-y) var(--wcp-pad-x);
	background: #f0f7ff;
	border-bottom: 2px solid #d0e8ff;
	text-align: center;
}

.wcp-upi-dest-label {
	margin: 0 0 4px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	color: #888;
}

.wcp-merchant-name {
	margin: 0 0 10px;
	font-size: clamp(16px, 4vw, 20px);
	font-weight: 700;
	color: var(--wcp-navy);
}

.wcp-upi-id-block {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: #fff;
	border: 2px solid var(--wcp-blue);
	border-radius: 8px;
	padding: 10px 16px;
	flex-wrap: wrap;
	max-width: 100%;
	box-sizing: border-box;
}

.wcp-upi-id-value {
	font-size: clamp(14px, 3.5vw, 18px);
	font-weight: 700;
	color: var(--wcp-text);
	font-family: "Courier New", Courier, monospace;
	letter-spacing: 0.3px;
	word-break: break-all;
}

/* ── Copy Button ───────────────────────────────────────────── */
.wcp-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #ecf0f1;
	border: 1px solid #bdc3c7;
	border-radius: 4px;
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	color: var(--wcp-text);
	transition: background 0.15s, transform 0.1s;
	white-space: nowrap;
	min-height: 34px;
}

.wcp-copy-btn:hover {
	background: #d5dbdb;
	transform: translateY(-1px);
}

.wcp-copy-btn:active {
	transform: translateY(0);
}

/* ── Mobile Pay Section ────────────────────────────────────── */
.wcp-mobile-section {
	padding: var(--wcp-pad-y) var(--wcp-pad-x);
	text-align: center;
	border-bottom: 1px solid #f0f0f0;
}

.wcp-step-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--wcp-muted);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin: 0 0 14px;
}

.wcp-pay-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	max-width: 360px;
	background: linear-gradient(135deg, var(--wcp-green), var(--wcp-green-lt));
	color: #fff;
	text-decoration: none;
	padding: 16px 24px;
	border-radius: 50px;
	font-size: clamp(16px, 4vw, 19px);
	font-weight: 700;
	box-shadow: 0 4px 16px rgba(39, 174, 96, 0.38);
	transition: transform 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
	min-height: 54px;
	/* button-element resets */
	border: none;
	cursor: pointer;
	font-family: var(--wcp-font);
	-webkit-appearance: none;
	appearance: none;
}

.wcp-pay-btn:hover,
.wcp-pay-btn:focus {
	transform: translateY(-2px);
	box-shadow: 0 6px 22px rgba(39, 174, 96, 0.5);
	color: #fff;
	text-decoration: none;
}

.wcp-pay-icon {
	font-size: 20px;
	flex-shrink: 0;
}

.wcp-hint {
	margin: 12px 0 0;
	font-size: 13px;
	color: #888;
}

.wcp-return-notice {
	background: #eafaf1;
	border: 1px solid #a9dfbf;
	border-radius: 8px;
	padding: 12px 16px;
	margin-top: 16px;
	font-size: 14px;
	font-weight: 600;
	color: #1e8449;
	text-align: left;
}

.wcp-return-notice p {
	margin: 0;
}

/* ── Desktop / QR Section ──────────────────────────────────── */
.wcp-desktop-section {
	padding: var(--wcp-pad-y) var(--wcp-pad-x);
	border-bottom: 1px solid #f0f0f0;
	display: flex;
	flex-direction: column;
	gap: var(--wcp-gap);
}

@media (min-width: 560px) {
	.wcp-desktop-section {
		flex-direction: row;
		align-items: flex-start;
	}

	.wcp-divider-or {
		flex-direction: column !important;
		padding: 0 4px !important;
	}

	.wcp-divider-or::before,
	.wcp-divider-or::after {
		content: '';
		flex: 1;
		width: 1px;
		background: #e0e0e0;
		display: block;
	}
}

.wcp-qr-wrap {
	flex: 0 0 auto;
	text-align: center;
}

.wcp-qr-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--wcp-muted);
	letter-spacing: 0.5px;
	margin: 0 0 8px;
}

.wcp-qr-img {
	display: block;
	width: clamp(140px, 30vw, 180px);
	height: clamp(140px, 30vw, 180px);
	object-fit: contain;
	border: 2px solid var(--wcp-border);
	border-radius: 8px;
	padding: 8px;
	background: #fff;
	margin: 0 auto;
}

.wcp-qr-apps {
	margin: 8px 0 0;
	font-size: 11px;
	color: #999;
}

.wcp-divider-or {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	color: #aaa;
	font-weight: 700;
	font-size: 12px;
	flex-shrink: 0;
	padding: 4px 0;
}

.wcp-divider-or::before,
.wcp-divider-or::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e0e0e0;
}

@media (min-width: 560px) {
	.wcp-divider-or::before,
	.wcp-divider-or::after {
		height: auto;
		width: 1px;
	}
}

.wcp-desktop-manual {
	flex: 1;
	min-width: 0;
}

.wcp-instructions {
	margin: 0;
	padding-left: 20px;
	color: #444;
	font-size: clamp(13px, 3vw, 14px);
	line-height: 1.9;
}

.wcp-instructions li {
	margin-bottom: 2px;
}

/* ── Info Banner ───────────────────────────────────────────── */
.wcp-info-banner {
	background: #fffbea;
	border: 1px solid #f0d060;
	border-radius: 6px;
	padding: 12px 16px;
	font-size: 13px;
	color: #7a5f00;
	line-height: 1.6;
	margin-bottom: 20px;
}

/* ── Confirmation Form ─────────────────────────────────────── */
.wcp-confirmation-section {
	padding: var(--wcp-pad-y) var(--wcp-pad-x);
}

.wcp-confirmation-section h3 {
	margin: 0 0 18px;
	font-size: clamp(16px, 4vw, 19px);
	font-weight: 700;
	color: var(--wcp-text);
}

.wcp-field {
	margin-bottom: 18px;
}

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

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

.wcp-field .optional {
	font-weight: 400;
	color: #999;
	font-size: 13px;
}

.wcp-field input[type="text"],
.wcp-field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #d5d9de;
	border-radius: 6px;
	font-size: 15px;
	color: var(--wcp-text);
	background: #fafafa;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

.wcp-field input[type="text"]:focus,
.wcp-field textarea:focus {
	outline: none;
	border-color: var(--wcp-blue);
	box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
	background: #fff;
}

.wcp-field input[type="file"] {
	display: block;
	width: 100%;
	padding: 10px 14px;
	border: 2px dashed #c0c8d0;
	border-radius: 6px;
	font-size: 14px;
	color: #555;
	background: #f7f9fb;
	box-sizing: border-box;
	cursor: pointer;
	transition: border-color 0.2s;
}

.wcp-field input[type="file"]:hover {
	border-color: var(--wcp-blue);
	background: #f0f6ff;
}

.wcp-field textarea {
	resize: vertical;
	min-height: 80px;
}

.wcp-field-hint {
	margin: 5px 0 0;
	font-size: 12px;
	color: #8a96a3;
	line-height: 1.5;
}

/* Screenshot preview */
#wcp-screenshot-preview {
	display: block;
	max-width: 200px;
	max-height: 150px;
	width: auto;
	height: auto;
	margin-top: 10px;
	border: 1px solid var(--wcp-border);
	border-radius: 6px;
}

/* ── Submit Button ─────────────────────────────────────────── */
.wcp-submit-btn {
	display: block;
	width: 100%;
	padding: 15px 20px;
	background: linear-gradient(135deg, var(--wcp-blue-dark), var(--wcp-blue));
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: clamp(15px, 4vw, 17px);
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.15s;
	min-height: 52px;
	letter-spacing: 0.2px;
}

.wcp-submit-btn:hover:not(:disabled) {
	opacity: 0.9;
	transform: translateY(-1px);
}

.wcp-submit-btn:active:not(:disabled) {
	transform: translateY(0);
}

.wcp-submit-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ── Alert Messages ────────────────────────────────────────── */
.wcp-message {
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
	margin-bottom: 14px;
	line-height: 1.5;
}

.wcp-message-error {
	background: #fdecea;
	color: #b71c1c;
	border: 1px solid #f5c6cb;
}

.wcp-message-success {
	background: #eafaf1;
	color: #1b5e20;
	border: 1px solid #a9dfbf;
}

/* ── Success State ─────────────────────────────────────────── */
.wcp-success-box {
	padding: clamp(28px, 6vw, 48px) var(--wcp-pad-x);
	text-align: center;
}

.wcp-success-icon {
	width: clamp(56px, 12vw, 72px);
	height: clamp(56px, 12vw, 72px);
	background: var(--wcp-green);
	color: #fff;
	border-radius: 50%;
	font-size: clamp(28px, 6vw, 38px);
	line-height: clamp(56px, 12vw, 72px);
	margin: 0 auto 16px;
}

.wcp-success-box h3 {
	font-size: clamp(18px, 4vw, 22px);
	color: var(--wcp-green);
	margin: 0 0 10px;
}

.wcp-success-box p {
	color: #555;
	font-size: clamp(14px, 3vw, 15px);
	max-width: 380px;
	margin: 0 auto;
}

/* ── Product Payment Options (product page) ────────────────── */
.wcp-payment-options {
	margin-bottom: 20px;
	padding: 16px;
	border: 1px solid #dde3ea;
	border-radius: 8px;
	background: #fafbfc;
}

.wcp-payment-options .wcp-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
	cursor: pointer;
}

.wcp-payment-options .wcp-option:last-child {
	margin-bottom: 0;
}

.wcp-payment-options .wcp-option input[type="radio"] {
	accent-color: var(--wcp-blue);
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-top: 2px;
}

/* ── Checkout Page ─────────────────────────────────────────── */
li.payment_method_woocom_pay img,
.wc_payment_method.payment_method_woocom_pay img {
	max-height: 28px !important;
	width: auto !important;
	vertical-align: middle;
}

.wcp-checkout-desc {
	margin: 0 0 10px;
	color: #555;
	font-size: 13px;
	line-height: 1.5;
}

.wcp-checkout-vpa {
	background: #f4f8ff;
	border: 1px solid #c8dff8;
	border-radius: 6px;
	padding: 12px 14px;
	margin-top: 8px;
}

.wcp-checkout-vpa-name {
	display: block;
	font-weight: 700;
	font-size: 14px;
	color: var(--wcp-navy);
	margin-bottom: 6px;
}

.wcp-checkout-vpa-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.wcp-checkout-vpa-label {
	font-size: 12px;
	color: #666;
	white-space: nowrap;
}

.wcp-checkout-vpa-id {
	font-family: "Courier New", Courier, monospace;
	font-size: clamp(13px, 3vw, 15px);
	font-weight: 700;
	color: var(--wcp-text);
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 4px 10px;
	word-break: break-all;
}

.wcp-checkout-copy {
	font-size: 11px !important;
	padding: 4px 10px !important;
	min-height: 28px !important;
}

.wcp-checkout-vpa-hint {
	margin: 8px 0 0;
	font-size: 12px;
	color: #7a8a9a;
	line-height: 1.4;
}

/* ── Payment Method Selector (checkout) ────────────────────── */
.wcp-pm-selector {
	margin: 8px 0 10px;
	border: 1px solid #dde3ea;
	border-radius: 8px;
	overflow: hidden;
}

.wcp-pm-label {
	font-size: 12px;
	font-weight: 600;
	color: #666;
	padding: 8px 12px 4px;
	margin: 0;
	background: #f7f8fa;
	border-bottom: 1px solid #eee;
}

.wcp-pm-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	cursor: pointer;
	background: #fff;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s;
}

.wcp-pm-option:last-child {
	border-bottom: none;
}

.wcp-pm-option:hover {
	background: #f4f8ff;
}

.wcp-pm-option.wcp-pm-active {
	background: #eef6ff;
	border-left: 3px solid var(--wcp-blue);
}

.wcp-pm-option input[type="radio"] {
	accent-color: var(--wcp-blue);
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	margin: 0;
}

.wcp-pm-name {
	font-size: 13px;
	color: var(--wcp-text);
	line-height: 1.4;
}

/* Detail blocks shown/hidden by JS when method changes */
.wcp-pm-detail {
	margin-top: 8px;
}

/* Error message in API gateway button area */
.wcp-error {
	color: var(--wcp-red);
	font-size: 13px;
}

/* ── Merchant Info (legacy fallback) ───────────────────────── */
.wcp-merchant-info {
	padding: var(--wcp-pad-y) var(--wcp-pad-x);
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
	color: #444;
}

.wcp-merchant-info p {
	margin: 4px 0;
}

.wcp-upi-id {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

/* ── Responsive: small phones (≤ 400px) ───────────────────── */
@media (max-width: 400px) {
	.wcp-upi-id-block {
		flex-direction: column;
		gap: 8px;
	}

	.wcp-pay-btn {
		border-radius: 12px;
	}

	.wcp-checkout-vpa-row {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ── Responsive: phones (≤ 480px) ─────────────────────────── */
@media (max-width: 480px) {
	.wcp-payment-header {
		padding: 18px 16px;
	}

	.wcp-logo {
		max-height: 40px;
	}

	.wcp-summary-table td:first-child {
		padding-right: 8px;
	}
}

/* ── Responsive: tablet and below (≤ 768px) ───────────────── */
@media (max-width: 768px) {
	.wcp-desktop-section {
		flex-direction: column;
	}

	.wcp-qr-img {
		width: clamp(130px, 40vw, 160px);
		height: clamp(130px, 40vw, 160px);
	}

	.wcp-divider-or {
		flex-direction: row;
	}

	.wcp-divider-or::before,
	.wcp-divider-or::after {
		height: 1px;
		width: auto;
		flex: 1;
	}
}
