/*
 * Reusable components (prefix .as-). Used by theme templates and by the
 * assigan-core / assigan-chat plugins, which rely on these class names.
 */

/* ---------- Buttons ---------- */
.as-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--as-space-2);
	min-height: var(--as-touch);
	min-width: var(--as-touch);
	padding: var(--as-space-2) var(--as-space-5);
	border: 2px solid transparent;
	border-radius: var(--as-radius-pill);
	font-family: var(--as-font-body);
	font-size: var(--as-text-base);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}
.as-btn--primary { background: var(--as-gold); color: var(--as-forest); }
.as-btn--primary:hover, .as-btn--primary:focus-visible { background: var(--as-gold-hover); color: var(--as-forest); }
.as-btn--secondary { background: var(--as-green); color: var(--as-white); }
.as-btn--secondary:hover, .as-btn--secondary:focus-visible { background: var(--as-green-hover); color: var(--as-white); }
.as-btn--ghost { background: transparent; color: var(--as-forest); border-color: var(--as-forest); }
.as-btn--block { display: flex; width: 100%; }
.as-btn[disabled], .as-btn.is-disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Card (product / vendor) ---------- */
.as-card {
	background: var(--as-surface);
	border: 1px solid var(--as-line);
	border-radius: var(--as-radius);
	box-shadow: var(--as-shadow);
	overflow: hidden;
}
.as-card__media { aspect-ratio: 1 / 1; background: var(--as-surface-alt); }
.as-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.as-card__body { padding: var(--as-space-3); display: grid; gap: var(--as-space-1); }
.as-card__title { font-family: var(--as-font-display); font-size: var(--as-text-base); font-weight: 600; margin: 0; }
.as-card__price { font-weight: 700; color: var(--as-forest); }
.as-card__meta { font-size: var(--as-text-sm); color: var(--as-ink-muted); }

/* ---------- Badges ---------- */
.as-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--as-space-1);
	padding: 2px var(--as-space-2);
	border-radius: var(--as-radius-pill);
	font-size: var(--as-text-xs);
	font-weight: 600;
	line-height: 1.6;
}
.as-badge--verified { background: var(--as-green); color: var(--as-white); }
.as-badge--location { background: var(--as-surface-alt); color: var(--as-forest); border: 1px solid var(--as-line); }
.as-badge--warning { background: #fdf0d5; color: #7a4f00; }

/* ---------- Chips (category / neighbourhood filters) ---------- */
.as-chips { display: flex; gap: var(--as-space-2); overflow-x: auto; padding-bottom: var(--as-space-1); scrollbar-width: none; }
.as-chip {
	flex: 0 0 auto;
	min-height: var(--as-touch);
	padding: 0 var(--as-space-4);
	display: inline-flex;
	align-items: center;
	border-radius: var(--as-radius-pill);
	border: 1px solid var(--as-line);
	background: var(--as-surface);
	color: var(--as-forest);
	font-size: var(--as-text-sm);
	font-weight: 500;
	text-decoration: none;
}
.as-chip[aria-pressed="true"], .as-chip.is-active { background: var(--as-forest); color: var(--as-white); border-color: var(--as-forest); }

/* ---------- Grid ---------- */
.as-grid { display: grid; gap: var(--as-space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .as-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--as-space-4); } }
@media (min-width: 1100px) { .as-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Section heading ("Près de chez vous") ---------- */
.as-section { margin-block: var(--as-space-6); }
.as-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--as-space-3); margin-bottom: var(--as-space-3); }
.as-section__title { font-size: var(--as-text-xl); margin: 0; }

/* ---------- Notices ---------- */
.as-notice { padding: var(--as-space-3) var(--as-space-4); border-radius: var(--as-radius); border: 1px solid var(--as-line); background: var(--as-surface); }
.as-notice--success { background: #e8f3ec; border-color: #c4e0cf; }
.as-notice--warning { background: #fdf3df; border-color: #f0dcae; }
.as-notice--danger { background: #fdecea; border-color: #f4c7c2; }

/* ---------- Language switch FR | EN ---------- */
.as-lang { display: inline-flex; gap: var(--as-space-1); }
.as-lang a { min-width: var(--as-touch); min-height: var(--as-touch); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; text-decoration: none; }
.as-lang a[aria-current="true"] { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Screen-reader only ---------- */
.as-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
