/**
 * Public Styles
 *
 * @package ATDW_Live_Products
 */

/* Container */
.atdw-live-container,
.atdw-live-single-container,
.atdw-live-search-container {
	margin: 30px 0;
}

/* Loading Spinner */
.atdw-live-loading {
	text-align: center;
	padding: 40px 20px;
}

.atdw-spinner {
	display: inline-block;
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #2271b1;
	border-radius: 50%;
	animation: atdw-spin 1s linear infinite;
}

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

/* Error Message */
.atdw-live-error {
	padding: 20px;
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	color: #721c24;
	text-align: center;
}

/* Results Count */
.atdw-results-count {
	margin-bottom: 20px;
	padding: 15px;
	background: #f0f7ff;
	border-left: 4px solid #2271b1;
	font-size: 16px;
	color: #333;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
}

.atdw-results-count strong {
	color: #2271b1;
	font-weight: 600;
}

.atdw-results-text {
	flex: 1 1 auto;
}

.atdw-results-nav {
	display: flex;
	gap: 10px;
	flex: 0 0 auto;
}

.atdw-results-prev,
.atdw-results-next {
	padding: 8px 16px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.atdw-results-prev:hover,
.atdw-results-next:hover {
	background: #135e96;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
}

/* Products Grid */
.atdw-live-products {
	display: grid;
	gap: 30px;
}

.atdw-layout-grid .atdw-live-products {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.atdw-layout-list .atdw-live-products {
	grid-template-columns: 1fr;
}

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

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

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

/* Product Card */
.atdw-product-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.atdw-product-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.atdw-product-image {
	position: relative;
	padding-top: 66.67%; /* 3:2 aspect ratio */
	overflow: hidden;
	background: #f5f5f5;
}

.atdw-product-image .atdw-listing-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.atdw-product-card:hover .atdw-product-image .atdw-listing-image {
	transform: scale(1.05);
}

/* Product badge styling */
.atdw-product-badge {
	position: absolute;
	top: 0;
	right: 0;
	width: 100px;
	height: auto;
	z-index: 10;
}

/* Meta shortcode badge styling */
.atdw-meta-badge {
	display: inline-block;
	width: 100px;
	height: auto;
	vertical-align: middle;
}

.atdw-product-price {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 8px 12px;
	font-size: 16px;
	font-weight: 700;
	border-radius: 4px;
	z-index: 2;
}

.atdw-product-content {
	padding: 20px;
}

.atdw-product-title {
	margin: 0 0 10px;
	font-size: 20px;
	font-weight: 600;
	color: #333;
}

.atdw-product-excerpt {
	margin: 15px 0;
	color: #666;
	line-height: 1.6;
	font-size: 14px;
}

.atdw-product-date {
	color: #666;
	font-size: 14px;
	margin: 10px 0;
	font-weight: 500;
}

.atdw-product-location {
	display: flex;
	align-items: center;
	gap: 5px;
	color: #999;
	font-size: 14px;
	margin: 10px 0;
}

.atdw-product-footer {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #f0f0f0;
}

/* Single Product */
.atdw-single-product {
	background: #fff;
	padding: 30px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.atdw-product-featured-image {
	margin-bottom: 30px;
}

.atdw-product-featured-image img {
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.atdw-product-description {
	margin: 20px 0;
	line-height: 1.8;
	color: #333;
}

.atdw-product-meta {
	margin: 30px 0;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.atdw-meta-item {
	margin: 10px 0;
	font-size: 15px;
}

.atdw-meta-item strong {
	display: inline-block;
	min-width: 100px;
	color: #555;
}

.atdw-meta-item a {
	color: #2271b1;
	text-decoration: none;
}

.atdw-meta-item a:hover {
	text-decoration: underline;
}

/* Search Form */
.atdw-live-search-form {
	padding: 25px;
	background: #f9f9f9;
	border-radius: 8px;
	margin-bottom: 30px;
	border: 1px solid #e0e0e0;
}

.atdw-search-row {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin-bottom: 15px;
	align-items: stretch;
}

.atdw-search-field {
	flex: 1 1 auto;
	min-width: 200px;
}

.atdw-search-field:has(.atdw-search-input) {
	flex: 2 1 300px;
}

.atdw-search-field:has(.atdw-search-button) {
	flex: 0 0 auto;
}

.atdw-search-input,
.atdw-filter-suburb,
.atdw-filter-sort {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.atdw-search-input:focus,
.atdw-filter-suburb:focus,
.atdw-filter-sort:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.atdw-search-input::placeholder {
	color: #999;
}

/* Types Selection */
.atdw-types-row {
	margin-top: 15px;
}

.atdw-types-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	background: #fff;
	color: #333;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 14px;
	font-weight: 500;
}

.atdw-types-toggle:hover {
	background: #f0f0f0;
	border-color: #2271b1;
}

.atdw-types-toggle .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	transition: transform 0.3s ease;
}

.atdw-types-checkboxes {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	padding: 20px;
	margin-top: 15px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
}

.atdw-type-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 14px;
}

.atdw-type-checkbox:hover {
	background: #f0f0f0;
	border-color: #2271b1;
}

.atdw-type-checkbox input[type="checkbox"] {
	margin: 0;
	cursor: pointer;
}

.atdw-type-checkbox input[type="checkbox"]:checked + span {
	color: #2271b1;
	font-weight: 600;
}

/* Button */
.atdw-button,
.atdw-search-button {
	display: inline-block;
	padding: 12px 24px;
	background: #2271b1;
	color: #fff !important;
	text-decoration: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.atdw-button:hover,
.atdw-search-button:hover {
	background: #135e96;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(34, 113, 177, 0.2);
}

/* Search Results */
.atdw-live-search-results {
	margin-top: 30px;
}

/* Pagination */
.atdw-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 20px;
	margin-top: 40px;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
	border: 1px solid #e0e0e0;
}

.atdw-prev-page,
.atdw-next-page {
	padding: 10px 20px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
}

.atdw-prev-page:hover:not(:disabled),
.atdw-next-page:hover:not(:disabled) {
	background: #135e96;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(34, 113, 177, 0.2);
}

.atdw-prev-page:disabled,
.atdw-next-page:disabled {
	background: #ddd;
	color: #999;
	cursor: not-allowed;
	opacity: 0.6;
}

.atdw-page-info {
	font-size: 14px;
	color: #333;
	font-weight: 500;
}

.atdw-current-page,
.atdw-total-pages {
	font-weight: 700;
	color: #2271b1;
}

/* Number Pagination */
.atdw-page-numbers {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.atdw-page-number {
	min-width: 40px;
	height: 40px;
	padding: 8px 12px;
	background: #fff;
	color: #333;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.atdw-page-number:hover {
	background: #f0f0f0;
	border-color: #2271b1;
	color: #2271b1;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(34, 113, 177, 0.2);
}

.atdw-page-number.atdw-current {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
	cursor: default;
}

.atdw-page-number.atdw-current:hover {
	background: #2271b1;
	transform: none;
	box-shadow: none;
}

/* Meta Shortcode */
.atdw-live-meta-container {
	margin: 20px 0;
}

.atdw-meta-gallery {
	display: grid;
	gap: 15px;
	margin: 20px 0;
}

/* Inline gallery layout - no flex, just inline-block */
.atdw-gallery-inline {
	display: block;
}

.atdw-gallery-inline .atdw-gallery-item {
	display: inline-block;
	margin: 0 10px 10px 0;
	vertical-align: top;
}

.atdw-gallery-columns-1 {
	grid-template-columns: 1fr;
}

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

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

.atdw-gallery-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.atdw-gallery-columns-5 {
	grid-template-columns: repeat(5, 1fr);
}

.atdw-gallery-item {
	position: relative;
	overflow: hidden;
	background: #f5f5f5;
}

.atdw-gallery-item img {
	transition: transform 0.3s ease;
	display: block;
	max-width: 100%;
}

.atdw-gallery-link:hover img {
	transform: scale(1.05);
}

.atdw-meta-image {
	margin: 20px 0;
	text-align: center;
}

.atdw-meta-image img {
	max-width: 100%;
	height: auto;
}

.atdw-meta-description {
	line-height: 1.8;
	color: #333;
	margin: 15px 0;
}

.atdw-meta-phone,
.atdw-meta-email,
.atdw-meta-website {
	color: #2271b1;
	text-decoration: none;
	transition: color 0.3s ease;
}

.atdw-meta-phone:hover,
.atdw-meta-email:hover,
.atdw-meta-website:hover {
	color: #135e96;
	text-decoration: underline;
}

.atdw-meta-price {
	font-size: 24px;
	font-weight: 700;
	color: #2271b1;
}

.atdw-no-value {
	color: #999;
	font-style: italic;
	padding: 10px 0;
}

.atdw-error {
	padding: 15px;
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	color: #721c24;
}

/* Google Maps Container */
.atdw-meta-map-js {
	min-height: 400px;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.atdw-meta-map {
	padding: 15px;
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
}

.atdw-map-coords {
	color: #666;
	font-size: 14px;
}

/* Responsive */
@media screen and (max-width: 1024px) {
	.atdw-columns-4 .atdw-live-products {
		grid-template-columns: repeat(3, 1fr);
	}

	.atdw-gallery-columns-5 {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media screen and (max-width: 768px) {
	.atdw-columns-3 .atdw-live-products,
	.atdw-columns-4 .atdw-live-products {
		grid-template-columns: repeat(2, 1fr);
	}

	.atdw-search-row {
		flex-direction: column;
		gap: 12px;
	}

	.atdw-search-field {
		min-width: 100%;
		flex: 1 1 100%;
	}

	.atdw-types-checkboxes {
		grid-template-columns: 1fr;
	}

	.atdw-search-button {
		width: 100%;
	}

	.atdw-gallery-columns-4,
	.atdw-gallery-columns-5 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media screen and (max-width: 480px) {
	.atdw-layout-grid .atdw-live-products,
	.atdw-columns-2 .atdw-live-products,
	.atdw-columns-3 .atdw-live-products,
	.atdw-columns-4 .atdw-live-products {
		grid-template-columns: 1fr;
	}

	.atdw-live-search-form {
		padding: 20px;
	}

	.atdw-gallery-columns-2,
	.atdw-gallery-columns-3,
	.atdw-gallery-columns-4,
	.atdw-gallery-columns-5 {
		grid-template-columns: repeat(2, 1fr);
	}

	.atdw-results-count {
		flex-direction: column;
		align-items: flex-start;
	}

	.atdw-results-nav {
		width: 100%;
		justify-content: flex-end;
	}

	.atdw-results-prev,
	.atdw-results-next {
		flex: 1;
		max-width: 120px;
	}
}
