/**
 * WC Withdrawal Wizard – styly průvodce na frontendu.
 *
 * Veškeré selektory jsou zahnízděné pod #wcww-wizard nebo .wcww-*
 * s dostatečnou specificitou, aby nepřebíjel Elementor ani jiné page buildery.
 *
 * Barvy a tvar tlačítek jsou řízeny CSS proměnnými injektovanými inline z PHP.
 */

/* CSS proměnné – výchozí hodnoty, přepíší se inline stylem z PHP */
#wcww-wizard,
.wcww-confirmation {
	--wcww-btn-bg:     #2271b1;
	--wcww-btn-color:  #ffffff;
	--wcww-btn-radius: 6px;

	--wcww-color-border:   #dcdcdc;
	--wcww-color-bg:       #ffffff;
	--wcww-color-bg-light: #f5f7fa;
	--wcww-color-text:     #1a1a1a;
	--wcww-color-muted:    #6b7280;
	--wcww-color-error:    #dc2626;
	--wcww-color-excluded: #9ca3af;
	--wcww-color-warning:  #92400e;
	--wcww-color-success:  #166534;
	--wcww-radius-card:    10px;
	--wcww-shadow:         0 2px 12px rgba(0, 0, 0, 0.08);

	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--wcww-color-text);
	line-height: 1.6;
}

/* Resetujeme box-sizing pro všechny potomky */
#wcww-wizard *,
#wcww-wizard *::before,
#wcww-wizard *::after,
.wcww-confirmation *,
.wcww-confirmation *::before,
.wcww-confirmation *::after {
	box-sizing: border-box;
}

/* =========================================================
   Wrapper průvodce
   ========================================================= */
#wcww-wizard {
	max-width: 680px;
	margin: 0 auto;
	padding: 0;
}

/* =========================================================
   STEPPER – čísla v kroužcích se spojnicemi
   ========================================================= */

/*
 * Struktura:
 *   .wcww-steps
 *     .wcww-step-indicator[data-step="N"]   (kroužek + popisek)
 *       .wcww-step-dot   (kroužek s číslem)
 *       .wcww-step-label (text pod kroužkem)
 *     .wcww-step-connector                  (čára mezi kroky, vložena JS)
 */

#wcww-wizard .wcww-steps {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	margin: 0 0 36px;
	padding: 0;
	list-style: none;
	gap: 0;
	width: 100%;
}

/* Záložka: wpautop nebo Elementor může vložit <br>/<p> dovnitř stepperu – schovat. */
#wcww-wizard .wcww-steps > br,
#wcww-wizard .wcww-steps > p,
#wcww-wizard .wcww-step-indicator > br {
	display: none !important;
}

/* Každý krok zabírá stejný díl řádku */
#wcww-wizard .wcww-step-indicator {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	position: relative;
	padding: 0;
	background: none;
	border: none;
	font-size: 12px;
	color: var(--wcww-color-muted);
	transition: color 0.2s;
	min-width: 0;
}

/* Spojovací čára – pseudo-element na pravé straně kroužku */
#wcww-wizard .wcww-step-indicator:not(:last-child)::after {
	content: "";
	display: block;
	position: absolute;
	top: 20px;                /* polovina výšky kroužku (40px / 2) */
	left: calc(50% + 24px);   /* začátek za kroužkem */
	right: calc(-50% + 24px); /* konec před dalším kroužkem */
	height: 2px;
	background: var(--wcww-color-border);
	transition: background 0.3s;
	z-index: 0;
}

/* Spojovací čára pro dokončené kroky – zbarvená */
#wcww-wizard .wcww-step-indicator.is-done:not(:last-child)::after {
	background: var(--wcww-btn-bg);
	opacity: 0.5;
}

/* Kroužek s číslem */
#wcww-wizard .wcww-step-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 2px solid #1a1a1a;
	background: #1a1a1a;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
	position: relative;
	z-index: 1;
	flex-shrink: 0;
	line-height: 1;
}

/* Aktivní krok */
#wcww-wizard .wcww-step-indicator.is-active .wcww-step-dot {
	background: var(--wcww-btn-bg);
	border-color: var(--wcww-btn-bg);
	color: var(--wcww-btn-color);
	box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.15);
}

/* Dokončený krok – fajfka místo čísla */
#wcww-wizard .wcww-step-indicator.is-done .wcww-step-dot {
	background: var(--wcww-color-bg-light);
	border-color: var(--wcww-btn-bg);
	color: var(--wcww-btn-bg);
	font-size: 18px; /* fajfka */
}

/* Popisek kroku */
#wcww-wizard .wcww-step-label {
	margin-top: 6px;
	font-size: 11px;
	font-weight: 500;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 80px;
	color: inherit;
	line-height: 1.3;
}

#wcww-wizard .wcww-step-indicator.is-active .wcww-step-label {
	font-weight: 700;
	color: var(--wcww-color-text);
}

#wcww-wizard .wcww-step-indicator.is-done .wcww-step-label {
	color: var(--wcww-color-muted);
}

/* Na mobilech skryjeme popisky a zmenšíme kroužky */
@media (max-width: 480px) {
	#wcww-wizard .wcww-step-dot {
		width: 32px;
		height: 32px;
		font-size: 13px;
	}
	#wcww-wizard .wcww-step-indicator:not(:last-child)::after {
		top: 16px;
	}
	#wcww-wizard .wcww-step-label {
		display: none;
	}
}

/* =========================================================
   Panel kroku
   ========================================================= */
#wcww-wizard .wcww-step-panel {
	background: var(--wcww-color-bg);
	border: 1px solid var(--wcww-color-border);
	border-radius: var(--wcww-radius-card);
	padding: 28px 32px;
	box-shadow: var(--wcww-shadow);
	animation: wcwwFadeIn 0.18s ease;
}

@media (max-width: 480px) {
	#wcww-wizard .wcww-step-panel {
		padding: 20px 16px;
	}
}

@keyframes wcwwFadeIn {
	from { opacity: 0; transform: translateY(5px); }
	to   { opacity: 1; transform: translateY(0); }
}

#wcww-wizard .wcww-step-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--wcww-color-text);
	line-height: 1.3;
}

#wcww-wizard .wcww-step-desc {
	margin: 0 0 20px;
	color: var(--wcww-color-muted);
	font-size: 14px;
	line-height: 1.55;
}

/* =========================================================
   Formulářová pole
   ========================================================= */
#wcww-wizard .wcww-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

#wcww-wizard .wcww-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

#wcww-wizard .wcww-field label {
	font-weight: 600;
	font-size: 14px;
	color: var(--wcww-color-text);
	margin: 0;
	padding: 0;
}

#wcww-wizard .wcww-field input[type="email"],
#wcww-wizard .wcww-field input[type="text"],
#wcww-wizard .wcww-field input[type="number"],
#wcww-wizard .wcww-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--wcww-color-border);
	border-radius: 5px;
	font-size: 15px;
	font-family: inherit;
	color: var(--wcww-color-text);
	background: var(--wcww-color-bg);
	transition: border-color 0.15s, box-shadow 0.15s;
	margin: 0;
	outline: none;
	box-shadow: none;
	-webkit-appearance: none;
}

#wcww-wizard .wcww-field input:focus,
#wcww-wizard .wcww-field textarea:focus {
	border-color: var(--wcww-btn-bg);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
	outline: none;
}

#wcww-wizard .wcww-field textarea {
	resize: vertical;
	min-height: 96px;
}

#wcww-wizard .wcww-field .wcww-field-hint {
	font-size: 12px;
	color: var(--wcww-color-muted);
	margin: 0;
}

#wcww-wizard .wcww-required {
	color: var(--wcww-color-error);
	margin-left: 2px;
}

#wcww-wizard .wcww-field-error {
	font-size: 12px;
	color: var(--wcww-color-error);
	margin: 4px 0 0;
}

#wcww-wizard .wcww-field input.wcww-field-invalid,
#wcww-wizard .wcww-field textarea.wcww-field-invalid {
	border-color: var(--wcww-color-error);
	outline: none;
	box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
}

/* =========================================================
   Tlačítka
   ========================================================= */
#wcww-wizard .wcww-actions {
	display: flex;
	gap: 12px;
	margin-top: 12px;
	flex-wrap: wrap;
	align-items: center;
}

/* Reset globálních téma-stylů pro tlačítka.
   !important zajistí přebití i tehdy, kdy téma načítá svůj CSS po pluginu. */
#wcww-wizard button,
#wcww-wizard [type="button"],
#wcww-wizard [type="submit"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: inherit !important;
	cursor: pointer !important;
	display: inline-block !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: center !important;
	text-decoration: none !important;
	transition: none !important;
	user-select: none !important;
	-webkit-user-select: none !important;
	white-space: normal !important;
	width: auto !important;
}

/* Tlačítka pluginu – !important na vizuálních vlastnostech, aby téma nemohlo přebít. */
#wcww-wizard button.wcww-btn,
#wcww-wizard a.wcww-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 11px 26px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	border: 2px solid transparent !important;
	border-radius: var(--wcww-btn-radius) !important;
	cursor: pointer !important;
	transition: filter 0.15s, opacity 0.15s, box-shadow 0.15s !important;
	text-decoration: none !important;
	line-height: 1.2 !important;
	letter-spacing: 0 !important;
	vertical-align: middle !important;
	white-space: nowrap !important;
	box-sizing: border-box !important;
}

#wcww-wizard button.wcww-btn:focus-visible,
#wcww-wizard a.wcww-btn:focus-visible {
	outline: 2px solid var(--wcww-btn-bg) !important;
	outline-offset: 2px !important;
}

#wcww-wizard button.wcww-btn-primary,
#wcww-wizard a.wcww-btn-primary {
	background: var(--wcww-btn-bg) !important;
	color: var(--wcww-btn-color) !important;
	border-color: var(--wcww-btn-bg) !important;
}

#wcww-wizard button.wcww-btn-primary:hover,
#wcww-wizard a.wcww-btn-primary:hover {
	filter: brightness(1.08) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}

#wcww-wizard button.wcww-btn-secondary,
#wcww-wizard a.wcww-btn-secondary {
	background: transparent !important;
	color: var(--wcww-color-muted);
	border-color: var(--wcww-color-border);
}

#wcww-wizard button.wcww-btn-secondary:hover,
#wcww-wizard a.wcww-btn-secondary:hover {
	background: var(--wcww-color-bg-light) !important;
	color: var(--wcww-color-text) !important;
}

#wcww-wizard button.wcww-btn:disabled,
#wcww-wizard button.wcww-btn.is-loading,
#wcww-wizard a.wcww-btn:disabled,
#wcww-wizard a.wcww-btn.is-loading {
	opacity: 0.55 !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
}

/* =========================================================
   Oblast chybové/varovné zprávy
   ========================================================= */
#wcww-wizard .wcww-error-area {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 5px;
	padding: 12px 16px;
	margin-bottom: 16px;
	color: var(--wcww-color-error);
	font-size: 14px;
}

#wcww-wizard .wcww-warning-area {
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-radius: 5px;
	padding: 12px 16px;
	margin-bottom: 16px;
	color: var(--wcww-color-warning);
	font-size: 14px;
}

/* =========================================================
   Seznam položek (krok 2)
   ========================================================= */
#wcww-wizard .wcww-items-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 8px;
}

#wcww-wizard .wcww-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border: 1.5px solid var(--wcww-color-border);
	border-radius: 7px;
	background: var(--wcww-color-bg);
	transition: border-color 0.15s, background 0.15s;
}

#wcww-wizard .wcww-item.is-selected {
	border-color: var(--wcww-btn-bg);
	background: color-mix(in srgb, var(--wcww-btn-bg) 5%, transparent);
}

/* Fallback pro prohlížeče bez color-mix */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	#wcww-wizard .wcww-item.is-selected {
		background: #f0f6fc;
	}
}

#wcww-wizard .wcww-item.is-excluded {
	background: var(--wcww-color-bg-light);
	border-color: var(--wcww-color-border);
	opacity: 0.72;
}

#wcww-wizard .wcww-item-checkbox {
	margin-top: 3px;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--wcww-btn-bg);
}

#wcww-wizard .wcww-item-checkbox:disabled {
	cursor: not-allowed;
}

#wcww-wizard .wcww-item-info {
	flex: 1;
	min-width: 0;
}

#wcww-wizard .wcww-item-name {
	font-weight: 600;
	font-size: 15px;
	word-break: break-word;
	color: var(--wcww-color-text);
	margin: 0;
}

#wcww-wizard .wcww-item-name.is-excluded {
	text-decoration: line-through;
	color: var(--wcww-color-excluded);
}

#wcww-wizard .wcww-item-meta {
	font-size: 13px;
	color: var(--wcww-color-muted);
	margin-top: 2px;
}

#wcww-wizard .wcww-item-excluded-note {
	font-size: 13px;
	color: var(--wcww-color-muted);
	margin-top: 6px;
	font-style: italic;
}

#wcww-wizard .wcww-item-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

#wcww-wizard .wcww-item-qty label {
	font-size: 13px;
	color: var(--wcww-color-muted);
	white-space: nowrap;
	font-weight: 400;
}

#wcww-wizard .wcww-item-qty input[type="number"] {
	width: 68px;
	padding: 5px 8px;
	border: 1px solid var(--wcww-color-border);
	border-radius: 4px;
	font-size: 14px;
	text-align: center;
	font-family: inherit;
	background: var(--wcww-color-bg);
	color: var(--wcww-color-text);
}

#wcww-wizard .wcww-all-excluded-notice {
	background: var(--wcww-color-bg-light);
	border: 1px solid var(--wcww-color-border);
	border-radius: 7px;
	padding: 20px;
	text-align: center;
	color: var(--wcww-color-muted);
}

/* =========================================================
   Doprava (krok 4)
   ========================================================= */
#wcww-wizard .wcww-shipping-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}

#wcww-wizard .wcww-shipping-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 16px;
	border: 1.5px solid var(--wcww-color-border);
	border-radius: 7px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

#wcww-wizard .wcww-shipping-option:hover {
	border-color: var(--wcww-btn-bg);
	background: var(--wcww-color-bg-light);
}

#wcww-wizard .wcww-shipping-option input[type="radio"] {
	margin-top: 3px;
	accent-color: var(--wcww-btn-bg);
	flex-shrink: 0;
}

#wcww-wizard .wcww-shipping-option-label {
	font-weight: 600;
	font-size: 15px;
}

#wcww-wizard .wcww-shipping-instructions {
	margin-top: 12px;
	padding: 14px 16px;
	background: var(--wcww-color-bg-light);
	border: 1px solid var(--wcww-color-border);
	border-radius: 6px;
	font-size: 14px;
}

#wcww-wizard .wcww-shipping-instructions:empty {
	display: none;
}

#wcww-wizard .wcww-shipping-instructions p:first-child { margin-top: 0; }
#wcww-wizard .wcww-shipping-instructions p:last-child  { margin-bottom: 0; }

/* HTML elementy v pokynech musí být blokové – téma je může resetovat na inline. */
#wcww-wizard .wcww-shipping-instructions p,
#wcww-wizard .wcww-shipping-instructions ul,
#wcww-wizard .wcww-shipping-instructions ol,
#wcww-wizard .wcww-shipping-instructions li,
#wcww-wizard .wcww-shipping-instructions h1,
#wcww-wizard .wcww-shipping-instructions h2,
#wcww-wizard .wcww-shipping-instructions h3,
#wcww-wizard .wcww-shipping-instructions h4 {
	display: block !important;
}

#wcww-wizard .wcww-shipping-instructions br {
	display: block !important;
	content: "" !important;
	margin: 0 !important;
}

/* Prostý text bez HTML tagů: zachovej zalomení řádků. */
#wcww-wizard .wcww-instructions-content {
	white-space: pre-line;
}

/* =========================================================
   Bankovní účet (krok 3b – volitelné pole)
   ========================================================= */
#wcww-wizard .wcww-bank-section {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--wcww-color-border);
}

#wcww-wizard .wcww-bank-section .wcww-bank-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--wcww-color-text);
	margin: 0 0 4px;
}

#wcww-wizard .wcww-bank-section .wcww-bank-hint {
	font-size: 13px;
	color: var(--wcww-color-muted);
	margin: 0 0 12px;
}

/* =========================================================
   Shrnutí (krok 5)
   ========================================================= */
#wcww-wizard .wcww-summary {
	background: var(--wcww-color-bg-light);
	border: 1px solid var(--wcww-color-border);
	border-radius: 7px;
	padding: 20px;
	font-size: 14px;
}

#wcww-wizard .wcww-summary-row {
	display: flex;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid var(--wcww-color-border);
}

#wcww-wizard .wcww-summary-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

#wcww-wizard .wcww-summary-label {
	font-weight: 600;
	min-width: 150px;
	flex-shrink: 0;
	color: var(--wcww-color-muted);
}

#wcww-wizard .wcww-summary-value {
	flex: 1;
	color: var(--wcww-color-text);
}

#wcww-wizard .wcww-summary-value ul {
	margin: 0;
	padding-left: 16px;
}

#wcww-wizard .wcww-summary-value li {
	margin-bottom: 2px;
}

/* =========================================================
   Potvrzení
   ========================================================= */
.wcww-confirmation {
	text-align: center;
	padding: 40px 32px;
	background: var(--wcww-color-bg);
	border: 1px solid var(--wcww-color-border);
	border-radius: var(--wcww-radius-card);
	box-shadow: var(--wcww-shadow);
	max-width: 680px;
	margin: 0 auto;
}

.wcww-confirmation-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #dcfce7;
	color: var(--wcww-color-success);
	font-size: 30px;
	font-weight: 700;
	margin-bottom: 16px;
}

.wcww-confirmation h2 {
	font-size: 22px;
	margin: 0 0 12px;
	color: var(--wcww-color-text);
}

.wcww-confirmation p {
	color: var(--wcww-color-muted);
	max-width: 480px;
	margin: 0 auto 16px;
	font-size: 15px;
}

.wcww-confirmation .wcww-shipping-instructions {
	text-align: left;
	max-width: 480px;
	margin: 0 auto;
}

.wcww-confirmation .wcww-shipping-instructions p,
.wcww-confirmation .wcww-shipping-instructions ul,
.wcww-confirmation .wcww-shipping-instructions ol,
.wcww-confirmation .wcww-shipping-instructions li,
.wcww-confirmation .wcww-shipping-instructions h1,
.wcww-confirmation .wcww-shipping-instructions h2,
.wcww-confirmation .wcww-shipping-instructions h3,
.wcww-confirmation .wcww-shipping-instructions h4 {
	display: block !important;
}

.wcww-confirmation .wcww-shipping-instructions br {
	display: block !important;
	content: "" !important;
	margin: 0 !important;
}

.wcww-confirmation .wcww-shipping-instructions {
	white-space: pre-line;
}
