/**
 * Otakara — Carte produit
 * Palette du logo : noir d'encre, rouge Otakara, blanc. Rien d'autre.
 * Pas de cadre, pas de fond : l'image est pleine largeur et le texte
 * s'aligne sur son bord gauche. La licence est écrite, jamais codée en couleur.
 */

.otk-card {
	--otk-red: #e30613;
	--otk-ink: #101216;
	--otk-ink-2: #4a5060;
	--otk-ink-3: #858c9b;
	--otk-line: #e6e8ee;
	--otk-surface: transparent;
	--otk-media-bg: #f2f3f6;
	--otk-radius: 8px;

	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--otk-surface);
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--otk-ink);
}

/* Thème sombre : classe otk-dark sur un conteneur Elementor parent. */
.otk-dark .otk-card {
	--otk-ink: #f3f4f8;
	--otk-ink-2: #b6bcc9;
	--otk-ink-3: #838a99;
	--otk-line: #2a2f3a;
	--otk-media-bg: #1c2029;
}

.otk-card.is-unavailable {
	opacity: .68;
}

/* ---------- Média : pleine largeur, sans cadre ni marge intérieure ---------- */

.otk-card__media {
	position: relative;
	aspect-ratio: 4 / 5;
	background: var(--otk-media-bg);
	border-radius: var(--otk-radius);
	overflow: hidden;
}

.otk-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	/* Marge de respiration : le produit ne touche jamais le bord du cadre.
	   box-sizing indispensable, sinon le padding s'ajoute aux 100 %. */
	box-sizing: border-box;
	padding: 9%;
	/*
	 * `contain` et non `cover` : une carte (59 × 86 mm, soit 0.69) et une boîte
	 * de display n'ont pas le même ratio. Recadrer coupe systématiquement l'un
	 * des deux. Ici le produit est toujours visible en entier, et le fond neutre
	 * comble la différence de format.
	 */
	object-fit: contain;
	transition: transform .4s cubic-bezier(.2, .6, .2, 1);
}

.otk-card:hover .otk-card__media img,
.otk-card:focus-within .otk-card__media img {
	transform: scale(1.045);
}

.otk-card.is-unavailable .otk-card__media img {
	filter: grayscale(.9);
}

/* ---------- Pastilles : badge d'état + gradation, groupés en haut à gauche ---- */

.otk-card__flags {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 6px;
	max-width: calc(100% - 20px);
}

.otk-card__badge {
	padding: 6px 10px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .1em;
	text-transform: uppercase;
	white-space: nowrap;
}

.otk-card__badge--red { background: var(--otk-red); color: #fff; }
.otk-card__badge--ink { background: var(--otk-ink); color: #fff; }
.otk-card__badge--muted { background: rgba(16, 18, 22, .78); color: #fff; }

/* ---------- Corps : aligné sur le bord de l'image ---------- */

.otk-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 6px;
	padding: 12px 0 0;
}

/* La licence, écrite. C'est le premier repère d'identification. */
.otk-card__eyebrow {
	margin: 0;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--otk-red);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.otk-card__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.28;
	letter-spacing: -.012em;
	color: var(--otk-ink);
	/* Pas de hauteur réservée : le pied de carte est déjà collé en bas par
	   margin-top:auto, donc les prix restent alignés sans ligne fantôme. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.otk-card__title a {
	color: inherit;
	text-decoration: none;
}

.otk-card:hover .otk-card__title a {
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
}

/* Lien étendu : toute la carte est cliquable, le bouton reste au-dessus. */
.otk-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.otk-card__link:focus-visible {
	outline: 2px solid var(--otk-red);
	outline-offset: 3px;
}

/* ---------- Pastille de gradation ---------- */

.otk-card__grade {
	margin: 0;
	padding: 6px 10px;
	background: var(--otk-ink);
	color: #fff;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .1em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ---------- Métadonnées ---------- */

.otk-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 3px 7px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--otk-ink-2);
}

.otk-card__meta li + li::before {
	content: "·";
	margin-right: 7px;
	color: var(--otk-ink-3);
	font-weight: 700;
}

/* ---------- Pied de carte ---------- */

.otk-card__footer {
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin-top: auto;
	padding-top: 14px;
}

.otk-card__price {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -.02em;
	color: var(--otk-ink);
}

.otk-card__price del {
	font-size: 13px;
	font-weight: 500;
	color: var(--otk-ink-3);
	margin-right: 7px;
	text-decoration-thickness: 1px;
}

.otk-card__price ins {
	text-decoration: none;
	color: var(--otk-red);
}

/* « À partir de » sur les produits variables */
.otk-card__price .from,
.otk-card__price small {
	display: block;
	margin-bottom: 1px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--otk-ink-3);
}

.otk-card__cote {
	margin: 4px 0 0;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--otk-ink-3);
}

.otk-card__stock {
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
}

.otk-card__stock--alert { color: var(--otk-red); }
.otk-card__stock--info  { color: var(--otk-ink-2); }
.otk-card__stock--muted { color: var(--otk-ink-3); }

/* ---------- Bouton ---------- */

.otk-card__cta {
	position: relative;
	z-index: 2;
	margin-top: 2px;
}

.otk-btn {
	display: block;
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--otk-ink);
	border-radius: 5px;
	background: var(--otk-ink);
	color: #fff;
	font-family: inherit;
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .07em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.otk-btn--solid:hover,
.otk-btn--solid:focus-visible {
	background: var(--otk-red);
	border-color: var(--otk-red);
	color: #fff;
}

.otk-btn--ghost {
	background: transparent;
	border-color: var(--otk-line);
	color: var(--otk-ink-2);
}

.otk-btn--ghost:hover,
.otk-btn--ghost:focus-visible {
	border-color: var(--otk-ink);
	color: var(--otk-ink);
}

/* État AJAX WooCommerce */
.otk-btn.loading { opacity: .55; pointer-events: none; }
.otk-btn.added   { background: var(--otk-red); border-color: var(--otk-red); }

.otk-card .added_to_cart {
	position: relative;
	z-index: 2;
	display: block;
	margin-top: 7px;
	font-size: 11.5px;
	font-weight: 600;
	text-align: center;
	text-decoration: underline;
	color: var(--otk-ink-2);
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
	.otk-card__media img { padding: 7%; }
	.otk-card__body   { padding-top: 10px; gap: 5px; }
	.otk-card__title  { font-size: 14px; }
	.otk-card__meta   { font-size: 11px; }
	.otk-card__price  { font-size: 17px; }
	.otk-card__footer { padding-top: 11px; gap: 7px; }
	.otk-btn          { padding: 11px 8px; font-size: 10.5px; letter-spacing: .05em; }
	.otk-card__flags  { top: 7px; left: 7px; gap: 4px; max-width: calc(100% - 14px); }
	.otk-card__badge,
	.otk-card__grade  { font-size: 9px; padding: 5px 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.otk-card__media img { transition: none; }
	.otk-card:hover .otk-card__media img,
	.otk-card:focus-within .otk-card__media img { transform: none; }
}
