/* ==========================================================================
   Read more
   ========================================================================== */
.core-readmore {
	--core-readmore-collapsed-height: 250px;
	position: relative;
}
.core-readmore p {
	text-align: justify;
}
.core-readmore.is-collapsible:not(.is-expanded) {
	max-height: var(--core-readmore-collapsed-height);
	overflow: hidden;
}

.core-readmore.is-collapsible:not(.is-expanded)::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 100px;
	pointer-events: none;
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0),
		rgba(255, 255, 255, 1)
	);
}

.core-readmore.is-expanded {
	max-height: none;
	overflow: visible;
}

.core-readmore.is-expanded::after,
.core-readmore.no-gradient::after {
	display: none;
}

.core-readmore-actions {
	margin-bottom: 30px;
	text-align: center;
}

.core-readmore-actions[hidden] {
	display: none !important;
}

@media (max-width: 768px) {
	.core-readmore {
		--core-readmore-collapsed-height: 200px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.core-readmore,
	.core-readmore::after {
		transition: none;
	}
}

/* ==========================================================================
   Construction gallery
   ========================================================================== */
.core-gallery-wrapper {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
}

.core-main-swiper {
	margin-bottom: 15px;
}

.core-main-swiper .swiper-slide {
	height: auto;
}

.core-gallery-main-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 4px;
}

.core-thumb-swiper {
	box-sizing: border-box;
}

.core-thumb-swiper .swiper-slide {
	height: auto;
	opacity: 0.45;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.core-thumb-swiper .swiper-slide-thumb-active {
	opacity: 1;
	border-color: var(--theme-palette-color-1, currentColor);
}

.core-thumb-swiper .swiper-slide:hover {
	opacity: 0.85;
}

.core-gallery-thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.core-gallery-thumb:focus-visible {
	outline: 2px solid var(--theme-palette-color-1, currentColor);
	outline-offset: -2px;
}

.core-gallery-thumb-image {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* ==========================================================================
   Floating contact
   ========================================================================== */
.core-floating-contact {
	position: fixed;
	bottom: 30px;
	left: 0;
	z-index: 9999;
	width: 100%;
	height: 0;
	pointer-events: none;
}

.core-contact-buttons {
	position: absolute;
	bottom: 0;
	left: 30px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	pointer-events: auto;
}

.core-support-popup {
	position: absolute;
	bottom: 0;
	left: 70px;
	display: flex;
	visibility: hidden;
	flex-direction: column;
	width: 290px;
	max-width: calc(100vw - 120px);
	overflow: hidden;
	opacity: 0;
	background: #fff;
	border-radius: var(--theme-button-border-radius, 8px);
	box-shadow: 0 10px 30px rgb(0 0 0 / 15%);
	transform: translateY(20px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
	pointer-events: auto;
}

.core-support-popup.show {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

.core-popup-header {
	padding: 12px;
	color: #333;
	font-size: 1em;
	font-weight: 800;
	text-align: center;
	background: #f4f4f5;
}

.core-popup-body {
	padding: 15px 20px;
	text-align: center;
}

.core-popup-body p {
	margin: 0 0 15px;
	color: #555;
	font-size: 0.75em;
	line-height: 1.4;
}

.core-popup-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-bottom: 12px;
	padding: 10px;
	gap: 8px;
	box-sizing: border-box;
	color: #fff !important;
	font-size: 0.95em;
	font-weight: 700;
	text-decoration: none !important;
	border-radius: var(--theme-button-border-radius, 10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.core-popup-btn:last-child {
	margin-bottom: 0;
}

.core-popup-btn:hover,
.core-popup-btn:focus-visible {
	color: #fff !important;
	opacity: 0.88;
	transform: translateY(-1px);
}

.core-popup-btn svg,
.core-svg-icon {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
}

.core-zalo { background-color: #2b8cfb; }
.core-messenger { background-color: #3142bc; }

.core-popup-footer {
	padding: 0 15px 15px;
	color: #666;
	font-size: 0.7em;
	line-height: 1.4;
	text-align: center;
}

.core-btn-phone,
.core-btn-chat {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	padding: 0;
	color: #fff;
	text-decoration: none;
	border: 0;
	border-radius: 50%;
	box-shadow: 0 4px 10px rgb(0 0 0 / 20%);
	cursor: pointer;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.core-btn-phone:hover,
.core-btn-chat:hover {
	transform: scale(1.08);
}

.core-btn-phone:focus-visible,
.core-btn-chat:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.core-btn-phone { background-color: #f13a3a; }
.core-btn-chat { background-color: #1e4b8f; }
.core-btn-chat.is-open { background-color: #2b8cfb; }

.core-btn-phone svg,
.core-btn-chat svg {
	position: relative;
	z-index: 2;
	width: 24px;
	height: 24px;
}

.core-pulse-ring {
	position: absolute;
	z-index: 1;
	width: 100%;
	height: 100%;
	opacity: 0;
	background-color: #f13a3a;
	border-radius: 50%;
	animation: core-pulsate 2s ease-out infinite;
}

.core-pulse-ring.core-delay {
	animation-delay: 1s;
}

.core-hidden {
	display: none !important;
}

@keyframes core-pulsate {
	0% { opacity: 0.6; transform: scale(1); }
	100% { opacity: 0; transform: scale(1.8); }
}

/* ==========================================================================
   WooCommerce attribute shortcode
   ========================================================================== */
.core-product-style {
	color: #111;
	font-weight: 700;
	text-transform: uppercase;
}

/* ==========================================================================
   YouTube video post type
   ========================================================================== */
.core-yt-video-frame {
	position: relative;
	width: 100%;
	margin-bottom: 25px;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 4px 10px rgb(0 0 0 / 10%);
}

.core-yt-video-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.core-yt-thumbnail-box {
	position: relative;
	display: block;
	z-index: 1;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

.core-yt-thumbnail-box img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.core-yt-thumbnail-box::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0;
	background-color: rgb(0 0 0 / 40%);
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.core-yt-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: 60px;
	height: 42px;
	opacity: 0.85;
	transform: translate(-50%, -50%);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.core-yt-thumbnail-box:hover::after,
.core-yt-thumbnail-box:focus-visible::after {
	opacity: 1;
}

.core-yt-thumbnail-box:hover .core-yt-play-icon,
.core-yt-thumbnail-box:focus-visible .core-yt-play-icon {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.04);
}

@media (max-width: 768px) {
	.core-floating-contact { bottom: 20px; }
	.core-contact-buttons { left: 15px; gap: 15px; }
	.core-btn-phone,
	.core-btn-chat { width: 45px; height: 45px; }
	.core-support-popup { left: 55px; width: 260px; max-width: calc(100vw - 80px); }
}

@media (prefers-reduced-motion: reduce) {
	.core-pulse-ring { animation: none; }
	.core-support-popup,
	.core-popup-btn,
	.core-btn-phone,
	.core-btn-chat,
	.core-yt-thumbnail-box::after,
	.core-yt-play-icon { transition: none; }
}
