/* Korvi read (read.js): kaal, kogus ja prügikast ühes reas ja sama kõrgusega; kassa koguse muutmine;
   eemaldamise kinnitus. Kompaktsed kastid (omaniku soov): korv 36 px; mini-korv, kassa ja telefoni korv 32 px
   (sihtala üle WCAG 2.5.8 24 px). */
.wc-block-cart .wc-block-cart-item__quantity { --pk-ctl-h: 2.25rem; }
.wc-block-cart.is-mobile .wc-block-cart-item__quantity, .wc-block-mini-cart__items .wc-block-cart-item__quantity, .pk-rida--kassa { --pk-ctl-h: 2rem; }

.pk-rida { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.pk-kaal { display: contents; }
.pk-kaal__label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pk-kaal-select {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	width: auto;
	height: var(--pk-ctl-h, 2.75rem);
	min-height: 0;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	padding: 0 1.6rem 0 0.6rem;
	font: inherit;
	font-size: 0.95em;
	line-height: 1.2;
	color: var(--wp--preset--color--ink, #2a1c12);
	background: var(--wp--preset--color--base, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6259' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 0.45rem center / 0.9rem no-repeat;
	border: 1.5px solid var(--wp--preset--color--field-line, #c9c2b8);
	border-radius: var(--wp--custom--radius-s, 10px);
	cursor: pointer;
}
.pk-kaal-select:hover { border-color: var(--wp--preset--color--brand, #6b4226); }
.pk-kaal-select:focus-visible { outline: 3px solid var(--wp--preset--color--focus, #1a73e8); outline-offset: 2px; }
.pk-kaal[aria-busy="true"] .pk-kaal-select, .pk-rida[aria-busy="true"] { opacity: 0.6; }
/* width 0 + min-width 100%: pikk veateade ei laienda rida (kassas ei hüppa rida teisele reale), murdub rea laiuses. */
.pk-rida__error { flex: none; order: 99; width: 0; min-width: 100%; margin: 0; color: var(--wp--preset--color--danger, #b00020); font-size: 0.875em; }

/* Väike suurus (mini-korv, kassa, telefoni korv): kaal + kogus + prügikast ≈ 177 px, mahub ühikuhinna kõrvale. */
.wc-block-mini-cart__items .pk-rida, .wc-block-cart.is-mobile .pk-rida, .pk-rida--kassa { gap: 0.25rem; }
.wc-block-mini-cart__items .pk-kaal-select, .wc-block-cart.is-mobile .pk-kaal-select, .pk-rida--kassa .pk-kaal-select { padding: 0 1.1rem 0 0.4rem; font-size: 0.875rem; background-position: right 0.25rem center; background-size: 0.75rem; }

/* Kassa rida (omaniku joonised): pilt | nimi … summa; teisel real kohe nime all (pildi kõrval) kaal, kogus, prügikast ja
   paremal summa all ühikuhind. Kastide koht ei sõltu hinna laiusest, nii et laadimise ajal (kohatäited) need ei nihku.
   Woo kirjelduse kast on display: contents, et nimi, ühikuhind, summa ja meie rida oleksid ühe flex-konteineri lapsed
   (Woo DOM-i ei liiguta). Kui ühikuhind kastide kõrvale ei mahu (pikk hind), läheb see järgmisele reale paremale. */
.wc-block-components-order-summary-item:has(.pk-rida--kassa) { position: relative; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.375rem; min-height: 3rem; padding-left: 3.5rem; }
.wc-block-components-order-summary-item:has(.pk-rida--kassa) > .wc-block-components-order-summary-item__image { position: absolute; top: 0; left: 0; width: 3rem; margin: 0; padding: 0; }
.wc-block-components-order-summary-item:has(.pk-rida--kassa) > .wc-block-components-order-summary-item__description { display: contents; }
.wc-block-components-order-summary-item:has(.pk-rida--kassa) .wc-block-components-product-name { order: 1; flex: 1 1 0; min-width: 0; margin: 0; }
/* Summa lahter ka laadimise ajal nime rea kõrgune (21 px), et rida ei kahaneks. */
.wc-block-components-order-summary-item:has(.pk-rida--kassa) > .wc-block-components-order-summary-item__total-price { order: 1; flex: none; display: flex; align-items: center; min-height: 1.3125rem; margin: 0 0 0 auto; padding: 0; }
/* Woo ::after on ridade eraldusjoon (absoluutne; viimasel real peidus sama spetsiifilise reegliga, mis võitis olenevalt
   stiilifailide järjekorrast — siis tuli ühikuhind summa kõrvale). Meil on oma joon, siin on see reavahetus. */
body .wc-block-components-order-summary .wc-block-components-order-summary-item:has(.pk-rida--kassa)::after { content: ""; position: static; display: block; order: 2; flex: 0 0 100%; height: 0.375rem; margin: 0; border: 0; opacity: 1; }
.wc-block-components-order-summary-item:has(.pk-rida--kassa) .wc-block-cart-item__prices { order: 4; margin: 0 0 0 auto; font-size: 0.875rem; color: var(--wp--preset--color--muted, #6b6259); }
.wc-block-components-order-summary-item:has(.pk-rida--kassa) .wc-block-components-product-metadata { order: 5; flex: 0 0 100%; margin: 0; }
/* Laadimise ajal (kogus/kaal muutub) joonistab Woo nime ja hinna asemele hallid kohatäited: samadele kohtadele, muidu läksid
   kastid kolmandale reale ja rida hüppas 60 → 82 → 60 px. */
.wc-block-components-order-summary-item:has(.pk-rida--kassa) > .wc-block-components-order-summary-item__description > .wc-block-components-skeleton__element:first-child { order: 1; flex: 1 1 0; min-width: 0; margin: 0; }
.wc-block-components-order-summary-item:has(.pk-rida--kassa) > .wc-block-components-order-summary-item__description > .wc-block-components-skeleton__element:not(:first-child) { order: 4; flex: 0 0 2.75rem; margin: 0.21875rem 0 0.21875rem auto; } /* hinna laiune ja kõrgune (13 px + 2 × 3,5 = 20 px; Woo 85 px ja veeris ei mahuks) */
.pk-rida--kassa { order: 3; flex: none; max-width: 100%; margin: 0; }
/* Kitsas kokkuvõte (telefon ≤ ~370 px, rea sisu < 232 px): kastid ja ühikuhind ei mahu nime alla kõrvuti — ühikuhind
   summa all paremal, kastid pildi all kogu rea laiuses (pilt on 48 px, kastide rida algab 53 px pealt). */
.wc-block-components-order-summary-item:has(.pk-rida--kassa) { container: pk-kassarida / inline-size; }
@container pk-kassarida (max-width: 14.5rem) {
	.wc-block-components-order-summary-item .pk-rida--kassa { order: 5; flex: 0 0 calc(100% + 3.5rem); max-width: none; margin: 0.375rem 0 0 -3.5rem; }
}
.wc-block-components-order-summary-item:has(.pk-rida--kassa) + .wc-block-components-order-summary-item { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--wp--preset--color--line, #e2d3be); }
/* Kassa: kogus (− n +) ja prügikast nagu korvis. */
.pk-qty-step { display: inline-flex; align-items: stretch; box-sizing: border-box; height: var(--pk-ctl-h, 2.25rem); border: 1.5px solid var(--wp--preset--color--field-line, #c9c2b8); border-radius: var(--wp--custom--radius-s, 10px); background: var(--wp--preset--color--base, #fff); }
.pk-qty-step__btn { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; margin: 0; padding: 0; font: inherit; font-size: 1.05rem; line-height: 1; color: var(--wp--preset--color--ink, #2a1c12); background: none; border: 0; border-radius: inherit; cursor: pointer; }
.pk-qty-step__btn:disabled { color: var(--wp--preset--color--muted, #6b6259); opacity: 0.45; cursor: default; }
.pk-qty-step__btn:not(:disabled):hover { color: var(--wp--preset--color--brand, #6b4226); }
.pk-qty-step__btn:focus-visible, .pk-qty-step__input:focus-visible { outline: 3px solid var(--wp--preset--color--focus, #1a73e8); outline-offset: 1px; }
.pk-qty-step__input { width: 1.75rem; min-width: 0; height: 100%; margin: 0; padding: 0; font: inherit; font-size: 0.9rem; font-weight: 600; text-align: center; color: var(--wp--preset--color--ink, #2a1c12); background: none; border: 0; -moz-appearance: textfield; }
.pk-qty-step__input::-webkit-outer-spin-button, .pk-qty-step__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pk-rida__remove { display: inline-flex; align-items: center; justify-content: center; width: 1.625rem; height: var(--pk-ctl-h, 2.25rem); margin: 0; padding: 0; color: var(--wp--preset--color--muted, #6b6259); background: none; border: 0; border-radius: 50%; cursor: pointer; transition: color 0.15s ease, background-color 0.15s ease; }
.pk-rida__remove::before { content: ""; width: 1.05rem; height: 1.05rem; background-color: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14M10 10v6M14 10v6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14M10 10v6M14 10v6'/%3E%3C/svg%3E") center / contain no-repeat; }
.pk-rida__remove:hover, .pk-rida__remove:focus-visible { color: var(--wp--preset--color--danger, #b00020); background-color: color-mix(in srgb, var(--wp--preset--color--danger, #b00020) 10%, var(--wp--preset--color--base, #fff)); }
.pk-rida__remove:focus-visible { outline: 3px solid var(--wp--preset--color--focus, #1a73e8); outline-offset: 2px; }
/* Kogus on nüüd muudetav (tükitoode) või alati 1 (kaalutoode, müüakse üksikult): pildi peal olev kogusemärk ja toote
   lühikirjeldus (koostisosad) on üleliigsed. */
.wc-block-components-order-summary-item:has(.pk-rida--kassa) .wc-block-components-order-summary-item__quantity { display: none; }
.wp-block-woocommerce-checkout .wc-block-components-order-summary-item .wc-block-components-product-metadata__description { display: none; }
.wc-block-components-order-summary-item:has(.pk-kaal-select) .wc-block-components-product-details__kaal { display: none; }

/* Eemaldamise kinnitus (<dialog>, korv, mini-korv ja kassa). Ainult dialog-element: teema tellimuse kinnituse sektsioonil on sama klass `pk-confirm` (order-confirmation.html) ja see sai muidu dialoogi laiuse, tausta ja varju. */
dialog.pk-confirm { box-sizing: border-box; width: min(24rem, calc(100vw - 2rem)); margin: auto; padding: 1.25rem 1.25rem 1rem; color: var(--wp--preset--color--ink, #2a1c12); background: var(--wp--preset--color--base, #fff); border: 0; border-radius: var(--wp--custom--radius, 16px); box-shadow: 0 24px 48px -16px rgba(42, 28, 18, 0.45); }
dialog.pk-confirm::backdrop { background: rgba(42, 28, 18, 0.45); }
/* Prügikasti kõrval (read.js placeDialog): kompaktne kast, hele taust — kursor on kohe „Eemalda” juures. */
dialog.pk-confirm.is-anchored { position: fixed; inset: auto; margin: 0; width: min(19rem, calc(100vw - 1rem)); padding: 1rem; border: 1px solid var(--wp--preset--color--line, #e2d3be); border-radius: var(--wp--custom--radius-s, 10px); box-shadow: 0 16px 32px -12px rgba(42, 28, 18, 0.4); }
dialog.pk-confirm.is-anchored::backdrop { background: rgba(42, 28, 18, 0.12); }
dialog.pk-confirm.is-anchored .pk-confirm__title { margin-bottom: 0.25rem; font-size: 1rem; }
dialog.pk-confirm.is-anchored .pk-confirm__text { margin-bottom: 0.85rem; font-size: 0.9rem; line-height: 1.4; }
dialog.pk-confirm.is-anchored .pk-confirm__actions button { flex: 1 1 0; min-height: 2.5rem; padding: 0.35rem 0.75rem; font-size: 0.95rem; }
.pk-confirm__title { margin: 0 0 0.5rem; font-size: 1.2rem; line-height: 1.3; }
.pk-confirm__text { margin: 0 0 1.25rem; line-height: 1.5; }
.pk-confirm__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.pk-confirm__actions button { flex: 1 1 8rem; min-height: 2.75rem; padding: 0.5rem 1rem; font: inherit; font-weight: 700; border-radius: var(--wp--custom--radius-s, 10px); cursor: pointer; }
.pk-confirm__cancel { color: var(--wp--preset--color--brand, #6b4226); background: var(--wp--preset--color--base, #fff); border: 2px solid var(--wp--preset--color--brand, #6b4226); }
.pk-confirm__ok { color: #fff; background: var(--wp--preset--color--danger, #b00020); border: 2px solid var(--wp--preset--color--danger, #b00020); }
.pk-confirm__cancel:hover { background: var(--wp--preset--color--sand, #f5ede3); }
.pk-confirm__ok:hover { filter: brightness(0.92); }
.pk-confirm__actions button:focus-visible { outline: 3px solid var(--wp--preset--color--focus, #1a73e8); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pk-rida__remove { transition: none; } }
