/* Plan de brocante — carte publique. */

.apbp-pub {
	--apbp-line: #d7dad3;
	--apbp-muted: #5f6a62;
	border: 1px solid var(--apbp-line);
	border-radius: 8px;
	overflow: hidden;
	background: #fbfbf6;
	color: #1e261f;
	font-size: 15px;
	margin: 1.5em 0;
}
.apbp-pub-bar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
	padding: 10px 14px; border-bottom: 1px solid var(--apbp-line); background: #f1f2ea;
}
.apbp-pub-legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--apbp-muted); }
.apbp-pub-legende span { display: inline-flex; align-items: center; gap: 6px; }
.apbp-sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.apbp-libre { background: rgba(255,255,255,.55); border: 1px solid #3aa655; }
.apbp-occupe { background: #15803d; }
.apbp-bloque { background: #6b7280; }
.apbp-option { background: #e8891c; }
.apbp-choisi { background: #1d4ed8; }
.apbp-pst.is-choisi { stroke: #1d4ed8; stroke-width: 2.5; }

/* Réservation */
.apbp-resa-form {
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	padding: 12px 14px; border-top: 1px solid var(--apbp-line); background: #f1f2ea;
}
.apbp-resa-choix { margin: 0; flex: 1; font-size: 14.5px; }
.apbp-resa-choix.est-alerte { color: #8a1f1f; }
.apbp-resa-btn {
	background: #15803d; color: #fff; border: none; border-radius: 5px;
	padding: 10px 18px; font-size: 15px; cursor: pointer;
}
.apbp-resa-btn[disabled] { background: #b7bfb8; cursor: not-allowed; }
.apbp-resa-btn:not([disabled]):hover { background: #126b33; }
.apbp-resa .apbp-pst { cursor: pointer; }
.apbp-pub-compteur { margin-left: auto; font-size: 14px; }
.apbp-pub-compteur strong { font-size: 17px; color: #15803d; }

.apbp-pub-map { position: relative; height: var(--apbp-h, 70vh); min-height: 320px; background: #2a2d28; }
.apbp-pub-map svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.apbp-pub-map svg.is-drag { cursor: grabbing; }
.apbp-pub-chargement { color: #ddd; padding: 20px; margin: 0; }
.apbp-pst { stroke-width: .8; cursor: pointer; }
.apbp-pst:hover { fill-opacity: .95 !important; }
.apbp-pst.is-sel { stroke: #ffe14d; stroke-width: 3; }
.apbp-plbl {
	font-family: ui-monospace, Menlo, Consolas, monospace; fill: #fff;
	paint-order: stroke; stroke: #000; stroke-width: 2.2;
	pointer-events: none; text-anchor: middle; dominant-baseline: central;
}

.apbp-pub-info { padding: 10px 14px; border-top: 1px solid var(--apbp-line); font-size: 14px; }
.apbp-pet { padding: 1px 8px; border-radius: 99px; font-size: 13px; }
.apbp-pet.is-libre { background: #e7f5ec; color: #14532d; }
.apbp-pet.is-occupe { background: #f0f1ee; color: #3f4652; }
.apbp-pet.is-bloque { background: #eceef0; color: #3f4652; }

.apbp-pub-secteurs {
	list-style: none; margin: 0; padding: 8px 14px; display: flex; flex-wrap: wrap;
	gap: 6px 18px; border-top: 1px solid var(--apbp-line); font-size: 13.5px; color: var(--apbp-muted);
}
.apbp-pub-secteurs li { display: flex; align-items: center; gap: 6px; }
.apbp-pub-secteurs i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.apbp-pub-secteurs b { color: #15803d; }
.apbp-pub-credit { margin: 0; padding: 6px 14px 10px; font-size: 11.5px; color: var(--apbp-muted); }

@media (max-width: 640px) {
	.apbp-pub-compteur { margin-left: 0; }
	.apbp-pub-map { height: 60vh; }
}

/* Choix du type d'emplacement (Riverain, Personnel de l'école, Externe…) */
.apbp-resa-type {
	display: flex;
	align-items: center;
	gap: .5em;
	flex-wrap: wrap;
	margin: 0 0 .6em;
}
.apbp-resa-type label { font-weight: 600; }
.apbp-resa-type select { max-width: 22em; }
.apbp-resa-zones { color: #6b7280; font-size: .92em; }

/* Emplacement fermé au type choisi : visible, mais pas cliquable. */
.apbp-pst.is-ferme { cursor: not-allowed; }
.apbp-ferme { background: #9ca3af; opacity: .55; }

/* Contrôles de zoom, posés sur la carte */
.apbp-pub-map { position: relative; }
.apbp-pub-ctrl {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	z-index: 2;
}
.apbp-pub-ctrl button {
	width: 34px;
	height: 34px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #1f2937;
	background: rgba(255, 255, 255, .94);
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.apbp-pub-ctrl button:hover { background: #fff; border-color: #94a3b8; }

/* Fiche de l'emplacement cliqué */
.apbp-fiche-titre { margin-bottom: .15em; }
.apbp-fiche-detail { color: #4b5563; font-size: .94em; }
.apbp-fiche-action { margin-top: .5em; display: flex; align-items: center; gap: .8em; flex-wrap: wrap; }
.apbp-fiche-btn[disabled] { opacity: .5; cursor: not-allowed; }
.apbp-fiche-lien { font-size: .94em; }
.apbp-fiche-msg { margin: .45em 0 0; color: #9a3412; }

/* Sur la fiche produit : la carte sort des colonnes et prend toute la largeur.
   Sans le clear, les thèmes qui font flotter la galerie la coincent à droite. */
.apbp-fiche-produit {
	clear: both;
	float: none;
	width: 100%;
	max-width: 100%;
	margin: 2.2em 0 1.5em;
}
.apbp-fiche-produit .apbp-pub { width: 100%; }
.apbp-fiche-renvoi { margin: 1em 0 0; font-weight: 600; }

/* Rendu « page de réservation » : une seule colonne. L'illustration, la
   description, le prix et le bouton d'achat sont retirés à la source ; l'image
   et le texte reviennent côte à côte juste avant le plan. Deux balisages
   coexistent selon le thème : colonnes de blocs, ou galerie + .summary. */

/* --- thème à blocs (template produit en blocs) --- */
body.apbp-page-emplacement main > .wp-block-columns,
body.apbp-page-emplacement .wp-block-columns.alignwide {
	display: flex !important;
	flex-direction: column !important;
	gap: 0 !important;
}
body.apbp-page-emplacement main > .wp-block-columns > .wp-block-column,
body.apbp-page-emplacement .wp-block-columns.alignwide > .wp-block-column {
	width: 100% !important;
	flex-basis: auto !important;
	margin-left: 0 !important;
}
/* Ceinture et bretelles : ces blocs sont déjà retirés côté serveur. */
body.apbp-page-emplacement .wp-block-woocommerce-product-price,
body.apbp-page-emplacement .wp-block-add-to-cart-form,
body.apbp-page-emplacement .wp-block-woocommerce-add-to-cart-form,
body.apbp-page-emplacement .wp-block-woocommerce-product-meta,
body.apbp-page-emplacement .wp-block-woocommerce-product-image-gallery,
body.apbp-page-emplacement .wp-block-columns .wp-block-post-excerpt {
	display: none !important;
}

/* --- thème classique (galerie flottée + .summary) --- */
body.apbp-page-emplacement div.product > .summary,
body.apbp-page-emplacement div.product > .entry-summary {
	float: none !important;
	width: 100% !important;
	margin: 0;
}
body.apbp-page-emplacement div.product > .woocommerce-product-gallery,
body.apbp-page-emplacement div.product > .summary .price,
body.apbp-page-emplacement div.product > .summary form.cart,
body.apbp-page-emplacement div.product > .summary .variations_form,
body.apbp-page-emplacement div.product > .summary .stock,
body.apbp-page-emplacement div.product > .summary .product_meta,
body.apbp-page-emplacement div.product > .summary .woocommerce-product-rating {
	display: none !important;
}

/* --- l'illustration et la description, remises côte à côte --- */
.apbp-intro {
	display: flex;
	gap: 1.6em;
	align-items: flex-start;
	margin: 0 0 1.6em;
}
.apbp-intro-image { flex: 0 0 32%; max-width: 320px; }
.apbp-intro-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}
.apbp-intro-texte { flex: 1 1 auto; min-width: 0; }
.apbp-intro-texte > :first-child { margin-top: 0; }
.apbp-intro-texte > :last-child { margin-bottom: 0; }

@media (max-width: 640px) {
	.apbp-intro { flex-direction: column; gap: 1em; }
	.apbp-intro-image { flex: 0 0 auto; max-width: 100%; }
}

.apbp-intro-seule { display: block; }
.apbp-intro-texte .apbp-mode-emploi { margin: 1.1em 0 0; }
.apbp-intro-texte .apbp-mode-emploi h2 { font-size: 1.15em; }
.apbp-mode-emploi { margin: 0 0 1.4em; }
.apbp-mode-emploi h2 { margin: 0 0 .4em; }
.apbp-mode-emploi ol { margin: 0; padding-left: 1.3em; }
.apbp-mode-emploi li { margin-bottom: .25em; }
