:root {
	--main-color: #9b1b32;
	--main-color-text: #2c241f;
	--main-color-light: color-mix(in srgb, var(--main-color), white 82%);
	--main-color-dark: color-mix(in srgb, var(--main-color), black 18%);
	--vert-noel: #1f4d38;
	--gray-light: #f6f1ea;
	--gray: #e4d9cc;
	--black: #2c241f;
	--nav-hauteur: 4.75rem;
	--panier-largeur: 560px;
}

html {
	scroll-padding-top: calc(var(--nav-hauteur) + 1rem);
}

body {
	margin: 0;
	background-color: var(--gray-light);
	background-image: url('../images/bg-pattern.png');
	background-repeat: repeat;
	background-attachment: fixed;
	color: var(--black);
	font-family: 'Roboto', sans-serif;
	font-size: 1rem;
	line-height: 1.3;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-title {
	font-family: 'Bricolage Grotesque', sans-serif;
	color: var(--black);
	line-height: 1.3;
}

h1 {
	margin: 0 0 2.5rem;
	font-size: 1.5rem;
}

h2 {
	margin: 0 0 1rem;
	font-size: 1.35rem;
}

h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
}

p {
	margin-bottom: 0.6rem;
}

.shop-nav {
	position: fixed;
	top: 0;
	left: 0;
	right: var(--panier-largeur);
	z-index: 30;
	min-height: var(--nav-hauteur);
	padding: 0.75rem 0;
	background: #fff;
	box-shadow: 0 0 16px var(--gray);
}

.shop-nav .navbar-brand {
	font-family: 'Bricolage Grotesque', sans-serif;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--black);
}

.shop-nav .navbar-brand:hover,
.shop-nav .nav-link:hover,
.shop-nav .nav-link.is-current {
	color: var(--main-color);
}

.shop-nav .nav-link {
	color: var(--black);
	font-weight: 500;
	padding: 0.5rem 0.85rem;
}

.shop-nav .navbar-toggler {
	border-color: var(--gray);
}

.shop-page {
	margin-right: var(--panier-largeur);
	padding-top: var(--nav-hauteur);
}

/* Page de commande : pas de colonne panier, pleine largeur */
.page-commande .shop-nav {
	right: 0;
}

.page-commande .shop-page {
	margin-right: 0;
}

.bloc {
	width: 100%;
	margin-bottom: 1.5rem;
	padding: 1.5rem;
	border-radius: 1rem;
	background: #fff;
}

.categorie-photo {
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: 0.7rem;
	background: var(--gray-light);
}

.categorie-texte a {
	color: var(--main-color);
	text-decoration: none;
}

.article-carte {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	height: 100%;
	padding: 0 1.1rem 1.1rem;
	overflow: hidden;
	border: 2px solid var(--main-color);
	border-radius: 1rem;
	background: #fff;
	text-align: center;
}

.article-photo {
	display: block;
	width: calc(100% + 2.2rem);
	max-width: none;
	height: auto;
	margin: 0 -1.1rem;
	background: transparent;
}

.article-carte p {
	margin-bottom: 0;
}

.article-description {
	font-size: 0.95rem;
	line-height: 1.5;
}

.article-prix {
	margin-top: auto;
	font-weight: 700;
}

.article-stock {
	font-size: 0.85rem;
	opacity: 0.7;
}

.btn-principal {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	padding: 0.5rem 1.5rem;
	border: 1px solid var(--main-color);
	border-radius: 1.2rem;
	background: var(--main-color);
	color: #fff;
	font-size: 1rem;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s linear, border-color 0.2s linear;
}

.btn-principal:hover,
.btn-principal:focus {
	border-color: var(--main-color-dark);
	background: var(--main-color-dark);
	color: #fff;
}

.btn-principal.revert {
	background: #fff;
	color: var(--main-color);
}

.btn-principal.revert:hover,
.btn-principal.revert:focus {
	background: var(--main-color);
	color: #fff;
}

.article-carte .btn-principal {
	width: 100%;
}

.btn-principal:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.panier-colonne {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 20;
	display: flex;
	flex-direction: column;
	width: var(--panier-largeur);
	height: 100vh;
	background: #fff;
	box-shadow: 0 0 16px var(--gray);
}

.panier-entete {
	display: flex;
	align-items: center;
	min-height: var(--nav-hauteur);
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--gray);
}

.panier-entete h2 {
	margin: 0;
	font-size: 1.25rem;
}

.panier-badge {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0.15rem 0.55rem;
	border-radius: 0.2rem;
	background: var(--main-color);
	color: #fff;
	font-family: 'Roboto', sans-serif;
	font-size: 0.85rem;
	font-weight: 500;
}

.panier-corps {
	flex: 1 1 auto;
	overflow: auto;
	padding: 1.25rem;
}

.panier-pied {
	padding: 1rem 1.25rem 1.25rem;
	border-top: 1px solid var(--gray);
	background: #fff;
}

.panier-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	font-size: 1.1rem;
	font-weight: 700;
}

.panier-vide {
	opacity: 0.7;
}

.panier-message {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	font-size: 0.95rem;
}

.panier-message.ok {
	background: color-mix(in srgb, var(--vert-noel), white 85%);
}

.panier-message.erreur {
	background: var(--main-color-light);
}

.panier-ligne {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	white-space: nowrap;
}

.panier-ligne + .panier-ligne {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--gray);
}

.panier-ligne-photo {
	width: 48px;
	height: 48px;
	flex: 0 0 auto;
	object-fit: contain;
	border-radius: 0.4rem;
	background: #fff;
}

.panier-nom {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.panier-prix,
.panier-ligne-total {
	flex: 0 0 auto;
}

.panier-quantite {
	width: 4.25rem;
	flex: 0 0 auto;
	padding: 0.35rem 0.5rem;
	border: 1px solid var(--main-color);
	border-radius: 0.3rem;
	color: var(--black);
	font-size: 1rem;
}

.panier-quantite:focus {
	outline: none;
	border-color: var(--main-color-dark);
}

.panier-retirer {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	border: none;
	border-radius: 0.4rem;
	background: transparent;
	color: var(--main-color);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.panier-retirer .bi {
	pointer-events: none;
}

.bi {
	font-family: 'bootstrap-icons';
}

.panier-commander {
	width: 100%;
	margin-top: 1rem;
}

/* Page de commande */
.commande-table {
	width: 100%;
	border-collapse: collapse;
}

.commande-table th,
.commande-table td {
	padding: 0.6rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid var(--gray);
}

.commande-table thead th {
	font-family: 'Bricolage Grotesque', sans-serif;
}

.commande-col-centre {
	text-align: center;
}

.commande-col-droite {
	text-align: right;
}

.commande-table tfoot td {
	font-weight: 700;
	border-bottom: none;
	border-top: 2px solid var(--gray);
}

.commande-form .field {
	margin-bottom: 1rem;
}

.commande-form label.left {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3rem;
}

.commande-form input.text,
.commande-form input[type="text"],
.commande-form input[type="email"] {
	width: 100%;
	max-width: 420px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--gray);
	border-radius: 0.4rem;
	font-size: 1rem;
	line-height: 1.3;
	color: var(--black);
}

.commande-form input.text:focus,
.commande-form input[type="text"]:focus,
.commande-form input[type="email"]:focus {
	outline: none;
	border-color: var(--main-color);
}

.commande-form .message {
	margin: 0 0 1rem;
	padding: 0.6rem 0.9rem;
	border-radius: 0.4rem;
	font-size: 0.95rem;
}

.commande-form span.message,
.commande-form .message.required,
.commande-form .message.validation {
	display: inline-block;
	margin: 0.3rem 0 0;
	padding: 0.2rem 0.5rem;
	background: var(--main-color-light);
	color: var(--main-color-dark);
}

.commande-form .message.good {
	background: color-mix(in srgb, var(--vert-noel), white 85%);
	color: var(--black);
}

.commande-form .message.bad {
	background: var(--main-color-light);
	color: var(--main-color-dark);
}

.commande-form input.action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.5rem;
	padding: 0.5rem 1.75rem;
	border: 1px solid var(--main-color);
	border-radius: 1.2rem;
	background: var(--main-color);
	color: #fff;
	font-size: 1rem;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.2s linear, border-color 0.2s linear;
}

.commande-form input.action:hover,
.commande-form input.action:focus {
	border-color: var(--main-color-dark);
	background: var(--main-color-dark);
}

.commande-form input.action:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* ==========================================================================
   Touches de Noël
   ========================================================================== */

/* Contact sur la page de commande : conserver les retours à la ligne */
.commande-contact {
	white-space: pre-line;
}

/* Ligne d'acceptation des conditions */
.commande-consent label {
	position: relative;
	display: block;
	padding-left: 1.6rem;
	font-weight: 400;
	line-height: 1.4;
	cursor: pointer;
}

.commande-consent input[type="checkbox"] {
	position: absolute;
	left: 0;
	top: 0.2rem;
}

.commande-consent a {
	color: var(--main-color);
}

/* Icône sapin dans le logo */
.shop-brand-icon {
	color: var(--vert-noel);
	margin-right: 0.4rem;
}

.shop-nav .navbar-brand:hover .shop-brand-icon {
	color: var(--vert-noel);
}

/* Icône cadeau dans l'en-tête du panier */
.panier-entete h2 .panier-icone {
	color: var(--main-color);
	margin-right: 0.45rem;
}

/* Neige qui tombe (décorative, non interactive) */
.neige {
	position: fixed;
	inset: 0;
	z-index: 9999;
	overflow: hidden;
	pointer-events: none;
}

.neige span {
	position: absolute;
	top: -5vh;
	color: #8fb8da;
	text-shadow: 0 0 5px rgba(255, 255, 255, 0.9), 0 0 2px rgba(42, 36, 31, 0.25);
	opacity: 0.9;
	user-select: none;
	animation-name: neige-chute;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

@keyframes neige-chute {
	0% {
		transform: translateY(0) translateX(0) rotate(0deg);
	}
	100% {
		transform: translateY(105vh) translateX(2.5vw) rotate(360deg);
	}
}

.neige span:nth-child(1)  { left: 4%;  font-size: 0.9rem;  animation-duration: 11s; animation-delay: 0s; }
.neige span:nth-child(2)  { left: 12%; font-size: 1.3rem;  animation-duration: 14s; animation-delay: 2s; }
.neige span:nth-child(3)  { left: 20%; font-size: 0.75rem; animation-duration: 9s;  animation-delay: 1s; }
.neige span:nth-child(4)  { left: 28%; font-size: 1.1rem;  animation-duration: 13s; animation-delay: 4s; }
.neige span:nth-child(5)  { left: 37%; font-size: 0.85rem; animation-duration: 10s; animation-delay: 0.5s; }
.neige span:nth-child(6)  { left: 45%; font-size: 1.4rem;  animation-duration: 16s; animation-delay: 3s; }
.neige span:nth-child(7)  { left: 54%; font-size: 0.8rem;  animation-duration: 12s; animation-delay: 1.5s; }
.neige span:nth-child(8)  { left: 62%; font-size: 1.15rem; animation-duration: 15s; animation-delay: 5s; }
.neige span:nth-child(9)  { left: 70%; font-size: 0.9rem;  animation-duration: 10.5s; animation-delay: 2.5s; }
.neige span:nth-child(10) { left: 78%; font-size: 1.25rem; animation-duration: 14.5s; animation-delay: 0.8s; }
.neige span:nth-child(11) { left: 86%; font-size: 0.75rem; animation-duration: 9.5s; animation-delay: 3.5s; }
.neige span:nth-child(12) { left: 93%; font-size: 1.05rem; animation-duration: 13.5s; animation-delay: 1.2s; }

@media (prefers-reduced-motion: reduce) {
	.neige {
		display: none;
	}
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Masqués par défaut (desktop) : bouton flottant, voile et fermeture du panier */
.panier-flottant,
.panier-overlay,
.panier-fermer {
	display: none;
}

/* Écrans intermédiaires : réduire la largeur de la colonne panier */
@media (max-width: 1199.98px) {
	:root {
		--panier-largeur: 420px;
	}
}

/* Tablette portrait et mobile : mise en page sur une seule colonne,
   le panier devient un tiroir coulissant. */
@media (max-width: 991.98px) {
	.shop-nav {
		right: 0;
	}

	.shop-page {
		margin-right: 0;
	}

	/* Le panier : tiroir masqué hors écran par défaut */
	.panier-colonne {
		width: min(90vw, var(--panier-largeur));
		z-index: 1045;
		transform: translateX(100%);
		transition: transform 0.25s ease;
	}

	body.panier-ouvert .panier-colonne {
		transform: translateX(0);
	}

	/* Voile sombre derrière le tiroir ouvert */
	.panier-overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1040;
		background: rgba(0, 0, 0, 0.45);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0.25s ease;
	}

	body.panier-ouvert .panier-overlay {
		opacity: 1;
		visibility: visible;
	}

	/* Bouton flottant d'ouverture du panier */
	.panier-flottant {
		position: fixed;
		right: 1rem;
		bottom: 1rem;
		z-index: 1030;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 3.5rem;
		height: 3.5rem;
		border: none;
		border-radius: 50%;
		background: var(--main-color);
		color: #fff;
		font-size: 1.4rem;
		box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
		cursor: pointer;
	}

	.panier-flottant-badge {
		position: absolute;
		top: -0.25rem;
		right: -0.25rem;
		min-width: 1.4rem;
		height: 1.4rem;
		padding: 0 0.35rem;
		border-radius: 0.7rem;
		background: var(--vert-noel);
		color: #fff;
		font-family: 'Roboto', sans-serif;
		font-size: 0.8rem;
		font-weight: 700;
		line-height: 1.4rem;
		text-align: center;
	}

	/* Bouton de fermeture dans l'en-tête du panier */
	.panier-fermer {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		margin-left: auto;
		padding: 0;
		border: none;
		background: transparent;
		color: var(--black);
		font-size: 1.4rem;
		line-height: 1;
		cursor: pointer;
	}

	/* Lignes du panier : réorganisées sur deux rangées pour les écrans étroits
	   (ligne 1 : photo + nom + corbeille ; ligne 2 : prix + quantité + total). */
	.panier-ligne {
		flex-wrap: wrap;
		white-space: normal;
		row-gap: 0.5rem;
	}

	.panier-nom {
		flex: 1 1 auto;
	}

	.panier-retirer {
		order: 1;
	}

	.panier-prix {
		order: 2;
	}

	.panier-quantite {
		order: 3;
		margin-right: auto;
	}

	.panier-ligne-total {
		order: 4;
	}
}
