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

/* ==========================================
   自定义购物车样式 - Custom Cart Styles
   ========================================== */

/* 整体页面背景 */
body.woocommerce-cart {
	background-color: #f5f5f5 !important;
}

.woocommerce-cart .site-content {
	background-color: #f5f5f5;
	padding: 40px 0;
}

/* 购物车主容器 */
.custom-cart-wrapper {
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
}

.custom-cart-container {
	display: flex;
	gap: 30px;
	align-items: flex-start;
}

/* 左侧产品列表 */
.custom-cart-left {
	flex: 1;
	background: #ffffff;
	padding: 30px;
	border: 1px solid #e0e0e0;
}

.cart-header h2 {
	margin: 0 0 25px 0;
	font-size: 24px;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #333;
	padding-bottom: 15px;
}

/* 产品项目容器 */
.custom-cart-items {
	margin-bottom: 20px;
}

.custom-cart-item {
	display: flex;
	gap: 20px;
	padding: 20px 0;
	border-bottom: 1px solid #e8e8e8;
	align-items: flex-start;
}

.custom-cart-item:last-child {
	border-bottom: none;
}

.cart-item-image {
	flex-shrink: 0;
	width: 100px;
	height: 100px;
	overflow: hidden;
}

.cart-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cart-item-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cart-item-name {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.cart-item-name a {
	color: #333;
	text-decoration: none;
	transition: color 0.3s;
}

.cart-item-name a:hover {
	color: #666;
}

.cart-item-price,
.cart-item-quantity-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #666;
}

.price-label,
.quantity-label {
	font-weight: 500;
	color: #666;
}

.cart-item-quantity-wrapper .quantity {
	display: inline-flex;
	align-items: center;
}

.cart-item-quantity-wrapper input.qty {
	width: 60px;
	height: 36px;
	text-align: center;
	border: 1px solid #ddd;
	padding: 5px;
	font-size: 14px;
}

.cart-item-subtotal {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	min-width: 100px;
}

.subtotal-amount {
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.item-remove a.remove {
	display: inline-block;
	padding: 4px 12px;
	background: #f5f5f5;
	color: #999;
	text-decoration: none;
	font-size: 13px;
	transition: all 0.3s;
	border: 1px solid #e0e0e0;
}

.item-remove a.remove:hover {
	background: #333;
	color: #fff;
	border-color: #333;
}

/* 自动更新提示区域 */
.cart-update-notice {
	margin-top: 20px;
	padding: 15px 20px;
	background: #f0f8f0;
	border: 1px solid #c3e6cb;
	text-align: center;
}

.auto-update-notice {
	margin: 0;
	color: #2e7d32;
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.auto-update-notice svg {
	flex-shrink: 0;
}

/* 更新购物车按钮（备用，默认隐藏）*/
.update-cart-button-manual {
	width: 100%;
	padding: 14px 20px;
	background: #333;
	color: #fff;
	border: none;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-top: 10px;
}

.update-cart-button-manual:hover {
	background: #555;
	color: #fff;
}

/* 正在更新的产品项样式 */
.custom-cart-item.updating {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.custom-cart-item.updating::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.5);
	z-index: 1;
}

/* 加载旋转动画 */
@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.loading-spinner {
	display: inline-block;
	animation: spin 1s linear infinite;
	font-size: 18px;
	color: #666;
}

/* 右侧表单区域 */
.custom-cart-right {
	flex-shrink: 0;
	width: 420px;
	position: sticky;
	top: 20px;
}

.custom-cart-totals {
	background: #ffffff;
	border: 1px solid #e0e0e0;
}

/* 订单汇总部分 */
.cart-summary-section {
	padding: 25px;
	border-bottom: 2px solid #f5f5f5;
}

.cart-summary-section h3 {
	margin: 0 0 20px 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.summary-table {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	font-size: 14px;
}

.summary-label {
	color: #666;
	font-weight: 500;
}

.summary-value {
	font-weight: 600;
	color: #333;
}

.summary-row.total-row {
	border-top: 2px solid #333;
	padding-top: 15px;
	margin-top: 5px;
	font-size: 16px;
}

.summary-row.total-row .summary-label,
.summary-row.total-row .summary-value {
	font-size: 18px;
	font-weight: 700;
	color: #333;
}

/* 询价表单部分 */
.inquiry-form-section {
	padding: 25px;
}

.inquiry-form-section h3 {
	margin: 0 0 10px 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.inquiry-description {
	margin-bottom: 20px;
	color: #666;
	font-size: 13px;
	line-height: 1.6;
}

.cart-inquiry-form .form-group {
	margin-bottom: 15px;
}

.cart-inquiry-form label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 13px;
	color: #333;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.cart-inquiry-form .required {
	color: #d32f2f;
	margin-left: 2px;
}

.cart-inquiry-form .form-control {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	font-size: 14px;
	background: #fafafa;
	transition: all 0.3s;
}

.cart-inquiry-form .form-control:focus {
	outline: none;
	border-color: #333;
	background: #fff;
}

.cart-inquiry-form textarea.form-control {
	resize: vertical;
	min-height: 100px;
	font-family: inherit;
}

.submit-inquiry-btn {
	width: 100%;
	padding: 15px 20px;
	background: #333;
	color: #fff;
	border: none;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.submit-inquiry-btn:hover {
	background: #555;
}

.submit-inquiry-btn:disabled {
	background: #999;
	cursor: not-allowed;
}

/* 消息提示 */
.inquiry-form-messages {
	margin-top: 15px;
	padding: 12px 15px;
	display: none;
	font-size: 13px;
	line-height: 1.5;
}

.inquiry-form-messages.success {
	display: block;
	background: #e8f5e9;
	border: 1px solid #4caf50;
	color: #2e7d32;
}

.inquiry-form-messages.error {
	display: block;
	background: #ffebee;
	border: 1px solid #ef5350;
	color: #c62828;
}

/* 响应式设计 */
@media (max-width: 1024px) {
	.custom-cart-container {
		flex-direction: column;
	}
	
	.custom-cart-right {
		width: 100%;
		position: static;
	}
}

@media (max-width: 768px) {
	.custom-cart-left,
	.custom-cart-totals,
	.cart-summary-section,
	.inquiry-form-section {
		padding: 20px;
	}
	
	.custom-cart-item {
		flex-wrap: wrap;
	}
	
	.cart-item-image {
		width: 80px;
		height: 80px;
	}
	
	.cart-item-subtotal {
		width: 100%;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		margin-top: 10px;
	}
	
	.cart-update-notice {
		padding: 12px 15px;
	}
	
	.auto-update-notice {
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.cart-header h2 {
		font-size: 20px;
	}
	
	.custom-cart-item {
		gap: 15px;
		padding: 15px 0;
	}
	
	.cart-item-image {
		width: 70px;
		height: 70px;
	}
	
	.cart-item-name {
		font-size: 14px;
	}
	
	.cart-summary-section h3,
	.inquiry-form-section h3 {
		font-size: 16px;
	}
}
