/*
 Theme Name:   NEOTRANSFORM
 Theme URI:    https://neo-transform.com/
 Description:
 Author:       NEO Transform
 Author URI:   https://neo-transform.com/
 Template:     bricks
 Version:      1.2
 Text Domain:  bricks
*/

/* Icon Google (.material-symbols-outlined) được khai báo trong inc/google-icons.php */

ul,
li {
	list-style-type: none;
}

/* Nội dung bài viết / mô tả sản phẩm / tin tuyển dụng: trả lại dấu đầu dòng
   (rule reset ở trên làm mất bullet trong nội dung soạn thảo). */
:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) ul > li {
	list-style-type: disc;
}

:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) ol > li {
	list-style-type: decimal;
}

:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) li + li {
	margin-top: .25em;
}

/* Nội dung soạn thảo không được đẩy bố cục tràn ngang:
   - ô lưới Bricks mặc định min-width:auto => bảng rộng làm giãn cả cột
   - ảnh/iframe trong nội dung luôn vừa khung */
.brx-grid > :is(.brxe-text-basic, .brxe-text, .brxe-post-content) {
	min-width: 0;
}

:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) :is(img, video) {
	max-width: 100%;
	height: auto;
}

:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) iframe {
	max-width: 100%;
}

@media (max-width: 767px) {
	/* Bảng nhiều cột: cuộn ngang trong khung thay vì làm tràn cả trang */
	:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Giữ cột đủ rộng để đọc, người dùng vuốt ngang trong bảng */
	:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) table > :is(thead, tbody, tfoot) {
		display: table;
		width: 100%;
		min-width: 600px;
	}

	:is(.woocommerce-product-details__short-description, .woocommerce-Tabs-panel, #single-content .brxe-text, .brxe-post-content) :is(td, th) {
		min-width: 110px;
		text-align: left;
		vertical-align: top;
	}

	/* Bảng có dòng tiêu đề (assets/js/content-tables.js): mỗi dòng thành một thẻ */
	/* !important: phải thắng rule cuộn ngang ở trên (selector có #single-content) */
	table.neo-table-stack,
	table.neo-table-stack > :is(thead, tbody, tfoot),
	table.neo-table-stack tr {
		display: block !important;
		min-width: 0 !important;
		overflow: visible !important;
	}

	table.neo-table-stack {
		border: 0;
	}

	table.neo-table-stack tr[data-head] {
		display: none !important; /* Đã thành nhãn trên từng ô */
	}

	table.neo-table-stack tr {
		margin-bottom: 14px;
		padding: 4px 14px;
		background: #fff;
		border: 1px solid #e3e3ee;
		border-radius: 6px;
	}

	table.neo-table-stack :is(td, th) {
		display: block;
		min-width: 0 !important;
		padding: 10px 0;
		border: 0;
		border-bottom: 1px solid #f0f0f5;
	}

	table.neo-table-stack :is(td, th):last-child {
		border-bottom: 0;
	}

	table.neo-table-stack :is(td, th)[data-label]::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 4px;
		color: #26226f;
		font-size: 13px;
		font-weight: 600;
		text-transform: uppercase;
	}

	table.neo-table-stack :is(td, th) p {
		margin: 0 0 6px;
		text-align: left !important;
	}
}

/* Ẩn khỏi mắt nhưng vẫn cho công cụ tìm kiếm / trình đọc màn hình đọc */
.neo-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ===========================
   BUTTON
=========================== */

.btn {
	width: 100% !important;
	transition: .5s;
}

.btn:hover {
	color: #fff;
	background: #26226f !important;
}

.btn-grad {
	display: block;
	text-align: center;
	text-transform: uppercase;
	color: #fff;
	background-image: linear-gradient(to right, #26226f 0%, #007eff 51%, #26226f 100%);
	background-size: 200% auto;
	border: none;
	border-radius: 2px;
	outline: none;
	transition: .5s;
}

.btn-grad:hover {
	background-position: right center;
	color: #fff;
	text-decoration: none;
}

.pro-listing-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: left; /* justify làm chữ giãn cách xấu trên cột hẹp (mobile) */
	min-height: 40px;
}

/* ===========================
   SLIDER SWIPER
=========================== */

.custom-nav-wrapper {
	display: flex;
	gap: 1rem;
}

.my-custom-prev,
.my-custom-next {
	display: flex;
	align-items: center;
	aspect-ratio: 1 / 1;
	background: #26226f;
	color: #fff;
	border-radius: 2px;
}

.my-custom-prev:hover,
.my-custom-next:hover {
	background: #fece0c;
}

.custom-nav-wrapper span {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 35px;
	font-size: 30px;
}

/* Lưới sản phẩm — chiều cao theo màn hình */
.product-grid-swiper {
	position: relative;
	width: 100%;
	height: 700px;
}

@media (min-width: 768px)  { .product-grid-swiper { height: 680px; } }
@media (min-width: 1025px) { .product-grid-swiper { height: 800px; } }
@media (min-width: 1200px) { .product-grid-swiper { height: 860px; } }

/* Thẻ trong slider 2 hàng: slide có chiều cao cố định (Swiper grid bắt buộc),
   nên ẢNH co giãn để lấp phần còn lại thay vì nội dung bị cắt/tràn.
   => ảnh mọi thẻ cùng khung, tên + giá + nút luôn thẳng hàng và hiện đủ. */
.product-grid-swiper swiper-slide {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.product-grid-swiper swiper-slide > :first-child,
.product-grid-swiper swiper-slide > .brxe-template > .brxe-block,
.product-grid-swiper swiper-slide > .brxe-template > .brxe-block > a.brxe-block {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.product-grid-swiper swiper-slide img {
	flex: 1 1 0;
	width: 100%;
	min-height: 0;
	height: auto;
	object-fit: contain;
}

/* [product_swiper_grid] */
.custom-swiper-grid {
	width: 100%;
	height: 680px;
	margin: 20px auto;
}

.custom-swiper-grid swiper-slide {
	height: calc((100% - 20px) / 2) !important; /* 2 hàng */
	box-sizing: border-box;
}

/* ===========================
   MEGA MENU
=========================== */

/* Header nổi trên overlay (999) nhưng dưới menu (1001) */
#brx-header {
	position: relative !important;
	z-index: 1000 !important;
}

.menu-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #26226f;
	font-weight: 600;
	text-transform: uppercase;
	border-radius: 2px;
	cursor: pointer;
	user-select: none;
}

.menu-toggle svg {
	width: 18px;
	height: 18px;
	fill: none;
}

.mega-menu-wrap {
	position: relative;
}

.h-mega-menu-wrap,
.h-mega-menu {
	height: 100%;
}

.mega-menu__inner {
	position: relative;
}

.h-mega-menu__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	height: 100%;
}

/* Overlay — top do JS gán theo chiều cao header */
.mega-overlay {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
}

.mega-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1001;
	width: 100%;
	background: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .25s, visibility .25s, transform .25s;
}

.mega-overlay.active,
.mega-menu.active {
	opacity: 1;
	visibility: visible;
}

.mega-menu.active {
	transform: translateY(0);
}

.menu-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 40px;
	padding: 0 18px;
	color: #333;
	font-size: 15px;
	text-decoration: none;
	transition: background-color .2s, color .2s;
}

.h-mega-menu .menu-link {
	height: auto;
	line-height: 1.5;
}

.menu-link:hover {
	background: #f5f5f5;
	color: #fece0c;
}

.arrow {
	font-size: 20px;
}

.submenu {
	position: absolute;
	top: 0;
	left: 100%;
	z-index: 1002;
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 24px 40px;
	/* 100% = độ rộng cột menu => không tràn khỏi màn hình 992–1200px */
	width: min(900px, calc(100vw - 100% - 64px));
	min-height: 100%;
	padding: 30px;
	background: #fff;
	box-shadow: 8px 10px 30px rgba(0, 0, 0, .12);
	opacity: 0;
	visibility: hidden;
	transform: translateX(10px);
	transition: opacity .25s, visibility .25s, transform .25s;
}

.menu-item:hover > .submenu {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

.submenu-col {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 180px;
}

.submenu-col h4 {
	margin: 0 0 8px;
	color: #26226f;
	font-size: 16px;
}

.submenu-col a {
	color: #555;
	text-decoration: none;
	transition: color .2s, transform .2s;
}

.submenu-col a:hover {
	color: #fece0c;
	transform: translateX(4px);
}

body.menu-open {
	overflow: hidden;
}

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width: 991px) {
	/* Menu con dạng accordion: bấm mũi tên để mở (assets/js/mega-menu.js) */
	.mega-menu {
		max-height: 75vh;
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.submenu {
		position: static;
		display: none;
		flex-direction: column;
		gap: 14px;
		width: auto;
		min-height: 0;
		padding: 6px 18px 14px 30px;
		background: #f8f8fb;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.menu-item.is-open > .submenu {
		display: flex;
	}

	.submenu-col {
		gap: 8px;
		min-width: 0;
	}

	.submenu-col h4 {
		margin: 0;
		font-size: 15px;
	}

	.menu-link .arrow {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 40px;
		height: 40px;
		margin-right: -12px;
		transition: transform .2s;
	}

	.menu-item.is-open > .menu-link {
		color: #26226f;
		font-weight: 600;
	}

	.menu-item.is-open > .menu-link .arrow {
		transform: rotate(90deg);
	}

	.ti-search:before {
		background: #fff !important;
		border: none !important;
	}
}

@media (max-width: 767px) {
	.menu-toggle svg {
		width: 40px;
		height: 40px;
		padding: 10px;
		background: #26226f;
		color: #fff;
		border-radius: 3px;
	}
}
