/**
 * eBoots — Account sheet (login/registrazione, sketch 016 A).
 * SITE-WIDE per utenti non loggati (markup in templates/parts/account-sheet.php,
 * logica in assets/js/account-sheet.js).
 *  - MOBILE (≤768px): bottom-sheet che sale dal basso (pattern taglia/carrello).
 *  - DESKTOP (>768px): modale centrata.
 * Il modale account nativo di Blocksy (#account-modal) è disattivato: l'icona
 * header apre questo pannello.
 */

/* Disattiva modale e dropdown account di Blocksy: usiamo i nostri pannelli. */
#account-modal { display: none !important; }
.ct-header-account .ct-header-account-dropdown { display: none !important; }

/* blocco scroll quando il pannello è aperto */
html.eb-account-lock, html.eb-account-lock body { overflow: hidden; }

/* ---- overlay ---- */
.eb-account {
	position: fixed;
	inset: 0;
	z-index: 99999;
	visibility: hidden;
	font-family: var(--font-ui);
}
.eb-account.is-open { visibility: visible; }

.eb-account__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	opacity: 0;
	transition: opacity 0.28s ease;
}
.eb-account.is-open .eb-account__scrim { opacity: 1; }

/* ---- sheet / modale ---- */
.eb-account__sheet {
	position: absolute;
	background: linear-gradient(180deg, #131313, var(--surface) 40%);
	color: var(--txt);
	border: 1px solid var(--line-strong);
	box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
	padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
	overflow-y: auto;
}

/* MOBILE: bottom-sheet */
@media (max-width: 768px) {
	.eb-account__sheet {
		left: 0;
		right: 0;
		bottom: 0;
		max-height: 90vh;
		border-radius: 22px 22px 0 0;
		border-bottom: 0;
		transform: translateY(100%);
	}
	.eb-account.is-open .eb-account__sheet { transform: translateY(0); }
}

/* DESKTOP: modale centrata */
@media (min-width: 769px) {
	.eb-account__sheet {
		left: 50%;
		top: 50%;
		width: 420px;
		max-width: calc(100vw - 48px);
		max-height: calc(100vh - 64px);
		border-radius: var(--radius-lg);
		padding: 18px 24px 24px;
		transform: translate(-50%, -48%);
		opacity: 0;
	}
	.eb-account.is-open .eb-account__sheet { transform: translate(-50%, -50%); opacity: 1; }
	.eb-account__grab { display: none; }
}

.eb-account__grab {
	display: block;
	width: 42px;
	height: 4px;
	border-radius: 3px;
	background: var(--line-strong);
	margin: 2px auto 14px;
}
.eb-account__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--muted);
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.eb-account__close:hover { color: var(--txt); border-color: var(--line-strong); }

.eb-account__eyebrow {
	margin: 0 0 4px;
	font-weight: 700;
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--volt);
}
.eb-account__title {
	margin: 0 0 16px;
	font-family: var(--font-d);
	font-weight: 800;
	font-size: 28px;
	line-height: 1;
	text-transform: uppercase;
	color: var(--txt);
}

/* ---- toggle Accedi/Registrati (stile EU/UK size-sheet) ---- */
.eb-account__seg {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	background: var(--surface-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-pill);
	padding: 4px;
	margin-bottom: 18px;
}
.eb-account__seg-btn {
	border: 0;
	background: transparent;
	color: var(--muted);
	font-family: var(--font-d);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 9px 0;
	border-radius: var(--radius-pill);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}
.eb-account__seg-btn.is-active { background: var(--volt); color: #0a0a0a; }

/* ---- campi (label flottanti, pattern cassa 013) ---- */
.eb-account__fld { position: relative; margin: 0 0 12px; }
.eb-account__fld input {
	width: 100%;
	background: var(--surface-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	color: var(--txt);
	font-family: var(--font-ui);
	font-size: 15px;
	padding: 20px 44px 8px 14px;
	outline: none;
	transition: border-color 0.15s ease;
}
.eb-account__fld input:focus { border-color: var(--volt); }
.eb-account__fld label {
	position: absolute;
	left: 14px;
	top: 14px;
	color: var(--muted);
	font-size: 14px;
	pointer-events: none;
	transition: all 0.15s ease;
	max-width: calc(100% - 56px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.eb-account__fld input:focus + label,
.eb-account__fld input:not(:placeholder-shown) + label {
	top: 6px;
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.eb-account__fld.is-invalid input { border-color: #ff5a5a; }

.eb-account__eye {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: 0;
	color: var(--muted);
	cursor: pointer;
	padding: 6px;
	transition: color 0.15s ease;
}
.eb-account__eye:hover, .eb-account__eye.is-on { color: var(--volt); }
.eb-account__eye svg { width: 18px; height: 18px; display: block; }

/* ---- riga ricordami / password dimenticata ---- */
.eb-account__aux {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 2px 0 16px;
}
.eb-account__chk {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--muted);
	font-size: 12.5px;
	line-height: 1.45;
	cursor: pointer;
}
.eb-account__chk input {
	appearance: none;
	-webkit-appearance: none;
	width: 17px;
	height: 17px;
	min-width: 17px;
	margin: 1px 0 0;
	border: 1px solid var(--line-strong);
	border-radius: 4px;
	background: var(--surface-2);
	cursor: pointer;
	position: relative;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.eb-account__chk input:checked { background: var(--volt); border-color: var(--volt); }
.eb-account__chk input:checked::after {
	content: '✓';
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #0a0a0a;
	font-size: 11px;
	font-weight: 800;
}
.eb-account__chk a { color: var(--txt); text-decoration: underline; text-underline-offset: 2px; }
.eb-account__chk--privacy { margin: 4px 0 16px; }
.eb-account__chk.is-invalid { color: #ff8080; }
.eb-account__chk.is-invalid input { border-color: #ff5a5a; }

.eb-account__lost {
	color: var(--muted);
	font-size: 12.5px;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.15s ease;
}
.eb-account__lost:hover { color: var(--txt); }

/* ---- errore ---- */
.eb-account__err[hidden] { display: none; }
.eb-account__err {
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 90, 90, 0.1);
	border: 1px solid rgba(255, 90, 90, 0.4);
	color: #ff9c9c;
	border-radius: var(--radius-md);
	font-size: 12.5px;
	padding: 10px 12px;
	margin: 0 0 14px;
}
.eb-account__err.is-shaking { animation: eb-account-shake 0.3s ease; }
@keyframes eb-account-shake {
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

/* ---- CTA ---- */
.eb-account__cta {
	display: block;
	width: 100%;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--volt);
	color: #0a0a0a;
	font-family: var(--font-d);
	font-weight: 800;
	font-size: 16px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	padding: 15px 0;
	cursor: pointer;
	position: relative;
	transition: transform 0.12s ease, filter 0.15s ease;
}
.eb-account__cta:hover { filter: brightness(1.06); }
.eb-account__cta:active { transform: scale(0.985); }
.eb-account__cta.is-loading { color: transparent; pointer-events: none; }
.eb-account__cta.is-loading::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2.5px solid rgba(10, 10, 10, 0.25);
	border-top-color: #0a0a0a;
	border-radius: 50%;
	animation: eb-account-spin 0.7s linear infinite;
}
@keyframes eb-account-spin { to { transform: rotate(360deg); } }
.eb-account__cta--ghost {
	background: transparent;
	border: 1px solid var(--line-strong);
	color: var(--txt);
}
.eb-account__cta--ghost:hover { border-color: var(--volt); color: var(--volt); filter: none; }

/* ---- ospite ---- */
.eb-account__guest {
	margin: 16px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--line);
	text-align: center;
	color: var(--muted);
	font-size: 12.5px;
}
.eb-account__guest-link {
	background: transparent;
	border: 0;
	padding: 0;
	color: var(--txt);
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

/* ---- successo ---- */
.eb-account__done { text-align: center; padding: 18px 0 6px; }
.eb-account__done-ring {
	display: grid;
	place-items: center;
	width: 62px;
	height: 62px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: rgba(199, 247, 63, 0.12);
	border: 1px solid var(--volt);
	color: var(--volt);
}
.eb-account__done-ring svg { width: 28px; height: 28px; }
.eb-account__done-title {
	margin: 0 0 6px;
	font-family: var(--font-d);
	font-weight: 800;
	font-size: 26px;
	text-transform: uppercase;
}
.eb-account__done-sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }

/* =========================================================================
   MENU ACCOUNT (loggati, sketch 017 B "Identità + taglia").
   MOBILE: bottom-sheet come sopra. DESKTOP: dropdown ancorato all'icona
   header (posizionato dal JS su --eb-accmenu-top/right), con freccetta.
   ====================================================================== */
html.eb-accmenu-lock, html.eb-accmenu-lock body { overflow: hidden; }

.eb-accmenu {
	position: fixed;
	inset: 0;
	z-index: 99999;
	visibility: hidden;
	font-family: var(--font-ui);
}
.eb-accmenu.is-open { visibility: visible; }

.eb-accmenu__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	opacity: 0;
	transition: opacity 0.28s ease;
}
.eb-accmenu.is-open .eb-accmenu__scrim { opacity: 1; }

.eb-accmenu__panel {
	position: absolute;
	background: linear-gradient(180deg, #131313, var(--surface) 40%);
	color: var(--txt);
	border: 1px solid var(--line-strong);
	box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
	padding: 10px 18px 22px;
}

@media (max-width: 768px) {
	.eb-accmenu__panel {
		left: 0;
		right: 0;
		bottom: 0;
		max-height: 88vh;
		overflow-y: auto;
		border-radius: 22px 22px 0 0;
		border-bottom: 0;
		transform: translateY(100%);
	}
	.eb-accmenu.is-open .eb-accmenu__panel { transform: translateY(0); }
}

@media (min-width: 769px) {
	/* Dropdown ancorato: niente scrim pieno, chiude il click fuori (JS). */
	.eb-accmenu__scrim { background: transparent; }
	.eb-accmenu__panel {
		left: auto;
		top: var(--eb-accmenu-top, 70px);
		right: var(--eb-accmenu-right, 16px);
		width: 300px;
		border-radius: var(--radius-lg);
		box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
		padding: 16px 16px 14px;
		transform: translateY(-6px);
		opacity: 0;
		transform-origin: top right;
	}
	.eb-accmenu.is-open .eb-accmenu__panel { transform: translateY(0); opacity: 1; }
	.eb-accmenu__panel::before {
		content: '';
		position: absolute;
		top: -5px;
		right: 18px;
		width: 9px;
		height: 9px;
		background: #131313;
		border-left: 1px solid var(--line-strong);
		border-top: 1px solid var(--line-strong);
		transform: rotate(45deg);
	}
	.eb-accmenu__grab { display: none; }
}

.eb-accmenu__grab {
	display: block;
	width: 42px;
	height: 4px;
	border-radius: 3px;
	background: var(--line-strong);
	margin: 2px auto 14px;
}

/* identità */
.eb-accmenu__id { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.eb-accmenu__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--volt);
	color: #0a0a0a;
	display: grid;
	place-items: center;
	font-family: var(--font-d);
	font-weight: 800;
	font-size: 20px;
	flex: 0 0 auto;
}
.eb-accmenu__who { min-width: 0; display: grid; }
.eb-accmenu__hello {
	font-family: var(--font-d);
	font-weight: 800;
	font-size: 20px;
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--txt);
}
.eb-accmenu__mail {
	font-size: 12.5px;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* chip taglia */
.eb-accmenu__size {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	margin: 0 0 12px;
	background: rgba(199, 247, 63, 0.07);
	border: 1px solid rgba(199, 247, 63, 0.35);
	border-radius: var(--radius-pill);
	font-size: 13px;
	color: var(--txt);
}
.eb-accmenu__size svg { width: 18px; height: 18px; color: var(--volt); flex: 0 0 auto; }
.eb-accmenu__size-tx { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-accmenu__size-tx b { font-family: var(--font-d); font-weight: 800; letter-spacing: 0.03em; }
.eb-accmenu__size-cta {
	margin-left: auto;
	background: none;
	border: 0;
	padding: 0;
	color: var(--volt);
	font-family: var(--font-ui);
	font-size: 12px;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

/* voci in card */
.eb-accmenu__cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eb-accmenu__cards a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--surface-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	text-decoration: none;
	color: var(--txt);
	font-size: 14px;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.eb-accmenu__cards a:hover { border-color: var(--line-strong); background: #1b1b1b; }
.eb-accmenu__cards svg { width: 19px; height: 19px; color: var(--volt); flex: 0 0 auto; }
.eb-accmenu__cards small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.eb-accmenu__arr { margin-left: auto; color: var(--muted); }

/* esci */
.eb-accmenu__out {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
	padding: 11px 0;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: var(--radius-pill);
	color: var(--muted);
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.eb-accmenu__out:hover { color: #ff8080; border-color: rgba(255, 90, 90, 0.5); }
.eb-accmenu__out svg { width: 16px; height: 16px; }
