/* ==========================================================================
   TattooClub — Network / offline states (styles)
   Existing design tokens: ink #111111, ivory #F9F5EF, line #E7E2D8, muted
   #68645E, electric green #B7E41C (retry / recovery), red #E24C4C (genuine
   errors), orange (timeout), neutral grey (offline / service unavailable).
   ========================================================================== */

.tc-net-state, .tc-net-banner, .tc-net-dialog {
	--net-ink: #111111;
	--net-ivory: #F9F5EF;
	--net-line: #E7E2D8;
	--net-muted: #68645E;
	--net-green: #B7E41C;
	--net-green-strong: #A5D10F;
	--net-red: #E24C4C;
	--net-orange: #E8890C;
	font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	box-sizing: border-box;
}
.tc-net-state *, .tc-net-banner *, .tc-net-dialog * { box-sizing: border-box; }

/* Host whose essential content failed: only the state is shown. */
.tc-net-has-state > :not(.tc-net-state) { display: none !important; }
.tc-net-has-state { display: block !important; }

/* ------------------------------------------------------------ State */
.tc-net-state {
	grid-column: 1 / -1;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	padding: 48px 24px 40px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 14px;
	color: var(--net-ink);
}
.tc-net-state--compact { padding: 40px 20px 28px; }
.tc-net-state__icon { position: relative; color: var(--net-ink); line-height: 0; margin-bottom: 4px; }
.tc-net-state__icon svg { width: 64px; height: 64px; stroke-width: 1.5; }
.tc-net-state__badge {
	position: absolute; right: -6px; bottom: -2px;
	width: 22px; height: 22px; border-radius: 50%;
	background: var(--net-red); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 0 0 3px #fff;
}
.tc-net-state__badge svg { width: 12px; height: 12px; stroke-width: 3; }
.tc-net-state__icon--timeout,
.tc-net-state__icon--unavailable { color: var(--net-ink); }
.tc-net-state__icon--timeout .tc-net-state__badge,
.tc-net-state__icon--unavailable .tc-net-state__badge { display: none; }

.tc-net-state .tc-net-state__title {
	margin: 0; font-family: inherit;
	font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em;
	color: var(--net-ink); text-transform: none;
}
.tc-net-state .tc-net-state__text {
	margin: 0; max-width: 440px;
	font-size: 15px; line-height: 1.55; color: var(--net-muted);
}
.tc-net-state .tc-net-state__note { margin: 0; font-size: 13.5px; color: var(--net-ink); font-weight: 600; min-height: 0; }
.tc-net-state .tc-net-state__note:empty { display: none; }
.tc-net-state__actions {
	display: flex; flex-direction: column; align-items: stretch; gap: 10px;
	width: 100%; max-width: 320px; margin-top: 8px;
}

/* Buttons (retry = electric green) */
.tc-net-state .tc-net-btn, .tc-net-dialog .tc-net-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 50px; padding: 0 22px; margin: 0;
	border-radius: 10px; border: 1.5px solid transparent;
	font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.1;
	letter-spacing: normal; text-transform: none; text-decoration: none;
	cursor: pointer; box-shadow: none; width: 100%;
	transition: background .15s ease, border-color .15s ease;
}
.tc-net-state .tc-net-btn svg, .tc-net-dialog .tc-net-btn svg { width: 18px; height: 18px; stroke-width: 2.2; flex: 0 0 auto; }
.tc-net-state .tc-net-btn--primary, .tc-net-dialog .tc-net-btn--primary { background: var(--net-green); color: var(--net-ink); }
.tc-net-state .tc-net-btn--primary:hover, .tc-net-dialog .tc-net-btn--primary:hover { background: var(--net-green-strong); color: var(--net-ink); }
.tc-net-state .tc-net-btn--ghost, .tc-net-dialog .tc-net-btn--ghost { background: #fff; color: var(--net-ink); border-color: var(--net-line); }
.tc-net-state .tc-net-btn--ghost:hover, .tc-net-dialog .tc-net-btn--ghost:hover { border-color: var(--net-ink); color: var(--net-ink); }
.tc-net-state .tc-net-btn:disabled, .tc-net-dialog .tc-net-btn:disabled { opacity: .65; cursor: progress; }
.tc-net-state .tc-net-btn:focus-visible, .tc-net-dialog .tc-net-btn:focus-visible { outline: 2px solid var(--net-ink); outline-offset: 2px; }

.tc-net-state .tc-net-state__help { font-size: 13.5px; color: var(--net-ink); text-decoration: underline; text-underline-offset: 3px; margin-top: 4px; }

/* "En attendant ?" (offline) */
.tc-net-state__meanwhile { width: 100%; max-width: 480px; margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--net-line); }
.tc-net-state__meanwhile p { margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--net-ink); }
.tc-net-state__meanwhile ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tc-net-state__meanwhile li { margin: 0; }
.tc-net-state__meanwhile a, .tc-net-state__meanwhile li > span {
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	font-size: 12.5px; line-height: 1.35; color: var(--net-muted); text-decoration: none;
}
.tc-net-state__meanwhile a:hover { color: var(--net-ink); }
.tc-net-state__meanwhile svg { width: 22px; height: 22px; color: var(--net-ink); }

/* ------------------------------------------------------------ Dialog */
.tc-net-dialog {
	position: fixed; inset: 0;
	/* Above Quick View (2147482000) and the search overlay; below toasts. */
	z-index: 2147482500;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
}
.tc-net-dialog__backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .55); opacity: 0; transition: opacity .2s ease; }
.tc-net-dialog__panel {
	position: relative; width: min(440px, 100%);
	max-height: calc(100vh - 40px); overflow-y: auto;
	background: #fff; border-radius: 16px;
	box-shadow: 0 24px 64px rgba(17, 17, 17, .3);
	opacity: 0; transform: translateY(10px) scale(.98);
	transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.tc-net-dialog.is-open .tc-net-dialog__backdrop { opacity: 1; }
.tc-net-dialog.is-open .tc-net-dialog__panel { opacity: 1; transform: none; }
.tc-net-dialog .tc-net-state { padding: 40px 28px 28px; max-width: none; }
.tc-net-dialog .tc-net-state__title { font-size: 21px; }
.tc-net-dialog .tc-net-state__text { font-size: 14.5px; }
.tc-net-dialog .tc-net-state__icon svg { width: 52px; height: 52px; }
.tc-net-dialog .tc-net-state__actions { max-width: none; }
.tc-net-dialog__x {
	position: absolute; top: 10px; right: 10px; z-index: 2;
	width: 40px; height: 40px; padding: 0; margin: 0; min-height: 0;
	display: flex; align-items: center; justify-content: center;
	border: 0; border-radius: 50%; background: transparent; color: var(--net-ink); cursor: pointer; box-shadow: none;
}
.tc-net-dialog__x:hover { background: var(--net-ivory); }
.tc-net-dialog__x:focus-visible { outline: 2px solid var(--net-ink); outline-offset: 2px; }
.tc-net-dialog--timeout .tc-net-state__icon { color: var(--net-ink); }

/* ------------------------------------------------------------ Banner */
.tc-net-banner {
	position: fixed; left: 50%; transform: translateX(-50%);
	top: 0; z-index: 2147481000;
	width: min(560px, calc(100% - 24px));
	margin-top: 8px;
	display: flex; align-items: center; gap: 12px;
	padding: 10px 8px 10px 16px;
	border-radius: 10px;
	background: #111111; color: #F9F5EF;
	box-shadow: 0 10px 28px rgba(17, 17, 17, .25);
	font-size: 14px; font-weight: 600;
}
.tc-net-banner[hidden] { display: none; }
.tc-net-banner svg { flex: 0 0 auto; }
.tc-net-banner span { flex: 1 1 auto; }
.tc-net-banner .tc-net-banner__close {
	flex: 0 0 auto; width: 40px; height: 40px; padding: 0; margin: 0; min-height: 0;
	display: flex; align-items: center; justify-content: center;
	border: 0; border-radius: 50%; background: transparent; color: #F9F5EF; cursor: pointer; box-shadow: none;
}
.tc-net-banner .tc-net-banner__close:hover { background: rgba(249, 245, 239, .12); }
.tc-net-banner .tc-net-banner__close:focus-visible { outline: 2px solid #B7E41C; outline-offset: 1px; }

/* Quick View embeds the compact state. */
.tc-qv__netstate { padding: 24px 12px; }

@media (max-width: 767px) {
	.tc-net-state { padding: 40px 20px 32px; gap: 12px; }
	.tc-net-state .tc-net-state__title { font-size: 22px; }
	.tc-net-state .tc-net-state__text { font-size: 14px; }
	.tc-net-state__actions { max-width: none; }
	/* Mobile: "En attendant ?" as a list, like the mockup */
	.tc-net-state__meanwhile ul { grid-template-columns: 1fr; gap: 4px; }
	.tc-net-state__meanwhile a, .tc-net-state__meanwhile li > span {
		flex-direction: row; gap: 12px; padding: 10px 4px; font-size: 14px; color: var(--net-ink);
	}
	.tc-net-dialog { padding: 16px; }
	.tc-net-dialog .tc-net-state { padding: 36px 20px 22px; }
	/* Full-width discreet bar under the header */
	.tc-net-banner { width: 100%; left: 0; transform: none; margin-top: 0; border-radius: 0; padding: 8px 6px 8px 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.tc-net-dialog__backdrop, .tc-net-dialog__panel { transition: none; }
	.tc-net-dialog__panel { transform: none; }
}
