/* ============================================
   Material Design - Variables
   ============================================ */
:root {
	--primary: #1976d2;
	--primary-dark: #1565c0;
	--primary-light: #42a5f5;
	--secondary: #424242;
	--accent: #ff9800;
	--success: #4caf50;
	--warning: #ff9800;
	--error: #f44336;
	--info: #2196f3;
	--text-primary: #212121;
	--text-secondary: #757575;
	--divider: #e0e0e0;
	--background: #fafafa;
	--surface: #ffffff;
	--shadow-1: 0 2px 4px rgba(0,0,0,0.1);
	--shadow-2: 0 4px 8px rgba(0,0,0,0.12);
	--shadow-3: 0 8px 16px rgba(0,0,0,0.15);
	--elevation-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset et base
   ============================================ */
* {
	box-sizing: border-box;
}

body {
	font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background: var(--background);
	color: var(--text-primary);
	line-height: 1.5;
	margin: 0;
	padding: 0;
}

/* ============================================
   Navigation Material Design
   ============================================ */
.navbar {
	background: var(--primary) !important;
	box-shadow: var(--shadow-2);
	border: none;
	padding: 0.75rem 0;
}

.navbar-brand {
	font-weight: 500;
	font-size: 1.25rem;
	color: white !important;
	text-decoration: none;
}

.navbar-brand:hover {
	color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link {
	color: rgba(255, 255, 255, 0.9) !important;
	font-weight: 400;
	padding: 0.5rem 1rem !important;
	border-radius: 4px;
	transition: background-color 0.2s;
}

.nav-link:hover {
	background-color: rgba(255, 255, 255, 0.1);
	color: white !important;
}

.navbar-text {
	color: rgba(255, 255, 255, 0.9) !important;
}

/* ============================================
   Container
   ============================================ */
.container {
	background: var(--surface);
	padding: 2rem;
	margin-top: 1rem;
	margin-bottom: 2rem;
	border-radius: 4px;
	box-shadow: var(--shadow-1);
}

/* ============================================
   Cartes Material Design
   ============================================ */
.card {
	border: none;
	border-radius: 4px;
	box-shadow: var(--shadow-1);
	transition: var(--elevation-transition);
	background: var(--surface);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.card:hover {
	box-shadow: var(--shadow-2);
}

.card-header {
	background: var(--primary);
	color: white;
	border: none;
	padding: 0.75rem 1rem;
	font-weight: 500;
	font-size: 0.875rem;
	flex-shrink: 0;
}

.card-header .btn-outline-secondary {
	border: 1px solid rgba(255, 255, 255, 0.5);
	color: white;
	background: rgba(255, 255, 255, 0.1);
}

.card-header .btn-outline-secondary:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.8);
	color: white;
}

.card-header.bg-warning {
	background: var(--warning) !important;
}

.card-header.bg-secondary {
	background: var(--secondary) !important;
}

.card-body {
	padding: 1.5rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.card-body .card-title {
	margin-bottom: 1rem;
	flex-shrink: 0;
}

.card-body .btn-container {
	margin-top: auto;
	flex-shrink: 0;
}

.card-footer {
	background: var(--surface);
	border-top: 1px solid var(--divider);
	padding: 1rem 1.5rem;
	flex-shrink: 0;
}

.card-img-top {
	border-radius: 0;
	background: #f5f5f5;
	flex-shrink: 0;
	height: 200px;
	object-fit: contain;
	width: 100%;
}

.card-img-top.bg-light {
	min-height: 200px;
}

/* ============================================
   Boutons Material Design
   ============================================ */
.btn {
	border-radius: 4px;
	font-weight: 500;
	padding: 0.625rem 1.5rem;
	text-transform: uppercase;
	font-size: 0.875rem;
	letter-spacing: 0.5px;
	border: none;
	box-shadow: var(--shadow-1);
	transition: var(--elevation-transition);
	cursor: pointer;
}

.btn:hover {
	box-shadow: var(--shadow-2);
}

.btn:active {
	box-shadow: var(--shadow-1);
}

.btn-primary {
	background: var(--primary);
	color: white;
}

.btn-primary:hover {
	background: var(--primary-dark);
	color: white;
}

.btn-success {
	background: var(--success);
	color: white;
}

.btn-success:hover {
	background: #45a049;
	color: white;
}

.btn-warning {
	background: var(--warning);
	color: white;
}

.btn-warning:hover {
	background: #f57c00;
	color: white;
}

.btn-danger {
	background: var(--error);
	color: white;
}

.btn-danger:hover {
	background: #d32f2f;
	color: white;
}

.btn-secondary {
	background: var(--secondary);
	color: white;
}

.btn-secondary:hover {
	background: #303030;
	color: white;
}

.btn-info {
	background: var(--info);
	color: white;
}

.btn-info:hover {
	background: #1976d2;
	color: white;
}

.btn-offrir {
	background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
	color: #1a1a1a;
	font-weight: 600;
	position: relative;
	overflow: hidden;
}

.btn-offrir:hover {
	background: linear-gradient(135deg, #ffed4e 0%, #ffd700 50%, #ffed4e 100%);
	color: #1a1a1a;
	box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.btn-offrir:active {
	transform: scale(0.98);
}

/* Effet de paillettes */
@keyframes sparkle {
	0% {
		transform: translate(0, 0) rotate(0deg) scale(0);
		opacity: 1;
	}
	50% {
		opacity: 1;
	}
	100% {
		transform: translate(var(--sparkle-x), var(--sparkle-y)) rotate(360deg) scale(1);
		opacity: 0;
	}
}

.sparkle {
	position: fixed;
	width: 8px;
	height: 8px;
	background: radial-gradient(circle, #fff 0%, transparent 70%);
	border-radius: 50%;
	pointer-events: none;
	animation: sparkle 0.6s ease-out forwards;
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
	z-index: 9999;
}

.btn-outline-secondary {
	border: 1px solid var(--text-secondary);
	color: var(--text-secondary);
	background: transparent;
	box-shadow: none;
}

.btn-outline-secondary:hover {
	background: rgba(0, 0, 0, 0.04);
	color: var(--text-secondary);
	box-shadow: var(--shadow-1);
}

.btn-sm {
	padding: 0.5rem 1rem;
	font-size: 0.8125rem;
	text-transform: none;
}

.btn:disabled {
	opacity: 0.38;
	cursor: not-allowed;
	box-shadow: none;
}

/* ============================================
   Formulaires Material Design
   ============================================ */
.form-control {
	border-radius: 4px;
	border: 1px solid var(--divider);
	padding: 0.75rem;
	transition: border-color 0.2s, box-shadow 0.2s;
	background: var(--surface);
	font-size: 1rem;
}

.form-control:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
	outline: none;
}

.form-label {
	font-weight: 500;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
}

.form-text {
	color: var(--text-secondary);
	font-size: 0.875rem;
}

/* ============================================
   Alertes Material Design
   ============================================ */
.alert {
	border-radius: 4px;
	border: none;
	box-shadow: var(--shadow-1);
	padding: 1rem 1.5rem;
	margin-bottom: 1rem;
}

.alert-success {
	background: #e8f5e9;
	color: #2e7d32;
	border-left: 4px solid var(--success);
}

.alert-danger {
	background: #ffebee;
	color: #c62828;
	border-left: 4px solid var(--error);
}

.alert-info {
	background: #e3f2fd;
	color: #1565c0;
	border-left: 4px solid var(--info);
}

.alert-warning {
	background: #fff3e0;
	color: #e65100;
	border-left: 4px solid var(--warning);
}

/* ============================================
   Tableaux Material Design
   ============================================ */
.table {
	border-radius: 4px;
	overflow: hidden;
	box-shadow: var(--shadow-1);
	background: var(--surface);
}

.table thead {
	background: var(--primary);
	color: white;
}

.table thead th {
	border: none;
	padding: 1rem;
	font-weight: 500;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.5px;
}

.table tbody tr {
	transition: background-color 0.2s;
	border-bottom: 1px solid var(--divider);
}

.table tbody tr:hover {
	background: rgba(0, 0, 0, 0.04);
}

.table tbody tr:last-child {
	border-bottom: none;
}

.table tbody td {
	padding: 1rem;
	border: none;
	vertical-align: middle;
}

/* ============================================
   Badges Material Design
   ============================================ */
.badge {
	padding: 0.375rem 0.75rem;
	border-radius: 12px;
	font-weight: 500;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.bg-primary {
	background: var(--primary) !important;
}

.bg-danger {
	background: var(--error) !important;
}

.bg-success {
	background: var(--success) !important;
}

.bg-warning {
	background: var(--warning) !important;
}

.bg-info {
	background: var(--info) !important;
}

/* ============================================
   Produits réservés - Style sobre
   ============================================ */
.produit-reserve {
	position: relative;
}

.card-header.bg-warning {
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
}

.card-header.bg-warning strong {
	font-weight: 500;
}

.card-header.bg-warning small {
	font-size: 0.75rem;
	opacity: 0.9;
	display: block;
	margin-top: 0.25rem;
}

/* ============================================
   Titres
   ============================================ */
h1, h2, h3, h4, h5, h6 {
	font-weight: 400;
	color: var(--text-primary);
	line-height: 1.2;
	margin-bottom: 1rem;
}

h1 {
	font-size: 2rem;
	font-weight: 300;
	color: var(--text-primary);
}

h2 {
	font-size: 1.5rem;
	font-weight: 400;
}

h3 {
	font-size: 1.25rem;
	font-weight: 400;
}

h5 {
	font-size: 1rem;
	font-weight: 500;
}

/* ============================================
   Effets de scroll
   ============================================ */
[id^="produit-"] {
	scroll-margin-top: 80px;
	transition: box-shadow 0.3s;
}

[id^="produit-"]:target {
	box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.3);
	border-radius: 4px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
	.container {
		padding: 1rem;
	}
	
	h1 {
		font-size: 1.75rem;
	}
	
	.card {
		margin-bottom: 1rem;
	}
}

/* ============================================
   Améliorations spécifiques
   ============================================ */
.text-muted {
	color: var(--text-secondary) !important;
}

.border-warning {
	border: none !important;
}

.border-secondary {
	border-left: 3px solid var(--secondary) !important;
	border-top: none !important;
	border-right: none !important;
	border-bottom: none !important;
}

.opacity-75 {
	opacity: 0.75;
}

/* Liens */
a {
	color: var(--primary);
	text-decoration: none;
	transition: color 0.2s;
}

a:hover {
	color: var(--primary-dark);
	text-decoration: underline;
}

/* Inputs file */
input[type="file"] {
	padding: 0.5rem;
	border-radius: 4px;
	cursor: pointer;
}

input[type="file"]:hover {
	background: rgba(0, 0, 0, 0.04);
}

/* Textarea */
textarea.form-control {
	min-height: 100px;
	resize: vertical;
}

/* Selects */
select.form-control {
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23757575' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 0.5rem center;
	background-repeat: no-repeat;
	background-size: 1.25em 1.25em;
	padding-right: 2.5rem;
}

/* Amélioration des cartes de liste */
.card-title a {
	color: var(--text-primary);
	font-weight: 500;
	transition: color 0.2s;
}

.card-title a:hover {
	color: var(--primary);
	text-decoration: none;
}

/* Focus visible */
*:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ============================================
   Tuiles de listes sur la page d'accueil
   ============================================ */
.liste-card {
	background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
	border-left: 4px solid var(--primary);
}

.liste-card:hover {
	border-left-color: var(--primary-dark);
	background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
}

/* ============================================
   Produit Hype - Badge et contour doré
   ============================================ */
.produit-hype {
	position: relative;
	border: 3px solid #ffd700 !important;
	box-shadow: 0 0 15px rgba(255, 215, 0, 0.4) !important;
}

.produit-hype .card-img-top {
	position: relative;
}

.hype-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 90px;
	height: 90px;
	background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
	color: #1a1a1a;
	box-shadow: 0 6px 9px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	border-radius: 50%;
	border: 3px solid #b8860b;
}

.hype-badge::before {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	right: 2px;
	bottom: 2px;
	border-radius: 50%;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
	z-index: -1;
}

.hype-badge-text {
	display: block;
	position: relative;
	z-index: 1;
	font-weight: 800;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.2px;
	text-align: center;
	line-height: 1.1;
	padding: 0 4px;
	word-break: break-word;
	transform: rotate(20deg);
}

.hype-badge-text br {
	display: block;
	content: "";
	margin: 0;
}
