/* ============================================================
   Build my routine — 4 page template (page-templates/routine-*.php)
   Design: Figma "My SpaceWork" node 177-4537.
   Auto-caricato dal loader CSS ricorsivo (mu-plugin managed).
   Scope: .pmc-routine (main dei template).
   ============================================================ */

.pmc-routine {
	--pmc-serif: Lora, serif;
	--pmc-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--pmc-ink: #080707;        /* Text/Dark Chorcoal */
	--pmc-charcoal: #3f3a35;   /* Text/Chorcoal */
	--pmc-muted: #766f67;      /* Text/Light Chorcoal */
	--pmc-shadow: 0 8px 20px rgba(182, 160, 120, 0.5); /* Card shadow */
	background: linear-gradient(180deg, #fff3dd 0%, #e1cfac 100%);
	/* l'header Impreza è pos_fixed e coprirebbe lo stepper */
	padding-top: var(--header-height, 88px);
	padding-bottom: 0;
}

/* ---------- Stepper ---------- */

.pmc-routine__stepper {
	background: rgba(255, 255, 255, 0.5);
	padding: 16px 20px;
	overflow-x: auto;
}

.pmc-routine__stepper-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 40px;
	min-width: max-content;
	margin: 0 auto;
}

.pmc-routine__step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 180px;
	flex: none;
}

.pmc-routine__step.is-todo {
	opacity: 0.3;
}

/* gli step già completati sono link: nessun cambio di colore o dimensione,
   altrimenti uno step concluso sembrerebbe quello attivo */
a.pmc-routine__step {
	text-decoration: none;
	cursor: pointer;
}

a.pmc-routine__step:hover .pmc-routine__step-label {
	text-decoration: underline;
}

.pmc-routine__step-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 99px;
	background: #fff;
	font-family: var(--pmc-sans);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--pmc-ink);
}

.pmc-routine__step.is-active .pmc-routine__step-circle {
	border: 1px solid var(--pmc-ink);
	box-shadow: 0 8px 10px rgba(182, 160, 120, 0.5);
}

/* check.svg ha viewBox 72x72 col cerchio 32px al centro (20,12):
   lo si renderizza a 72px e si riallinea, così il cerchio resta 32px col suo glow */
.pmc-routine__step.is-done .pmc-routine__step-circle {
	background: none;
	position: relative;
}

.pmc-routine__step.is-done .pmc-routine__step-circle img {
	position: absolute;
	left: -20px;
	top: -12px;
	width: 72px;
	height: 72px;
	max-width: none;
	display: block;
}

.pmc-routine__step-label {
	font-family: var(--pmc-sans);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--pmc-ink);
	white-space: nowrap;
}

.pmc-routine__stepper-sep {
	width: 32px;
	height: 1px;
	background: var(--pmc-muted);
	flex: none;
}

/* ---------- Step 1: Let's begin ---------- */

.pmc-routine__intro {
	text-align: center;
	margin: 80px 0;
}

.pmc-routine__title {
	margin: 0 0 10px;
	font-family: var(--pmc-serif);
	font-size: 48px;
	font-style: italic;
	font-weight: 600;
	line-height: 1.2;
	color: var(--pmc-ink);
}

.pmc-routine__subtitle {
	margin: 0;
	font-family: var(--pmc-sans);
	font-size: 20px;
	line-height: 1.4;
	color: var(--pmc-charcoal);
}

.pmc-routine__categories {
	display: flex;
	gap: 24px;
	/* la larghezza arriva dal container del tema (.l-section-h, "Site content width"
	   di Impreza): qui solo i margini verticali */
	padding: 0 0 40px;
}

.pmc-routine__category {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	flex: 1 1 0;
	min-width: 0;
	height: 302px;
	padding: 0 40px 40px;
	border: 1px solid #fff;
	border-radius: 32px;
	background-color: #fff3dd;
	/* asset card-*.jpg già ritagliati 412:302 (il Figma stirava le foto verticali:
	   riprodurlo con background-size 100% 100% le deformava) */
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	box-shadow: var(--pmc-shadow);
	overflow: hidden;
	text-decoration: none;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* velo scuro dal 36% in giù, come da design */
.pmc-routine__category::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 36%, #000 100%);
	pointer-events: none;
}

/* La foto Skin originale di Figma è a colori: il trattamento monocromatico e
 * il gradiente restano effetti separati, sopra l'immagine. */
.pmc-routine__category--skin {
	background-image: none !important;
}

.pmc-routine__category--skin::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--pmc-card-image) center / cover no-repeat;
	filter: grayscale(100%);
	pointer-events: none;
}

.pmc-routine__category--skin::before {
	z-index: 1;
}

.pmc-routine__category--skin::after {
	z-index: 0;
}

.pmc-routine__category--skin .pmc-routine__category-text {
	z-index: 2;
}

.pmc-routine__category:hover {
	border: 2px solid #fff;
	box-shadow: 0 8px 10px rgba(0, 0, 0, 0.5);
}

.pmc-routine__category-text {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: center;
}

.pmc-routine__category-title {
	font-family: var(--pmc-serif);
	font-size: 40px;
	font-style: italic;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
}

.pmc-routine__category-tagline {
	font-family: var(--pmc-serif);
	font-size: 18px;
	font-style: italic;
	font-weight: 500;
	line-height: 1.2;
	color: #fff;
}

/* ---------- Hero categoria (step 2 e 4) ---------- */

.pmc-routine__hero {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	padding: 20px 40px;
	background-color: #fff3dd;
	background-size: cover;
	text-align: center;
}

.pmc-routine__hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
	pointer-events: none;
}

.pmc-routine__hero-title {
	position: relative;
	margin: 0;
	font-family: var(--pmc-serif);
	font-size: 48px;
	font-style: italic;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
}

.pmc-routine__hero-subtitle {
	position: relative;
	margin: 0;
	font-family: var(--pmc-serif);
	font-size: 24px;
	font-style: italic;
	font-weight: 500;
	line-height: 1.2;
	color: #fff;
}

/* ---------- Domande e opzioni (step 2 e 3) ---------- */

.pmc-routine__question-block {
	padding: 40px 0 80px;
}

/* step 3: nessun hero, blocco centrato in verticale */
.pmc-routine__question-block--centered {
	min-height: 460px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.pmc-routine__question {
	margin: 0 0 40px;
	font-family: var(--pmc-serif);
	font-size: 24px;
	font-style: italic;
	font-weight: 600;
	line-height: 1.2;
	color: var(--pmc-ink);
	text-align: center;
}

.pmc-routine__options {
	display: flex;
	align-items: stretch;
	gap: 24px;
}

.pmc-routine__option {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	min-width: 0;
	min-height: 176px;
	padding: 40px;
	border: 1px solid #fff;
	border-radius: 32px;
	background: rgba(255, 255, 255, 0.1);
	box-shadow: var(--pmc-shadow);
	text-align: center;
	text-decoration: none;
	transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pmc-routine__option:hover {
	background: #fff;
	border: 2px solid var(--pmc-ink);
	box-shadow: 0 8px 10px rgba(182, 160, 120, 0.9);
}

.pmc-routine__option-label {
	font-family: var(--pmc-serif);
	font-size: 18px;
	font-style: italic;
	font-weight: 700;
	line-height: 1.2;
	color: var(--pmc-ink);
}

/* ---------- Step 4: Your routine ---------- */

.pmc-routine__result-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 40px 0 0;
}

.pmc-routine__result-headings {
	flex: 1 1 0;
	min-width: 0;
}

.pmc-routine__result-title {
	margin: 0 0 8px;
	font-family: var(--pmc-serif);
	font-size: 32px;
	font-style: italic;
	font-weight: 600;
	line-height: 1.2;
	color: var(--pmc-ink);
}

.pmc-routine__result-sub {
	margin: 0;
	font-family: var(--pmc-sans);
	font-size: 14px;
	line-height: 1.4;
	color: var(--pmc-charcoal);
}

/* "perché questa routine": regola non negoziabile della result page */
.pmc-routine__result-why {
	margin: 8px 0 0;
	font-family: var(--pmc-sans);
	font-size: 14px;
	font-style: italic;
	line-height: 1.4;
	color: var(--pmc-ink);
}

/* card prodotto = Grid Layout 213 di Impreza (markup e CSS gestiti dal backend, non qui) */
/*
 * Solo spaziatura: il wrapper deve restare block. Con display:flex il grid
 * Impreza diventa flex item, le sue colonne in % si risolvono su una base
 * indefinita e la lista collassa a width:0 (card larghe pochi pixel).
 * Il gap tra le card lo mette il grid stesso (items_gap dello shortcode).
 */
.pmc-routine__products {
	padding: 160px 0 40px; /* spazio sopra le card, come da design */
}

/*
 * Con 1 o 2 prodotti (approccio "One product", o matrice con meno risultati)
 * le colonne del grid sono 1fr e la card si allargherebbe a tutta la riga,
 * sformata. Qui la colonna resta larga come nel grid a 3 e la riga si centra,
 * così la card è sempre la stessa di shop e archivi.
 * Il gap del grid è calc(var(--gap) * 2), quindi due gap = 4 * var(--gap).
 * Solo da 1025px: sotto è Impreza a ridurre --columns (2 fino a 1024, 1 fino
 * a 600) e le card devono restare fluide.
 */
@media (min-width: 1025px) {
	.w-grid.type_grid.pmc-routine-grid .w-grid-list {
		grid-template-columns: repeat(var(--columns, 1), minmax(0, calc((100% - 4 * var(--gap)) / 3)));
		justify-content: center;
	}
}

.pmc-routine__chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 12px;
	border: 1px solid rgba(37, 57, 112, 0.16);
	border-radius: 43px;
	background: #e6edff;
	font-family: var(--pmc-sans);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	color: #253970;
	white-space: nowrap;
}

.pmc-routine__result-head .w-btn {
	white-space: nowrap;
}

/* ---------- Sezione step ---------- */

.pmc-routine__steps-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
	margin-top: 80px;
	padding: 80px 40px;
	border-radius: 56px 56px 0 0;
	background: #f9f1e3;
}

.pmc-routine__steps-title {
	margin: 0 0 24px;
	font-family: var(--pmc-serif);
	font-size: 32px;
	font-style: italic;
	font-weight: 600;
	line-height: 1.2;
	color: var(--pmc-ink);
	text-align: center;
}

.pmc-routine__steps {
	display: flex;
	flex-direction: column;
	gap: 40px;
	width: 100%;
}

.pmc-routine__step-row {
	display: flex;
	align-items: center;
	width: 100%;
}

.pmc-routine__step-img {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 203px;
	flex: none;
	padding: 16px 0;
}

.pmc-routine__step-img img {
	max-height: 180px;
	max-width: 150px;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 6px 6px rgba(109, 95, 80, 0.19)) drop-shadow(0 1px 3px rgba(109, 95, 80, 0.22));
}

.pmc-routine__step-card {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex: 1 1 0;
	min-width: 0;
	padding: 40px;
	border-radius: 40px;
	background: #fff;
}

.pmc-routine__step-badge {
	position: absolute;
	left: 0;
	top: -17px;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--pmc-charcoal);
	font-family: var(--pmc-serif);
	font-size: 16px;
	font-style: italic;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}

.pmc-routine__step-body {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.pmc-routine__step-name {
	margin: 0 0 4px;
	font-family: var(--pmc-serif);
	font-size: 24px;
	font-style: italic;
	font-weight: 600;
	line-height: 1.2;
	color: var(--pmc-ink);
}

.pmc-routine__step-times {
	display: flex;
	align-items: center;
	gap: 16px;
}

.pmc-routine__step-time {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var(--pmc-sans);
	font-size: 14px;
	line-height: 1.4;
	color: var(--pmc-charcoal);
}

.pmc-routine__step-time img {
	width: 24px;
	height: 24px;
	display: block;
}

.pmc-routine__step-times-sep {
	width: 1px;
	align-self: stretch;
	background: var(--pmc-muted);
}

.pmc-routine__step-desc {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pmc-routine__step-desc p {
	margin: 0;
	font-family: var(--pmc-sans);
	font-size: 16px;
	line-height: 1.4;
	color: var(--pmc-ink);
}

.pmc-routine__step-desc .pmc-routine__step-note {
	font-size: 14px;
	color: var(--pmc-charcoal);
}

.pmc-routine__chip-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	padding: 10px 24px;
	border: 1px solid rgba(37, 57, 112, 0.16);
	border-radius: 999px;
	background: #e6edff;
	font-family: var(--pmc-sans);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: #262a42;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.2s ease;
}

.pmc-routine__chip-btn:hover {
	background: #d8e3ff;
	color: #262a42;
}

.pmc-routine__addall.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.pmc-routine__empty {
	padding: 80px 0;
	font-family: var(--pmc-sans);
	font-size: 16px;
	color: var(--pmc-charcoal);
	text-align: center;
}

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

@media (max-width: 1024px) {
	.pmc-routine__options {
		flex-wrap: wrap;
	}

	.pmc-routine__option {
		flex: 1 1 calc(50% - 12px);
		min-height: 140px;
	}

	.pmc-routine__steps-section {
		padding: 64px 24px;
	}
}

@media (max-width: 600px) {
	.pmc-routine__stepper-inner {
		justify-content: flex-start;
		gap: 16px;
	}

	.pmc-routine__step {
		width: auto;
	}

	/* mobile Figma 561:20611: gap 40 stepper/titolo/card, card 361x238, px 16 */
	.pmc-routine__intro {
		margin: 40px 0;
	}

	.pmc-routine__categories,
	.pmc-routine__question-block,
	.pmc-routine__result-head,
	.pmc-routine__products {
		padding-left: 16px;
		padding-right: 16px;
	}

	.pmc-routine__categories {
		flex-direction: column;
	}

	.pmc-routine__category {
		/* in colonna flex-basis 0 annullerebbe l'height */
		flex: 0 0 auto;
		height: 238px;
	}

	.pmc-routine__hero-title {
		font-size: 36px;
	}

	.pmc-routine__option {
		flex: 1 1 100%;
		min-height: 120px;
		padding: 24px;
	}

	.pmc-routine__question-block--centered {
		min-height: 0;
		padding-top: 56px;
		padding-bottom: 56px;
	}

	.pmc-routine__result-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}

	.pmc-routine__steps-section {
		padding: 56px 20px;
		border-radius: 32px 32px 0 0;
	}

	.pmc-routine__steps-title {
		font-size: 24px;
	}

	.pmc-routine__step-row {
		flex-direction: column;
		gap: 8px;
	}

	.pmc-routine__step-img {
		width: 100%;
		padding: 0 0 8px;
	}

	.pmc-routine__step-img img {
		max-height: 140px;
	}

	.pmc-routine__step-card {
		flex-direction: column;
		align-items: center;
		width: 100%;
		padding: 32px 20px 24px;
		text-align: center;
	}

	.pmc-routine__step-card .pmc-routine__step-body {
		align-items: center;
	}

	.pmc-routine__step-badge {
		left: 50%;
		transform: translateX(-50%);
	}

	.pmc-routine__step-times {
		justify-content: center;
	}
}
