/* AM Shopping : grille de produits Amazon (modele B, cartes arrondies). */

.ams-bloc {
	--ams-fond: #ffffff;
	--ams-bord: #ececf1;
	--ams-texte: #1f2937;
	--ams-doux: #6b7280;
	--ams-logo: #111111;
	--ams-ombre: 0 6px 20px rgba(17, 24, 39, .07);
	container-type: inline-size;
	margin: 2em 0;
	font-size: 16px;
	line-height: 1.45;
	clear: both;
}

.ams-carte-sombre {
	--ams-fond: #1c1f26;
	--ams-bord: #2d323c;
	--ams-texte: #f3f4f6;
	--ams-doux: #a1a7b3;
	--ams-logo: #ffffff;
	--ams-ombre: 0 6px 20px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
	.ams-carte-auto {
		--ams-fond: #1c1f26;
		--ams-bord: #2d323c;
		--ams-texte: #f3f4f6;
		--ams-doux: #a1a7b3;
		--ams-logo: #ffffff;
		--ams-ombre: 0 6px 20px rgba(0, 0, 0, .35);
	}
}

/* Protection contre les styles du theme. */
.ams-bloc, .ams-bloc * { box-sizing: border-box; }
.ams-bloc p { margin: 0; padding: 0; }
.ams-bloc a { text-decoration: none; box-shadow: none; border: 0; }
.ams-bloc img { max-width: 100%; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }

.ams-titre-bloc {
	font-weight: 700;
	font-size: 1.1em;
	margin: 0 0 .8em !important;
}

.ams-grille {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}
.ams-cols-2 .ams-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; margin: 0 auto; }
.ams-cols-4 .ams-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ams-seul .ams-grille { grid-template-columns: minmax(0, 320px); justify-content: center; }

.ams-carte {
	display: flex;
	flex-direction: column;
	background: var(--ams-fond);
	color: var(--ams-texte);
	border: 1px solid var(--ams-bord);
	border-radius: 18px;
	box-shadow: var(--ams-ombre);
	padding: 14px 16px 18px;
	text-align: center;
	transition: transform .15s ease, box-shadow .15s ease;
}
.ams-carte:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(17, 24, 39, .12); }

.ams-haut {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 30px;
	gap: 8px;
}

.ams-promo {
	background: var(--ams-promo);
	color: var(--ams-promo-txt);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	padding: 7px 11px;
	border-radius: 999px;
	white-space: nowrap;
}

.ams-logo {
	width: 76px;
	height: auto;
	color: var(--ams-logo);
	flex: none;
	margin-left: auto;
}

.ams-image {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 170px;
	margin: 8px 0 12px;
	background: #ffffff;
	border-radius: 12px;
}
.ams-image img {
	max-height: 160px !important;
	width: auto !important;
	object-fit: contain;
}

.ams-nom {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-weight: 700;
	font-size: 1em;
	line-height: 1.3;
	color: var(--ams-texte) !important;
	margin-bottom: 6px;
}
.ams-nom:hover { color: var(--ams-c1) !important; }

.ams-desc {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: .82em;
	line-height: 1.5;
	color: var(--ams-doux);
}

.ams-bas {
	margin-top: auto;
	padding-top: 14px;
}

.ams-prix {
	font-size: 1.45em;
	font-weight: 800;
	line-height: 1.2;
	color: var(--ams-texte);
}

.ams-fin-promo {
	font-size: .78em;
	color: var(--ams-promo);
	font-weight: 600;
	margin-top: 2px !important;
}

.ams-bouton {
	display: inline-block;
	margin-top: 12px;
	min-width: 70%;
	padding: 11px 18px;
	border-radius: 10px;
	background: linear-gradient(90deg, var(--ams-c1), var(--ams-c2));
	color: var(--ams-txt) !important;
	font-size: .88em;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1.2;
	transition: filter .15s ease, transform .15s ease;
}
.ams-bouton:hover,
.ams-bouton:focus { filter: brightness(1.08); transform: translateY(-1px); color: var(--ams-txt) !important; }

.ams-releve {
	margin-top: 10px !important;
	font-size: 12px;
	color: #8b909a;
	text-align: right;
}

/* Prix barre et marchand (produits saisis a la main). */
.ams-barre {
	font-size: .62em;
	font-weight: 500;
	color: var(--ams-doux);
	margin-left: 6px;
	text-decoration: line-through;
}
.ams-marchand {
	margin-left: auto;
	font-size: 13px;
	font-weight: 700;
	color: var(--ams-texte);
}

/* Boite : un produit en largeur. */
.ams-boite-bloc { display: grid; gap: 16px; }
.ams-boite {
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	gap: 20px;
	align-items: center;
	text-align: left;
	padding: 16px 20px;
}
.ams-boite .ams-boite-image { height: 180px; margin: 0; }
.ams-boite .ams-boite-image img { max-height: 170px !important; }
.ams-boite-corps { min-width: 0; }
.ams-boite .ams-haut { margin-bottom: 6px; }
.ams-boite .ams-nom { font-size: 1.1em; -webkit-line-clamp: 2; }
.ams-puces {
	margin: 8px 0 0 !important;
	padding: 0 0 0 18px !important;
	font-size: .88em;
	line-height: 1.55;
	color: var(--ams-doux);
}
.ams-puces li { margin: 0 0 3px !important; padding: 0 !important; }
.ams-boite-bas {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 12px;
}
.ams-boite-bas .ams-bouton { margin-top: 0; min-width: 0; }

/* Tableau comparatif. */
.ams-tableau {
	background: var(--ams-fond);
	color: var(--ams-texte);
	border: 1px solid var(--ams-bord);
	border-radius: 18px;
	box-shadow: var(--ams-ombre);
	padding: 4px 16px;
}
.ams-ligne {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto auto;
	gap: 16px;
	align-items: center;
	padding: 12px 0;
	border-top: 1px solid var(--ams-bord);
}
.ams-ligne:first-child { border-top: 0; }
.ams-vignette {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	background: #ffffff;
	border-radius: 10px;
}
.ams-vignette img { max-height: 66px !important; width: auto !important; object-fit: contain; }
.ams-ligne .ams-nom { margin: 0; font-size: .98em; }
.ams-ligne-sous {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 3px;
	font-size: .82em;
	color: var(--ams-doux);
}
.ams-ligne-sous .ams-promo { font-size: 11px; padding: 4px 8px; }
.ams-ligne-prix { text-align: right; white-space: nowrap; }
.ams-ligne-prix .ams-prix { font-size: 1.2em; }
.ams-ligne .ams-bouton { margin-top: 0; min-width: 0; white-space: nowrap; padding: 10px 16px; }

@container (max-width: 560px) {
	.ams-boite { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 14px; }
	.ams-boite .ams-boite-image { height: 110px; }
	.ams-boite .ams-boite-image img { max-height: 104px !important; }
	.ams-boite .ams-puces { display: none; }
	.ams-boite-bas .ams-bouton { width: 100%; text-align: center; }

	.ams-ligne {
		grid-template-columns: 64px minmax(0, 1fr);
		grid-template-areas: "image nom" "image prix" "action action";
		gap: 6px 12px;
	}
	.ams-ligne-image { grid-area: image; }
	.ams-vignette { width: 64px; height: 64px; }
	.ams-ligne-nom { grid-area: nom; }
	.ams-ligne-prix { grid-area: prix; text-align: left; }
	.ams-ligne-action { grid-area: action; }
	.ams-ligne .ams-bouton { width: 100%; text-align: center; }
}

/* Bloc de repli : bouton de recherche Amazon. */
.ams-repli-carte {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	background: var(--ams-fond);
	color: var(--ams-texte);
	border: 1px solid var(--ams-bord);
	border-radius: 18px;
	box-shadow: var(--ams-ombre);
	padding: 16px 20px;
}
.ams-repli-carte .ams-logo { margin-left: 0; }
.ams-repli-texte { flex: 1 1 180px; font-weight: 700; }
.ams-repli .ams-bouton { margin-top: 0; min-width: 0; }

.ams-note-admin {
	margin: 1em 0 .4em !important;
	padding: 8px 12px !important;
	font-size: 13px;
	background: #fff7ed;
	color: #9a3412;
	border: 1px dashed #fdba74;
	border-radius: 8px;
}

/* Colonnes selon la largeur reelle de l'article, pas celle de l'ecran. */
@container (max-width: 720px) {
	.ams-cols-4 .ams-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 600px) {
	.ams-cols-3 .ams-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Telephone : une carte par ligne, image a gauche. */
@container (max-width: 460px) {
	.ams-bloc .ams-grille { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.ams-grille .ams-carte {
		display: grid;
		grid-template-columns: 96px minmax(0, 1fr);
		grid-template-areas: "haut haut" "image nom" "image bas";
		column-gap: 14px;
		text-align: left;
		padding: 12px 14px 14px;
	}
	.ams-grille .ams-haut { grid-area: haut; min-height: 24px; }
	.ams-grille .ams-logo { width: 62px; }
	.ams-grille .ams-image { grid-area: image; height: 96px; margin: 6px 0 0; }
	.ams-grille .ams-image img { max-height: 92px !important; }
	.ams-grille .ams-nom { grid-area: nom; margin: 6px 0 0; font-size: .95em; }
	.ams-grille .ams-desc { display: none; }
	.ams-grille .ams-bas { grid-area: bas; padding-top: 6px; }
	.ams-grille .ams-prix { font-size: 1.2em; }
	.ams-grille .ams-bouton { margin-top: 8px; min-width: 0; width: 100%; text-align: center; padding: 10px 12px; }
}
