/**
 * Responsive Styles
 *
 * @package Ensofia_Estates
 * @since 1.0.0
 */

/* Tablet */
@media (max-width: 1024px) {
	.properties-grid.grid-4 {
		grid-template-columns: repeat(2, 1fr);
	}

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

	/* Grid View Tablet */
	.properties-grid.properties-grid-view {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Mixed View Tablet */
	.properties-mixed-view {
		grid-template-columns: 1fr 1fr;
		max-height: 500px;
	}

	.properties-map-container {
		height: 500px;
	}

	/* List View Tablet */
	.properties-list-view .property-card-carousel {
		flex: 0 0 250px;
		max-width: 250px;
		height: 180px;
	}

	.hero-section {
		height: 70vh;
		min-height: 500px;
		max-height: 700px;
	}

	.hero-slide-title {
		font-size: 2.5rem;
	}

	.hero-slide-price {
		font-size: 2rem;
	}

	.hero-slide-meta {
		gap: 1.5rem;
		font-size: 0.95rem;
	}

	.hero-carousel-prev,
	.hero-carousel-next {
		width: 45px;
		height: 45px;
	}

	.hero-carousel-prev {
		left: 1rem;
	}

	.hero-carousel-next {
		right: 1rem;
	}

	[dir="rtl"] .hero-carousel-prev {
		left: auto;
		right: 1rem;
	}

	[dir="rtl"] .hero-carousel-next {
		right: auto;
		left: 1rem;
	}
}

/* Mobile */
@media (max-width: 768px) {
	.site-header-inner {
		display: flex;
		flex-wrap: wrap;
		position: relative;
		gap: 1rem;
	}

	.site-branding {
		flex: 1 1 auto;
		order: 1;
	}

	.menu-toggle {
		display: block;
		order: 2;
	}

	.main-navigation {
		width: 100%;
		display: none;
		position: relative;
		order: 3;
		grid-column: 1 / -1;
	}

	.main-navigation.active {
		display: block;
	}

	.main-navigation ul {
		flex-direction: column;
		gap: 0;
		justify-content: flex-start;
	}

	.main-navigation li {
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	}

	.main-navigation a {
		padding: 1rem;
	}

	.language-switcher {
		order: 1;
		margin-left: auto;
	}

	.language-switcher-menu {
		right: 0;
		left: auto;
		min-width: 140px;
	}

	[dir="rtl"] .language-switcher-menu {
		right: auto;
		left: 0;
	}

	.language-switcher-trigger {
		padding: 0.4rem 0.6rem;
		font-size: 0.8rem;
	}

	.language-flag {
		width: 18px;
		height: 13px;
	}

	.properties-grid.grid-4,
	.properties-grid.grid-3,
	.properties-grid.grid-2 {
		grid-template-columns: 1fr;
	}

	/* New Properties Grid - 3 columns responsive */
	.properties-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.5rem;
	}

	/* Filter Top Section Responsive */
	.filters-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 1rem;
	}

	.advanced-filters-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.filter-span-2 {
		grid-column: span 2;
	}

	.filter-search-button-wrapper {
		grid-column: 1 / -1;
	}

	.property-filters-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	.properties-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	.properties-controls {
		width: 100%;
		justify-content: space-between;
		flex-wrap: wrap;
		gap: 1rem;
	}

	/* RTL: Maintain reversed order in responsive */
	[dir="rtl"] .properties-controls,
	html[lang="he"] .properties-controls,
	html[lang="he-IL"] .properties-controls {
		flex-direction: row-reverse;
	}

	.properties-view-switcher {
		width: 100%;
		justify-content: flex-start;
		flex-wrap: wrap;
	}

	.view-switcher-btn span {
		display: none;
	}

	.view-switcher-btn {
		padding: 0.5rem;
		min-width: 40px;
		justify-content: center;
	}

	/* List View Responsive */
	.properties-list-view .property-card {
		flex-direction: column;
	}

	.properties-list-view .property-card-carousel {
		flex: 0 0 auto;
		max-width: 100%;
		width: 100%;
		height: 250px;
	}

	.properties-list-view .property-price {
		text-align: left;
		margin-top: 1rem;
	}

	/* Mixed View Responsive */
	.properties-mixed-view-wrapper {
		grid-template-columns: 1fr;
	}

	.properties-mixed-view-grid {
		grid-template-columns: 1fr;
		max-height: none;
		margin-bottom: 1.5rem;
	}

	#properties-map-container-mixed {
		height: 400px;
		margin-top: 0;
	}

	.properties-map-container {
		height: 400px;
		margin-top: 1.5rem;
	}

	.properties-map-view + #properties-map-container {
		height: 500px;
		min-height: 400px;
	}

	.hero-section {
		height: 60vh;
		min-height: 400px;
		max-height: 600px;
	}

	.hero-slide-content {
		padding: 0 1rem;
	}

	.hero-slide-info {
		max-width: 100%;
	}

	.hero-slide-location {
		font-size: 0.75rem;
		margin-bottom: 0.75rem;
	}

	.hero-slide-title {
		font-size: 1.75rem;
		margin-bottom: 1rem;
	}

	.hero-slide-price {
		font-size: 1.5rem;
		margin-bottom: 1.5rem;
	}

	.hero-slide-meta {
		gap: 1rem;
		margin-bottom: 1.5rem;
		font-size: 0.875rem;
		flex-direction: column;
	}

	.hero-meta-item {
		gap: 0.5rem;
	}

	.hero-meta-item svg {
		width: 18px;
		height: 18px;
	}

	.hero-slide-button {
		padding: 0.875rem 2rem;
		font-size: 0.95rem;
	}

	.hero-carousel-prev,
	.hero-carousel-next {
		width: 40px;
		height: 40px;
	}

	.hero-carousel-prev {
		left: 0.5rem;
	}

	.hero-carousel-next {
		right: 0.5rem;
	}

	[dir="rtl"] .hero-carousel-prev {
		left: auto;
		right: 0.5rem;
	}

	[dir="rtl"] .hero-carousel-next {
		right: auto;
		left: 0.5rem;
	}

	.hero-carousel-prev svg,
	.hero-carousel-next svg {
		width: 20px;
		height: 20px;
	}

	.hero-carousel-indicators {
		bottom: 1rem;
		gap: 0.5rem;
	}

	.hero-carousel-indicator {
		width: 10px;
		height: 10px;
	}

	.hero-carousel-indicator.active {
		width: 24px;
	}

	.search-basic {
		grid-template-columns: 1fr;
	}

	.properties-archive {
		flex-direction: column;
	}

	.properties-sidebar {
		order: 2;
	}

	.properties-content {
		order: 1;
	}

	.property-details-table th,
	.property-details-table td {
		display: block;
		width: 100%;
	}

	.property-details-table th {
		border-bottom: none;
		font-weight: 700;
	}

	/* Property Page Header */
	.property-page-header {
		padding: 1rem 0;
	}

	.property-title {
		font-size: 1.5rem;
	}

	.property-page-header .breadcrumbs a,
	.property-page-header .breadcrumbs span {
		font-size: 0.85rem;
	}

	/* Property Content Layout */
	.property-content {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.property-main {
		order: 1; /* Main content appears first on mobile */
	}

	.property-sidebar {
		position: static;
		order: 2; /* Sidebar appears at the bottom after content on mobile */
	}

	.property-cta {
		padding: 1.5rem;
	}

	.property-cta-buttons {
		flex-direction: column;
	}

	.property-cta-buttons .btn {
		width: 100%;
	}

	.property-details-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
	}

	.gallery-modal {
		padding: 1rem;
	}

	.gallery-modal-prev {
		left: 0.5rem;
	}

	.gallery-modal-next {
		right: 0.5rem;
	}

	.gallery-modal-close {
		top: 1rem;
		right: 1rem;
	}

	.site-footer-inner {
		grid-template-columns: 1fr;
	}

	/* Property Gallery Carousel */
	.gallery-carousel-main {
		aspect-ratio: 4 / 3;
	}

	.gallery-carousel-prev,
	.gallery-carousel-next {
		width: 40px;
		height: 40px;
	}

	.gallery-carousel-prev {
		left: 0.5rem;
	}

	.gallery-carousel-next {
		right: 0.5rem;
	}

	.gallery-carousel-prev svg,
	.gallery-carousel-next svg {
		width: 20px;
		height: 20px;
	}

	.gallery-counter {
		bottom: 0.5rem;
		left: 0.5rem;
		padding: 0.375rem 0.75rem;
		font-size: 0.75rem;
	}

	.gallery-thumb {
		width: 80px;
		height: 80px;
	}

	.lightbox-close {
		top: 1rem;
		right: 1rem;
		width: 40px;
		height: 40px;
		font-size: 1.5rem;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.container {
		padding: 0 15px;
	}

	.property-card-content {
		padding: 1rem;
	}

	.property-details-box {
		padding: 1rem;
	}

	.property-details-grid {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}

	/* Properties Grid - Single column on mobile */
	.properties-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	/* View Switcher Mobile */
	.properties-view-switcher {
		width: 100%;
		justify-content: center;
	}

	.view-switcher-btn {
		flex: 1;
		min-width: 0;
	}

	.view-switcher-btn span {
		display: none;
	}

	/* List View Mobile */
	.properties-list-view .property-card {
		flex-direction: column;
		padding: 0.75rem;
	}

	.properties-list-view .property-card-carousel {
		height: 200px;
	}

	.properties-list-view .property-price {
		text-align: left;
		font-size: 1.25rem;
	}

	/* Mixed View Mobile */
	.properties-mixed-view-wrapper {
		grid-template-columns: 1fr;
	}

	.properties-mixed-view-grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
		max-height: none;
		margin-bottom: 1rem;
	}

	#properties-map-container-mixed {
		height: 350px;
		margin-top: 0;
	}

	.properties-map-container {
		height: 350px;
		margin-top: 1rem;
	}

	.properties-map-view + #properties-map-container {
		height: 450px;
		min-height: 350px;
	}

	/* Info Window Mobile */
	.property-info-window {
		max-width: 250px;
	}

	.property-info-window-image {
		height: 120px;
	}

	/* Filter Top Section - Single column on mobile */
	.filters-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.advanced-filters-grid {
		grid-template-columns: 1fr;
	}

	.filter-span-2 {
		grid-column: span 1;
	}

	.filter-features {
		grid-column: 1 / -1;
	}

	.filter-search-button-wrapper {
		grid-column: 1 / -1;
		justify-content: center;
	}

	.features-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.property-filters-top {
		padding: 1.5rem;
	}

	.check-buttons {
		flex-wrap: wrap;
	}

	.check-button {
		min-width: 60px;
		font-size: 0.75rem;
		padding: 0.4rem 0.75rem;
	}

	.range-inputs {
		flex-wrap: wrap;
	}

	.range-input {
		width: 80px;
		font-size: 0.75rem;
	}

	.property-detail-item {
		padding: 0.75rem;
	}

	.detail-icon {
		width: 40px;
		height: 40px;
	}

	.detail-icon svg {
		width: 20px;
		height: 20px;
	}

	/* Property Gallery Carousel */
	.gallery-carousel-main {
		aspect-ratio: 1 / 1;
	}

	.gallery-thumb {
		width: 70px;
		height: 70px;
	}

	.gallery-thumbnails {
		gap: 0.5rem;
	}
}

/* 404 Page Responsive Styles */
@media (max-width: 768px) {
	.error-404 {
		padding: 2rem 0;
		min-height: 50vh;
	}

	.error-number {
		font-size: 5rem;
	}

	.error-404 .page-title {
		font-size: 2rem;
	}

	.error-404 .error-message {
		font-size: 1rem;
		padding: 0 1rem;
	}

	.error-404-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.error-404-actions .btn {
		width: 100%;
		min-width: auto;
	}

	.error-404-helpful-links {
		margin-top: 2rem;
		padding-top: 2rem;
	}

	.helpful-links-list {
		grid-template-columns: 1fr;
	}

	.error-404-search {
		margin-top: 2rem;
		padding-top: 2rem;
	}

	.error-404-search form {
		flex-direction: column;
	}
}

@media (max-width: 480px) {
	.error-number {
		font-size: 4rem;
	}

	.error-404 .page-title {
		font-size: 1.75rem;
	}

	.error-404-helpful-links h2,
	.error-404-search h2 {
		font-size: 1.25rem;
	}
}

