/* =========================================================
   Gestione Master – colore principale #d0104c
   Per cambiarlo basta modificare --gm-accent (e le due varianti).
   ========================================================= */
.gm-wrap {
	--gm-accent: #d0104c;
	--gm-accent-dark: #a50c3c;
	--gm-accent-soft: #fdeef3;
	--gm-text: #1d1f27;
	--gm-muted: #6b7080;
	--gm-border: #ececf1;
	--gm-ok: #12805c;
	--gm-ko: #b42318;
	--gm-wait: #b54708;
	--gm-radius: 14px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px 64px;
	color: var(--gm-text);
	box-sizing: border-box;
}
.gm-wrap *, .gm-wrap *::before, .gm-wrap *::after { box-sizing: border-box; }
.gm-ico { width: 18px; height: 18px; flex: none; }

/* ---------- Testata (archivi e scheda) ---------- */
.gm-hero {
	position: relative;
	background: linear-gradient(135deg, var(--gm-accent) 0%, var(--gm-accent-dark) 100%);
	color: #fff;
	border-radius: var(--gm-radius);
	padding: 32px 32px 36px;
	margin-bottom: 28px;
	overflow: hidden;
}
.gm-hero::after { /* decorazione discreta */
	content: ""; position: absolute; right: -60px; top: -60px;
	width: 220px; height: 220px; border-radius: 50%;
	border: 36px solid rgba(255, 255, 255, .08);
}
.gm-breadcrumb { font-size: 13px; opacity: .85; margin-bottom: 14px; }
.gm-breadcrumb a { color: inherit; text-decoration: none; }
.gm-breadcrumb a:hover { text-decoration: underline; }
.gm-archive__title, .gm-hero__title { color: #fff; margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; }
.gm-archive__desc, .gm-hero__lead { max-width: 760px; margin-top: 10px; opacity: .92; }
.gm-archive__desc p { margin: 0; }

/* ---------- Filtri ---------- */
.gm-filters {
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
	background: #fff; border: 1px solid var(--gm-border); border-top: 4px solid var(--gm-accent);
	border-radius: var(--gm-radius); padding: 18px 20px; margin: 0 0 8px;
	box-shadow: 0 6px 20px rgba(29, 31, 39, .05);
}
.gm-filter { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gm-muted); flex: 1 1 180px; }
.gm-filter select {
	appearance: none; -webkit-appearance: none;
	padding: 11px 36px 11px 12px; border: 1.5px solid var(--gm-border); border-radius: 10px;
	font-size: 15px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--gm-text);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d0104c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
	transition: border-color .2s;
}
.gm-filter select:focus { outline: none; border-color: var(--gm-accent); box-shadow: 0 0 0 3px var(--gm-accent-soft); }
.gm-reset { font-size: 14px; color: var(--gm-muted); align-self: center; text-decoration: none; }
.gm-reset:hover { color: var(--gm-accent); }
.gm-count { color: var(--gm-muted); font-size: 14px; margin: 14px 0 18px; }

/* ---------- Griglia card ---------- */
.gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.gm-card {
	position: relative; display: flex; flex-direction: column; background: #fff;
	border: 1.5px solid var(--gm-border); border-radius: var(--gm-radius); overflow: hidden;
	transition: border-color .2s, box-shadow .2s, transform .2s;
}
.gm-card::before { /* barra colorata in alto */
	content: ""; height: 4px; background: var(--gm-accent); display: block;
}
.gm-card:hover { border-color: var(--gm-accent); box-shadow: 0 12px 28px rgba(208, 16, 76, .14); transform: translateY(-3px); }
.gm-card__img img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gm-card__body { display: flex; flex-direction: column; gap: 12px; padding: 20px; flex: 1; }
.gm-card__ateneo {
	align-self: flex-start; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
	color: var(--gm-accent); background: var(--gm-accent-soft); padding: 4px 10px; border-radius: 999px;
}
.gm-card__title { font-size: 18px; line-height: 1.3; margin: 0; }
.gm-card__title a { color: inherit; text-decoration: none; }
.gm-card:hover .gm-card__title a { color: var(--gm-accent); }
.gm-card__meta { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--gm-muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.gm-card__meta li { display: flex; align-items: center; gap: 6px; }
.gm-card__meta .gm-ico { width: 16px; height: 16px; color: var(--gm-accent); }
.gm-card__btn { margin-top: auto; }

/* ---------- Stato iscrizioni (pillola) ---------- */
.gm-pill {
	align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
	font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
}
.gm-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.gm-pill--aperte { color: var(--gm-ok); background: #e7f6ef; }
.gm-pill--aperte i { animation: gm-pulse 1.8s infinite; }
.gm-pill--chiuse { color: var(--gm-ko); background: #fdecea; }
.gm-pill--in_arrivo { color: var(--gm-wait); background: #fef3e6; }
@keyframes gm-pulse { 0% { box-shadow: 0 0 0 0 rgba(18, 128, 92, .5); } 70% { box-shadow: 0 0 0 7px rgba(18, 128, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 128, 92, 0); } }

/* ---------- Bottoni ---------- */
.gm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--gm-accent); color: #fff !important; border: 2px solid var(--gm-accent);
	padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 14px; line-height: 1.2;
	text-transform: uppercase; letter-spacing: .03em; text-decoration: none !important; cursor: pointer;
	transition: background .2s, border-color .2s, transform .2s;
}
.gm-btn:hover { background: var(--gm-accent-dark); border-color: var(--gm-accent-dark); }
.gm-btn .gm-ico { width: 16px; height: 16px; transition: transform .2s; }
.gm-btn:hover .gm-ico { transform: translateX(3px); }
.gm-btn--ghost { background: #fff; color: var(--gm-accent) !important; }
.gm-btn--ghost:hover { background: var(--gm-accent-soft); border-color: var(--gm-accent); }
.gm-btn--ghost:hover .gm-ico { transform: translateY(2px); }
.gm-btn--full { display: flex; width: 100%; }

/* Paginazione */
.gm-pagination .nav-links { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.gm-pagination .page-numbers { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1.5px solid var(--gm-border); border-radius: 10px; color: var(--gm-text); text-decoration: none; font-weight: 600; }
.gm-pagination .page-numbers.current, .gm-pagination .page-numbers:hover { background: var(--gm-accent); border-color: var(--gm-accent); color: #fff; }

/* ---------- Scheda singola ---------- */
.gm-tags { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.gm-tag {
	font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
	background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .3);
}
.gm-tag:hover { background: #fff; color: var(--gm-accent); }
.gm-single .gm-hero { padding-bottom: 40px; }
.gm-single .gm-hero > * { position: relative; max-width: calc(100% - 380px); }
.gm-single__layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
.gm-single__img { width: 100%; height: auto; border-radius: var(--gm-radius); margin-bottom: 24px; }
.gm-section { margin-top: 32px; padding-left: 18px; border-left: 4px solid var(--gm-accent); }
.gm-section h2 { margin-top: 0; }

/* Box dettagli a destra */
.gm-box {
	position: sticky; top: 24px; margin-top: -90px; z-index: 2;
	background: #fff; border-radius: 18px; overflow: hidden;
	box-shadow: 0 20px 50px rgba(29, 31, 39, .14), 0 2px 6px rgba(29, 31, 39, .06);
	border: 1px solid var(--gm-border);
}
.gm-box__head {
	position: relative; padding: 22px 24px 24px;
	background: linear-gradient(160deg, #fff 0%, var(--gm-accent-soft) 100%);
	border-bottom: 1px dashed #f3c4d3;
}
.gm-box__head .gm-pill { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.gm-box__price { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.gm-box__price strong { flex-basis: 100%; font-size: 40px; line-height: 1; font-weight: 800; color: var(--gm-accent); letter-spacing: -.02em; }
.gm-box__price .gm-box__title { font-size: 22px; color: var(--gm-text); }
.gm-box__price small { flex-basis: 100%; color: var(--gm-muted); font-size: 13px; }
.gm-box__old { color: var(--gm-muted); text-decoration: line-through; font-size: 16px; }
.gm-box__badge { background: var(--gm-accent); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }

.gm-box__list { list-style: none; margin: 0; padding: 8px 24px; }
.gm-box__list li {
	display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 12px;
	padding: 12px 0; border-bottom: 1px solid var(--gm-border);
}
.gm-box__list li:last-child { border-bottom: 0; }
.gm-box__icon {
	grid-row: span 2; width: 38px; height: 38px; border-radius: 10px;
	display: flex; align-items: center; justify-content: center;
	background: var(--gm-accent-soft); color: var(--gm-accent);
}
.gm-box__label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--gm-muted); font-weight: 600; }
.gm-box__value { font-size: 15px; font-weight: 700; }
.gm-box__actions { display: flex; flex-direction: column; gap: 10px; padding: 4px 24px 24px; }
.gm-box__actions .gm-btn { padding: 14px 20px; font-size: 15px; }

@media (max-width: 900px) {
	.gm-single__layout { grid-template-columns: 1fr; }
	.gm-box { position: static; margin-top: 0; order: -1; }
	.gm-hero { padding: 24px 20px 28px; }
	.gm-single .gm-hero > * { max-width: none; }
}
