/* Boutique du drop (design system 04/11) : onglet, puis grille de cartes posée sur les colonnes
   (bureau : 4 cartes de 3 colonnes ; tablette : 2 cartes de 4 ; téléphone : 2 cartes de 2), filets 1 px tracés
   au milieu des gouttières ; les filets horizontaux vont jusqu'aux bords de l'écran. Le texte de chaque carte démarre sur un bord de colonne.
   Carte : titre .t-nav, série et édition .t-small grises, prix .price-tag, image centrée avec de l'air. */

.shop {
	position: relative;
	z-index: 1;
	background: var(--c-white);
	color: var(--c-ink);
}

.tabs {
	display: flex;
	gap: var(--space-5);
	padding-block: var(--space-4);
}

.shopgrid {
	--per: 3; /* colonnes par carte */
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	column-gap: var(--gutter);
	margin: 0;
	padding: 0 var(--margin);
	list-style: none;
	border-top: var(--rule);
	border-bottom: var(--rule);
}

.card {
	position: relative;
	grid-column: span var(--per);
	min-width: 0;
}

/* Filet horizontal sous chaque carte, prolongé dans les gouttières et jusqu'aux bords de l'écran en début et
   fin de rangée ; la dernière rangée n'en a pas (le filet du bas de la grille, pleine largeur, la ferme).
   Ainsi une dernière rangée incomplète garde le filet sous les cartes de la rangée d'au-dessus. */
.card::before {
	content: "";
	position: absolute;
	bottom: 0;
	left: calc(-1 * var(--gutter) / 2);
	right: calc(-1 * var(--gutter) / 2);
	border-bottom: var(--rule);
}

/* Filet vertical, au milieu de la gouttière de droite (pas après la dernière carte d'une rangée) */
.card::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	right: calc(-1 * var(--gutter) / 2);
	border-right: var(--rule);
}

.card:nth-child(4n + 1)::before {
	left: calc(-1 * var(--margin));
}

.card:nth-child(4n)::before {
	right: calc(-1 * var(--margin));
}

.card:nth-child(4n)::after {
	content: none;
}

.card:nth-child(4n + 1):nth-last-child(-n + 4)::before,
.card:nth-child(4n + 1):nth-last-child(-n + 4) ~ .card::before {
	content: none;
}

.card__link {
	display: flex;
	flex-direction: column;
	gap: var(--space-7);
	height: 100%;
	padding: var(--pad) 0 var(--space-6);
	text-decoration: none;
}

.card__info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-1);
}

.card__se,
.card__ed {
	color: var(--c-grey);
}

.card__price {
	margin-top: var(--space-3);
}

.card__img {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
}

.card__img img {
	position: absolute;
	inset: 6%;
	width: 88%;
	height: 88%;
	object-fit: contain;
	filter: var(--shadow-print);
	transition: transform .3s var(--ease-out);
}

@media (hover: hover) {
	.card__link:hover .card__img img {
		transform: translateY(calc(-1 * var(--space-1)));
	}
}

.card__link:focus-visible {
	outline: var(--focus);
	outline-offset: var(--focus-offset);
}

/* Demande particulière : la phrase et le bouton (grand) sur la même ligne, alignés */
.ask {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-4) var(--space-6);
	padding-block: var(--space-8);
}

/* Tablette (2 cartes de 4 colonnes) et téléphone (2 cartes de 2 colonnes) : mêmes règles, par rangées de 2 */
@media (max-width: 1023px) {
	.shopgrid {
		--per: 4;
	}

	.card:nth-child(4n + 1)::before {
		left: calc(-1 * var(--gutter) / 2);
	}

	.card:nth-child(4n)::before {
		right: calc(-1 * var(--gutter) / 2);
	}

	.card:nth-child(4n)::after {
		content: "";
	}

	.card:nth-child(4n + 1):nth-last-child(-n + 4)::before,
	.card:nth-child(4n + 1):nth-last-child(-n + 4) ~ .card::before {
		content: "";
	}

	.card:nth-child(2n + 1)::before {
		left: calc(-1 * var(--margin));
	}

	.card:nth-child(2n)::before {
		right: calc(-1 * var(--margin));
	}

	.card:nth-child(2n)::after {
		content: none;
	}

	.card:nth-child(2n + 1):nth-last-child(-n + 2)::before,
	.card:nth-child(2n + 1):nth-last-child(-n + 2) ~ .card::before {
		content: none;
	}
}

@media (max-width: 639px) {
	.shopgrid {
		--per: 2;
	}
}

/* ---------- Sections du shop (08/11, Lorène) : Drop, Les incontournables, Mes favorites, Toutes les photos ---------- */
.shopsec + .shopsec {
	margin-top: var(--space-9);
}

.shopsec__head {
	display: flex;
	align-items: baseline;
	gap: var(--space-3);
	padding-block: var(--space-8) var(--space-5);
}

.shopsec__n {
	color: var(--c-grey);
}

/* Tri et filtre par série : des onglets du design system */
.shopbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-3) var(--space-6);
	padding-bottom: var(--space-5);
}

.shopbar__group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-5);
}

.shopbar .tab {
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.shopbar .tab[aria-pressed="true"] {
	color: var(--c-ink);
	border-bottom: var(--rule);
	border-color: currentColor;
}

/* Shop fermé */
.shut {
	display: grid;
	justify-items: center;
	gap: var(--space-5);
	padding-block: var(--space-10) var(--space-9);
	text-align: center;
}

.shut .nlf {
	width: min(100%, calc(6 * var(--col) + 5 * var(--gutter)));
	text-align: left;
}

/* Formulaire newsletter */
.nlf {
	display: grid;
	gap: var(--space-3);
}

.nlf__row {
	display: flex;
	align-items: end;
	gap: var(--space-3);
}

.nlf__field {
	flex: 1;
}

.nlf__ok {
	display: flex;
	align-items: start;
	gap: var(--space-2);
	color: var(--c-grey);
}

.nlf__ok input {
	flex: none;
	width: var(--space-4);
	height: var(--space-4);
	margin: 0;
	accent-color: var(--c-ink);
}

.nlf__ok a {
	color: inherit;
}

.nlf__status:empty {
	display: none;
}

/* Pop-up newsletter : panneau blanc centré, fond flouté (comme « Demander un tirage ») */
.nlp {
	width: min(100% - 2 * var(--margin), calc(5 * var(--col) + 4 * var(--gutter)));
	margin: auto;
	padding: 0;
	border: var(--rule);
	background: var(--c-white);
	color: var(--c-ink);
}

.nlp::backdrop {
	background: var(--c-veil);
	backdrop-filter: blur(var(--blur-photo));
	-webkit-backdrop-filter: blur(var(--blur-photo));
}

.nlp__in {
	display: grid;
	gap: var(--space-4);
	padding: var(--space-6);
}

.nlp__x {
	justify-self: end;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.nlp__early {
	margin: 0;
	color: var(--c-grey);
}

@media (max-width: 639px) {
	.nlp__in {
		padding: var(--space-5);
	}

	.nlf__row {
		flex-direction: column;
		align-items: stretch;
	}

	.shopbar {
		flex-direction: column;
	}
}

/* Recadrage d'affichage (08/11, Lorène : Life Somewhere en 4:3, coupée sur les côtés) */
.card__img--crop img {
	inset: 0;
	height: auto;
	max-height: 88%;
	margin: auto;
	aspect-ratio: var(--crop);
	object-fit: cover;
}

/* ---------- Onglets collants du shop (08/11, Lorène) : toujours visibles en haut, sous la navbar ---------- */
.shoptabs {
	position: sticky;
	top: var(--hdr-h);
	z-index: 3;
	background: var(--c-white);
	border-bottom: var(--rule);
}

.shoptabs__in {
	/* Le haut de la section = directement les intercalaires (08/11, Lorène) : pas d'espace ni de filet au-dessus */
	display: flex;
	align-items: flex-end;
	gap: 0;
	padding: 0; /* le premier intercalaire part du bord gauche de la section */
	overflow-x: auto;
	scrollbar-width: none;
}

.shoptabs__in::-webkit-scrollbar {
	display: none;
}

.shoptab {
	/* Intercalaires de classeur (08/11, Lorène) : coins du haut arrondis, posés sur le filet ; celui ouvert est noir */
	position: relative;
	display: flex;
	flex: none;
	align-items: baseline;
	gap: var(--space-2);
	min-height: 44px;
	margin-bottom: -1px;
	padding: var(--space-3) var(--space-5) var(--space-2);
	border: 1px solid var(--c-ink);
	border-bottom: 0;
	border-radius: 0 var(--space-4) 0 0; /* intercalaire : côté gauche droit, coin droit arrondi */
	background: var(--c-white);
	color: var(--c-ink);
	text-decoration: none;
	transition: background .25s ease, color .25s ease;
}

/* Les intercalaires se recouvrent comme dans un classeur : chacun glisse sous le coin arrondi du précédent,
   la ligne du haut ne se coupe jamais. Le premier est dessus, puis les suivants (z-index décroissant). */
.shoptab + .shoptab {
	margin-left: calc(-1 * var(--space-4));
	padding-left: calc(var(--space-5) + var(--space-4));
	border-left: 0;
}

.shoptab:nth-child(1) { z-index: 4; }
.shoptab:nth-child(2) { z-index: 3; }
.shoptab:nth-child(3) { z-index: 2; }
.shoptab:nth-child(4) { z-index: 1; }

.shoptab:first-child {
	border-left: 0; /* collé au bord de l'écran */
	padding-left: var(--margin);
}

.shoptab[aria-selected="true"] {
	/* L'intercalaire ouvert devient noir mais garde sa place dans la pile (14/11, Lorène) : il reste derrière le précédent */
	background: var(--c-ink);
	color: var(--c-white);
}

@media (hover: hover) {
	.shoptab:not([aria-selected="true"]):hover {
		background: var(--c-soft, #f2f2f2);
	}
}

.shoptab:focus-visible {
	outline: var(--focus);
	outline-offset: var(--focus-offset);
}

/* Titres du shop (onglets, archives, shop fermé) : interlettrage resserré, contour de 1 px (08/11, Lorène) */
.shoptab__t,
.shopsec__t,
.shut__t {
	letter-spacing: -0.03em;
	-webkit-text-stroke: 1px currentColor;
	paint-order: stroke fill;
}

.shoptab__n {
	color: currentColor;
	opacity: .6;
}

/* Dans un panneau, le titre est porté par l'onglet : on le garde pour les lecteurs d'écran seulement */
.shopsec.is-panel .shopsec__head {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.shopsec.is-panel {
	padding-top: var(--space-5);
}

.shopsec.is-panel + .shopsec.is-panel {
	margin-top: 0;
}

/* Collée en haut : un fond blanc remonte sous la navbar (rien ne passe derrière) — classe posée par shop.js */
.shoptabs::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: var(--hdr-h);
	background: var(--c-white);
	opacity: 0;
	pointer-events: none;
}

.shoptabs.is-stuck::before {
	opacity: 1;
}

/* Sous les onglets : un seul filet, puis directement les tirages (08/11, Lorène) */
.shopsec.is-panel {
	padding-top: 0;
}

.shopsec.is-panel .shopgrid {
	border-top: 0;
}

.shopsec.is-panel .shopbar {
	padding-top: var(--space-4);
	border-bottom: var(--rule);
}

/* Filtre « Par couleur » : pastilles de couleur avec le nombre de photos (08/11, Lorène) */
.shopbar__colors {
	align-items: center;
}

.shopdot {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--c-grey);
	cursor: pointer;
}

.shopdot i {
	display: block;
	width: var(--space-4);
	height: var(--space-4);
	border-radius: 50%;
	background: var(--dot);
	outline: 1px solid transparent;
	outline-offset: 3px;
	transition: outline-color .2s ease;
}

.shopdot[aria-pressed="true"] {
	color: var(--c-ink);
}

.shopdot[aria-pressed="true"] i {
	outline-color: var(--c-ink);
}

.shopdot:focus-visible {
	outline: var(--focus);
	outline-offset: var(--focus-offset);
}

.shopbar__n {
	color: var(--c-grey);
}

.shopbar__group[hidden] {
	display: none;
}

/* « Par couleur / Par série » : un interrupteur à deux cases (comme les boutons), bien distinct des filtres (08/11) */
.shopswitch {
	display: inline-flex;
	align-self: center;
	border: var(--rule);
	border-color: var(--c-ink);
}

.shopswitch__b {
	min-height: 44px;
	padding: 0 var(--space-5);
	border: 0;
	background: var(--c-white);
	color: var(--c-ink);
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.shopswitch__b + .shopswitch__b {
	border-left: var(--rule);
	border-color: var(--c-ink);
}

.shopswitch__b[aria-pressed="true"] {
	background: var(--c-ink);
	color: var(--c-white);
}

.shopswitch__b:focus-visible {
	outline: var(--focus);
	outline-offset: var(--focus-offset);
}

.shopbar {
	align-items: center;
}

/* Le filet sous les intercalaires est noir : ils sont posés dessus */
.shoptabs {
	border-bottom-color: var(--c-ink);
}

.shopsec__empty {
	padding-block: var(--space-9);
	color: var(--c-grey);
}

/* Téléphone (08/11, Lorène) : « Toutes » au lieu de « Toutes les photos », pour que les intercalaires tiennent */
.shoptab__short {
	display: none;
}

@media (max-width: 639px) {
	.shoptab__full {
		display: none;
	}

	.shoptab__short {
		display: inline;
	}

	.shoptab {
		padding-inline: var(--space-3);
	}

	.shoptab + .shoptab {
		padding-left: calc(var(--space-3) + var(--space-4));
	}

	.shoptab:first-child {
		padding-left: var(--margin);
	}
}

