/* ==========================================================================
   CartTrigger Product Recommender — Wizard Modal
   ========================================================================== */

body.ctwrec-modal-open {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */

.ctwrec-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	animation: ctwrec-fade-in 0.3s ease forwards;
}

.ctwrec-modal[hidden] {
	display: none;
}

.ctwrec-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(7, 10, 28, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */

.ctwrec-panel {
	position: relative;
	z-index: 1;
	background: #fff;
	width: 100%;
	max-width: 620px;
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 0;
	padding: 2.5rem;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	animation: ctwrec-slide-up 0.25s ease forwards;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.ctwrec-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.ctwrec-header-text {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ctwrec-label {
	font-family: var(--font-mono, "JetBrains Mono", monospace);
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: var(--color-terra-600, #9a5a3a);
}

.ctwrec-title {
	margin: 0;
	font-family: var(--font-grotesk, "Space Grotesk", sans-serif);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-blu-900, #1a2340);
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.ctwrec-close {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
	border: none;
	color: rgba(26, 35, 64, 0.3);
	cursor: pointer;
	transition: color 0.2s;
	margin-top: 2px;
}

.ctwrec-close:hover {
	color: var(--color-blu-900, #1a2340);
}

/* --------------------------------------------------------------------------
   Progress bar
   -------------------------------------------------------------------------- */

.ctwrec-progress-bar {
	height: 2px;
	background: rgba(0, 0, 0, 0.06);
	margin: 0 0 0.5rem;
}

.ctwrec-progress-fill {
	height: 100%;
	background: var(--color-blu-900, #1a2340);
	transition: width 0.3s ease;
}

.ctwrec-step-counter {
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: rgba(0, 0, 0, 0.35);
	margin-bottom: 1.75rem;
}

/* --------------------------------------------------------------------------
   Body
   -------------------------------------------------------------------------- */

.ctwrec-body {
	/* padding handled by panel */
}

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */

.ctwrec-step-question {
	margin: 0 0 0.375rem;
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: rgba(0, 0, 0, 0.38);
}

.ctwrec-step-hint {
	margin: 0 0 1.25rem;
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.28);
	letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Options (radio & checkbox)
   -------------------------------------------------------------------------- */

.ctwrec-options {
	display: flex;
	flex-direction: column;
}

.ctwrec-options--grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 2rem;
}

.ctwrec-option {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 0;
	cursor: pointer;
	font-family: var(--font-inter, sans-serif);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-blu-900, #1a2340);
	user-select: none;
	transition: color 0.15s;
}

.ctwrec-option:hover {
	color: var(--color-blu-800, #243060);
}

/* Radio — square */
.ctwrec-option input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	min-width: 16px;
	flex-shrink: 0;
	border: 1.5px solid rgba(0, 45, 90, 0.3);
	border-radius: 0;
	background: #fff;
	cursor: pointer;
	position: relative;
	margin: 0;
	transition: border-color 0.2s, background-color 0.2s;
}

.ctwrec-option input[type="radio"]:checked {
	background-color: var(--color-blu-900, #1a2340);
	border-color: var(--color-blu-900, #1a2340);
	box-shadow: inset 0 0 0 3.5px #fff;
}

.ctwrec-option input[type="radio"]:hover:not(:checked) {
	border-color: var(--color-blu-900, #1a2340);
}

/* Checkbox — square with checkmark */
.ctwrec-option input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	min-width: 16px;
	flex-shrink: 0;
	border: 1.5px solid rgba(0, 45, 90, 0.3);
	border-radius: 0;
	background: #fff;
	cursor: pointer;
	position: relative;
	margin: 0;
	transition: border-color 0.2s, background-color 0.2s;
}

.ctwrec-option input[type="checkbox"]:checked {
	background-color: var(--color-blu-900, #1a2340);
	border-color: var(--color-blu-900, #1a2340);
}

.ctwrec-option input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 5px;
	height: 9px;
	border: 1.5px solid #fff;
	border-top: none;
	border-left: none;
	transform: translate(-50%, -60%) rotate(45deg);
}

.ctwrec-option input[type="checkbox"]:hover:not(:checked) {
	border-color: var(--color-blu-900, #1a2340);
}

.ctwrec-option input:focus-visible {
	outline: 2px solid var(--color-blu-800, #243060);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Validation hint
   -------------------------------------------------------------------------- */

.ctwrec-validation-hint {
	margin: 0.5rem 0 0;
	font-size: 0.8rem;
	color: #c0392b;
}

/* --------------------------------------------------------------------------
   Loading
   -------------------------------------------------------------------------- */

.ctwrec-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 3rem 0;
	text-align: center;
	color: rgba(0, 0, 0, 0.45);
	font-size: 0.8rem;
	font-family: var(--font-mono, monospace);
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.ctwrec-loading p {
	margin: 0;
}

.ctwrec-spinner {
	width: 1.5rem;
	height: 1.5rem;
	border: 2px solid rgba(26, 35, 64, 0.12);
	border-top-color: var(--color-blu-900, #1a2340);
	border-radius: 50%;
	animation: ctwrec-spin 0.7s linear infinite;
}

/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */

.ctwrec-results-intro {
	margin: 0 0 1.25rem;
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: rgba(0, 0, 0, 0.38);
}

.ctwrec-results__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
}

.ctwrec-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ctwrec-card {
	display: flex;
	gap: 1rem;
	padding: 1rem 0;
	border-bottom: 1px solid rgba(0, 45, 90, 0.06);
}

.ctwrec-card:first-child {
	border-top: 1px solid rgba(0, 45, 90, 0.06);
}

.ctwrec-card__image {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	object-fit: cover;
}

.ctwrec-card__body {
	flex: 1;
	min-width: 0;
}

.ctwrec-card__name {
	margin: 0 0 0.25rem;
	font-family: var(--font-grotesk, sans-serif);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-blu-900, #1a2340);
}

.ctwrec-card__reason {
	margin: 0 0 0.5rem;
	font-size: 0.8rem;
	color: rgba(0, 0, 0, 0.45);
	line-height: 1.5;
}

.ctwrec-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.ctwrec-card__price {
	font-family: var(--font-grotesk, sans-serif);
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--color-blu-900, #1a2340);
}

.ctwrec-card__link {
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--color-blu-900, #1a2340);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ctwrec-card__link:hover {
	color: var(--color-terra-600, #9a5a3a);
}

/* --------------------------------------------------------------------------
   Reason tag injected into archive product cards
   -------------------------------------------------------------------------- */

.ctprec-reason-tag {
	padding: 0.75rem 0.875rem;
	margin-bottom: 1.25rem;
	background: rgba(154, 90, 58, 0.055);
	border-left: 2px solid rgba(154, 90, 58, 0.45);
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	line-height: 1.7;
	font-style: italic;
	color: var(--color-terra-600, #9a5a3a);
	letter-spacing: 0.01em;
}

.ctprec-reason-tag::before {
	content: 'PARA TI';
	display: block;
	font-style: normal;
	font-weight: 600;
	font-size: 9px;
	letter-spacing: 0.15em;
	margin-bottom: 0.3rem;
	opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Error
   -------------------------------------------------------------------------- */

.ctwrec-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding: 2.5rem 0;
	text-align: center;
}

.ctwrec-error p {
	margin: 0;
	font-size: 0.875rem;
	color: rgba(0, 0, 0, 0.45);
}

.ctwrec-error-detail {
	width: 100%;
	margin: 0;
	padding: 0.75rem 1rem;
	background: #fff3f3;
	border: 1px solid #fcc;
	border-radius: 0;
	font-family: var(--font-mono, monospace);
	font-size: 0.75rem;
	color: #c0392b;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-all;
	text-align: left;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.ctwrec-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding-top: 2rem;
	margin-top: 1.75rem;
	border-top: 1px solid rgba(26, 35, 64, 0.08);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.ctwrec-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-grotesk, sans-serif);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	padding: 1rem 1.75rem;
	border: none;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	line-height: 1;
}

.ctwrec-btn--primary {
	background: var(--color-blu-900, #1a2340);
	color: #fff;
	flex: 1;
}

.ctwrec-btn--primary:hover,
.ctwrec-btn--primary:focus-visible {
	background: var(--color-blu-950, #0d1220);
	outline: none;
}

.ctwrec-btn--ghost {
	background: transparent;
	color: rgba(26, 35, 64, 0.4);
	padding-left: 0;
}

.ctwrec-btn--ghost:hover,
.ctwrec-btn--ghost:focus-visible {
	color: var(--color-blu-900, #1a2340);
	outline: none;
}

/* --------------------------------------------------------------------------
   Recommender notice (above shop loop)
   -------------------------------------------------------------------------- */

.ctwrec-notice {
	margin-bottom: 1.5rem;
	padding: 0.875rem 1.25rem;
	background: rgba(26, 35, 64, 0.04);
	border-left: 3px solid var(--color-blu-900, #1a2340);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.ctwrec-notice p {
	margin: 0;
	font-size: 0.875rem;
	color: var(--color-blu-900, #1a2340);
}

.ctwrec-notice__actions {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex-shrink: 0;
}

.ctwrec-notice__btn {
	font-family: var(--font-grotesk, sans-serif);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	background: var(--color-blu-900, #1a2340);
	color: #fff;
	border: none;
	padding: 0.5rem 1rem;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
}

.ctwrec-notice__btn:hover {
	background: var(--color-blu-950, #0d1220);
}

.ctwrec-notice__link {
	font-size: 0.8rem;
	color: rgba(26, 35, 64, 0.5);
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
	transition: color 0.15s;
}

.ctwrec-notice__link:hover {
	color: var(--color-blu-900, #1a2340);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes ctwrec-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes ctwrec-slide-up {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}

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

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.ctwrec-modal {
		padding: 0;
		align-items: flex-end;
	}

	.ctwrec-panel {
		max-height: 92dvh;
		padding: 2rem 1.5rem 1.5rem;
	}

	.ctwrec-options--grid {
		grid-template-columns: 1fr;
	}
}

/* ── Shortcode trigger button ─────────────────────────────────────────────── */
.ctprec-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	background: var(--color-blu-900, #1a1a2e);
	color: #fff;
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 0.75rem 1.5rem;
	border: none;
	cursor: pointer;
	transition: background 0.3s ease;
}

.ctprec-trigger:hover {
	background: var(--color-blu-950, #0d0d1a);
}
