/* ==========================================================================
   Вкладки «Я отримувач / Інший отримувач» — inc/woocommerce/recipient.php
   Перемикання без JS: радіо + :has(). Ролі кольорів — --co-* з checkout.css (запасні — токени).
   ========================================================================== */

/* штатний заголовок billing («Ваші дані») ховаємо — заголовки дає блок отримувача, за вкладкою */
.woocommerce form.woocommerce-checkout:has(.theme-recipient) .woocommerce-billing-fields > h3{display:none}

/* місце у flex-формі checkout.css: замість заголовка (1), перед billing-полями (2) */
.woocommerce form.woocommerce-checkout .theme-recipient{order:1}

.theme-recipient{
	--rc-ink:var(--co-ink, var(--theme-text));
	--rc-line:var(--co-line, var(--theme-accent));
	--rc-soft:var(--co-soft, var(--theme-accent-soft));
	--rc-radius:var(--co-radius, var(--theme-radius));
	--rc-h:var(--co-field-h, 56px);
	--rc-gap:var(--co-gap, 16px);
	display:flex;flex-direction:column;gap:var(--rc-gap);
}

/* ---------- вкладки — «пігулки», як «Самовивіз / Нова Пошта» ---------- */
.theme-recipient__tabs{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0 0 var(--rc-gap)}
.theme-recipient__tab{
	position:relative;
	display:flex;align-items:center;justify-content:center;
	box-sizing:border-box;min-height:var(--rc-h);
	margin:0;padding:12px 16px;
	border:1px solid var(--rc-line);
	border-radius:var(--rc-radius);
	color:var(--rc-ink);
	font-size:18px;font-weight:500;line-height:1.25;text-align:center;
	cursor:pointer;
	transition:background-color .15s,border-color .15s;
}
.theme-recipient__tab:hover{background:var(--rc-soft)}
.theme-recipient__tab:has(input:checked){background:var(--rc-soft);border-color:var(--rc-ink);font-weight:600}
.theme-recipient__tab input{position:absolute;opacity:0;pointer-events:none;margin:0}
.theme-recipient__tab:has(input:focus-visible){outline:2px solid var(--rc-ink);outline-offset:-2px}

/* ---------- що видно в кожному режимі ---------- */
.theme-recipient__other{display:none;flex-direction:column;gap:var(--rc-gap)}
.theme-recipient:has(input[value="other"]:checked) .theme-recipient__other{display:flex}
.theme-recipient:has(input[value="other"]:checked) .theme-recipient__me{display:none}

/* поля отримувача — стовпчиком, як billing-поля в checkout.css */
.theme-recipient__fields{margin:0 0 var(--rc-gap)}
.woocommerce form.woocommerce-checkout .theme-recipient__fields .form-row{box-sizing:border-box;width:100%;float:none}

@media (max-width:767px){
	.theme-recipient__tab{font-size:16px;padding:10px 12px}
}
@media (prefers-reduced-motion:reduce){
	.theme-recipient__tab{transition:none}
}
