/* ==========================================================================
   Good Uniforme — E-Boutique shop layout (archive + category pages)
   ========================================================================== */

.gu-shop-head,
.gu-shop {
	--gu-shop-width: 1320px;
	--gu-shop-pad: clamp(1rem, 4vw, 2rem);
}

/* --------------------------------------------------------------------------
   Header: breadcrumbs, H1, SEO intro, quote buttons
   -------------------------------------------------------------------------- */
.gu-shop-head {
	background: var(--gu-surface);
	border-bottom: 1px solid var(--gu-line);
}
.gu-shop-head__inner {
	max-width: var(--gu-shop-width);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--40) var(--gu-shop-pad);
}
.gu-shop-head .gu-breadcrumbs ol { margin-bottom: 1rem; }
.gu-shop-head__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.25rem 2.5rem;
}
.gu-shop-head__text { flex: 1 1 560px; min-width: 0; }
.gu-shop-head__title {
	margin: 0;
	font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
	line-height: 1.15;
	text-wrap: balance;
}
.gu-shop-head__lead { margin-top: .75rem; max-width: 78ch; color: var(--gu-muted); line-height: 1.65; }
.gu-shop-head__lead p { margin: 0; }
.gu-shop-head__lead p + p { margin-top: .5rem; }
.gu-shop-head__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.gu-shop-head__actions .gu-btn { padding-block: .7rem; }

/* --------------------------------------------------------------------------
   Layout: sidebar + products
   -------------------------------------------------------------------------- */
.gu-shop {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
	max-width: var(--gu-shop-width);
	margin: 0 auto !important;
	padding: var(--wp--preset--spacing--40) var(--gu-shop-pad) var(--wp--preset--spacing--60);
	scroll-margin-top: 6rem;
}
.gu-shop > * { margin: 0 !important; }
.gu-shop__main { min-width: 0; }

.gu-shop__sidebar {
	position: sticky;
	top: calc(var(--wp--custom--header-height, 88px) + 1.25rem);
	max-height: calc(100vh - var(--wp--custom--header-height, 88px) - 2.5rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding-right: .25rem;
}
.gu-shop__sidebar-head, .gu-shop__backdrop { display: none; }

.gu-shop-box { margin: 0; }
.gu-shop-box + .gu-shop-box { padding-top: 1.25rem; border-top: 1px solid var(--gu-line); }
.gu-shop-box__title {
	margin: 0 0 .6rem;
	padding: 0;
	color: var(--gu-navy);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

/* Category tree */
.gu-shop-cats ul { margin: 0; padding: 0; list-style: none; }
.gu-shop-cats a { color: var(--gu-navy); text-decoration: none; }
.gu-shop-cats__all,
.gu-shop-cats__parent {
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .4rem .5rem;
	border-radius: var(--gu-radius-s);
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.25;
	transition: background-color .15s var(--gu-ease), color .15s var(--gu-ease);
}
.gu-shop-cats__all { margin-bottom: .35rem; }
.gu-shop-cats__list { display: grid; gap: .15rem; }
.gu-shop-cats__row { display: flex; align-items: center; }
.gu-shop-cats__row > a { flex: 1; min-width: 0; }
.gu-shop-cats__name { flex: 1; min-width: 0; }

.gu-shop-cats__all:hover, .gu-shop-cats__parent:hover { background: var(--gu-surface); }
.gu-shop-cats__all[aria-current="page"],
.gu-shop-cats__parent[aria-current="page"] { background: var(--gu-surface); color: var(--gu-accent); }
.gu-shop-cats__item.is-open > .gu-shop-cats__row .gu-shop-cats__parent:not([aria-current]) { color: var(--gu-navy); }

.gu-shop-cats__toggle {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 2rem; height: 2rem;
	margin-left: .15rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--gu-muted);
	cursor: pointer;
}
.gu-shop-cats__toggle:hover { background: var(--gu-surface); color: var(--gu-navy); }
.gu-shop-cats__toggle svg { transition: transform .2s var(--gu-ease); }
.gu-shop-cats__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.gu-shop-cats__sub { margin: .1rem 0 .4rem .9rem !important; padding-left: .6rem !important; border-left: 1px solid var(--gu-line); }
.gu-shop-cats__child {
	position: relative;
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem .5rem;
	border-radius: var(--gu-radius-s);
	color: #475066 !important;
	font-size: .85rem;
	line-height: 1.3;
}
.gu-shop-cats__child:hover { color: var(--gu-accent) !important; }
.gu-shop-cats__child[aria-current="page"] { color: var(--gu-accent) !important; font-weight: 700; }
.gu-shop-cats__child[aria-current="page"]::before {
	content: "";
	position: absolute;
	left: calc(-.6rem - 1px);
	top: .3rem; bottom: .3rem;
	width: 2px;
	border-radius: 2px;
	background: var(--gu-accent);
}

/* "Pas sur la liste ?" — special order */
.gu-shop-special {
	padding: 1rem;
	border: 1.5px dashed var(--gu-line);
	border-radius: var(--gu-radius-m);
	text-align: center;
}
.gu-shop-special__text { margin: 0 0 .6rem; color: var(--gu-navy); font: 700 .9rem var(--wp--preset--font-family--heading); }
.gu-shop-special__btn { display: flex; box-sizing: border-box; width: 100%; justify-content: center; padding: .7rem 1rem; font-size: var(--wp--preset--font-size--small); box-shadow: none; }

.gu-shop-help {padding: 1.1rem 1.15rem !important; border: 0 !important; border-radius: var(--gu-radius-m); background: var(--gu-navy); color: rgba(255, 255, 255, .8); font-size: .875rem; line-height: 1.55; }
.gu-shop-help p { margin: 0 0 .6rem; }
.gu-shop-help__title { color: #fff; font: 800 1rem / 1.25 var(--wp--preset--font-family--heading); }
.gu-shop-help .gu-contact { color: #fff; font-weight: 700; text-decoration: none; }

/* --------------------------------------------------------------------------
   Toolbar
   -------------------------------------------------------------------------- */
.gu-shop-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1rem;
	margin-bottom: 1.25rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--gu-line);
}
.gu-shop-bar__form { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; flex: 1 1 520px; order: 2; justify-content: flex-end; }
.gu-shop-bar__meta { display: flex; align-items: center; gap: .75rem; order: 1; }
.gu-shop-bar__count { margin: 0; color: var(--gu-muted); font-size: var(--wp--preset--font-size--small); font-weight: 600; }

.gu-shop-bar__search {
	display: flex;
	align-items: center;
	gap: .5rem;
	flex: 0 1 320px;
	padding: 0 .9rem;
	border: 1px solid var(--gu-line);
	border-radius: 999px;
	background: #fff;
	color: var(--gu-muted);
	transition: border-color .15s var(--gu-ease);
}
.gu-shop-bar__search:focus-within { border-color: var(--gu-navy); }
.gu-shop-bar__search input {
	flex: 1;
	min-width: 0;
	padding: .6rem 0;
	border: 0;
	background: transparent;
	color: var(--gu-navy);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
}
.gu-shop-bar__search input:focus { outline: none; }

.gu-shop-bar__sort { display: flex; align-items: center; gap: .5rem; color: var(--gu-muted); font-size: var(--wp--preset--font-size--small); white-space: nowrap; }
.gu-shop-bar__sort select {
	appearance: none;
	padding: .6rem 2.2rem .6rem .9rem;
	border: 1px solid var(--gu-line);
	border-radius: 999px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23030F27' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right .8rem center / 14px no-repeat;
	color: var(--gu-navy);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.gu-shop-bar__sort select:focus-visible { outline: 2px solid var(--wp--preset--color--amber); outline-offset: 2px; }

.gu-shop-bar__filters {
	display: none;
	align-items: center;
	gap: .5rem;
	padding: .6rem 1rem;
	border: 1px solid var(--gu-navy);
	border-radius: 999px;
	background: #fff;
	color: var(--gu-navy);
	font: 700 var(--wp--preset--font-size--small) var(--wp--preset--font-family--heading);
	cursor: pointer;
}
.gu-shop-bar__badge { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; border-radius: 999px; background: var(--gu-accent); color: #fff; font-size: .7rem; }

.gu-shop-bar__chips { display: flex; flex-wrap: wrap; gap: .4rem; flex-basis: 100%; order: 3; margin: 0; padding: 0; list-style: none; }
.gu-shop-bar__chips a {
	display: inline-flex;
	gap: .4rem;
	padding: .3rem .75rem;
	border-radius: 999px;
	background: var(--gu-surface);
	color: var(--gu-navy);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	text-decoration: none;
}
.gu-shop-bar__chips a:hover { background: var(--gu-navy); color: #fff; }

/* --------------------------------------------------------------------------
   Product cards (shop variant: tighter, quote button)
   -------------------------------------------------------------------------- */
.gu-shop-grid .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 1rem !important; }
.gu-shop-grid .gu-card { border-radius: 10px; }
.gu-shop-grid .gu-card:hover { transform: translateY(-2px); }
.gu-shop-grid .gu-card__media,
.gu-shop-grid .gu-card__media--empty { aspect-ratio: 1 !important; background: #fff; border-bottom: 1px solid var(--gu-line); }
.gu-shop-grid .gu-card__media img { padding: .5rem; object-fit: contain !important; }
.gu-shop-grid .gu-card__media .gu-card__alt { object-fit: contain; background: #fff; }
.gu-shop-grid .wp-block-post-featured-image.gu-card__media--empty { background: var(--gu-surface) url("../images/logo.png") center / 46% auto no-repeat; }
.gu-shop-grid .gu-card:hover .gu-card__media img { transform: scale(1.03); }
.gu-shop-grid .gu-card__body { gap: .3rem; padding: .65rem .75rem .75rem; }
.gu-shop-grid .gu-card__title { font-size: .875rem !important; line-height: 1.3; }
.gu-shop-grid .gu-swatch__dot { width: .85rem; height: .85rem; }
.gu-shop-grid .gu-swatches { gap: .3rem; }
.gu-shop-grid .gu-card__cta { padding-top: .2rem; font-size: .75rem; }
.gu-shop-grid .gu-card__cta::after { content: none; }
.gu-shop-grid .gu-card__price { font-size: .95rem; }
.gu-card__quote {
	position: relative;
	z-index: 2;
	display: block;
	margin-top: .35rem !important;
	padding: .4rem .5rem;
	border-radius: 6px;
	box-shadow: inset 0 0 0 1.5px var(--gu-navy);
	color: var(--gu-navy);
	font: 700 .72rem var(--wp--preset--font-family--heading);
	text-align: center;
	text-decoration: none;
	transition: background-color .2s var(--gu-ease), color .2s var(--gu-ease);
}
.gu-card__quote:hover, .gu-card__quote:focus-visible { background: var(--gu-navy); color: #fff; }
@media (max-width: 1180px) and (min-width: 1024px), (max-width: 860px) { .gu-shop-grid .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 600px) { .gu-shop-grid .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .6rem !important; } }
.gu-shop-grid .gu-pagination { margin-top: var(--wp--preset--spacing--40) !important; }
.gu-shop-grid .gu-empty { padding: 3rem 1rem; border: 1px dashed var(--gu-line); border-radius: var(--gu-radius-m); color: var(--gu-muted); }

/* Empty listing: special request ([gu_shop_empty]) */
.gu-shop-empty {
	display: flex; flex-direction: column; align-items: center;
	padding: 3rem 1.5rem;
	border: 1px dashed var(--gu-line);
	border-radius: var(--gu-radius-m);
	background: var(--wp--preset--color--cream);
	text-align: center;
}
.gu-shop-empty__icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 56px; height: 56px; margin-bottom: 1rem;
	border-radius: 50%;
	background: #fff;
	color: var(--wp--preset--color--accent);
	box-shadow: 0 6px 16px rgba(3, 15, 39, .08);
}
.gu-shop-empty__icon .gu-icon { width: 26px; height: 26px; }
.gu-shop-empty__title { max-width: 32ch; margin: 0 0 .6rem; color: var(--gu-navy); font: 800 1.35rem/1.25 var(--wp--preset--font-family--heading); text-wrap: balance; }
.gu-shop-empty__text { max-width: 52ch; margin: 0 0 1.4rem; color: var(--gu-muted); line-height: 1.65; }
.gu-shop-empty .gu-devis { justify-content: center; }

/* --------------------------------------------------------------------------
   Tablet & mobile: sidebar becomes a drawer
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
	.gu-shop { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.gu-shop-bar__filters { display: inline-flex; }

	.gu-shop__sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 1000;
		width: min(340px, 88vw);
		max-height: none;
		padding: 0 1.25rem 2rem;
		background: #fff;
		box-shadow: 0 0 40px rgba(3, 15, 39, .2);
		transform: translateX(-105%);
		visibility: hidden;
		transition: transform .3s var(--gu-ease), visibility 0s linear .3s;
	}
	.gu-shop.is-open .gu-shop__sidebar { transform: none; visibility: visible; transition: transform .3s var(--gu-ease); }
	.gu-shop__sidebar-head {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 -1.25rem;
		padding: .9rem 1.25rem;
		background: #fff;
		border-bottom: 1px solid var(--gu-line);
	}
	.gu-shop-cats .gu-shop-box__title { display: none; }
	.gu-shop-cats { padding-top: 1rem; }
	.gu-shop__sidebar-title { margin: 0; color: var(--gu-navy); font: 800 1.1rem var(--wp--preset--font-family--heading); }
	.gu-shop__close { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 50%; background: var(--gu-surface); color: var(--gu-navy); cursor: pointer; }
	.gu-shop__backdrop { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(3, 15, 39, .45); }
	.gu-shop__backdrop[hidden] { display: none; }
	.admin-bar .gu-shop__sidebar { top: var(--wp-admin--admin-bar--height, 46px); }
}

@media (max-width: 781px) {
	.gu-shop-head__inner { padding-block: 1.5rem; }
	.gu-shop-head__actions { width: 100%; }
	.gu-shop-head__actions .gu-btn { flex: 1; justify-content: center; }
	.gu-shop-bar__form { flex-basis: 100%; justify-content: stretch; }
	.gu-shop-bar__search { flex: 1 1 100%; }
	.gu-shop-bar__sort { flex: 1; justify-content: space-between; }
	.gu-shop-bar__meta { flex: 1 1 100%; justify-content: space-between; }
}

@media (max-width: 600px) {
	.gu-card__quote { padding: .5rem; font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
	.gu-shop__sidebar, .gu-shop-cats__toggle svg { transition: none !important; }
}
