/*
Theme Name: Woodmart Child
Template: woodmart
Version: 1.0
Author: woodmart
Description: A child theme for the Woodmart theme.
*/

/* 产品列表网格样式 - 统一标题和编码高度 */
.wb-grid-item .wd-product-header {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wb-grid-item .wb-loop-meta.wb-loop-ean {
	min-height: 20px;
	line-height: 20px;
	font-weight: 700;
	font-size: 14px;
	color: #333;
	margin-bottom: 0;
	text-align: left;
	width: 100%;
}

/* 限制标题最多两行并统一高度 */
.wb-grid-item h3.product-title,
.wb-grid-item .product-title,
.wb-grid-item .wd-entities-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 2.4em;
	line-height: 1.2em;
	text-align: left;
	width: 100%;
}

/* 桌面端按钮横向排列 - 胶囊型左红右黑 */
@media (min-width: 768px) {
	.product-wrapper .swap-wrapp {
		width: 100%;
		overflow: hidden !important;
	}

	.product-wrapper .swap-elements {
		display: flex !important;
		gap: 0 !important;
		align-items: stretch;
		flex-direction: row !important;
		width: 100%;
		max-width: 100%;
		overflow: hidden;
	}

	.product-wrapper .swap-elements > div {
		width: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: hidden;
	}

	.product-wrapper .wd-add-btn {
		flex: 1;
	}

	.product-wrapper .wb-add-to-cart {
		flex: 1;
	}

	.product-wrapper .wd-add-btn .button,
	.product-wrapper .wb-add-to-cart .button {
		width: 100%;
		max-width: 100%;
		white-space: nowrap;
		padding: 0 6px;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 40px;
		min-height: 40px;
		border: none !important;
		margin: 0 !important;
		font-weight: 600;
		font-size: 11px;
		font-family: Inter, Arial, Helvetica, sans-serif;
		letter-spacing: -0.3px;
		transition: opacity 0.2s;
		overflow: hidden;
		text-overflow: ellipsis;
		box-sizing: border-box;
	}

	.product-wrapper .wd-add-btn .button span,
	.product-wrapper .wb-add-to-cart .button span {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	/* View Detail 按钮 - 左侧红色圆角 */
	.product-wrapper .wd-add-btn .button.wd-view-detail {
		background: #e31e24 !important;
		color: #fff !important;
		border-radius: 24px 0 0 24px !important;
		font-size: 12px !important;
	}

	.product-wrapper .wd-add-btn .button.wd-view-detail:hover {
		opacity: 0.9;
	}

	/* Add to Cart 按钮 - 右侧深灰圆角 */
	.product-wrapper .wb-add-to-cart .button {
		background: #3d3d3d !important;
		color: #fff !important;
		border-radius: 0 24px 24px 0 !important;
		font-size: 11px !important;
	}

	.product-wrapper .wb-add-to-cart .button:hover {
		opacity: 0.9;
	}
}

/* 手机端按钮垂直排列 - 椭圆型全宽按钮 */
@media (max-width: 767px) {
	.product-wrapper .swap-wrapp {
		width: 100%;
	}

	.product-wrapper .swap-elements {
		display: flex !important;
		flex-direction: column !important;
		gap: 8px !important;
		width: 100%;
	}

	.product-wrapper .swap-elements > div {
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.product-wrapper .wd-add-btn,
	.product-wrapper .wb-add-to-cart {
		width: 100%;
	}

	.product-wrapper .wd-add-btn .button,
	.product-wrapper .wb-add-to-cart .button {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 40px;
		min-height: 40px;
		border: none !important;
		margin: 0 !important;
		font-weight: 600;
		font-size: 13px;
		font-family: Inter, Arial, Helvetica, sans-serif;
		transition: opacity 0.2s;
		box-sizing: border-box;
		padding: 0 16px;
	}

	.product-wrapper .wd-add-btn .button span,
	.product-wrapper .wb-add-to-cart .button span {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	/* View Detail 按钮 - 椭圆红色 */
	.product-wrapper .wd-add-btn .button.wd-view-detail {
		background: #e31e24 !important;
		color: #fff !important;
		border-radius: 20px !important;
	}

	.product-wrapper .wd-add-btn .button.wd-view-detail:hover {
		opacity: 0.9;
	}

	/* Add to Cart 按钮 - 椭圆深灰 */
	.product-wrapper .wb-add-to-cart .button {
		background: #3d3d3d !important;
		color: #fff !important;
		border-radius: 20px !important;
	}

	.product-wrapper .wb-add-to-cart .button:hover {
		opacity: 0.9;
	}
}

.wd-product.wd-hover-alt:not(.wd-variation-active) .swap-wrapp {
	overflow: visible !important;
	height: auto !important;
	margin-block: 0 !important;
	transition: none !important;
}

.wd-carousel-wrap,
.wd-carousel-wrap .swiper,
.wd-carousel-wrap .swiper-wrapper,
.wd-carousel-wrap .swiper-slide {
	height: auto !important;
	overflow: visible !important;
}

.wd-carousel .product-grid-item,
.wd-carousel .product-wrapper {
	height: auto !important;
	overflow: visible !important;
}

.woocommerce-cart .wb-cart-quote-btn {
	background-color: #d70000 !important;
	color: #ffffff !important;
	border-radius: 999px;
	border: none;
	padding: 12px 32px;
	font-weight: 600;
	text-align: center;
	box-shadow: none;
}

.woocommerce-cart .wb-cart-quote-btn.disabled {
	opacity: 0.6;
	pointer-events: none;
}

.woocommerce-cart .wb-cart-quote-btn:hover,
.woocommerce-cart .wb-cart-quote-btn:focus {
	background-color: #b50000 !important;
	color: #ffffff !important;
}

.wb-quote-page {
	padding: 40px 0 60px;
}

.wb-quote-page .container {
	max-width: 960px;
}

.wb-quote-title {
	font-size: 28px;
	margin-bottom: 24px;
	font-weight: 600;
}

.wb-quote-notice {
	margin-bottom: 24px;
}

.wb-quote-cart {
	margin-bottom: 32px;
}

.wb-quote-table {
	width: 100%;
	border-collapse: collapse;
}

.wb-quote-table th,
.wb-quote-table td {
	padding: 12px 16px;
	border-bottom: 1px solid #e5e5e5;
	text-align: left;
}

.wb-quote-table th {
	font-weight: 600;
	background-color: #fafafa;
}

.wb-quote-product-name {
	display: block;
	font-weight: 600;
}

.wb-quote-variation {
	display: block;
	color: #555555;
	margin-top: 4px;
}

.wb-quote-form-wrapper {
	background-color: #ffffff;
	border: 1px solid #ececec;
	border-radius: 12px;
	padding: 24px;
}

.wb-quote-form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

.wb-quote-form .wb-quote-field-wide {
	grid-column: 1 / -1;
}

.wb-quote-form .wb-quote-field {
	display: flex;
	flex-direction: column;
}

.wb-quote-form label {
	font-weight: 600;
	margin-bottom: 6px;
}

.wb-quote-form input,
.wb-quote-form textarea {
	border-radius: 6px;
	border: 1px solid #d8d8d8;
	padding: 10px 14px;
	font-size: 15px;
	box-sizing: border-box;
}

.wb-quote-form textarea {
	min-height: 140px;
	resize: vertical;
}

.wb-quote-submit {
	grid-column: 1 / -1;
	text-align: center;
}

.wb-submit-quote {
	background-color: #ffffff !important;
	color: #d70000 !important;
	border: 2px solid #d70000 !important;
	border-radius: 999px;
	padding: 12px 40px;
	font-weight: 600;
	box-shadow: none;
}

.wb-submit-quote:hover,
.wb-submit-quote:focus {
	background-color: #d70000 !important;
	color: #ffffff !important;
}

.wb-submit-quote[disabled] {
	opacity: 0.6;
	pointer-events: none;
}

.wb-quote-hint {
	margin-top: 12px;
	color: #555555;
}

.wb-quote-cart-actions {
	margin-top: 16px;
	display: flex;
	justify-content: flex-end;
}

.wd-product.purchasable,
.wd-product .product-element-top,
.wd-product .product-element-top .product-image-link,
.wd-product .product-element-top .hover-img,
.wd-product .wrap-price,
.wd-product .wrapp-product-price,
.wd-product .swap-wrapp,
.wd-product .swap-elements,
.wd-product .swap-elements .wd-add-btn,
.wd-product .swap-elements .wb-add-to-cart,
.wd-product .swap-elements .wb-request-quote {
	transform: none !important;
	transition: none !important;
	animation: none !important;
}

.wd-product .product-element-top .hover-img,
.wd-product .product-element-top .hover-img img {
	display: none !important;
}

body:not(.home) .whb-header {
	height: 120px;
}

/* Tablet and mobile: reduce header height to 60px */
@media (max-width: 1024px) {
	body:not(.home) .whb-header {
		height: 60px;
	}
}

@media (min-width: 769px) and (max-width: 1199.98px) {
	.elementor-17008 .elementor-element.elementor-element-44e54713 {
		--width: 100% !important;
	}
}

.single-product .summary .price,
.single-product .summary .woocommerce-Price-amount,
.single-product .summary .price ins,
.single-product .summary .price del,
.price {
	display: none !important;
}

.single-product .summary .product-print-button {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	margin-left: 20px;
}

.single-product .summary .product-print-button a {
	display: inline-flex;
	align-items: center;
	padding: 12px 24px;
	border-radius: 999px;
	font-weight: 600;
}

.wb-print-product {
	display: none;
	cursor: pointer;
}

.wb-print-product .elementor-icon-list-icon svg {
	width: 1em;
	height: 1em;
	transition: none;
}

.wb-print-product .elementor-icon-list-text {
	color: #333 !important;
}

.whb-col-right .wd-search-dropdown {
	width: 468px !important;
	border-radius: 6px !important;
}

/* Give accessory cards a default transparent border to prevent layout shifting */
.wb-related-products-tab .wd-product,
.wb-related-products-tab .product-grid-item {
	border: 1px solid #eee;
	padding: 10px;
}

.mc4wp-form.wb-mailchimp-disabled input[type="submit"] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Tweak account dashboard spacing without touching other templates. */
body.woocommerce-account .main-page-wrapper {
	padding-top: 48px;
}

body.woocommerce-account .woocommerce-my-account-wrapper,
body.woocommerce-account .wd-wtl-content {
	padding-top: 24px;
}

/* Ensure wishlist endpoint mirrors the account spacing. */

body.page-id-45 .main-page-wrapper,
body.page-id-60 .main-page-wrapper,
body.page-id-17964 .main-page-wrapper,
body.page-id-17966 .main-page-wrapper {
	padding-top: 48px;
}


body.page-id-45 .woocommerce-my-account-wrapper,
body.page-id-45 .wd-wishlist-content,
body.page-id-60 .woocommerce-my-account-wrapper,
body.page-id-60 .wd-wishlist-content,
body.page-id-17964 .woocommerce-my-account-wrapper,
body.page-id-17964 .wd-wishlist-content,
body.page-id-17966 .woocommerce-my-account-wrapper,
body.page-id-17966 .wd-wishlist-content {
	padding-top: 24px;
}

.wd-prefooter{
	padding: 0 !important;
}

/* Single product: keep brands compact next to title */
.single-product .wd-product-brands {
	display: flex;
	align-items: center;
	justify-content: flex-end; /* align brand items to the right */
	gap: 8px;
	max-width: 420px;
	margin-left: auto; /* push the whole block to the right when possible */
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 2px; /* room for scrollbar */
	-webkit-overflow-scrolling: touch;
}

.single-product .wd-product-brands a {
	display: inline-flex;
	align-items: center;
}

.single-product .wd-product-brands img {
	max-height: 28px;
	height: auto;
	width: auto;
}

@media (max-width: 1024px) {
	.single-product .wd-product-brands { max-width: 360px; }
}

@media (max-width: 768px) {
	.single-product .wd-product-brands { max-width: 100%; }
}

/* Product title + codes sizing */
.single-product .product_title.entry-title.wd-entities-title {
	font-size: 24px !important;
	line-height: 1.25;
	font-weight: 700;
	margin-bottom: 10px;
}

.single-product .wb-product-code-main {
	font-size: 28px !important;
	font-weight: 700;
	line-height: 1.2;
	color: #333;
	margin-bottom: 6px;
}

.single-product .wb-product-ean {
	font-size: 13px !important;
	font-weight: 600;
	line-height: 1.25;
	color: #222;
	margin-bottom: 4px;
}

/* ============================================
   产品详情页品牌列表 - 折叠展开功能
   ============================================ */

/* 品牌列表容器 */
.wd-product-brands {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	position: relative;
}

/* 品牌链接样式 */
.wd-product-brands a {
	display: inline-block;
	padding: 6px 12px;
	background-color: #f5f5f5;
	border: 1px solid #e0e0e0;
	border-radius: 3px;
	text-decoration: none;
	color: #333;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.3s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 120px;
}

.wd-product-brands a:hover {
	background-color: #e8e8e8;
	border-color: #d0d0d0;
	color: #d70000;
}

/* 品牌项隐藏处理 */
.wd-product-brands a.wb-brand-hidden {
	display: none !important;
}

/* 品牌项显示处理 */
.wd-product-brands a.wb-brand-shown {
	display: inline-block !important;
	animation: fadeIn 0.3s ease;
}

/* 淡入动画 */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* 查看全部按钮 */
.wd-product-brands .wb-brands-toggle-btn {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	background-color: #f5f5f5;
	border: 1px solid #e0e0e0;
	border-radius: 3px;
	color: #333;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	user-select: none;
}

.wd-product-brands .wb-brands-toggle-btn:hover {
	background-color: #e8e8e8;
	border-color: #d0d0d0;
	color: #d70000;
}

.wd-product-brands .wb-brands-toggle-btn svg {
	width: 16px;
	height: 16px;
	margin-left: 4px;
	transition: transform 0.3s ease;
}

/* 展开状态 - 旋转箭头 */
.wd-product-brands.wb-brands-expanded .wb-brands-toggle-btn svg {
	transform: rotate(180deg);
}

/* 隐藏的品牌数量提示（如果需要） */
.wd-product-brands .wb-hidden-count {
	font-size: 12px;
	color: #999;
}

/* 响应式设计 - 平板和桌面 */
@media screen and (min-width: 768px) {
	.wd-product-brands {
		gap: 10px 14px;
	}

	.wd-product-brands a {
		padding: 8px 14px;
		font-size: 13px;
		max-width: 140px;
	}

	.wd-product-brands .wb-brands-toggle-btn {
		padding: 8px 14px;
		font-size: 13px;
	}

	/* 平板端 - 默认显示4个品牌 */
	.wd-product-brands a:nth-child(n+5):not(.wb-brands-toggle-btn) {
		display: none;
	}

	/* 展开时显示所有品牌 */
	.wd-product-brands.wb-brands-expanded a:nth-child(n+5):not(.wb-brands-toggle-btn) {
		display: inline-block;
	}
}

/* 响应式设计 - 手机端 */
@media screen and (max-width: 767px) {
	.wd-product-brands {
		gap: 6px 10px;
		margin-bottom: 10px;
	}

	.wd-product-brands a {
		padding: 5px 10px;
		font-size: 12px;
		max-width: 100px;
	}

	.wd-product-brands .wb-brands-toggle-btn {
		padding: 5px 10px;
		font-size: 12px;
		flex-shrink: 0;
	}

	.wd-product-brands .wb-brands-toggle-btn svg {
		width: 14px;
		height: 14px;
		margin-left: 3px;
	}

	/* 手机端 - 默认显示3个品牌 */
	.wd-product-brands a:nth-child(n+4):not(.wb-brands-toggle-btn) {
		display: none;
	}

	/* 展开时显示所有品牌 */
	.wd-product-brands.wb-brands-expanded a:nth-child(n+4):not(.wb-brands-toggle-btn) {
		display: inline-block;
	}
}

/* 响应式设计 - 桌面端 (1024px+) */
@media screen and (min-width: 1024px) {
	.wd-product-brands {
		gap: 8px 12px;
	}

	.wd-product-brands a {
		padding: 6px 12px;
		font-size: 13px;
		max-width: 120px;
	}

	.wd-product-brands .wb-brands-toggle-btn {
		padding: 6px 12px;
		font-size: 13px;
	}

	/* 桌面端 - 默认显示6个品牌 */
	.wd-product-brands a:nth-child(n+7):not(.wb-brands-toggle-btn) {
		display: none;
	}

	/* 展开时显示所有品牌 */
	.wd-product-brands.wb-brands-expanded a:nth-child(n+7):not(.wb-brands-toggle-btn) {
		display: inline-block;
	}
}