/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* ====================================
   Mini Cart 数量调整功能样式
   Mini Cart Quantity Input Styles
   ==================================== */

/* Mini cart 中的数量输入框容器 */
.woocommerce-mini-cart .cart-info .quantity {
	display: inline-flex !important;
	align-items: center;
	margin: 10px 0;
	border: 1px solid #e0e0e0;
	border-radius: 3px;
	overflow: hidden;
}

/* 数量输入框样式 */
.woocommerce-mini-cart .cart-info .quantity input.qty {
	width: 50px;
	height: 36px;
	border: none;
	text-align: center;
	font-size: 14px;
	padding: 0;
	margin: 0;
	-moz-appearance: textfield;
}

/* 移除数字输入框的上下箭头 */
.woocommerce-mini-cart .cart-info .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-mini-cart .cart-info .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* 加减按钮样式 */
.woocommerce-mini-cart .cart-info .quantity .minus,
.woocommerce-mini-cart .cart-info .quantity .plus {
	width: 36px;
	height: 36px;
	background-color: #f5f5f5;
	border: none;
	cursor: pointer;
	font-size: 16px;
	font-weight: bold;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
}

/* 加减按钮悬停效果 */
.woocommerce-mini-cart .cart-info .quantity .minus:hover,
.woocommerce-mini-cart .cart-info .quantity .plus:hover {
	background-color: #e0e0e0;
}

/* 加减按钮激活效果 */
.woocommerce-mini-cart .cart-info .quantity .minus:active,
.woocommerce-mini-cart .cart-info .quantity .plus:active {
	background-color: #d0d0d0;
}

/* 价格显示样式调整 */
.woocommerce-mini-cart .cart-info > .quantity:not(.quantity) {
	margin-top: 10px;
	display: block;
}

/* 加载状态样式 */
.woocommerce-mini-cart-item.wd-loading {
	opacity: 0.6;
	pointer-events: none;
}

.woocommerce-mini-cart-item.wd-loading .quantity {
	position: relative;
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
	.woocommerce-mini-cart .cart-info .quantity {
		margin: 8px 0;
	}
	
	.woocommerce-mini-cart .cart-info .quantity input.qty {
		width: 45px;
		height: 32px;
		font-size: 13px;
	}
	
	.woocommerce-mini-cart .cart-info .quantity .minus,
	.woocommerce-mini-cart .cart-info .quantity .plus {
		width: 32px;
		height: 32px;
		font-size: 14px;
	}
}

/* ====================================
   Elementor Mini Cart 数量调整功能样式
   Elementor Mini Cart Quantity Styles
   ==================================== */

/* Elementor 购物车中的数量输入框容器 */
.elementor-menu-cart__product .wd-quantity-input {
	display: inline-flex !important;
	align-items: center;
	margin: 10px 0;
	border: 1px solid #e0e0e0;
	border-radius: 3px;
	overflow: hidden;
}

/* Elementor 数量输入框样式 */
.elementor-menu-cart__product .wd-qty-input {
	width: 50px;
	height: 36px;
	border: none;
	text-align: center;
	font-size: 14px;
	padding: 0;
	margin: 0;
	-moz-appearance: textfield;
}

/* 移除数字输入框的上下箭头 */
.elementor-menu-cart__product .wd-qty-input::-webkit-outer-spin-button,
.elementor-menu-cart__product .wd-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Elementor 加减按钮样式 */
.elementor-menu-cart__product .wd-qty-minus,
.elementor-menu-cart__product .wd-qty-plus {
	width: 36px;
	height: 36px;
	background-color: #f5f5f5;
	border: none;
	cursor: pointer;
	font-size: 16px;
	font-weight: bold;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
}

/* Elementor 加减按钮悬停效果 */
.elementor-menu-cart__product .wd-qty-minus:hover,
.elementor-menu-cart__product .wd-qty-plus:hover {
	background-color: #e0e0e0;
}

/* Elementor 加减按钮激活效果 */
.elementor-menu-cart__product .wd-qty-minus:active,
.elementor-menu-cart__product .wd-qty-plus:active {
	background-color: #d0d0d0;
}

/* Elementor 购物车产品加载状态 */
.elementor-menu-cart__product[style*="opacity: 0.6"] {
	pointer-events: none;
}

/* Elementor 响应式设计 - 移动设备 */
@media (max-width: 768px) {
	.elementor-menu-cart__product .wd-quantity-input {
		margin: 8px 0;
	}
	
	.elementor-menu-cart__product .wd-qty-input {
		width: 45px;
		height: 32px;
		font-size: 13px;
	}
	
	.elementor-menu-cart__product .wd-qty-minus,
	.elementor-menu-cart__product .wd-qty-plus {
		width: 32px;
		height: 32px;
		font-size: 14px;
	}
}

/* 强制显示加减按钮 - 提高优先级并确保宽度 */
body .elementor-menu-cart__product .wd-qty-plus,
body .elementor-menu-cart__product .wd-qty-minus {
	display: flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: 36px !important;
	min-width: 36px !important;
	max-width: 36px !important;
	height: 36px !important;
	min-height: 36px !important;
	flex-shrink: 0 !important;
	flex-grow: 0 !important;
	align-items: center !important;
	justify-content: center !important;
	background-color: #f5f5f5 !important;
	border: none !important;
	cursor: pointer !important;
	font-size: 16px !important;
	font-weight: bold !important;
}

/* 确保数量输入框容器正确显示 */
body .elementor-menu-cart__product .wd-quantity-input {
	display: inline-flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: space-between !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
}

/* 数量输入框也要固定宽度 */
body .elementor-menu-cart__product .wd-qty-input {
	width: 50px !important;
	min-width: 50px !important;
	max-width: 50px !important;
	flex-shrink: 0 !important;
	flex-grow: 0 !important;
}

/* ====================================
   强制产品变体显示为按钮样式
   Force Product Variations to Display as Buttons
   ==================================== */

/* 隐藏有按钮样式时的下拉选择框 */
.variations select.wd-hide-select {
	display: none !important;
}

/* 确保有 swatches 时，下拉框完全隐藏 */
.variations .value.with-swatches select {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	position: absolute !important;
	left: -9999px !important;
}

/* 确保按钮样式容器正确显示 */
.variations .value.with-swatches .wd-swatches-product {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
}

/* 文本样本按钮样式优化 */
.wd-swatch.wd-text {
	min-width: 45px !important;
	padding: 8px 16px !important;
	border: 1px solid #e0e0e0 !important;
	border-radius: 3px !important;
	background-color: #fff !important;
	cursor: pointer !important;
	transition: all 0.3s ease !important;
	text-align: center !important;
}

/* 文本样本悬停效果 */
.wd-swatch.wd-text:hover {
	border-color: #333 !important;
	background-color: #f5f5f5 !important;
}

/* 文本样本选中效果 */
.wd-swatch.wd-text.wd-active {
	border-color: #333 !important;
	background-color: #333 !important;
	color: #fff !important;
}

/* 文本样本内的文字样式 */
.wd-swatch.wd-text .wd-swatch-text {
	font-size: 14px !important;
	font-weight: 500 !important;
}

/* 禁用状态的样本 */
.wd-swatch.wd-disabled {
	opacity: 0.3 !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
}
