/* ==========================================================================
   So Listing Tabs - Layout2
   Header (title + tabs + "Xem tất cả"), product card grid:
   image (size from module settings), name, price, add to cart.
   Loaded automatically by catalog/controller/extension/module/so_listing_tabs_custom.php
   when a module uses type_layout = layout2.
   ========================================================================== */

/* ---------- Wrapper ---------- */
.so-lt2 {
	//background: #fbfaf7;
	//border: 1px solid #ece8df;
	border-radius: 10px;
	padding: 16px 14px 18px;
	margin-bottom: 24px;
}

/* ---------- Header: title + tabs + view all ---------- */
.so-lt2 .lt2-head {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 22px;
	margin: 0 2px 14px;
}
.so-lt2 .lt2-title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.2;
	color: #1f2a37;
	white-space: nowrap;
}
.so-lt2 .lt2-viewall {
	margin-left: auto;
	font-size: 13px;
	font-weight: 700;
	color: #1f2a37;
	white-space: nowrap;
	text-decoration: none;
}
.so-lt2 .lt2-viewall:hover { color: #ef6c2f; }

/* ---------- Tabs (override theme styles) ---------- */
.so-lt2 .ltabs-tabs-container {
	flex: 1;
	min-width: 0;
	margin: 0;
	float: none;
}
.so-lt2 .ltabs-tabs-wrap {
	position: static;
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}
.so-lt2 .ltabs-tab-selected,
.so-lt2 .ltabs-tab-arrow { display: none !important; }

.so-lt2 .ltabs-tabs {
	display: flex !important;
	position: static !important;
	width: auto !important;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
	border: 0;
	background: none;
	box-shadow: none;
}
.so-lt2 .ltabs-tabs::-webkit-scrollbar { display: none; }

.so-lt2 .ltabs-tabs .ltabs-tab {
	float: none;
	display: block;
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none !important;
	font-size: 13px;
	color: #374151;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color .2s, border-color .2s;
}
.so-lt2 .ltabs-tabs .ltabs-tab:before,
.so-lt2 .ltabs-tabs .ltabs-tab:after { display: none !important; }

.so-lt2 .ltabs-tabs .ltabs-tab .ltabs-tab-label {
	padding: 0 !important;
	font-size: 13px !important;
	font-weight: inherit;
	line-height: 1.4;
	text-transform: none !important;
	color: #374151 !important;
	background: none !important;
}
.so-lt2 .ltabs-tabs .ltabs-tab:hover .ltabs-tab-label { color: #ef6c2f !important; }
.so-lt2 .ltabs-tabs .ltabs-tab.tab-sel {
	border-bottom-color: #ef6c2f;
	font-weight: 600;
}
.so-lt2 .ltabs-tabs .ltabs-tab.tab-sel .ltabs-tab-label { color: #ef6c2f !important; }

/* ---------- Items container ---------- */
.so-lt2 .wap-listing-tabs { margin: 0; padding: 0; }
.so-lt2 .ltabs-items { display: none; }
.so-lt2 .ltabs-items.ltabs-items-selected { display: block; }

/* Grid mode (loadmore / non-slider) */
.so-lt2 .ltabs-items-inner:not(.owl2-carousel) {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
}
.so-lt2 .ltabs-items-inner:not(.owl2-carousel) .ltabs-item {
	width: auto !important;
	float: none !important;
	padding: 0 !important;
	margin: 0 !important;
}
.so-lt2 .ltabs-items-inner [class^="clr"] { display: none; }

/* Slider mode: equal-height cards */
.so-lt2 .owl2-carousel .owl2-stage { display: flex; }
.so-lt2 .owl2-carousel .owl2-item,
.so-lt2 .owl2-carousel .ltabs-item { height: 100%; }

/* ---------- Product card ---------- */
.so-lt2 .lt2-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid #e7e3da;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow .25s, transform .25s;
}
.so-lt2 .lt2-card:hover {
	box-shadow: 0 8px 22px rgba(17, 24, 39, .10);
	transform: translateY(-2px);
}

/* Image: ratio comes from module Width/Height (inline aspect-ratio) */
.so-lt2 .lt2-img {
	display: block;
	position: relative;
	overflow: hidden;
	background: #f3f1ec;
}
.so-lt2 .lt2-img img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .4s, opacity .35s;
}
.so-lt2 .lt2-img[style*="aspect-ratio"] img {
	height: 100%;
	object-fit: cover;
}
/* Second image on hover (Product image num = 2) */
.so-lt2 .lt2-img .lt2-img2 {
	position: absolute;
	inset: 0;
	opacity: 0;
}
.so-lt2 .lt2-card:hover .lt2-has2 .lt2-img2 { opacity: 1; }
.so-lt2 .lt2-card:hover .lt2-img img { transform: scale(1.04); }

.so-lt2 .lt2-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 2px 7px;
	border-radius: 4px;
	background: #ef6c2f;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

/* Body */
.so-lt2 .lt2-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 10px;
}
.so-lt2 .lt2-name {
	margin: 0 0 8px;
	min-height: 2.7em;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.so-lt2 .lt2-name a { color: #1f2a37; text-decoration: none; }
.so-lt2 .lt2-name a:hover { color: #ef6c2f; }

/* Footer: price + cart */
.so-lt2 .lt2-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
}
.so-lt2 .lt2-price {
	min-width: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: #ef6c2f;
}
.so-lt2 .lt2-price .lt2-old {
	display: block;
	font-size: 11px;
	font-weight: 400;
	color: #9ca3af;
	text-decoration: line-through;
}
.so-lt2 .lt2-price a { color: #ef6c2f; text-decoration: none; }

.so-lt2 .lt2-cart {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	gap: 5px;
	padding: 4px 0;
	border: 0;
	background: none;
	font-size: 13px;
	font-weight: 600;
	color: #1f2a37;
	cursor: pointer;
	transition: color .2s;
}
.so-lt2 .lt2-cart:hover { color: #ef6c2f; }
.so-lt2 .lt2-cart svg { transition: transform .2s; }
.so-lt2 .lt2-cart:hover svg { transform: translateX(2px); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
	.so-lt2 .ltabs-items-inner:not(.owl2-carousel) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 767px) {
	.so-lt2 { padding: 12px 10px 14px; }
	.so-lt2 .lt2-head { flex-wrap: wrap; gap: 6px 12px; }
	.so-lt2 .lt2-title { font-size: 18px; }
	.so-lt2 .ltabs-tabs-container { order: 3; flex: 0 0 100%; }
	.so-lt2 .ltabs-items-inner:not(.owl2-carousel) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.so-lt2 .lt2-foot {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
}
