/* Auto Plaatsen: formulier (.ap-tool) en de auto-pagina (.ap-auto) */

.ap-tool,
.ap-auto {
	--ap-accent: #1f5fbf;
	--ap-groen: #1e7d3c;
	--ap-rood: #b3261e;
	--ap-rand: rgba(0, 0, 0, .14);
	--ap-zacht: rgba(0, 0, 0, .04);
	--ap-tekst-zacht: rgba(0, 0, 0, .62);
	--ap-radius: 10px;
}

.ap-tool *,
.ap-tool *::before,
.ap-tool *::after { box-sizing: border-box; }

.ap-tool { max-width: 920px; margin: 0 auto; font-size: 17px; line-height: 1.5; }
.ap-tool p { margin: 0 0 .75em; }
.ap-kop { margin: 1.2em 0 .6em; font-size: 1.5em; line-height: 1.2; }

/* Meldingen */
.ap-melding { padding: 14px 16px; border-radius: var(--ap-radius); margin: 0 0 16px; border-left: 5px solid; background: var(--ap-zacht); }
.ap-melding--ok { border-color: var(--ap-groen); }
.ap-melding--fout { border-color: var(--ap-rood); }

/* Knoppen */
.ap-knop {
	display: inline-flex; align-items: center; justify-content: center; gap: .3em;
	min-height: 44px; padding: 8px 16px; margin: 0;
	font: inherit; font-size: .95em; font-weight: 600; line-height: 1.2; text-decoration: none !important;
	color: inherit; background: #fff; border: 1px solid var(--ap-rand); border-radius: 8px;
	cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s;
}
.ap-knop:hover { background: var(--ap-zacht); }
.ap-knop:focus-visible { outline: 3px solid var(--ap-accent); outline-offset: 2px; }
.ap-knop--hoofd { background: var(--ap-accent); border-color: var(--ap-accent); color: #fff !important; }
.ap-knop--groen { background: var(--ap-groen); border-color: var(--ap-groen); color: #fff !important; }
.ap-knop--hoofd:hover, .ap-knop--groen:hover { background: var(--ap-accent); filter: brightness(1.1); }
.ap-knop--groen:hover { background: var(--ap-groen); }
.ap-knop--rood { color: var(--ap-rood) !important; border-color: currentColor; }
.ap-knop--groot { min-height: 52px; padding: 12px 22px; font-size: 1.05em; }
.ap-knop[disabled] { opacity: .55; cursor: wait; }
.ap-mini { display: inline; margin: 0; }

/* Overzicht */
.ap-balk { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ap-balk__gebruiker { color: var(--ap-tekst-zacht); font-size: .9em; }
.ap-leeg { padding: 24px; text-align: center; border: 2px dashed var(--ap-rand); border-radius: var(--ap-radius); }
.ap-lijst { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ap-item {
	display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: start;
	padding: 14px; border: 1px solid var(--ap-rand); border-radius: var(--ap-radius); background: #fff; margin: 0;
}
.ap-item--concept { background: #fafafa; }
.ap-item__foto { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--ap-zacht); display: grid; place-items: center; color: var(--ap-tekst-zacht); font-size: .85em; }
.ap-item__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-item__titel { margin: 4px 0 2px; font-size: 1.15em; line-height: 1.3; }
.ap-item__sub { margin: 0; color: var(--ap-tekst-zacht); font-size: .92em; }
.ap-item__labels { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-item__acties { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.ap-label { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.ap-label--online { background: #dff3e5; color: #155c2c; }
.ap-label--concept { background: #fff1cc; color: #6b4e00; }
.ap-label--verkocht { background: #fbe0de; color: #8c1d17; }

/* Formulier */
.ap-terug { text-decoration: none; }
.ap-hint { color: var(--ap-tekst-zacht); font-size: .9em; }
.ap-form .ap-kaart, .ap-kaart {
	border: 1px solid var(--ap-rand); border-radius: var(--ap-radius); padding: 18px; margin: 0 0 18px; background: #fff; min-width: 0;
}
.ap-kaart legend { font-weight: 700; font-size: 1.1em; padding: 0 6px; }
.ap-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.ap-raster--breed { grid-template-columns: 1fr; }
.ap-veld label { display: block; font-weight: 600; margin-bottom: 4px; }
.ap-veld input[type="text"],
.ap-veld input[type="date"],
.ap-veld select,
.ap-veld textarea {
	width: 100%; min-height: 46px; padding: 10px 12px; margin: 0;
	font: inherit; font-size: 16px; color: inherit; background: #fff;
	border: 1px solid rgba(0, 0, 0, .3); border-radius: 8px;
}
.ap-veld textarea { min-height: 120px; resize: vertical; }
.ap-veld input:focus, .ap-veld select:focus, .ap-veld textarea:focus { outline: 3px solid rgba(31, 95, 191, .35); border-color: var(--ap-accent); }
.ap-veld .ap-hint { margin: 4px 0 0; }
.ap-eenheid { display: flex; align-items: stretch; }
.ap-eenheid span { display: flex; align-items: center; padding: 0 12px; background: var(--ap-zacht); border: 1px solid rgba(0, 0, 0, .3); color: var(--ap-tekst-zacht); }
.ap-eenheid span:first-child { border-right: 0; border-radius: 8px 0 0 8px; }
.ap-eenheid span:last-child { border-left: 0; border-radius: 0 8px 8px 0; }
.ap-eenheid input:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.ap-eenheid input:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.ap-verplicht { color: var(--ap-rood); }
.ap-veld--fout input, .ap-veld--fout select, .ap-veld--fout textarea { border-color: var(--ap-rood); border-width: 2px; }
.ap-foutmelding { color: var(--ap-rood); font-size: .9em; font-weight: 600; margin: 4px 0 0 !important; }

/* Foto's */
.ap-upload {
	display: flex; align-items: center; gap: 14px; padding: 22px; margin: 6px 0 8px;
	border: 2px dashed var(--ap-accent); border-radius: var(--ap-radius); background: rgba(31, 95, 191, .05); cursor: pointer;
}
.ap-upload::before { content: "📷"; font-size: 2em; line-height: 1; }
.ap-upload__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ap-upload:focus-within { outline: 3px solid var(--ap-accent); outline-offset: 2px; }
.ap-fotos, .ap-voorbeeld { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ap-voorbeeld:empty { display: none; }
.ap-foto { border: 1px solid var(--ap-rand); border-radius: 8px; overflow: hidden; background: #fff; font-size: .9em; }
.ap-foto img, .ap-voorbeeld img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ap-voorbeeld img { border-radius: 8px; }
.ap-foto label { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 0; cursor: pointer; }
.ap-foto__weg { color: var(--ap-rood); border-top: 1px solid var(--ap-rand); }
.ap-foto:has(.ap-foto__weg input:checked) img { opacity: .3; }

.ap-opslaan {
	position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	padding: 14px 0; background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0));
}
.ap-bezig { font-weight: 600; }

@media (max-width: 600px) {
	.ap-item { grid-template-columns: 96px 1fr; }
	.ap-item__acties .ap-knop, .ap-item__acties .ap-mini { flex: 1 1 auto; }
	.ap-item__acties .ap-mini .ap-knop { width: 100%; }
	.ap-opslaan { gap: 8px; padding: 10px 0; }
	.ap-opslaan .ap-knop { flex: 1 1 0; min-width: 0; white-space: normal; padding: 10px 8px; font-size: .95em; }
	.ap-bezig { flex: 1 1 100%; text-align: center; }
	.ap-balk .ap-knop { width: 100%; }
	.ap-kaart { padding: 14px; }
}

/* ---------- De auto-pagina ---------- */
.ap-auto__prijs { font-size: 2em; font-weight: 800; margin: 0 0 .5em; }
.ap-auto__verkocht {
	display: inline-block; padding: 8px 16px; border-radius: 8px;
	background: var(--ap-rood); color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.ap-auto__specs { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; }
.ap-auto__specs th, .ap-auto__specs td { padding: 10px 12px; border-bottom: 1px solid var(--ap-rand); text-align: left; vertical-align: top; }
.ap-auto__specs th { width: 40%; font-weight: 600; background: var(--ap-zacht); }
.ap-auto__opties { columns: 2 220px; }
.ap-auto__galerij { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 1.5em; }
.ap-auto__galerij a { display: block; border-radius: 8px; overflow: hidden; }
.ap-auto__galerij img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; margin: 0; transition: transform .25s; }
.ap-auto__galerij a:hover img { transform: scale(1.03); }

/* Eenvoudige fotoviewer */
.ap-viewer { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; }
.ap-viewer img { max-width: 94vw; max-height: 86vh; object-fit: contain; }
.ap-viewer button {
	position: absolute; background: rgba(255, 255, 255, .15); color: #fff; border: 0; border-radius: 50%;
	width: 52px; height: 52px; font-size: 26px; line-height: 1; cursor: pointer;
}
.ap-viewer button:hover { background: rgba(255, 255, 255, .3); }
.ap-viewer__dicht { top: 14px; right: 14px; }
.ap-viewer__vorige { left: 14px; top: 50%; transform: translateY(-50%); }
.ap-viewer__volgende { right: 14px; top: 50%; transform: translateY(-50%); }
.ap-viewer__teller { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 15px; }
.ap-auto__galerij > br, .ap-auto__galerij > p:empty { display: none; }
