* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background: #faf7f5;
	color: #333;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #ffffffee;
	backdrop-filter: blur(12px);
	border-bottom: 1px solid #eee;
}


.navbar {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0.5rem 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.logo {
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #c0392b;
	font-size: 1rem;
	text-decoration: none;
}

.nav-links {
	list-style: none;
	display: none;
	flex-direction: column;
	width: 100%;
	margin-top: 0.3rem;
	gap: 0.25rem;
	font-size: 0.9rem;
}

.nav-links a {
	text-decoration: none;
	color: #555;
	font-size: 0.95rem;
}

.nav-links a:hover {
	color: #c0392b;
}

.nav-toggle {
	border: none;
	background: transparent;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	padding: 0.2rem;
	cursor: pointer;
}

.nav-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	background: #333;
	border-radius: 999px;
}

.nav-links.open {
	display: flex;
}


.cart-button {
	border: none;
	background: #c0392b;
	color: #fff;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.85rem;
}

main {
	max-width: 1300px;
	margin: 1.5rem auto 3rem;
	padding: 0 1rem;
}

.hero-slogan {
	margin: 2rem 0 2.5rem;
	font-size: 2rem;
	font-weight: 700;
	text-align: center;
	color: #c0392b;
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
	line-height: 1.4;
}

.carousel-section {
	margin-bottom: 2.5rem;
}


.carousel-wrapper {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	background: linear-gradient(135deg, #ffe1e0, #fff7d9);
	min-height: 230px;
	display: flex;
	align-items: stretch;
	padding: 0 3rem; /* laisse de la place pour les flèches sur les côtés */
}

.carousel-slide {
	display: grid;
	grid-template-columns: 1fr;
	width: 100%;
	transition: transform 0.35s ease-out, opacity 0.35s ease-out;
	opacity: 1;
}

.carousel-image-wrapper {
	padding: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.carousel-image-wrapper img {
	width: 100%;
	height: 220px;
	border-radius: 12px;
	object-fit: cover;
}

.carousel-image-wrapper {
	position: relative;
}

.carousel-ribbon {
	position: absolute;
	top: 10px;
	left: 10px;
	background: #c0392b;
	color: #fff;
	font-size: 0.8rem;
	padding: 0.2rem 0.7rem;
	border-radius: 999px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}


.carousel-info {
	padding: 0 1rem 1rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.4rem;
}

.carousel-title {
	font-size: 1.3rem;
	color: #c0392b;
}

.carousel-desc {
	font-size: 0.9rem;
	white-space: pre-line; /* respecter les retours à la ligne de la description */
}

.carousel-price {
	font-weight: 600;
}

.btn-primary {
	display: inline-block;
	border: none;
	background: #c0392b;
	color: white;
	padding: 0.5rem 1.2rem;
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.95rem;
}

.btn-primary:hover {
	background: #a83226;
}

.carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	border: none;
	background: #ffffffcc;
	border-radius: 999px;
	width: 32px;
	height: 32px;
	cursor: pointer;
	z-index: 2;
}

.carousel-arrow.left { left: 0.75rem; }
.carousel-arrow.right { right: 0.75rem; }

.carousel-dots {
	margin-top: 0.7rem;
	display: flex;
	justify-content: center;
	gap: 0.4rem;
}

.carousel-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ddd;
	border: none;
}

.carousel-dot.active {
	background: #c0392b;
}

.catalogue-section h2 {
	margin-bottom: 1rem;
}


.product-grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 0.8rem;
}

.product-card {
	background: #fff;
	border-radius: 12px;
	padding: 0.6rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	box-shadow: 0 8px 16px rgba(0,0,0,0.03);
	cursor: pointer;
}
.product-image-wrapper {
	position: relative;
}

.product-card img {
	width: 100%;
	border-radius: 10px;
	height: 160px;
	object-fit: cover;
}

.product-ribbon {
	position: absolute;
	top: 8px;
	left: -8px;
	background: #c0392b;
	color: #fff;
	font-size: 0.75rem;
	padding: 0.15rem 0.6rem;
	border-radius: 0 999px 999px 0;
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-title {
	font-size: 0.95rem;
	font-weight: 600;
}

.product-price {
	font-weight: 600;
	color: #c0392b;
}

.product-card button {
	margin-top: auto;
	width: 100%;
	font-size: 0.85rem;
}

/* Modale produit */
.product-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 200;
}

.product-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.35);
}

.product-modal-dialog {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 16px;
	max-width: 480px;
	width: 90%;
	padding: 1rem;
	max-height: 90vh; /* pour éviter que le contenu déborde trop en hauteur */
	overflow-y: auto; /* permettre le scroll interne sur mobile */
	box-shadow: 0 18px 45px rgba(0,0,0,0.25);
}

.product-modal-close {
	position: absolute;
	top: 0.4rem;
	right: 0.6rem;
	border: none;
	background: transparent;
	font-size: 1.6rem;
	cursor: pointer;
}

.product-modal-content {
	display: grid;
	grid-template-columns: 1.1fr 1.4fr;
	gap: 0.8rem;
	align-items: center;
}

#modal-product-image {
	width: 100%;
	border-radius: 12px;
	height: 160px;
	object-fit: cover;
}

.product-modal-text {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.product-modal-price {
	font-weight: 600;
	color: #c0392b;
}

.product-modal-ingredients {
	font-size: 0.9rem;
	white-space: pre-line; /* respecter les retours à la ligne de la description */
}

/* Modale de confirmation de commande (après paiement) */
.order-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 250;
}

.order-modal.open {
	display: flex;
}

.order-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.45);
}

.order-modal-dialog {
	position: relative;
	z-index: 1;
	background: #ffffff;
	border-radius: 16px;
	max-width: 420px;
	width: 90%;
	padding: 1.5rem 1.25rem 1.25rem;
	text-align: center;
	box-shadow: 0 18px 45px rgba(0,0,0,0.25);
}

.order-modal-title {
	font-size: 1.6rem;
	margin-bottom: 0.5rem;
	color: #2e7d32; /* vert de validation */
}

.order-modal-text {
	font-size: 0.95rem;
	margin-bottom: 0.75rem;
	color: #444;
}

.order-modal-order-id {
	font-size: 1.05rem;
	font-weight: 700;
	margin-bottom: 1.1rem;
	color: #2e7d32;
}

.modal-flavors {
	margin: 0.4rem 0 0.6rem;
}

.modal-flavors-header {
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 0.4rem;
}

.modal-flavors-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
	margin-bottom: 0.4rem;
}

.modal-flavor-card {
	background: #fafafa;
	border-radius: 8px;
	padding: 0.35rem;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.25rem;
	border: 1px solid #eee;
}

.modal-flavor-image-wrap {
	width: 100%;
	height: 60px; /* cadre plus petit pour réduire la hauteur de la modale */
	overflow: hidden;
	border-radius: 6px;
}

.modal-flavor-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover; /* remplir complètement le cadre */
	object-position: center center; /* centrer l'image dans le cadre */
}

.modal-flavor-name {
	font-size: 0.85rem;
	font-weight: 600;
	text-align: center;
}

.modal-flavor-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.25rem;
}

.modal-flavor-btn {
	border: 1px solid #ddd;
	background: #f8f8f8;
	border-radius: 999px;
	padding: 0.25rem 0.7rem; /* boutons plus grands et plus confortables */
	min-width: 2.1rem;
	font-size: 0.9rem;
	cursor: pointer;
}

.modal-flavor-count {
	min-width: 1.4rem;
	text-align: center;
	font-size: 0.85rem;
}

.modal-flavors-summary {
	font-size: 0.85rem;
	color: #555;
}

.modal-flavors-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.3rem;
	font-size: 0.8rem;
}

.modal-flavors-page-btn {
	border: 1px solid #ddd;
	background: #f8f8f8;
	border-radius: 999px;
	padding: 0.2rem 0.6rem;
	font-size: 0.8rem;
	cursor: pointer;
}

.modal-flavors-page-btn[disabled] {
	opacity: 0.5;
	cursor: default;
}

.modal-qty-row {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0.4rem 0;
}

.modal-qty-row input[type="number"] {
	width: 60px;
	padding: 0.3rem 0.4rem;
	text-align: center;
	border-radius: 999px;
	border: 1px solid #ddd;
}

.qty-btn {
	border: 1px solid #ddd;
	background: #f8f8f8;
	border-radius: 999px;
	padding: 0.2rem 0.6rem;
	font-size: 0.9rem;
	cursor: pointer;
}

@media (max-width: 600px) {
	.product-modal-content {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 900px) {
	.product-modal-dialog {
		width: 60vw;       /* 60% de la largeur de la fenêtre */
		max-width: 60vw;
		padding: 1.5rem;
	}

	.product-modal-content {
		grid-template-columns: 1.4fr 1fr; /* colonne image plus large */
	}

	#modal-product-image {
		height: 400px;     /* image encore plus grande pour une modale plus carrée */
	}
}

.pagination {
	margin-top: 1rem;
	display: flex;
	justify-content: center;
	gap: 0.3rem;
}

.pagination button {
	border: 1px solid #ddd;
	background: #fff;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.8rem;
}

.pagination button.active {
	background: #c0392b;
	color: #fff;
	border-color: #c0392b;
}

.cart-panel {
	position: fixed;
	top: 0;
	right: -400px;
	width: 320px;
	height: 100vh;
	background: #fff;
	box-shadow: -4px 0 20px rgba(0,0,0,0.1);
	display: flex;
	flex-direction: column;
	transition: right 0.25s ease-out;
	z-index: 100;
}

.cart-panel.open {
	right: 0;
}

.cart-header {
	padding: 0.8rem 1rem;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.close-cart {
	border: none;
	background: transparent;
	font-size: 1.4rem;
	cursor: pointer;
}

.cart-items {
	flex: 1;
	overflow-y: auto;
	padding: 0.5rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.cart-item {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.cart-item button {
	border: 1px solid #ddd;
	background: #f8f8f8;
	border-radius: 999px;
	padding: 0.15rem 0.5rem;
	font-size: 0.85rem;
	cursor: pointer;
}

.cart-item-main {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.cart-item-main img {
	width: 46px;
	height: 46px;
	border-radius: 8px;
	object-fit: cover;
}

.cart-item-info {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.cart-item-name {
	font-weight: 600;
	color: #c0392b;
}

.cart-item-qty {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.cart-item-weight {
	font-size: 0.8rem;
	color: #777;
}

.cart-item-composition {
	font-size: 0.8rem;
	color: #555;
}

.cart-item-total {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.3rem;
}

.cart-item-price {
	font-weight: 600;
	white-space: nowrap;
}

.cart-footer {
	padding: 0.8rem 1rem 1rem;
	border-top: 1px solid #eee;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.cart-total {
	font-weight: 600;
}

.cart-weight {
	font-size: 0.85rem;
	color: #555;
}


.checkout-section {
	margin-top: 2rem;
	background: #fff;
	border-radius: 16px;
	padding: 1rem;
	box-shadow: 0 8px 18px rgba(0,0,0,0.04);
	overflow-x: auto; /* pour laisser respirer les tableaux larges (admin) */
}

.checkout-content {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

.checkout-summary, .checkout-form {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.checkout-item {
	display: flex;
	justify-content: space-between;
	font-size: 0.9rem;
}

.checkout-shipping {
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px dashed #ddd;
}

.checkout-total {
	margin-top: 0.6rem;
	font-weight: 600;
}

.checkout-form label {
	display: flex;
	flex-direction: column;
	font-size: 0.85rem;
	gap: 0.25rem;
}

.checkout-form input {
	padding: 0.4rem 0.5rem;
	border-radius: 6px;
	border: 1px solid #ddd;
}

.checkout-layout {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 2rem;
}

.checkout-forms-column h2 {
	margin-bottom: 1rem;
}

.checkout-block {
	background: #fafafa;
	border-radius: 12px;
	padding: 1rem;
	margin-bottom: 1rem;
	border: 1px solid #eee;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.checkout-block h3 {
	font-size: 1rem;
	margin-bottom: 0.25rem;
}

.checkout-block label {
	display: flex;
	flex-direction: column;
	font-size: 0.85rem;
	gap: 0.25rem;
}

.checkout-block input,
.checkout-block select {
	padding: 0.45rem 0.55rem;
	border-radius: 6px;
	border: 1px solid #ddd;
	font-size: 0.9rem;
}

.field-error {
	border-color: #e74c3c !important;
	background-color: #ffecec;
}

.field-error-message {
	color: #e74c3c;
	font-size: 0.78rem;
	margin-top: 0.1rem;
}

.field-hint {
	font-style: italic;
	color: #777;
	font-size: 0.85em;
	margin-left: 0.15rem;
}

.checkout-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
}

.checkout-summary-column {
	background: #fff;
	border-radius: 12px;
	border: 1px solid #eee;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	align-self: flex-start;
}

.checkout-summary-column h3 {
	margin-bottom: 0.5rem;
}

.checkout-radio-line {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
	padding: 0.45rem 0.6rem;
	border-radius: 8px;
	border: 1px solid #ddd;
	font-size: 0.85rem;
}

.checkout-radio-line input[type="radio"] {
	margin-right: 0.4rem;
}

.checkout-radio-line span small {
	display: block;
	font-size: 0.75rem;
	color: #777;
}

.hidden {
	display: none;
}

.site-footer {
	border-top: 1px solid #eee;
	padding: 1rem;
	text-align: center;
	font-size: 0.85rem;
	color: #777;
}

/* Suggestions d'adresse (checkout) */
.address-suggestions {
	margin-top: 0.25rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 4px 10px rgba(0,0,0,0.05);
	max-height: 180px;
	overflow-y: auto;
	display: none;
}

.address-suggestion-item {
	width: 100%;
	text-align: left;
	padding: 0.35rem 0.5rem;
	border: none;
	background: transparent;
	font-size: 0.85rem;
	cursor: pointer;
}

.address-suggestion-item:hover {
	background: #f5f5f5;
}

/* Élargissement tablettes */
@media (min-width: 600px) {
	.navbar {
		flex-wrap: nowrap;
	}

	.product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Élargissement desktop */
@media (min-width: 900px) {
	.nav-toggle {
		display: none;
	}

	.nav-links {
		display: flex;
		flex-direction: row;
		width: auto;
		margin-top: 0;
		gap: 1rem;
	}

	.carousel-slide {
		grid-template-columns: 1.3fr 1fr;
	}

	.carousel-image-wrapper img {
		height: 260px;
	}

	.checkout-content {
		grid-template-columns: 1.2fr 1fr;
	}

	.product-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

