.single-product {
	.product-gallery-slider img {
		width: 62px !important;
		height: auto !important;
	}

	@media screen and (min-width: 550px) {
		.product-images {
			transform: translateX(27px) translateY(19px);
		}
	}
	.product-page-price bdi,
	.product-title,
	th label {
		font-weight: 400 !important;
	}
	.product-title {
		display: flex;
	}
	.variations {
		tr {
			display: flex;
			flex-direction: row;
			align-items: center;
			th {
				padding: 0 1rem 0 0;
				label {
					transform: translateY(3px);
				}
			}
			.value {
				display: flex;
				flex-flow: row wrap;
				align-items: center;
				select {
					border: none;
					border-radius: 10px;
					width: auto;
				}
			}
		}
		.reset_variations {
			margin-left: 1rem;
			position: relative;
			bottom: initial;
			right: initial;
			color: #000000;
		}
	}
	.single_add_to_cart_button {
		background-color: #68676b !important;
		border-radius: 10px;
		text-transform: initial;
	}
	.product_meta span a {
		text-decoration: underline;
	}
	.product_meta span {
		border-top: none;
		padding: 2px 0;
	}

	.product-container {
		width: 100%;
		display: flex;
		flex-flow: column wrap;
		align-items: center;
		gap: 8rem;
		padding-bottom: 425px;
		margin-bottom: 6rem;

		@media (max-width: 919px) {
			padding-left: 10px;
			padding-right: 10px;
			padding-top: 10px;
		}

		.product-main {
			display: flex !important;
			flex-flow: column wrap !important;
			background-color: #f8e8db;
			background-image: url("/wp-content/themes/dropinlegene/assets/images/icons/Blodsjekk_Pakke_boks_360x335px.svg") !important;
			background-size: 100% auto;
			background-repeat: no-repeat;
			background-position: top center;
			border-radius: 45px;
		}
	}
	@media screen and (min-width: 500px) {
		.product-container {
			padding-bottom: 450px;
		}
	}
	@media screen and (min-width: 850px) {
		.product-main,
		.product-footer {
			max-width: 900px;
		}
	}
	.large-6 {
		width: auto;
		max-width: initial;
		flex-basis: initial;
	}
	.is-divider {
		display: none;
	}
	#product-sidebar {
		display: none;
	}
	.image-tools {
		display: none;
	}
	.product-gallery {
		position: relative;
		z-index: 2;
		background: transparent;
		width: calc(80px + 2rem);
		padding: 0 0.7rem;
	}
	.product-main {
		.row {
			display: flex !important;
			flex-direction: column;
		}
	}
	@media screen and (min-width: 550px) {
		.product-gallery {
			position: relative;
			z-index: 2;
			background: transparent;
			width: calc(90px + 3rem);
			padding: 0 2rem;
		}
	}

	@media (min-width: 767px) {
		.product-main {
			display: flex !important;
			flex-flow: row wrap !important;

			.row {
				display: flex !important;
				flex-flow: row wrap !important;
			}
		}
	}
	.flickity-prev-next-button,
	.next-prev-thumbs,
	.social-icons {
		display: none !important;
	}
	.description_tab.active a::before {
		display: none !important;
	}

	.product-section-title {
		text-align: center;
		text-transform: initial;
		font-weight: 400;
		margin: 3rem 0;
	}

	.wc-tabs a {
		text-transform: initial;
		font-weight: 400;
		font-size: 1.2rem;
	}
	/* Add the red underline using the after pseudo-element */
	.description_tab.active a::after {
		content: ""; /* Required for the pseudo-element to render */
		display: block;
		position: absolute;
		left: 0;
		bottom: 6px;
		width: 100%;
		height: 2px;
		background-color: #9c1c20;
	}
	.product-footer .woocommerce-tabs {
		border-top: none;
	}
	.tabs.wc-tabs > li.active > a::before {
		display: none !important;
	}

	.tabs.wc-tabs > li.active > a::after {
		content: "";
		display: block;
		position: absolute;
		left: 0;
		bottom: 6px;
		width: 100%;
		height: 2px;
		background-color: #9c1c20;
	}
	.product-footer .woocommerce-tabs {
		border-top: none;
	}
	.related.related-products-wrapper {
		position: absolute;
		padding: 0 1rem;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1;
	}

	/* Fix for related products in Flickity slider - using !important to override other styles */
	.single-product .related.related-products-wrapper .row-slider .flickity-viewport {
		min-height: 300px !important;
	}

	/* Set consistent structure */
	.single-product .related.related-products-wrapper .product-small.col {
		height: auto !important;
		margin-bottom: 15px !important;
	}

	.single-product .related.related-products-wrapper .product-small.box {
		height: 100% !important;
		display: flex !important;
		flex-direction: column !important;
	}

	/* Force proper image handling */
	.single-product .related.related-products-wrapper .box-image {
		flex-shrink: 0 !important;
		margin-bottom: 10px !important;
	}

	/* Override box-text styling */
	.single-product .related.related-products-wrapper .box-text.box-text-products {
		padding: 0 5px 15px 5px !important;
		display: flex !important;
		flex-direction: column !important;
		flex: 1 !important;
	}

	/* Fix the title area - match tallest title */
	.single-product .related.related-products-wrapper .title-wrapper {
		min-height: 80px !important; /* Increased height to accommodate two lines */
		display: flex !important;
		flex-direction: column !important;
		justify-content: center !important;
		margin-bottom: 10px !important;
		order: -1 !important;
		padding: 0 !important;
	}

	/* Center titles and ensure consistent sizing */
	.single-product .related.related-products-wrapper .woocommerce-loop-product__title {
		text-align: center !important;
		font-size: 0.9em !important;
		line-height: 1.3 !important;
		margin: 0 auto !important;
		padding: 0 !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		height: 100% !important;
	}

	/* Keep price-add-to-cart at the bottom with consistent spacing */
	.single-product .related.related-products-wrapper .price-and-add-to-cart {
		display: flex !important;
		flex-direction: column !important;
		order: 10 !important;
		position: relative !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		height: auto !important;
		margin-top: 0 !important;
	}

	/* Ensure price is consistently positioned */
	.single-product .related.related-products-wrapper .price-wrapper {
		text-align: center !important;
		margin-bottom: 5px !important;
	}

	/* Make buttons consistent */
	.single-product .related.related-products-wrapper .add-to-cart-button {
		text-align: center !important;
	}

	/* Additional responsive fixes */
	@media screen and (max-width: 549px) {
		.single-product .related.related-products-wrapper .woocommerce-loop-product__title {
			font-size: 0.8em !important;
		}
	}

	.related .flickity-slide {
		height: auto;
	}

	/* Responsive adjustments */
	@media (max-width: 849px) {
		.related .product {
			width: 50%;
		}
	}

	@media (max-width: 480px) {
		.related .product {
			width: 100%;
		}
	}
	@media screen and (min-width: 1040px) {
		.related.related-products-wrapper {
			max-width: 1370px;
			margin: 0 auto 0 auto;
		}
	}

	.product-info {
		padding: 10px 65px 30px 15px;

		@media (max-width: 767px) {
			margin-top: 30px;
		}

		@media (max-width: 767px) {
			padding: 20px;
		}
	}

	.sp-custom-priority-message {
		padding: 20px;
		border-radius: 10px;
		background: #fff2ec;
		margin-bottom: 20px;

		p {
			margin-bottom: 0;
		}
	}

	.woosb-summary {
		font-size: 1.2em;
	}

	.woosb-alert {
		padding: 10px 20px;
		border: 1px solid #9c1c20;
		background-color: #fff2ec;
		border-radius: 10px;
	}

	.woosb-bundled {
		.woosb-products {
			border: none !important;

			.woosb-item-text {
				border: none !important;
				margin: 40px 0 10px;
				padding: 0;

				h3 {
					font-size: 1.2rem !important;
					font-weight: 500 !important;
				}
			}

			.woosb-product {
				gap: 20px;
				border: none !important;
				opacity: 0.5;

				&:first-of-type {
					opacity: 1;
				}

				&.selected {
					opacity: 1;
				}

				&:hover {
					opacity: 1;

					> * {
						opacity: 0.5;

						&.woosb-quantity {
							opacity: 1;
						}
					}

					&.selected {
						> * {
							opacity: 1;
						}
					}
				}

				.woosb-thumb {
					width: 60px;
					flex: 0 0 60px;
					padding: 0;
					margin-top: 2px;
				}

				.woosb-title {
					.woosb-name {
						line-height: 1;
						margin-bottom: 6px;

						a {
							color: #000;

							&:hover {
								text-decoration: underline;
							}
						}
					}
				}

				.variations_form {
					.variation {
						padding: 0;
						border: none !important;

						.label {
							display: none;
						}

						select {
							background-color: white !important;
							border-radius: 10px !important;
							padding: 10px 14px !important;
							background-image: url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-chevron-down'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
							background-position: calc(100% - 14px) 50% !important;
							background-repeat: no-repeat !important;
							background-size: auto 16px !important;
						}
					}

					.reset_variations {
						display: none !important;
					}
				}

				.woosb-quantity {
					width: 112px;
					flex: 0 0 112px;
					align-self: flex-end;
					padding: 0;

					.quantity {
						input {
							min-width: 36px;
							height: 36px;
							line-height: 34px;
							border: none;
							border-right: 1px solid #f1f1f1;
							border-left: 1px solid #f1f1f1;
						}
					}

					.woosb-quantity-input-plus,
					.woosb-quantity-input-minus {
						width: 36px;
						height: 36px;
						flex: 0 0 36px;
						line-height: 34px;
						border: none;
					}

					.woosb-quantity-input-plus {
						border-radius: 0 10px 10px 0;
					}

					.woosb-quantity-input-minus {
						border-radius: 10px 0 0 10px;
					}
				}

				.woosb-price {
					align-self: flex-end;
					margin-bottom: 5px;
				}
			}
		}

		@media (max-width: 550px) {
			.woosb-products {
				display: grid;
				grid-template-columns: 1fr 1fr;
				gap: 20px;

				.woosb-item-text {
					grid-column: 1 / -1;
				}

				.woosb-product {
					flex-direction: column;
					align-items: center;
					text-align: center;
					padding: 20px 10px 15px;
					background-color: #fff2ec;
					height: 100%;
					border-radius: 15px;
					box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.06);

					&:first-of-type {
						grid-column: 1 / -1;
					}

					.woosb-thumb {
						display: none;
					}

					.woosb-title {
						.woosb-name {
							text-align: center;
							margin-bottom: 16px;
						}
					}

					.woosb-quantity {
						align-self: center;
						flex: auto;
					}

					.woosb-price {
						align-self: center;
						flex: auto;
						line-height: 1;
						padding: 0;

						.woosb-price-ori {
							text-align: center;
						}
					}
				}
			}
		}

		@media (max-width: 400px) {
			.woosb-products {
				grid-template-columns: 1fr;

				.woosb-item-text {
					grid-column: 1 / -1;
				}

				.woosb-product {
					&:first-of-type {
						grid-column: 1 / -1;
					}
				}
			}
		}
	}

	.woosb-bundles {
		.woosb-products {
			border: none;

			.woosb-product {
				border: none;
				gap: 20px;

				.woosb-thumb {
					padding: 0;
				}

				.woosb-price {
					padding: 0;
					width: auto;
					flex: auto;
				}
			}
		}
	}
}

body.product-priority--enkeltprodukt {
	.woosb-products {
		.woosb-product {
			opacity: 1;
		}
	}
}
