/**
 * Gallery Module Styles
 *
 * @package WP_Immo_Detail
 */

/* Gallery Module Container */
.wp-immo-gallery-module {
	width: 100%;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
}

/* Remove all blue colors and outlines */
.wp-immo-gallery-module *,
.wp-immo-gallery-module *:focus,
.wp-immo-gallery-module *:active,
.wp-immo-gallery-module *:visited {
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

/* Main Image Container */
.wp-immo-gallery-main {
	position: relative;
	width: 100%;
	overflow: hidden;
	background-color: #f5f5f5;
	margin-bottom: 1rem;
}

/* Verkaufsstatus-Banderole für Detailseite */
.status-ribbon {
	position: absolute;
	top: 60px;
	right: -80px;
	width: 300px;
	padding: 12px 0 10px 0;
	background: #8B0000;
	color: white;
	text-align: center;
	font-size: 16px;
	font-weight: 600;
	text-transform: uppercase;
	transform: rotate(45deg);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
	z-index: 10;
	letter-spacing: 1px;
}

/* Banderolen-Farben */
.status-ribbon.verkauft {
	background: var(--ribbon-verkauft, #8B0000);
}

.status-ribbon.vermietet {
	background: var(--ribbon-vermietet, #8B0000);
}

.status-ribbon.reserviert {
	background: var(--ribbon-reserviert, #006400);
}

.status-ribbon.vorbereitung {
	background: var(--ribbon-vorbereitung, #aa9a7f);
}

.status-ribbon.preisreduziert {
	background: var(--ribbon-preisreduziert, #00008B);
}

/* Banderolen-Position Links */
.status-ribbon.ribbon-left {
	right: auto;
	top: 67px;
	left: -85px;
	width: 350px;
	transform: rotate(-45deg);
}

/* Aspect Ratios */
.wp-immo-gallery-ratio-16-9 {
	aspect-ratio: 16 / 9;
}

.wp-immo-gallery-ratio-4-3 {
	aspect-ratio: 4 / 3;
}

/* Main Image */
.wp-immo-gallery-main-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Main Image Navigation */
.wp-immo-gallery-main-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 30px;
	height: 60px;
	border: none;
	background-color: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	z-index: 10;
	outline: none;
	transition: none;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}

.wp-immo-gallery-main-nav:hover,
.wp-immo-gallery-main-nav:active {
	background-color: rgba(0, 0, 0, 0.7);
}

.wp-immo-gallery-main-prev {
	left: 0;
}

.wp-immo-gallery-main-prev::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 17px;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 12px;
	height: 12px;
	border-left: 3px solid #ffffff;
	border-bottom: 3px solid #ffffff;
}

.wp-immo-gallery-main-next {
	right: 0;
}

.wp-immo-gallery-main-next::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 17px;
	transform: translate(50%, -50%) rotate(-135deg);
	width: 12px;
	height: 12px;
	border-left: 3px solid #ffffff;
	border-bottom: 3px solid #ffffff;
}

/* Thumbnails Wrapper */
.wp-immo-gallery-thumbs-wrapper {
	position: relative;
	width: 100%;
}

/* Navigation Buttons - Hidden */
.wp-immo-gallery-nav {
	display: none;
}

/* Thumbnails Container */
.wp-immo-gallery-thumbs {
	width: 100%;
	overflow: hidden;
	position: relative;
}

/* Navigation Overlay Left - Fixed Position */
.wp-immo-gallery-thumbs::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 30px;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 10;
	pointer-events: none;
	transition: none;
}

.wp-immo-gallery-thumbs:hover::before {
	background-color: rgba(0, 0, 0, 0.7);
}

/* Chevron Left - Fixed Position */
.wp-immo-gallery-thumbs::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 17px;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 12px;
	height: 12px;
	border-left: 3px solid #ffffff;
	border-bottom: 3px solid #ffffff;
	z-index: 11;
	pointer-events: none;
}

/* Navigation Overlay Right - Fixed Position */
.wp-immo-gallery-thumbs-wrapper::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 30px;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 10;
	pointer-events: none;
	transition: none;
}

.wp-immo-gallery-thumbs-wrapper:hover::before {
	background-color: rgba(0, 0, 0, 0.7);
}

/* Chevron Right - Fixed Position */
.wp-immo-gallery-thumbs-wrapper::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 17px;
	transform: translate(50%, -50%) rotate(-135deg);
	width: 12px;
	height: 12px;
	border-left: 3px solid #ffffff;
	border-bottom: 3px solid #ffffff;
	z-index: 11;
	pointer-events: none;
}

/* Thumbnails Track */
.wp-immo-gallery-thumbs-track {
	display: flex;
	gap: 0.5rem;
	transition: transform 0.3s ease;
}

/* Thumbnail Container */
.wp-immo-gallery-thumb-container {
	position: relative;
	flex: 0 0 calc(20% - 0.4rem);
	overflow: hidden;
	background-color: #f5f5f5;
}

/* Thumbnail Button */
.wp-immo-gallery-thumb {
	position: relative;
	width: 100%;
	height: 100%;
	border: none;
	padding: 0;
	cursor: pointer;
	display: block;
	background: none;
	outline: none;
}

.wp-immo-gallery-thumb:focus,
.wp-immo-gallery-thumb:active {
	outline: none;
	border: none;
	background: none;
}

/* Thumbnail Image */
.wp-immo-gallery-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Thumbnail Overlay */
.wp-immo-gallery-thumb-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.4);
	transition: opacity 0.2s;
	pointer-events: none;
}

/* Active Thumbnail */
.wp-immo-gallery-thumb-active .wp-immo-gallery-thumb-overlay {
	opacity: 0;
}

/* Thumbnail Hover */
.wp-immo-gallery-thumb:hover .wp-immo-gallery-thumb-overlay {
	opacity: 0;
}

/* Lightbox */
.wp-immo-gallery-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: none;
}

.wp-immo-gallery-lightbox.wp-immo-gallery-lightbox-open {
	display: block;
}

/* Lightbox Overlay */
.wp-immo-gallery-lightbox-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.9);
}

/* Lightbox Content */
.wp-immo-gallery-lightbox-content {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

/* Lightbox Close Button */
.wp-immo-gallery-lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 3rem;
	height: 3rem;
	border: none;
	background-color: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s;
	z-index: 10;
	outline: none;
}

.wp-immo-gallery-lightbox-close:hover {
	background-color: rgba(255, 255, 255, 0.2);
}

.wp-immo-gallery-lightbox-close:focus,
.wp-immo-gallery-lightbox-close:active {
	outline: none;
	border: none;
}

.wp-immo-gallery-lightbox-close .dashicons {
	font-size: 1.5rem;
	width: 1.5rem;
	height: 1.5rem;
}

/* Lightbox Navigation */
.wp-immo-gallery-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 3rem;
	height: 3rem;
	border: none;
	background-color: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s;
	z-index: 10;
	outline: none;
}

.wp-immo-gallery-lightbox-nav:hover {
	background-color: rgba(255, 255, 255, 0.2);
}

.wp-immo-gallery-lightbox-nav:focus,
.wp-immo-gallery-lightbox-nav:active {
	outline: none;
	border: none;
}

.wp-immo-gallery-lightbox-prev {
	left: 2rem;
}

.wp-immo-gallery-lightbox-next {
	right: 2rem;
}

.wp-immo-gallery-lightbox-nav .dashicons {
	font-size: 1.5rem;
	width: 1.5rem;
	height: 1.5rem;
}

/* Lightbox Image Wrapper */
.wp-immo-gallery-lightbox-image-wrapper {
	max-width: 90%;
	max-height: 90%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Lightbox Image */
.wp-immo-gallery-lightbox-img {
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	display: block;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Lightbox Caption */
.wp-immo-gallery-lightbox-caption {
	margin-top: 1rem;
	color: #ffffff;
	font-size: 1rem;
	text-align: center;
	max-width: 600px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
	/* Hide thumbnails on mobile */
	.wp-immo-gallery-thumbs-wrapper {
		display: none;
	}

	/* Main image takes full space */
	.wp-immo-gallery-main {
		margin-bottom: 0;
	}

	/* Larger navigation buttons on mobile */
	.wp-immo-gallery-main-nav {
		width: 40px;
		height: 80px;
	}

	/* Adjust lightbox padding */
	.wp-immo-gallery-lightbox-content {
		padding: 1rem;
	}

	/* Smaller navigation buttons in lightbox */
	.wp-immo-gallery-lightbox-prev {
		left: 0.5rem;
	}

	.wp-immo-gallery-lightbox-next {
		right: 0.5rem;
	}

	.wp-immo-gallery-lightbox-nav {
		width: 2.5rem;
		height: 2.5rem;
	}

	/* Close button positioning */
	.wp-immo-gallery-lightbox-close {
		top: 0.5rem;
		right: 0.5rem;
		width: 2.5rem;
		height: 2.5rem;
	}

	/* Full height image on mobile */
	.wp-immo-gallery-lightbox-img {
		max-height: 70vh;
	}
}

/* Gallery Action Buttons */
.wp-immo-gallery-actions {
	display: flex;
	gap: 15px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.wp-immo-gallery-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	padding: 12px 24px;
	background-color: var(--wp-immo-ci-color-1);
	color: white;
	border: none;
	border-radius: 0;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease;
	box-sizing: border-box;
}

.wp-immo-gallery-action-btn:hover {
	background-color: var(--wp-immo-ci-color-2);
	color: white;
	text-decoration: none;
}

.wp-immo-gallery-action-btn:active {
	background-color: var(--wp-immo-ci-color-2);
}

/* Virtual Tour Modal */
.wp-immo-virtual-tour-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	background-color: rgba(0, 0, 0, 0.9);
}

.wp-immo-virtual-tour-modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
}

.wp-immo-virtual-tour-content {
	position: relative;
	width: 90%;
	height: 90%;
	max-width: 1400px;
	background-color: #000;
}

.wp-immo-virtual-tour-iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.wp-immo-virtual-tour-close {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 50px;
	height: 50px;
	background-color: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #000;
	z-index: 100000;
	transition: background-color 0.3s ease;
}

.wp-immo-virtual-tour-close:hover {
	background-color: #fff;
}

.wp-immo-virtual-tour-close .dashicons {
	width: 24px;
	height: 24px;
}

@media (max-width: 768px) {
	.wp-immo-gallery-actions {
		flex-direction: column;
		gap: 10px;
	}

	.wp-immo-gallery-action-btn {
		width: 100%;
		justify-content: center;
		padding: 12px 20px;
	}

	.wp-immo-virtual-tour-content {
		width: 95%;
		height: 85%;
	}

	.wp-immo-virtual-tour-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 20px;
	}
}
