/**
 * Single Product Page – Child-only layout (no Blocksy summary).
 * Left: title, Utförsäljning, qty+Köp, Pris/Lager/Leveranstid, payment, SKU/Category/Brand.
 * Right: gallery.
 *
 * FIX v2: Mobile floating button overlap resolved.
 *         - padding-bottom added to layout/tabs/related on mobile
 *         - scroll-to-top repositioned on single product page
 *
 * @package Blocksy_Child
 */

/* ========== Layout: Custom summary LEFT, Gallery RIGHT ========== */
.single-product .product {
	max-width: 1320px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 4rem;
	padding-right: 4rem;
	box-sizing: border-box;
}
.autohjul-single-product-layout {
	display: flex;
	flex-wrap: wrap;
	flex-direction: row;
	gap: 2rem;
	width: 100%;
}
.autohjul-single-summary {
	flex: 1 1 45%;
	min-width: 280px;
	order: 1;
}
.autohjul-single-gallery {
	flex: 1 1 45%;
	min-width: 280px;
	max-width: 400px;
	order: 2;
}

/* Gallery wrapper: overflow hidden so hover "fade up" doesn't spill */
.autohjul-single-gallery .woocommerce-product-gallery__image,
.autohjul-single-gallery .flex-viewport,
.autohjul-single-gallery .woocommerce-product-gallery {
	overflow: hidden !important;
}
.autohjul-single-gallery .woocommerce-product-gallery__image img,
.autohjul-single-gallery .flex-control-thumbs + .flex-viewport img,
.autohjul-single-gallery img.wp-post-image,
.autohjul-single-gallery img {
	max-width: 380px !important;
	width: 100% !important;
	height: auto !important;
	display: block !important;
	transform: translateY(0) !important;
	transition: transform 0.35s ease !important;
}

/* Remove theme's expand/scale hover; only fade up on hover */
.autohjul-single-gallery .woocommerce-product-gallery__image:hover img,
.autohjul-single-gallery .flex-viewport:hover img,
.autohjul-single-gallery .woocommerce-product-gallery:hover img,
.autohjul-single-gallery a:hover img {
	transform: translateY(-6px) !important;
}

/* ---- Responsive: Layout ---- */
@media (max-width: 992px) {
	.single-product .product {
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
}

@media (max-width: 768px) {
	.single-product .product {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
	.autohjul-single-product-layout {
		flex-direction: column;
		/* FIX: space for floating Kontakt button at bottom */
		padding-bottom: 90px;
	}
	.autohjul-single-summary { order: 1; }
	.autohjul-single-gallery {
		order: 2;
		max-width: 100%;
	}
}


/* ========== Title ========== */
.autohjul-single-title { margin-bottom: 0.75em; }

.autohjul-single-brand {
	font-size: 0.95em;
	margin-bottom: 0.25em;
	color: #333;
}
.autohjul-single-brand a { color: inherit; text-decoration: none; }
.autohjul-single-brand a:hover { text-decoration: underline; }

.autohjul-single-product-title {
	font-weight: 700;
	font-size: 1.5em;
	line-height: 1.25;
	margin: 0 0 0.35em;
	color: #111;
}

.autohjul-single-specs {
	font-size: 0.85em;
	color: #555;
	font-weight: 400;
}
.autohjul-single-dot { margin-left: 0.35em; }


/* ========== Utförsäljning ========== */
.autohjul-utforsaljning {
	color: #c00;
	font-weight: 600;
	margin: 0 0 0.75em;
}


/* ========== Quantity + Köp button ========== */
.autohjul-single-cart {
	display: block;
	max-width: 100%;
}
.autohjul-single-qty-wrap {
	display: inline-flex !important;
	align-items: center;
	gap: 0.4em;
	margin-bottom: 0.75em;
	flex-wrap: nowrap;
	width: auto !important;
	max-width: 100%;
}
.autohjul-single-qty {
	width: 2.75em !important;
	min-width: 2.75em !important;
	max-width: 3.5em !important;
	padding: 0.35em 0.4em !important;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9em !important;
	box-sizing: border-box;
}
.autohjul-single-kop {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.35em;
	padding: 0.35em 0.75em !important;
	background: #0066cc !important;
	color: #fff !important;
	border: none !important;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.85em !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	flex-shrink: 0 !important;
	white-space: nowrap;
	box-sizing: border-box;
}
.autohjul-single-kop:hover  { background: #0052a3 !important; color: #fff !important; }
.autohjul-single-kop:disabled { background: #ccc !important; cursor: not-allowed; }
.autohjul-single-kop svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Prevent WooCommerce/theme from forcing full-width button */
.single-product .cart.autohjul-single-cart .button,
.single-product .autohjul-single-kop.single_add_to_cart_button {
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
}


/* ========== Price / Lager / Leveranstid ========== */
.autohjul-single-meta {
	display: block !important;
	margin-bottom: 1em;
	padding: 0;
	visibility: visible !important;
}
.autohjul-single-price {
	display: block !important;
	margin-bottom: 0.5em;
}
.autohjul-single-price-label  { margin-right: 0.35em; color: #666 !important; font-weight: 400; }
.autohjul-single-price-value  { font-weight: 700 !important; }

.autohjul-single-lager-row {
	display: flex !important;
	align-items: center;
	gap: 0.25em;
	margin-bottom: 0.35em;
	visibility: visible !important;
}
.autohjul-single-lager-label  { margin-right: 0.25em; color: #666 !important; font-weight: 400; }
.autohjul-single-lager-value  { font-weight: 700 !important; color: #111 !important; }

.autohjul-single-lager-tooltip {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	cursor: pointer;
	flex-shrink: 0;
}
.autohjul-single-lager-tooltip i {
	font-style: italic;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	color: #fff !important;
}
.autohjul-single-lager-tooltip--orange { background: #e67e00 !important; color: #fff !important; }
.autohjul-single-lager-tooltip--green  { background: #27ae60 !important; color: #fff !important; }

.autohjul-single-leveranstid {
	display: block !important;
	margin-top: 0.35em;
	visibility: visible !important;
}
.autohjul-single-leveranstid-label { margin-right: 0.35em; color: #666 !important; font-weight: 400; }
.autohjul-single-leveranstid-value { font-weight: 700 !important; color: #111 !important; }


/* ========== Payment icons ========== */
.autohjul-single-payment-icons { margin: 1em 0; }
.autohjul-single-payment-icons img { max-width: 100%; height: auto; display: block; }


/* ========== Product meta block (SKU / Category / Brand) ========== */
.autohjul-single-product-meta-block {
	margin-top: 1em;
	margin-bottom: 1em;
	padding: 0;
}
.autohjul-single-product-meta-row  { display: block; margin-bottom: 0.6em; }
.autohjul-single-product-meta-label {
	display: block;
	font-weight: 700 !important;
	color: #333 !important;
	font-size: 0.95em;
	margin-bottom: 0.15em;
}
.autohjul-single-product-meta-value {
	display: block;
	font-weight: 400 !important;
	color: #666 !important;
	font-size: 0.9em;
}


/* ========== Lower section: Tabs + Lager ========== */
.single-product .autohjul-tabs-lower-section {
	width: 100%;
	max-width: 1320px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 2.5rem;
	padding-left: 4rem;
	padding-right: 4rem;
	box-sizing: border-box;
}
@media (max-width: 992px) {
	.single-product .autohjul-tabs-lower-section {
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
}
@media (max-width: 768px) {
	.single-product .autohjul-tabs-lower-section {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

.autohjul-tabs-and-lager {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	align-items: flex-start;
	width: 100%;
}
.autohjul-tabs-wrap {
	flex: 1 1 60%;
	min-width: 280px;
}

/* ---- Responsive: Tabs + Lager ---- */
@media (max-width: 768px) {
	.autohjul-tabs-and-lager {
		flex-direction: column;
		/* FIX: space for floating button */
		padding-bottom: 90px;
	}
	.autohjul-lager-sidebar {
		flex: 1 1 100%;
		max-width: 320px;
	}
}


/* ========== Tabs design ========== */
.autohjul-product-tabs .wc-tabs {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #ddd;
	gap: 0;
	justify-content: flex-start;
}
.autohjul-product-tabs .wc-tabs li { margin: 0; }
.autohjul-product-tabs .wc-tabs a {
	display: block;
	padding: 0.65em 1.35em;
	text-decoration: none;
	color: #888;
	font-size: 0.9em;
	font-weight: 500;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}
.autohjul-product-tabs .wc-tabs a:hover { color: #0066cc; }
.autohjul-product-tabs .wc-tabs li.active a {
	color: #0066cc;
	font-weight: 600;
	border-bottom: 2px solid #0066cc;
	margin-bottom: -1px;
}
.autohjul-product-tabs .woocommerce-Tabs-panel {
	padding: 1.25rem 0;
	border: none;
}
.autohjul-tab-loading { color: #666; }


/* ========== Teknisk table ========== */
.autohjul-teknisk-table { width: 100%; border-collapse: collapse; }
.autohjul-teknisk-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.65rem 0;
	border-bottom: 1px solid #eee;
	gap: 1.5rem;
	min-height: 2.5em;
}
.autohjul-teknisk-row:nth-child(odd)  { background: #fff; }
.autohjul-teknisk-row:nth-child(even) { background: #f8f8f8; }

.autohjul-teknisk-label {
	font-weight: 700 !important;
	color: #111 !important;
	flex: 0 1 40%;
	max-width: 45%;
	font-size: 0.95em;
}
.autohjul-teknisk-value-cell {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: #333;
	flex: 1 1 50%;
	min-width: 0;
	font-weight: 400;
	text-align: right;
}
.autohjul-teknisk-info-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #e0e0e0;
	color: #555;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	flex-shrink: 0;
}
.autohjul-teknisk-value { text-align: left; font-weight: 400; color: #333; }
.autohjul-teknisk-brand-img {
	max-height: 100px;
	width: auto;
	max-width: 40%;
	display: block;
	object-fit: contain;
}

.autohjul-tab-frakt-list { list-style: none; margin: 0.5em 0; padding: 0; }
.autohjul-tab-frakt-list li { margin: 0.35em 0; }
.autohjul-om-modellen-title { color: #0066cc; margin-bottom: 0.5em; }


/* ========== Lager sidebar ========== */
.autohjul-lager-sidebar {
	flex: 0 0 240px;
	min-width: 220px;
}
.autohjul-single-lager-box {
	background: rgba(33, 150, 243, 0.08);
	border: 1px solid rgba(33, 150, 243, 0.3);
	border-radius: 8px;
	padding: 1.25rem 1.35rem;
	box-shadow: 0 1px 3px rgba(33, 150, 243, 0.12);
}
.autohjul-single-lager-box__title {
	margin: 0 0 0.75em;
	font-size: 1.1em;
	font-weight: 700;
	color: #2196F3;
}
.autohjul-single-lager-box__row {
	display: flex;
	justify-content: space-between;
	padding: 0.45rem 0;
	border-bottom: 1px solid rgba(33, 150, 243, 0.2);
	color: #333;
	font-size: 0.95em;
}
.autohjul-single-lager-box__row:last-of-type { border-bottom: none; }


/* ========== Related / Upsells ========== */
.single-product .autohjul-related,
.single-product .autohjul-upsells {
	max-width: 1320px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 4rem;
	padding-right: 4rem;
	box-sizing: border-box;
	margin-top: 2.5rem;
}
.autohjul-upsells-title,
.autohjul-related-title {
	margin-bottom: 1em;
	font-size: 1.25em;
	text-align: center;
}
.autohjul-upsells-grid,
.autohjul-related-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 992px) {
	.single-product .autohjul-related,
	.single-product .autohjul-upsells {
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
	.autohjul-upsells-grid,
	.autohjul-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	.single-product .autohjul-related,
	.single-product .autohjul-upsells {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

@media (max-width: 576px) {
	.autohjul-upsells-grid,
	.autohjul-related-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
}

ul.products.autohjul-related-grid {
	/* FIX: extra bottom space on mobile so last card isn't under floating button */
	margin-bottom: 2rem !important;
}

@media (max-width: 768px) {
	ul.products.autohjul-related-grid {
		margin-bottom: 100px !important;
	}
}

ul.products.autohjul-related-grid > li.autohjul-product-card {
	padding: 0 !important;
	margin: 0 !important;
}


/* ========== Visa fler button ========== */
.autohjul-related-visa-fler-wrap {
	text-align: center;
	margin-top: 1rem;
	margin-bottom: 2rem;
}
.autohjul-related-visa-fler {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(135deg, #ec4848 0%, #db2727 100%);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.autohjul-related-visa-fler:hover {
	background: linear-gradient(135deg, #db2727 0%, #be1818 100%);
	box-shadow: 0 4px 12px rgba(236, 72, 153, 0.45);
	transform: translateY(-1px);
}
.autohjul-related-more { margin-top: 0; }


/* ========== Stock status colors ========== */
span.autohjul-single-lager-value.autohjul-single-lager-value--out {
	color: red !important;
}
p.autohjul-out-of-stock.stock.out-of-stock {
	color: red !important;
}


/* ================================================================
   FIX: Mobile – Floating button overlap (scroll-to-top position)
   Only on single product page, scroll-to-top moves up slightly
   so it doesn't sit on top of gallery or content.
   ================================================================ */
@media (max-width: 768px) {
	.single-product .autohjul-scroll-to-top {
		bottom: 80px;
	}
}