/*
 * OuadhiasMarket — styles isolés.
 * Toutes les règles sont préfixées par .oqm-wrap pour ne JAMAIS affecter le thème hôte.
 * Les variables sont déclarées sur .oqm-wrap (et non sur :root) afin de rester confinées.
 */

.oqm-wrap {
	--oqm-accent: #2c7a4b;        /* vert olive : rappel agriculture/terroir */
	--oqm-accent-dark: #1f5c38;
	--oqm-terracotta: #b4532a;    /* terre cuite : rappel poterie/artisanat */
	--oqm-bg: #ffffff;
	--oqm-soft: #f5f3ee;          /* tons sable */
	--oqm-border: #e2ddd2;
	--oqm-text: #2b2b2b;
	--oqm-muted: #6b6b6b;
	--oqm-radius: 10px;
	--oqm-shadow: 0 1px 3px rgba(0,0,0,.08);

	box-sizing: border-box;
	color: var(--oqm-text);
	font-size: 16px;
	line-height: 1.5;
	max-width: 100%;
}

.oqm-wrap *,
.oqm-wrap *::before,
.oqm-wrap *::after {
	box-sizing: border-box;
}

/* ---------- Filtres ---------- */
.oqm-filters {
	background: var(--oqm-soft);
	border: 1px solid var(--oqm-border);
	border-radius: var(--oqm-radius);
	padding: 14px;
	margin-bottom: 20px;
}
.oqm-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: stretch;
}
.oqm-filter-row > * {
	flex: 1 1 160px;
	min-width: 140px;
}
.oqm-wrap input[type="text"],
.oqm-wrap input[type="number"],
.oqm-wrap input[type="email"],
.oqm-wrap input[type="file"],
.oqm-wrap select,
.oqm-wrap textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--oqm-border);
	border-radius: 8px;
	background: var(--oqm-bg);
	color: var(--oqm-text);
	font: inherit;
}
.oqm-wrap textarea { resize: vertical; }
.oqm-wrap input:focus,
.oqm-wrap select:focus,
.oqm-wrap textarea:focus {
	outline: 2px solid var(--oqm-accent);
	outline-offset: 1px;
	border-color: var(--oqm-accent);
}

/* ---------- Boutons ---------- */
.oqm-btn {
	display: inline-block;
	cursor: pointer;
	padding: 10px 18px;
	border: 1px solid var(--oqm-accent);
	border-radius: 8px;
	background: var(--oqm-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-align: center;
	transition: background .15s ease;
}
.oqm-btn:hover { background: var(--oqm-accent-dark); border-color: var(--oqm-accent-dark); }
.oqm-btn-primary { width: 100%; padding: 14px; font-size: 1.05em; }

/* ---------- Grille d'annonces ---------- */
.oqm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
}
.oqm-card {
	background: var(--oqm-bg);
	border: 1px solid var(--oqm-border);
	border-radius: var(--oqm-radius);
	overflow: hidden;
	box-shadow: var(--oqm-shadow);
	transition: transform .15s ease, box-shadow .15s ease;
}
.oqm-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.oqm-card-link { text-decoration: none; color: inherit; display: block; }
.oqm-card-media {
	aspect-ratio: 4 / 3;
	background: var(--oqm-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.oqm-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oqm-noimg { color: var(--oqm-muted); font-size: .85em; }
.oqm-card-body { padding: 12px 14px 16px; }
.oqm-card-title {
	margin: 0 0 8px;
	font-size: 1.02em;
	line-height: 1.3;
	color: var(--oqm-text);
}
.oqm-card-price {
	font-weight: 700;
	color: var(--oqm-terracotta);
	margin-bottom: 4px;
}
.oqm-card-loc { font-size: .85em; color: var(--oqm-muted); }

/* ---------- Pagination ---------- */
.oqm-pagination {
	margin-top: 26px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}
.oqm-pagination .page-numbers {
	display: inline-block;
	padding: 8px 13px;
	border: 1px solid var(--oqm-border);
	border-radius: 8px;
	text-decoration: none;
	color: var(--oqm-text);
	background: var(--oqm-bg);
}
.oqm-pagination .page-numbers.current {
	background: var(--oqm-accent);
	border-color: var(--oqm-accent);
	color: #fff;
}
.oqm-empty {
	background: var(--oqm-soft);
	border: 1px dashed var(--oqm-border);
	border-radius: var(--oqm-radius);
	padding: 26px;
	text-align: center;
	color: var(--oqm-muted);
}

/* ---------- Formulaire ---------- */
.oqm-form { display: block; }
.oqm-field { margin-bottom: 16px; }
.oqm-field > label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}
.oqm-field-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
@media (max-width: 540px) {
	.oqm-field-2 { grid-template-columns: 1fr; }
}
.oqm-radios { display: flex; gap: 20px; padding-top: 8px; }
.oqm-radios label { font-weight: 400; }
.oqm-fieldset {
	border: 1px solid var(--oqm-border);
	border-radius: var(--oqm-radius);
	padding: 16px;
	margin: 0 0 16px;
}
.oqm-fieldset legend { font-weight: 700; padding: 0 8px; }
.oqm-hint { font-size: .85em; color: var(--oqm-muted); margin: 6px 0 0; }
.oqm-consent label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }

/* Piège à robots : invisible pour les humains. */
.oqm-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

/* ---------- Notices ---------- */
.oqm-notice {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 18px;
	border: 1px solid transparent;
}
.oqm-notice-success { background: #e8f5ec; border-color: #b6e0c2; color: #1f5c38; }
.oqm-notice-error { background: #fbeaea; border-color: #f0c2c2; color: #9b2c2c; }

/* ---------- Notice de connexion requise ---------- */
.oqm-notice-auth {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}
.oqm-notice-auth p {
	margin: 0;
	flex: 1 1 100%;
}
.oqm-notice-auth .oqm-btn-outline {
	background: #fff;
	color: var(--oqm-accent);
}
.oqm-notice-auth .oqm-btn-outline:hover {
	background: var(--oqm-accent);
	color: #fff;
}

/* ---------- Détail d'une annonce ---------- */
.oqm-single { margin-top: 22px; }
.oqm-single-price {
	font-size: 1.5em;
	font-weight: 800;
	color: var(--oqm-terracotta);
	margin-bottom: 14px;
}
.oqm-meta { list-style: none; padding: 0; margin: 0 0 18px; }
.oqm-meta li { padding: 4px 0; }
.oqm-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
	margin-bottom: 20px;
}
.oqm-gallery img { width: 100%; border-radius: 8px; display: block; }
.oqm-contact {
	background: var(--oqm-soft);
	border: 1px solid var(--oqm-border);
	border-radius: var(--oqm-radius);
	padding: 16px 18px;
}
.oqm-contact h3 { margin: 0 0 10px; }
.oqm-contact a { color: var(--oqm-accent-dark); }
