/**
 * 产品详情页 PC 端布局优化
 * 通过插件设置 → 页面布局 → 优化 PC 端产品页布局 开关控制
 */

@media only screen and (min-width: 881px) {

	/* Only constrain the outermost content grid, not inner grid items (which would break Related Products). */
	#qodef-woo-page.qodef--single > .qodef-content-grid,
	#yith-quick-view-content.single-product > .qodef-content-grid {
		width: 1200px !important;
		max-width: 1200px !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	#qodef-woo-page.qodef--single .qodef-woo-single-inner,
	#yith-quick-view-content.single-product .qodef-woo-single-inner {
		grid-template-columns: 58% 1fr !important;
		grid-column-gap: 60px !important;
		gap: 60px !important;
		width: 1200px !important;
		max-width: 1200px !important;
		margin: 0 auto !important;
		padding: 0 !important;
		box-sizing: border-box !important;
	}

	#qodef-woo-page.qodef--single .qodef-woo-single-image,
	#yith-quick-view-content.single-product .qodef-woo-single-image {
		margin: 0 !important;
		padding: 0 !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery,
	#yith-quick-view-content.single-product .woocommerce-product-gallery {
		margin: 0 !important;
		padding: 0 !important;
	}

	#qodef-woo-page.qodef--single .qodef-woo-single-image .woocommerce-product-gallery__wrapper {
		width: 100% !important;
		max-width: 100% !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery__image {
		max-width: 100% !important;
		width: 100% !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery__image img {
		max-width: 100% !important;
		width: 100% !important;
		height: auto !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image img {
		max-height: 580px !important;
		max-width: 100% !important;
		width: auto !important;
		height: auto !important;
		object-fit: contain !important;
		margin: 0 auto !important;
		display: block !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper {
		flex-direction: column !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper {
		width: 100% !important;
		margin-right: 0 !important;
		margin-top: 8px;
		display: flex !important;
		flex-wrap: nowrap !important;
		overflow-x: auto !important;
		scroll-behavior: smooth !important;
		gap: 8px !important;
		padding-bottom: 6px !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper::-webkit-scrollbar {
		height: 6px;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper::-webkit-scrollbar-track {
		background: transparent;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper::-webkit-scrollbar-thumb {
		background: #ddd;
		border-radius: 3px;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper::-webkit-scrollbar-thumb:hover {
		background: #bbb;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper
	.woocommerce-product-gallery__image {
		flex-shrink: 0 !important;
		height: 80px !important;
		width: auto !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper
	.woocommerce-product-gallery__image img {
		max-height: 80px !important;
		height: 100% !important;
		width: auto !important;
		object-fit: contain !important;
	}

	/* Active thumbnail highlight */
	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper
	.woocommerce-product-gallery__image.qodef--active {
		border: 2px solid #333 !important;
		border-radius: 2px;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper
	.woocommerce-product-gallery__image:not(.qodef--active) {
		border: 2px solid transparent !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
		width: 100% !important;
		cursor: pointer;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image .zoomImg {
		display: none !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper {
		position: relative;
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-left,
	#qodef-woo-page.qodef--single .pc-thumbnail-nav-right {
		position: absolute;
		bottom: 12px;
		width: 28px;
		height: 28px;
		background: rgba(255, 255, 255, 0.9);
		border: 1px solid #e8e8e8;
		border-radius: 50%;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 10;
		opacity: 0;
		transition: opacity 0.3s;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-left:hover,
	#qodef-woo-page.qodef--single .pc-thumbnail-nav-right:hover {
		background: #fff;
		border-color: #ccc;
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-left {
		left: 0;
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-right {
		right: 0;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery__wrapper:hover .pc-thumbnail-nav-left,
	#qodef-woo-page.qodef--single .woocommerce-product-gallery__wrapper:hover .pc-thumbnail-nav-right {
		opacity: 1;
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-left::before,
	#qodef-woo-page.qodef--single .pc-thumbnail-nav-right::before {
		content: '';
		display: inline-block;
		width: 6px;
		height: 6px;
		border-left: 2px solid #333;
		border-bottom: 2px solid #333;
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-left::before {
		transform: rotate(45deg);
		margin-left: 2px;
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-right::before {
		transform: rotate(-135deg);
		margin-right: 2px;
	}
}

#qodef-woo-page.qodef--single .entry-summary .price {
	margin-top: 10px;
}

#qodef-woo-page.qodef--single .entry-summary form.cart {
	margin-top: 16px;
}

@media only screen and (max-width: 880px) {
	#qodef-woo-page.qodef--single > .qodef-content-grid,
	#yith-quick-view-content.single-product > .qodef-content-grid {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-left: 15px !important;
		padding-right: 15px !important;
	}

	#qodef-woo-page.qodef--single .qodef-woo-single-inner,
	#qodef-woo-page.qodef--single .qodef-woo-single-inner.qodef-position--left,
	#yith-quick-view-content.single-product .qodef-woo-single-inner,
	#yith-quick-view-content.single-product .qodef-woo-single-inner.qodef-position--left {
		display: block !important;
		grid-template-columns: none !important;
		grid-column-gap: 0 !important;
		gap: 20px !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	#qodef-woo-page.qodef--single .qodef-woo-single-image,
	#yith-quick-view-content.single-product .qodef-woo-single-image {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		float: none !important;
	}

	#qodef-woo-page.qodef--single .summary.entry-summary,
	#yith-quick-view-content.single-product .summary.entry-summary {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 20px 0 0 !important;
		padding: 0 !important;
		float: none !important;
		clear: both !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery__wrapper {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		flex-direction: column !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image img {
		max-height: none !important;
		height: auto !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper {
		width: 100% !important;
		margin-right: 0 !important;
		margin-top: 8px;
		display: flex !important;
		flex-wrap: wrap !important;
		overflow-x: visible !important;
		gap: 8px !important;
		padding-bottom: 6px !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper
	.woocommerce-product-gallery__image {
		flex-shrink: 0 !important;
		height: auto !important;
		width: calc(25% - 6px) !important;
	}

	#qodef-woo-page.qodef--single .woocommerce-product-gallery.qodef-position--left
	.woocommerce-product-gallery__wrapper > .qodef-woo-thumbnails-wrapper
	.woocommerce-product-gallery__image img {
		max-height: none !important;
		height: auto !important;
		width: 100% !important;
		object-fit: cover !important;
	}

	#qodef-woo-page.qodef--single .pc-thumbnail-nav-left,
	#qodef-woo-page.qodef--single .pc-thumbnail-nav-right {
		display: none !important;
	}
}