/* ==========================================================================
   Lackzon – produktsida (v2)
   Allt är prefixat med .pdp-v2 och skriver över main.css.
   ========================================================================== */

.pdp-v2 {
	--pdp-radius: 8px;
	--pdp-ok: #2f9e44;
	--pdp-warn: #c77700;
	--pdp-bad: #d63c3c;
	--pdp-sale: #c9302c;
	--pdp-star-on: #f0a500;
	--pdp-star-off: #d5d5d5;
	--pdp-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 3 6.6 7.2.8-5.4 4.8 1.5 7.1L12 16.8l-6.3 3.5 1.5-7.1-5.4-4.8L9 8.6z'/%3E%3C/svg%3E");
}

/* --- Grundlayout ------------------------------------------------------------- */

.pdp-v2.single-product div.product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; }

/* Galleri: mjuka hörn, luftigare tumnaglar */
.pdp-v2 .woocommerce-product-gallery__wrapper,
.pdp-v2 .woocommerce-product-gallery .flex-viewport { border-radius: var(--pdp-radius); overflow: hidden; background: #fff; }
.pdp-v2 .woocommerce-product-gallery .flex-control-thumbs { grid-template-columns: repeat(auto-fill, minmax(56px, 72px)); gap: 10px; margin-top: 12px; }
.pdp-v2 .woocommerce-product-gallery .flex-control-thumbs li { border-radius: 6px; overflow: hidden; transition: border-color .15s; }
.pdp-v2 .woocommerce-product-gallery .flex-control-thumbs li:has(img.flex-active) { border-color: var(--primary); }
.pdp-v2 .woocommerce-product-gallery .flex-control-thumbs img { opacity: .7; }
.pdp-v2.single-product div.product > .onsale {
	top: 14px; left: 14px; padding: 5px 10px; border-radius: 4px; font-size: 13px; font-weight: 700;
	background: var(--pdp-sale); box-shadow: 0 2px 8px rgba(201, 48, 44, .3);
}

/* --- Rubrik, kategori, status ------------------------------------------------ */

.pdp-eyebrow {
	display: inline-block; margin-bottom: 8px; color: var(--primary);
	font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.pdp-eyebrow:hover { color: var(--primary-dark); text-decoration: underline; }
.pdp-v2 .summary .product_title { color: var(--dark); font-size: 28px; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 12px; }

.pdp-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 20px; font-size: 13px; }
.pdp-stock { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.pdp-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.pdp-stock.is-in { color: var(--pdp-ok); }
.pdp-stock.is-backorder { color: var(--pdp-warn); }
.pdp-stock.is-out { color: var(--pdp-bad); }
.pdp-sku { color: var(--muted); }

/* --- Pris ---------------------------------------------------------------------- */

.pdp-v2 .summary > .price { margin: 0 0 6px; font: 700 32px/1.1 var(--ff); letter-spacing: -.02em; color: var(--dark); }
.pdp-v2 .summary > .price .amount { color: inherit; }
.pdp-v2 .summary > .price ins { background: none; padding: 0; color: var(--pdp-sale); font-weight: 700; }
.pdp-v2 .summary > .price del { font-size: .55em; font-weight: 400; color: var(--muted); margin: 0 0 0 10px; }
.pdp-v2 .summary > .price .opbs-price-pair { display: inline-flex; flex-direction: row-reverse; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; }
.pdp-v2 .summary > .price .woocommerce-price-suffix { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.pdp-save {
	display: inline-block; margin: 4px 0 6px; padding: 3px 9px; border-radius: 4px;
	background: #fdecec; color: var(--pdp-sale); font-size: 13px; font-weight: 700;
}
.pdp-save .amount { color: inherit; }
.pdp-v2 .summary .iworks-omnibus { margin: 2px 0 20px; font-size: 12px; }

.pdp-v2 .woocommerce-product-details__short-description { font-size: 15px; line-height: 1.65; letter-spacing: 0; color: #555; padding: 16px 0 4px; border-top: 1px solid var(--border); }
.pdp-v2 .summary .iworks-omnibus + .woocommerce-product-details__short-description,
.pdp-v2 .summary .pdp-save + .woocommerce-product-details__short-description { margin-top: 0; }

/* --- Köpruta --------------------------------------------------------------------- */

.pdp-buy { margin: 18px 0 0; padding: 18px; border-radius: var(--pdp-radius); background: var(--gray-bg); }
.pdp-buy:empty { display: none; }
.pdp-v2 .pdp-buy form.cart { margin: 0; padding: 0; border: 0; }
.pdp-v2 .pdp-buy form.variations_form { display: block; }
/* Produktfält från tillägg (t.ex. Färgkod) får en egen rad ovanför antal och köpknapp */
.pdp-v2 .pdp-buy .alg-product-input-fields-table { display: block; flex: 0 0 100%; margin: 0 0 4px; border: 0; background: none; }
.pdp-v2 .pdp-buy .alg-product-input-fields-table:empty { display: none; }
/* Variantprodukter: raden måste kunna brytas, annars knuffar fältets 100 % ut antal och köpknapp ur bild */
.pdp-v2 .pdp-buy .woocommerce-variation-add-to-cart { flex-wrap: wrap; }
.pdp-v2 .pdp-buy .alg-product-input-fields-table :is(tbody, tr, td) { display: block; padding: 0; border: 0; background: none; }
.pdp-v2 .pdp-buy .alg-product-input-fields-table tr + tr { margin-top: 10px; }
.pdp-v2 .pdp-buy .alg-product-input-fields-table label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--dark); }
.pdp-v2 .pdp-buy .alg-product-input-fields-table :is(input:not([type=checkbox], [type=radio]), select, textarea) {
	display: block; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #d5d5d5; border-radius: 6px; background: #fff; font-size: 16px; /* 16px: ingen autozoom i iOS */
}
/* Id i selektorn för att slå "#alg_wc_pif_local_1 { margin-left: 10px }" i WPBakerys Custom CSS */
.pdp-v2 .pdp-buy #alg-product-input-fields-table :is(input, select, textarea) { margin-left: 0; }
.pdp-v2 .pdp-buy .quantity { flex: none; background: #fff; border-radius: 6px; height: 52px; }
.pdp-v2 .pdp-buy .single_add_to_cart_button.button {
	flex: 1; height: 52px; border-radius: 6px; background: var(--primary); font-size: 15px; letter-spacing: .01em;
}
.pdp-v2 .pdp-buy .single_add_to_cart_button.button:hover { background: var(--primary-dark); }
.pdp-v2 .pdp-buy .single_add_to_cart_button::before { width: 18px; height: 18px; }
.pdp-v2 .pdp-buy .variations_button, .pdp-v2 .pdp-buy .woocommerce-variation-add-to-cart { width: 100%; }
.pdp-v2 .pdp-buy table.variations { width: 100%; }
.pdp-v2 .pdp-buy table.variations th, .pdp-v2 .pdp-buy table.variations td { display: block; padding: 0 0 6px; font-size: 13px; }
.pdp-v2 .pdp-buy table.variations select { width: 100%; height: 44px; border-radius: 6px; border-color: #d5d5d5; font-size: 14px; }
.pdp-v2 .pdp-buy .stock { margin: 0 0 10px; font-size: 13px; }
.pdp-v2 .pdp-buy > .stock.in-stock, .pdp-v2 .pdp-buy > .stock.available-on-backorder { display: none; } /* visas redan under rubriken */
.pdp-v2 .pdp-buy > .stock.out-of-stock { margin: 0; font-size: 15px; }

/* --- USP:er ---------------------------------------------------------------------- */

.pdp-usps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.pdp-usps li { display: flex; align-items: flex-start; gap: 12px; }
.pdp-usps .icon {
	flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 50%;
	background: #e9eef6; fill: var(--primary);
}
.pdp-usps div { display: flex; flex-direction: column; font-size: 13px; line-height: 1.4; padding-top: 1px; }
.pdp-usps strong { color: var(--dark); font-size: 14px; }
.pdp-usps span { color: var(--muted); }
.pdp-logos { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.pdp-logos .payment-logos { justify-content: flex-start; gap: 6px 20px; opacity: .85; }
.pdp-logos .payment-logos img { height: 24px; }
.pdp-logos .payment-logos .logo-kustom { height: 15px; }

/* --- Flikar ---------------------------------------------------------------------- */

.pdp-v2 .woocommerce-tabs { margin-top: 32px; }
.pdp-v2 .woocommerce-tabs ul.tabs { gap: 4px; margin-bottom: 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.pdp-v2 .woocommerce-tabs ul.tabs li a {
	padding: 12px 18px; font-size: 13px; letter-spacing: .02em; white-space: nowrap; color: #818692;
	border-bottom-width: 3px; transition: color .15s, border-color .15s;
}
.pdp-v2 .woocommerce-tabs ul.tabs li a:hover { color: var(--dark); }
.pdp-v2 .woocommerce-tabs ul.tabs li.active a { color: var(--primary); border-bottom-color: var(--primary); }
.pdp-v2 .woocommerce-Tabs-panel { padding: 24px 0 0; font-size: 14px; line-height: 1.7; max-width: 820px; }

/* --- Betygsstjärnor (ersätter WooCommerce ikonfont) ------------------------------ */

.pdp-v2 .star-rating {
	flex: none; width: 90px; height: 18px; overflow: hidden; background: var(--pdp-star-off);
	-webkit-mask: var(--pdp-star) 0 0 / 18px 18px repeat-x;
	mask: var(--pdp-star) 0 0 / 18px 18px repeat-x;
}
/* Texten ("Betygsatt 4 av 5") finns kvar för skärmläsare via aria-label, men ska inte synas */
.pdp-v2 .star-rating > span { display: block; height: 100%; overflow: hidden; background: var(--pdp-star-on); font-size: 0; color: transparent; }

.pdp-v2 .woocommerce-product-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -8px 0 16px; font-size: 13px; }
.pdp-v2 .woocommerce-review-link { color: var(--muted); }
.pdp-v2 .woocommerce-review-link:hover { color: var(--primary); text-decoration: underline; }

/* --- Recensioner ------------------------------------------------------------------ */

.pdp-v2 .woocommerce-Tabs-panel--reviews { max-width: none; }
.pdp-v2 #reviews { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 32px 56px; align-items: start; scroll-margin-top: 130px; /* länken till #reviews: flikarna ska synas under den fasta menyn */ }
.pdp-v2 #reviews > .clear { display: none; }

.pdp-v2 .woocommerce-Reviews-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.pdp-v2 .woocommerce-noreviews { margin: 0; color: var(--muted); }

.pdp-v2 #reviews .commentlist, .pdp-v2 #reviews .children { list-style: none; margin: 0; padding: 0; }
.pdp-v2 #reviews .commentlist > li { padding: 20px 0; }
.pdp-v2 #reviews .commentlist > li + li { border-top: 1px solid var(--border); }
.pdp-v2 #reviews .commentlist > li:last-child { padding-bottom: 0; }

.pdp-v2 .comment_container { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
.pdp-v2 .comment_container .avatar { display: block; width: 44px; height: 44px; border-radius: 50%; background: var(--gray-bg); }
.pdp-v2 .comment-text { display: flex; flex-direction: column; min-width: 0; }
.pdp-v2 .comment-text .meta { order: -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin: 0; line-height: 1.4; }
.pdp-v2 .comment-text .star-rating { margin: 5px 0 0; }
.pdp-v2 .woocommerce-review__author { color: var(--dark); font-weight: 700; }
.pdp-v2 .pdp-staff-badge {
	display: inline-block; padding: 1px 7px; border-radius: 4px; vertical-align: 1px;
	background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.pdp-v2 .woocommerce-review__dash { display: none; }
.pdp-v2 .woocommerce-review__published-date { color: var(--muted); font-size: 12px; }
.pdp-v2 .woocommerce-review__verified { color: var(--pdp-ok); font-size: 12px; font-style: normal; font-weight: 600; }
.pdp-v2 .woocommerce-review__awaiting-approval { color: var(--pdp-warn); font-size: 13px; }
.pdp-v2 .comment-text .description { margin-top: 8px; color: #444; }
.pdp-v2 .comment-text .description p { margin: 0; }
.pdp-v2 .comment-text .description p + p { margin-top: .75em; }

/* Svar på en recension: egen ljusgrå ruta, indragen under recensionstexten */
.pdp-v2 #reviews .commentlist > li > .children { margin: 16px 0 0 58px; padding: 14px 16px; border-radius: var(--pdp-radius); background: var(--gray-bg); }
.pdp-v2 #reviews .children > li + li { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.pdp-v2 #reviews .children .children { margin-top: 14px; }
.pdp-v2 #reviews .children .comment_container { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.pdp-v2 #reviews .children .avatar { width: 32px; height: 32px; }
.pdp-v2 #reviews .children .description { margin-top: 4px; }

/* Sidnumrering av recensioner: mindre luft än i produktlistorna */
.pdp-v2 #comments .woocommerce-pagination { margin-top: 24px; text-align: left; }

/* Formuläret. #review_form i selektorn för att slå .page-content input[...] i main.css */
.pdp-v2 #review_form_wrapper { padding: 22px; border-radius: var(--pdp-radius); background: var(--gray-bg); }
.pdp-v2 .woocommerce-verification-required { margin: 0; padding: 22px; border-radius: var(--pdp-radius); background: var(--gray-bg); color: #555; }
.pdp-v2 #review_form .comment-reply-title { display: block; margin: 0 0 4px; color: var(--dark); font-size: 18px; font-weight: 700; line-height: 1.3; }
.pdp-v2 #review_form .comment-reply-title small { font-size: 13px; font-weight: 400; }
.pdp-v2 #review_form .comment-form { margin: 0; }
.pdp-v2 #review_form .comment-form > :is(p, div) { margin: 0 0 14px; }
.pdp-v2 #review_form .comment-notes, .pdp-v2 #review_form .logged-in-as { color: #777; font-size: 12px; line-height: 1.5; }
.pdp-v2 #review_form .required { color: var(--pdp-bad); }
.pdp-v2 #review_form label { display: block; margin-bottom: 5px; color: var(--dark); font-size: 13px; font-weight: 600; line-height: 1.4; }
.pdp-v2 #review_form :is(input[type=text], input[type=email], input[type=url], select, textarea) {
	display: block; width: 100%; min-height: 44px; margin: 0; padding: 9px 12px; border: 1px solid #d5d5d5; border-radius: 6px;
	background: #fff; color: var(--dark); font-size: 16px; /* 16px: ingen autozoom i iOS */ line-height: 1.4; transition: border-color .15s, box-shadow .15s;
}
.pdp-v2 #review_form textarea { height: 130px; resize: vertical; }
.pdp-v2 #review_form :is(input[type=text], input[type=email], input[type=url], select, textarea):focus {
	outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 83, 165, .15);
}
.pdp-v2 #review_form .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; }
.pdp-v2 #review_form .comment-form-cookies-consent input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); }
.pdp-v2 #review_form .comment-form-cookies-consent label { margin: 0; color: #555; font-size: 12px; font-weight: 400; line-height: 1.5; }
.pdp-v2 #review_form .form-submit { margin: 0; }
.pdp-v2 #review_form #submit {
	display: block; width: 100%; height: 48px; padding: 0 1.5em; border: 0; border-radius: 6px; cursor: pointer;
	background: var(--primary); color: #fff; font: 700 14px var(--ff); text-transform: uppercase; letter-spacing: .01em; transition: background .15s;
}
.pdp-v2 #review_form #submit:hover { background: var(--primary-dark); }
.pdp-v2 #review_form #submit:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

/* Klickbara stjärnor. WooCommerce JS byter ut betygsmenyn mot p.stars > span > a.star-1…5 */
.pdp-v2 #review_form p.stars { margin: 0; line-height: 0; }
.pdp-v2 #review_form p.stars span { display: inline-flex; gap: 2px; margin-left: -3px; }
.pdp-v2 #review_form p.stars a { display: block; width: 36px; height: 36px; padding: 3px; overflow: hidden; border-radius: 6px; color: var(--pdp-star-off); font-size: 0; }
.pdp-v2 #review_form p.stars a::before {
	content: ""; display: block; width: 30px; height: 30px; background: currentColor; transition: color .1s;
	-webkit-mask: var(--pdp-star) center / contain no-repeat;
	mask: var(--pdp-star) center / contain no-repeat;
}
.pdp-v2 #review_form p.stars.selected a { color: var(--pdp-star-on); }
.pdp-v2 #review_form p.stars.selected a.active ~ a { color: var(--pdp-star-off); }
/* .stars.stars: hover ska gå före valt betyg, så att man ser det nya betyget innan man klickar */
.pdp-v2 #review_form p.stars.stars span:hover a { color: var(--pdp-star-on); }
.pdp-v2 #review_form p.stars.stars span:hover a:hover ~ a { color: var(--pdp-star-off); }
.pdp-v2 #review_form p.stars a:focus-visible { outline: 2px solid var(--primary-light); outline-offset: -1px; }

.pdp-v2 .related > h2, .pdp-v2 .up-sells > h2 { font-size: 18px; text-transform: none; font-weight: 700; border: 0; padding: 0; margin: 40px 0 16px; }

/* --- Fast köpknapp på mobilen ----------------------------------------------------- */

.pdp-sticky { display: none; }

@media (max-width: 991px) {
	.pdp-v2.single-product div.product { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.pdp-v2 #reviews { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
	.pdp-v2 .summary .product_title { font-size: 22px; }
	.pdp-v2 .summary > .price { font-size: 28px; }
	.pdp-buy { padding: 14px; margin-left: -4px; margin-right: -4px; }
	.pdp-v2 #reviews .commentlist > li > .children { margin-left: 0; }
	.pdp-v2 #review_form_wrapper, .pdp-v2 .woocommerce-verification-required { padding: 16px; }

	.pdp-sticky:not([hidden]) {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
		display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
		background: #fff; box-shadow: 0 -4px 16px rgba(0, 0, 0, .1);
		transform: translateY(100%); transition: transform .25s ease;
	}
	.pdp-sticky.is-visible { transform: none; }
	.pdp-sticky-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
	.pdp-sticky-title { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.pdp-sticky-price { font-size: 17px; font-weight: 700; color: var(--dark); }
	.pdp-sticky-price .amount { color: inherit; }
	.pdp-sticky-btn {
		flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 6px; cursor: pointer;
		background: var(--primary); color: #fff; font: 700 14px var(--ff); text-transform: uppercase;
	}
	.pdp-v2 .site-footer { padding-bottom: 80px; }
}
