/* =========================================================
   Noty Annonces — styles front
   Variables surchargeables par le thème :
     --noty-accent, --noty-accent-loc, --noty-radius, --noty-card-bg, --noty-text, --noty-muted
   ========================================================= */
:root {
	--noty-accent: #0d1b3d;
	--noty-accent-loc: #0369a1;
	--noty-radius: 14px;
	--noty-card-bg: #FBF8F1;
	--noty-text: #0f172a;
	--noty-muted: #6E6B66;
	--noty-border: #E9E6DF;
	--noty-shadow: 0 4px 18px rgba(15, 23, 42, .08);
}

.noty-annonces-block,
.noty-apercu-block { width: 100%; }

/* ── Grilles ── */
.noty-grid,
.noty-preview__grid {
	display: grid;
	grid-template-columns: repeat(var(--noty-cols, 3), minmax(0, 1fr));
	gap: 22px;
	margin: 18px 0;
}

@media (max-width: 900px) {
	.noty-grid,
	.noty-preview__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
	.noty-grid,
	.noty-preview__grid { grid-template-columns: 1fr; }
}

/* ── Carte annonce (liste) ── */
.noty-card {
	background: var(--noty-card-bg);
	border: 1px solid var(--noty-border);
	border-radius: var(--noty-radius);
	overflow: hidden;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s, transform .15s;
}
.noty-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #F4EFE4;
}
.noty-card__media img {
	width: 100%; height: 100%;
	object-fit: cover; display: block;
	transition: transform .4s;
}
.noty-card:hover .noty-card__media img { transform: scale(1.04); }
.noty-card__badge {
	position: absolute; top: 12px; left: 12px;
	display: inline-flex; align-items: center; gap: 5px;
	background: var(--noty-accent); color: #fff;
	font-size: .72rem; font-weight: 600;
	padding: 5px 10px; border-radius: 999px;
}
.noty-card__badge--location { background: var(--noty-accent-loc); }
.noty-card__badge-icon { width: 13px; height: 13px; }
.noty-card__content { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.noty-card__location { font-size: .78rem; font-weight: 700; letter-spacing: .03em; color: var(--noty-muted); }
.noty-card__location span { font-weight: 500; }
.noty-card__type { font-size: 1.08rem; font-weight: 700; color: var(--noty-text); }
.noty-card__details { font-size: .85rem; color: var(--noty-muted); }
.noty-card__price-block { margin-top: 8px; }
.noty-card__price { font-size: 1.35rem; font-weight: 800; color: var(--noty-accent); line-height: 1.1; }
.noty-card__price-block--location .noty-card__price { color: var(--noty-accent-loc); }
.noty-card__price-details { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.noty-card__price-details span { font-size: .74rem; color: var(--noty-muted); }

/* ── Carte aperçu ── */
.noty-preview-card {
	background: var(--noty-card-bg);
	border: 1px solid var(--noty-border);
	border-radius: var(--noty-radius);
	overflow: hidden;
	display: flex; flex-direction: column;
	transition: box-shadow .2s, transform .15s;
}
.noty-preview-card:hover { box-shadow: var(--noty-shadow); transform: translateY(-2px); }
.noty-preview-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #F4EFE4; }
.noty-preview-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.noty-preview-card:hover .noty-preview-card__media img { transform: scale(1.04); }
.noty-preview-card__tag {
	position: absolute; top: 10px; left: 10px;
	background: var(--noty-accent); color: #fff;
	font-size: .7rem; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.noty-preview-card__tag--location { background: var(--noty-accent-loc); }
.noty-preview-card__price {
	position: absolute; bottom: 10px; right: 10px;
	background: rgba(15, 23, 42, .82); color: #fff;
	font-size: .82rem; font-weight: 700; padding: 5px 11px; border-radius: 8px;
	backdrop-filter: blur(4px);
}
.noty-preview-card__content { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.noty-preview-card__location { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--noty-muted); }
.noty-preview-card__icon { width: 14px; height: 14px; flex-shrink: 0; }
.noty-preview-card__type { font-size: 1rem; font-weight: 700; color: var(--noty-text); margin: 0; }
.noty-preview-card__features { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 2px; }
.noty-preview-card__feature { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--noty-muted); }
.noty-preview-card__feature svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── En-tête aperçu + CTA ── */
.noty-preview__header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.noty-preview__title { font-size: 1.6rem; font-weight: 800; margin: 0; color: var(--noty-text); }
.noty-preview__subtitle { margin: 4px 0 0; color: var(--noty-muted); }
.noty-preview__count { font-size: .85rem; font-weight: 600; color: var(--noty-accent); }
.noty-preview__cta { text-align: center; margin-top: 8px; }
.noty-preview__btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--noty-accent); color: #fff !important;
	text-decoration: none; font-weight: 600;
	padding: 12px 24px; border-radius: 999px;
	transition: transform .15s, box-shadow .2s;
}
.noty-preview__btn:hover { transform: translateY(-1px); box-shadow: var(--noty-shadow); }
.noty-preview__btn-icon { width: 18px; height: 18px; transition: transform .2s; }
.noty-preview__btn:hover .noty-preview__btn-icon { transform: translateX(3px); }

/* ── Compteur / bouton « Afficher plus » / états ── */
.noty-results-count { font-size: .9rem; color: var(--noty-muted); margin-bottom: 6px; }
.noty-more { text-align: center; margin: 24px 0 8px; }
.noty-more__btn {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--noty-accent); color: #fff !important;
	text-decoration: none; font-weight: 600;
	padding: 12px 28px; border-radius: 999px; cursor: pointer;
	transition: transform .15s, box-shadow .2s;
}
.noty-more__btn:hover { transform: translateY(-1px); box-shadow: var(--noty-shadow); }
.noty-empty, .noty-error, .noty-loading {
	padding: 28px; text-align: center; color: var(--noty-muted);
	background: #F4EFE4; border: 1px dashed var(--noty-border); border-radius: var(--noty-radius);
}
.noty-error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.noty-loading { display: flex; align-items: center; justify-content: center; gap: 12px; }
.noty-spinner {
	width: 22px; height: 22px; border: 3px solid var(--noty-border);
	border-top-color: var(--noty-accent); border-radius: 50%;
	animation: noty-spin .8s linear infinite;
}
@keyframes noty-spin { to { transform: rotate(360deg); } }

/* ── Filtres ── */
.noty-filters {
	background: var(--noty-card-bg);
	border: 1px solid var(--noty-border);
	border-radius: var(--noty-radius);
	padding: 18px; margin-bottom: 20px;
}
.noty-filters__main { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 14px; align-items: end; }
.noty-filters__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.noty-filters__row--actions { grid-template-columns: 1fr; }
.noty-filters__advanced { border-top: 1px solid var(--noty-border); margin-top: 16px; padding-top: 4px; }
.noty-filters, .noty-filters *, .noty-filters *::before, .noty-filters *::after { box-sizing: border-box; }
.noty-filters__field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.noty-filters__field > span { font-size: .78rem; font-weight: 600; color: var(--noty-muted); }
.noty-filters__field input,
.noty-filters__field select {
	width: 100%; max-width: 100%; margin: 0; padding: 9px 11px;
	border: 1px solid var(--noty-border); border-radius: 9px;
	font-size: .9rem; line-height: 1.3; background: #fff; color: var(--noty-text);
}
.noty-filters__field input:focus,
.noty-filters__field select:focus { outline: 2px solid var(--noty-accent); outline-offset: -1px; border-color: var(--noty-accent); }
.noty-filters__actions { display: flex; gap: 8px; }
.noty-filters__btn {
	display: inline-flex; align-items: center; gap: 6px;
	border: 1px solid var(--noty-border); background: #fff; color: var(--noty-text);
	font-size: .88rem; font-weight: 600; padding: 9px 16px; border-radius: 9px; cursor: pointer;
	transition: background .15s, border-color .15s;
}
.noty-filters__btn:hover { background: #F4EFE4; }
.noty-filters__btn--search { background: var(--noty-accent); border-color: var(--noty-accent); color: #fff; }
.noty-filters__btn--search:hover { filter: brightness(1.05); background: var(--noty-accent); }
.noty-filters__btn--active { border-color: var(--noty-accent); color: var(--noty-accent); }
.noty-btn-icon, .noty-toggle-icon { width: 15px; height: 15px; transition: transform .2s; }
.noty-filters__field--spacer { visibility: hidden; }

@media (max-width: 780px) {
	.noty-filters__main { grid-template-columns: 1fr; }
	.noty-filters__row { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Lightbox photos (galerie carte)
   ========================================================= */
.noty-lightbox { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.92); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.noty-lightbox--open { opacity: 1; visibility: visible; }
.noty-lightbox__img-wrap { position: relative; max-width: 90vw; max-height: 85vh; display: flex; align-items: center; justify-content: center; }
.noty-lightbox__img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.5); transition: opacity .25s; user-select: none; -webkit-user-drag: none; }
.noty-lightbox__img--loading { opacity: .3; }
.noty-lightbox__close { position: absolute; top: 16px; right: 16px; z-index: 10; width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(255,255,255,.15); backdrop-filter: blur(8px); color: #fff; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s; }
.noty-lightbox__close:hover { background: rgba(255,255,255,.3); transform: scale(1.1); }
.noty-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; width: 48px; height: 48px; border: none; border-radius: 50%; background: rgba(255,255,255,.15); backdrop-filter: blur(8px); color: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s; }
.noty-lightbox__nav:hover { background: rgba(255,255,255,.3); transform: translateY(-50%) scale(1.1); }
.noty-lightbox__nav--prev { left: 16px; }
.noty-lightbox__nav--next { right: 16px; }
.noty-lightbox__nav:disabled { opacity: .25; cursor: default; transform: translateY(-50%); }
.noty-lightbox__counter { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.8); font-size: 14px; font-weight: 500; background: rgba(0,0,0,.5); backdrop-filter: blur(8px); padding: 6px 16px; border-radius: 20px; user-select: none; }
.noty-lightbox__spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: noty-lb-spin .8s linear infinite; display: none; }
.noty-lightbox__img--loading ~ .noty-lightbox__spinner { display: block; }
@keyframes noty-lb-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
.noty-preview-card__media, .noty-card__media { position: relative; overflow: hidden; }
.noty-preview-card__media[data-noty-gallery]::after, .noty-card__media[data-noty-gallery]::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .2s; pointer-events: none; }
.noty-preview-card__media[data-noty-gallery]:hover::after, .noty-card__media[data-noty-gallery]:hover::after { background: rgba(0,0,0,.08); }
.noty-photo-count { position: absolute; bottom: 8px; right: 8px; z-index: 2; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); color: #fff; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 12px; display: flex; align-items: center; gap: 4px; pointer-events: none; }
.noty-photo-count svg { width: 14px; height: 14px; }
/* Sur les cartes d'aperçu, le prix occupe le coin bas-droit : on décale le compteur à gauche. */
.noty-preview-card__media .noty-photo-count { right: auto; left: 8px; }

/* =========================================================
   Modale détail annonce
   ========================================================= */
#noty-detail-overlay { position: fixed; inset: 0; z-index: 99998; background: rgba(15,23,42,.65); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: ndm-fade-in .2s ease; }
@keyframes ndm-fade-in { from { opacity: 0; } to { opacity: 1; } }
.ndm-box { background: #fff; border-radius: 16px; max-width: 780px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 24px 80px rgba(0,0,0,.35); animation: ndm-slide-up .25s ease; }
@keyframes ndm-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ndm-close { position: absolute; top: 14px; right: 14px; z-index: 10; width: 36px; height: 36px; background: #F4EFE4; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #6E6B66; transition: background .15s, color .15s; }
.ndm-close:hover { background: #E9E6DF; color: #1e293b; }
.ndm-close svg { width: 16px; height: 16px; }
.ndm-header { padding: 24px 24px 0; }
.ndm-ref { font-size: .72rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 6px; }
.ndm-title { font-size: 1.3rem; font-weight: 700; color: #0f172a; margin: 0 0 10px; padding-right: 40px; }
.ndm-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.ndm-meta-item { display: flex; align-items: center; gap: 5px; font-size: .83rem; color: #6E6B66; }
.ndm-meta-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.ndm-price { font-size: 1.8rem; font-weight: 800; color: #0d1b3d; line-height: 1; margin-bottom: 4px; }
.ndm-price--location { color: #0369a1; }
.ndm-hn { font-size: .75rem; color: #94a3b8; margin: 0 0 16px; }
.ndm-carousel { position: relative; margin-top: 20px; background: #0f172a; border-radius: 0 0 16px 16px; overflow: hidden; }
.ndm-carousel__track { display: flex; transition: transform .35s cubic-bezier(.4,0,.2,1); will-change: transform; cursor: zoom-in; }
.ndm-carousel__slide { flex: 0 0 100%; aspect-ratio: 1 / 1; max-height: 480px; }
.ndm-carousel__slide img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.ndm-carousel__btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s; }
.ndm-carousel__btn:hover { background: rgba(255,255,255,.32); }
.ndm-carousel__btn:disabled { opacity: .25; cursor: default; }
.ndm-carousel__btn svg { width: 18px; height: 18px; }
.ndm-carousel__btn--prev { left: 10px; }
.ndm-carousel__btn--next { right: 10px; }
.ndm-carousel__dots { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.ndm-carousel__dot { width: 7px; height: 7px; border-radius: 50%; border: none; background: rgba(255,255,255,.4); cursor: pointer; padding: 0; transition: background .2s, transform .2s; }
.ndm-carousel__dot--active { background: #fff; transform: scale(1.3); }
.ndm-carousel__counter { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.65); font-size: 12px; background: rgba(0,0,0,.35); padding: 2px 10px; border-radius: 10px; pointer-events: none; }
.ndm-section { padding: 20px 24px; border-top: 1px solid #F4EFE4; }
.ndm-section__title { font-size: .72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; }
.ndm-desc { font-size: .88rem; line-height: 1.7; color: #6E6B66; white-space: pre-wrap; margin: 0; }
[data-noty-detail="1"] { transition: box-shadow .2s, transform .15s; }
[data-noty-detail="1"]:hover { box-shadow: 0 8px 28px rgba(0,0,0,.12); transform: translateY(-2px); }
@media (max-width: 600px) {
	#noty-detail-overlay { padding: 0; align-items: flex-end; }
	.ndm-box { border-radius: 16px 16px 0 0; max-height: 95vh; }
	.ndm-carousel__slide { aspect-ratio: 1 / 1; max-height: 360px; }
	.ndm-carousel { border-radius: 0; }
}
