/**
 * Custom Shop Page Dark Theme
 * Based on design mockup
 */

/* Hide WooCommerce default elements */
.woocommerce-notices-wrapper,
.woocommerce-result-count,
.woocommerce-ordering,
.woocommerce-breadcrumb,
.page-title,
.term-description,
.shop-page-title {
	display: none !important;
}

/* Shop Wrapper */
.custom-shop-wrapper {
	background: transparent;
	min-height: 100vh;
	padding: 60px 0;
}

.custom-shop-container {
	max-width: 1290px;
	margin: 0 auto;
	padding: 0 40px;
}

/* Override Flatsome default styles */
.shop-container,
.shop-page-title {
	display: none !important;
}

#main {
	background: transparent !important;
}

.page-wrapper {
	background: transparent !important;
}

/* Shop Header */
.custom-shop-header {
	margin-bottom: 30px;
}

.shop-title-section {
	margin-bottom: 25px;
}

.shop-title {
	font-size: 32px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 8px 0;
}

.shop-title .highlight {
	background: linear-gradient(122deg, #00d4ff, #7c3aed);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.shop-subtitle {
	color: #9ca3af;
	font-size: 16px;
	margin: 0;
}

/* Search Bar */
.shop-search-wrapper {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.shop-search-box {
	position: relative;
	flex: 1;
	max-width: 400px;
	min-width: 250px;
}

.shop-left-controls {
	display: flex;
	gap: 12px;
	align-items: center;
	flex: 1;
}

.shop-search-box .search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: #6b7280;
	pointer-events: none;
}

#shop-search-input {
	width: 100%;
	padding: 12px 16px 12px 48px;
	background: transparent;
	border: 1px solid #2d2d45;
	border-radius: 8px;
	color: #0d6efd;
	font-size: 15px;
	transition: all 0.3s ease;
}

#shop-search-input:focus {
	outline: none;
	border-color: #7c3aed;
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

#shop-search-input::placeholder {
	color: #6b7280;
}

.shop-filter-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: transparent;
	border: 1px solid #2d2d45;
	border-radius: 8px;
	color: #0d6efd;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
}

.shop-filter-toggle:hover {
	background: #2d2d45;
	border-color: #7c3aed;
}

.shop-filter-toggle svg {
	width: 20px;
	height: 20px;
}

/* Filters */
.custom-shop-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 25px;
}

.filter-chip {
	padding: 8px 18px;
	background: transparent;
	border: 1px solid #2d2d45;
	border-radius: 20px;
	color: #3f86ff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
}

.filter-chip:hover {
	background: #2d2d45;
	color: #ffffff;
	border-color: #3a3a52;
}

.filter-chip.active {
	background: linear-gradient(135deg, #00d4ff, #7c3aed);
	color: #ffffff;
	border-color: transparent;
}

/* Sort Dropdown */
.custom-shop-sort {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
}

.custom-shop-sort label {
	color: #0d6efd;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

#shop-orderby {
	padding: 10px 40px 10px 16px;
	background: #ffffff;
	border: 1px solid #2d2d45;
	border-radius: 8px;
	color: #000000;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	appearance: none;
	transition: all 0.3s ease;
}

#shop-orderby:focus {
	outline: none;
	border-color: #7c3aed;
}

.custom-shop-sort .dropdown-icon {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	color: #000000;
}

/* Products Grid */
.custom-products-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	margin-bottom: 40px;
}

/* Product Card */
.custom-product-card {
	background: transparent;
	border-radius: 12px;
	overflow: hidden;
	transition: all 0.3s ease;
	list-style: none;
	border: none !important;
	outline: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.custom-product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.custom-product-card * {
	box-sizing: border-box;
}

.product-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
	border: none !important;
	outline: none !important;
}

.product-card-image {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #1a1a1a;
	border-radius: 12px;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
}

.product-card-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center center;
	transition: all 0.5s ease;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
}

.custom-product-card:hover .product-card-image img {
	transform: scale(1.08);
	opacity: 0.75;
}

/* Overlay with gradient - Full coverage from top to bottom */
.product-card-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px;
	background: linear-gradient(to bottom,
			rgba(0, 0, 0, 0.5) 0%,
			rgba(0, 0, 0, 0.1) 30%,
			rgba(0, 0, 0, 0.1) 70%,
			rgba(0, 0, 0, 0.6) 100%);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: all 0.3s ease;
	z-index: 2;
	font-family: Finlandica, system-ui, sans-serif;
}

.custom-product-card:hover .product-card-overlay {
	background: linear-gradient(to bottom,
			rgba(0, 0, 0, 0.65) 0%,
			rgba(0, 0, 0, 0.2) 30%,
			rgba(0, 0, 0, 0.2) 70%,
			rgba(0, 0, 0, 0.75) 100%);
}

/* Member Badge (Top Right Corner) */
.product-member-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: linear-gradient(135deg, #00d4ff, #7c3aed);
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 4px;
	z-index: 3;
}

/* Owned Badge (Top Right Corner) - Similar to category badge */
.product-owned-badge {
	position: absolute;
	top: 19px;
	right: 10px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #ffffff;
	padding: 2px 5px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	line-height: 1.2;
	z-index: 3;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
}

.product-owned-badge svg {
	width: 10px;
	height: 10px;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 1));
}

/* Overlay Info Rows */
.product-info-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

/* Row 1: Category & Rating - TOP of overlay */
.product-meta-row {
	min-height: auto;
	margin-bottom: 0;
}

.product-category-info .product-category-badge {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #ffffff;
	padding: 2px 5px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	display: inline-block;
	line-height: 1.2;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
}

.product-rating-info .product-rating-badge {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	padding: 4px 10px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	gap: 5px;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-rating-info .rating-star {
	color: #ffd700;
	font-size: 14px;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 1));
}

.product-rating-info .rating-value {
	color: #ffffff;
	font-weight: 700;
	font-size: 14px;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
}

/* Row 2: Title & Price - BOTTOM of overlay */
.product-main-row {
	align-items: flex-end;
	gap: 16px;
}

.product-card-title {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	flex: 1;
	color: #ffffff;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
}

.product-main-row .product-price {
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	color: #ffffff;
	white-space: nowrap;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
}

/* FREE price styling */
.free-price {
	color: #10b981;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Removed unused styles - product card now uses overlay only */

/* Price styling for overlay */
.product-price .woocommerce-Price-amount {
	color: inherit;
}

/* Load More Button */
.load-more-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 40px 0;
}

.load-more-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 40px;
	background: linear-gradient(135deg, #00d4ff, #7c3aed);
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 180px;
}

.load-more-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 212, 255, 0.4);
}

.load-more-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.load-more-loading svg {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

/* Responsive */
@media (max-width: 768px) {
	.custom-shop-header {
		margin-bottom: 20px;
	}

	.shop-title {
		font-size: 24px;
	}

	.shop-subtitle {
		font-size: 14px;
	}

	.shop-search-wrapper {
		flex-direction: column;
	}

	.shop-search-box {
		max-width: 100%;
	}

	.shop-filter-toggle {
		width: 100%;
		justify-content: center;
	}

	.custom-shop-filters {
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 10px;
	}

	.custom-shop-filters::-webkit-scrollbar {
		height: 6px;
	}

	.custom-shop-filters::-webkit-scrollbar-track {
		background: transparent;
	}

	.custom-shop-filters::-webkit-scrollbar-thumb {
		background: #7c3aed;
		border-radius: 3px;
	}

	/* Change to 1 column on tablets for larger product display */
	.custom-products-grid,
	.custom-products-grid.products {
		grid-template-columns: 1fr !important;
		gap: 20px !important;
		max-width: 500px;
		margin: 0 auto;
	}

	.product-card-overlay {
		padding: 14px;
	}

	.product-card-title {
		font-size: 15px;
		-webkit-line-clamp: 2;
	}

	.product-main-row .product-price {
		font-size: 15px;
	}

	.product-info-row {
		gap: 12px;
	}

	.product-category-info .product-category-badge {
		font-size: 13px;
		padding: 4px 10px;
	}

	.product-rating-info .rating-star {
		font-size: 14px;
	}

	.product-rating-info .rating-value {
		font-size: 13px;
	}
}

@media (max-width: 480px) {

	/* Single column on mobile phones for best readability */
	.custom-products-grid,
	.custom-products-grid.products {
		grid-template-columns: 1fr !important;
		gap: 16px !important;
		max-width: 100%;
	}

	#main>.wf-wrap {
		padding: 0px !important;
	}

	.product-card-overlay {
		padding: 14px;
	}

	.product-card-title {
		font-size: 12px !important;
		-webkit-line-clamp: 2;
		line-height: 1.4;
		font-weight: 700;
	}

	.product-main-row .product-price {
		font-size: 12px !important;
		font-weight: 700;
	}

	.product-category-info .product-category-badge {
		font-size: 10px !important;
		padding: 4px 8px;
		font-weight: 700;
	}

	.product-rating-info .rating-star {
		font-size: 12px !important;
	}

	.product-rating-info .rating-value {
		font-size: 11px !important;
		font-weight: 700;
	}

	.product-rating-info .product-rating-badge {
		padding: 4px 9px;
	}

	.product-info-row {
		gap: 10px;
	}
}

/* Products list styles */
.custom-shop-wrapper .products {
	list-style: none;
	padding: 0;
	margin: 0;
}

.custom-shop-wrapper .products:before,
.custom-shop-wrapper .products:after {
	display: none;
}

/* Override Flatsome product grid */
.custom-products-grid.products {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 20px !important;
}

/* Responsive container padding */
@media (max-width: 1200px) {
	.custom-shop-container {
		padding: 0 30px;
	}

	.custom-products-grid,
	.custom-products-grid.products,
	.shortcode-products-grid {
		grid-template-columns: repeat(3, 1fr) !important;
	}
}

@media (max-width: 992px) {
	.custom-shop-container {
		padding: 0 20px;
	}
}

@media (max-width: 768px) {
	.custom-shop-wrapper {
		padding: 40px 0;
	}

	.custom-shop-container {
		padding: 0 15px;
	}

	/* Force 2 columns on tablet and mobile */
	.custom-products-grid,
	.custom-products-grid.products,
	.shortcode-products-grid,
	ul.products {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 16px !important;
	}
}

/* ===================================
   SHORTCODE SPECIFIC STYLES
   =================================== */

/* Shortcode wrapper adjustments */
.nguyenthaimmo-products-shortcode {
	margin: 40px 0;
	padding: 0 !important;
	background: transparent !important;
	min-height: auto !important;
}

/* Shortcode header */
.shortcode-products-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.shortcode-products-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	background: linear-gradient(122deg, #00d4ff, #7c3aed);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.shortcode-view-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px;
	background: linear-gradient(122deg, #00d4ff, #7c3aed);
	color: #ffffff !important;
	text-decoration: none;
	border-radius: 50px;
	font-size: 12px;
	font-weight: 600;
	transition: all 0.3s ease;
	box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.shortcode-view-more-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5);
	color: #ffffff !important;
	background: linear-gradient(122deg, #7c3aed, #00d4ff);
}

.shortcode-view-more-btn svg {
	transition: transform 0.3s ease;
	width: 16px;
	height: 16px;
}

.shortcode-view-more-btn:hover svg {
	transform: translateX(4px);
}

/* Shortcode products grid */
.shortcode-products-grid {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.shortcode-products-grid.custom-products-grid {
	display: grid !important;
}

/* Responsive for shortcode */
@media (max-width: 1200px) {

	.shortcode-products-grid,
	.shortcode-products-grid.custom-products-grid,
	.shortcode-products-grid.products {
		grid-template-columns: repeat(3, 1fr) !important;
	}
}

@media (max-width: 768px) {

	/* Removed column layout forcing for shortcode header to keep title and button on same line */

	.shortcode-products-title {
		font-size: 24px;
	}


	.shortcode-products-grid,
	.shortcode-products-grid.custom-products-grid,
	.shortcode-products-grid.products {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 16px !important;
	}
}

@media (max-width: 480px) {

	.shortcode-products-grid,
	.shortcode-products-grid.custom-products-grid,
	.shortcode-products-grid.products {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 12px !important;
	}

	.shortcode-products-header {
		margin-bottom: 20px;
	}

	.shortcode-products-title {
		font-size: 20px;
	}
}

/* ===================================
   RELATED PRODUCTS STYLES
   =================================== */

.custom-related-products {
	margin: 60px 0 40px;
	padding: 0;
}

.custom-related-products .related-products-title {
	font-size: 32px;
	font-weight: 700;
	margin: 0 0 30px 0;
	text-transform: none;
	letter-spacing: normal;
	background: linear-gradient(122deg, #00d4ff, #7c3aed);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.custom-related-products .custom-products-grid {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 20px !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.custom-related-products .custom-products-grid::before,
.custom-related-products .custom-products-grid::after {
	display: none !important;
}

/* Responsive for related products */
@media (max-width: 1200px) {
	.custom-related-products .custom-products-grid {
		grid-template-columns: repeat(3, 1fr) !important;
	}
}

@media (max-width: 768px) {
	.custom-related-products {
		margin: 40px 0 30px;
	}

	.custom-related-products .related-products-title {
		font-size: 24px;
		margin-bottom: 20px;
	}

	.custom-related-products .custom-products-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 16px !important;
	}
}

@media (max-width: 480px) {
	.custom-related-products .related-products-title {
		font-size: 20px;
	}

	.custom-related-products .custom-products-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 12px !important;
	}
}