/**
 * Styles pour l'archive des logements
 * Note: Les styles de la barre de recherche sont dans accommodation-search-form.css
 */

.custom-container{
	/*max-width: 2000px;*/
	margin-left: auto;
	margin-right: auto;
	padding-left: max(3vw,15px);
	padding-right: max(3vw,15px);
}

.accommodation-archive {
	padding: 60px 0;
}

/* Préchargement - éviter le flash des vignettes non stylées */
.products-grid {
	opacity: 1;
	transition: opacity 0.3s ease, filter 0.3s ease;
	position: relative;
}

.products-grid.loading {
	opacity: 0.5;
	filter: blur(3px);
	pointer-events: none;
}

h1{
	color: #FFFFFF;
	font-size: 3rem;
	text-align: center;
	margin-bottom: 30px;
}

#breadcrumbs{
	text-align: center;
}

#breadcrumbs *,
#breadcrumbs a,
#breadcrumbs .breadcrumb_last{
	color: #FFFFFF;
}

.archive-content {
	padding-top: 15px;
	display: flex;
	flex-wrap: wrap;
	gap: 15px 30px;
	position: relative;
}

.posts-counter {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
}

/* Liste des produits avec map */
.archive-main-with-map {
	flex: 1;
}

/* Map */
.archive-map {
	flex: 1;
}

.archive-map-content{
	position: sticky;
	/*top: max(3vw,15px);*/
	top: 50px;
	/*height: calc(100vh - (max(3vw,15px) * 2));*/
	height: calc(100vh - 100px);
	background: #f0f0f0;
	align-self: start;
	border-radius: 30px;
	overflow: hidden;
}

#accommodations-map {
	width: 100%;
	height: 100%;
}

/* Leaflet marker personnalisé */
.price-marker {
	background: white;
	border: 2px solid #333;
	border-radius: 20px;
	padding: 3px 6px;
	font-weight: 700;
	font-size: 14px;
	color: #333;
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
	cursor: pointer;
	transition: all 0.3s ease;
	width: fit-content !important;
	text-align: center;
}

.price-marker:hover,
.price-marker-highlight {
	background: #333;
	color: white;
	transform: scale(1.1);
	z-index: 1000 !important;
}

/* Anciens styles (désactivés) */
.archive-layout,
.archive-sidebar {
	display: none;
}

/* Grille de produits */
.products-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Résultat de recherche / tri */
.woocommerce-result-count {
	font-size: 1rem;
	color: #666;
}

.woocommerce-ordering {
	margin-bottom: 30px;
}

.woocommerce-ordering select {
	padding: 8px 30px 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
	font-size: 0.9rem;
}

/* Pagination */
.archive-content .woocommerce-pagination {
	display: flex !important;
	justify-content: center;
	margin: 30px 0;
}

.woocommerce-pagination {
	margin-top: 40px;
	text-align: center;
}

.woocommerce-pagination ul {
	display: inline-flex;
	gap: 10px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.woocommerce-pagination ul li {
	display: inline-block;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
	display: block;
	padding: 8px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	color: #1D2B01;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
}

.woocommerce-pagination ul li a:hover {
	background: #1D2B01;
	color: white;
	border-color: #1D2B01;
}

.woocommerce-pagination ul li span.current {
	background: #1D2B01;
	color: white;
	border-color: #1D2B01;
	cursor: default;
}

/* Aucun produit trouvé */
.no-products-found {
	text-align: center;
	padding: 60px 20px;
	background: #f8f8f8;
	border-radius: 8px;
}

.no-products-found .woocommerce-info {
	font-size: 1.1rem;
	color: #666;
	margin: 0;
}

/* Popup Leaflet personnalisée pour les markers */
.accommodation-marker-popup .leaflet-popup-content-wrapper {
	border-radius: 16px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.accommodation-marker-popup .leaflet-popup-content {
	margin: 0;
	width: 280px !important;
}

.accommodation-marker-popup .leaflet-popup-tip {
	background: white;
}

.accommodation-marker-popup .marker-popup-content {
	background: white;
}

.accommodation-marker-popup .popup-link {
	display: block;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s ease;
}

.accommodation-marker-popup .popup-link:hover {
	opacity: 0.95;
}

.accommodation-marker-popup .popup-image {
	position: relative;
	width: 100%;
	height: 200px;
	overflow: hidden;
}

.accommodation-marker-popup .popup-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.accommodation-marker-popup .popup-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	width: 36px;
	height: 36px;
	background: white;
	border-radius: 50%;
	padding: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.accommodation-marker-popup .popup-badge img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.accommodation-marker-popup .popup-details {
	padding: 12px 16px 16px;
}

.accommodation-marker-popup .popup-category {
	font-size: 11px;
	color: #666;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.accommodation-marker-popup .popup-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 8px 0;
	color: #333;
	line-height: 1.3;
}

.accommodation-marker-popup .popup-price {
	font-size: 15px;
	font-weight: 700;
	color: #333;
}

.accommodation-marker-popup .popup-price span {
	font-size: 13px;
	font-weight: 400;
	color: #666;
}

.accommodation-marker-popup .leaflet-popup-close-button {
	width: 24px;
	height: 24px;
	font-size: 20px;
	font-weight: 700;
	color: #333;
	top: 8px;
	right: 8px;
	padding: 0;
}

.accommodation-marker-popup .leaflet-popup-close-button:hover {
	color: #000;
}

/* Loader pour le chargement des accommodations */
.accommodation-loader {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	z-index: 10000;
	background: white;
	padding: 30px 40px;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.accommodation-loader p {
	margin: 15px 0 0 0;
	color: #666;
	font-size: 14px;
}

.loader-spinner {
	width: 40px;
	height: 40px;
	margin: 0 auto;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #333;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Messages d'erreur et aucun résultat */
.no-results-message,
.error-message {
	padding: 60px 40px;
	text-align: center;
	color: #666;
	background: #f8f8f8;
	border-radius: 12px;
	margin: 20px 0;
}

.no-results-message svg {
	color: #999;
	margin-bottom: 20px;
}

.no-results-message h3 {
	font-size: 20px;
	font-weight: 600;
	color: #333;
	margin: 0 0 12px 0;
}

.no-results-message p {
	font-size: 15px;
	color: #666;
	line-height: 1.6;
	margin: 0;
}

.error-message {
	background: #ffebee;
	color: #c62828;
}



@media (max-width: 1999px) {
	.products-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 1299px) {
	.products-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 991px) {

	.search-bar-wrapper:not(.waiting-page){
		position: fixed;
        top: 55px;
		left: 0;
		width: 100%;
		z-index: 2;
		margin-bottom: unset;
	}

	.search-bar-wrapper{
		padding-top: max(5vw,50px)
	}

	h1{
		display: none;
	}

	.posts-counter{
		position: absolute;
        top: calc(100vh - 198px);
		left: 0;
		margin-bottom: unset;
		width: 100%;
		z-index: 3;
		background: white;
		border-top-left-radius: 16px; 
		border-top-right-radius: 16px; 
		padding: 15px;
	}  

	.archive-main-with-map {
		flex: 0 0 100%;
		max-width: 100%;
		width: 100%;
		position: absolute;
        top: calc(100vh - 150px);
        left: 0;
        z-index: 3;
		padding: 0 15px 15px;
        background: white;
	}

	.archive-map {
		flex: 0 0 100%;
		position: fixed;
        top: 55px;
		left: 0;
		max-width: 100%;
		width: 100%;
        height: calc(100vh - 190px);
        z-index: 1;
		padding: 15px;
	}

	.archive-map-content{
		top: unset;
        position: relative;
        height: 100%;
	}

	.products-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	body.post-type-archive-product>footer{
		display: none;
	}
}

@media (max-width: 767px) {
	.products-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 575px) {
	.products-grid {
		grid-template-columns: 1fr;
	}
}