/*
 * Delivery options and courier picker on the classic and block checkouts.
 * Classic: body.bulcom-ds #shipping_method > li (rendered by WooCommerce, label by the plugin).
 * Blocks:  .bulcom-rates > .bulcom-rate-item (rendered by assets/js/courier-blocks.js).
 */
:root {
	--bulcom-accent: #2563eb;
	--bulcom-accent-soft: rgba(37, 99, 235, .06);
	--bulcom-line: #e3e6ec;
	--bulcom-muted: #6b7280;
	--bulcom-ok: #15803d;
	--bulcom-radius: 12px;
	--bulcom-surface: #fff;
	--bulcom-pad: 14px 16px;
}
@supports (background: color-mix(in srgb, red 10%, white)) {
	:root { --bulcom-accent-soft: color-mix(in srgb, var(--bulcom-accent) 6%, transparent); }
}

/* ---------- list of options ---------- */
body.bulcom-ds #shipping_method,
.bulcom-rates {
	list-style: none;
	margin: 0;
	padding: 0;
	/* Space the options with the container's gap, not the item's margin: a theme
	   that zeroes #shipping_method li { margin } (e.g. Elementor) cannot glue the
	   cards together. Tiles and accordion override display below. */
	display: flex;
	flex-direction: column;
	gap: 10px;
	/* The options adapt to the width this list actually has, never to the viewport's: a theme may put the
	   checkout in a narrow column on a desktop, give it the full width on a phone, or a shop's own CSS may
	   change it again - so every responsive rule below is a @container query against this element, not a
	   media query. That is what kept breaking on one theme and not another.
	   inline-size containment also means the list takes its width from its parent and can never be widened
	   by its own contents, so it cannot push a <fieldset> (block checkout) or a table cell (classic) past
	   the right edge of the screen. Only the list's descendants are affected: the pop-up slot and the map
	   dialog are an ancestor and a child of <body>, so their fixed positioning is untouched. */
	container-type: inline-size;
	container-name: bulcom-delivery;
	/* A definite width, so inline-size containment never collapses the list to zero. Containment takes
	   the width from the parent, but a shrink-to-fit ancestor (a floated or fit-content column, as some
	   custom checkouts build) gives no definite width to take, and the list fell to 0 wide and spilled
	   its contents across the page. 100% still comes from the parent and still cannot be widened by the
	   contents, so it keeps the original intent while surviving those layouts. */
	width: 100%;
	max-width: 100%;
}
/* The "Standard" style leaves WooCommerce's own list alone, so it carries bulcom-ds-standard WITHOUT
   bulcom-ds and the rule above never reaches it - yet the rows in it are still ours, and the @container
   queries further down are written for them. Declare the container on its own here, with none of the
   layout above, so those queries have something to measure against and WooCommerce's list is untouched. */
body.bulcom-ds-standard #shipping_method { container-type: inline-size; container-name: bulcom-delivery; width: 100%; max-width: 100%; }
body.bulcom-ds #shipping_method > li,
.bulcom-rates > .bulcom-rate-item {
	position: relative;
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--bulcom-line);
	border-radius: var(--bulcom-radius);
	background: var(--bulcom-surface, #fff);
	color: inherit;
	transition: border-color .15s, background-color .15s, box-shadow .15s;
}
/* The block checkout's and the preview's list is a bare <ul>, so a theme's content styling reaches it:
   Kadence gives `.single-content ul` a 2em indent and a 1.5em bottom margin, which outweighs our lone
   class and pushed the options in from the left and down the page. The classic list is already safe - its
   selector carries #shipping_method - so this repeats the class for the other two contexts, the same
   trick as the repeated id below. */
.bulcom-ds-root .bulcom-rates.bulcom-rates { margin: 0; padding: 0; }
/* WooCommerce's own stylesheet (and the copy a theme like Kadence ships) styles
   `.woocommerce ul#shipping_method li` and `... li label` with exactly our specificity and loads after us,
   so it wins the tie: a 0.5em bottom margin on every option, fighting the list's own gap, and `display:
   inline` on the label. Repeating the id outweighs it whatever the load order. Some themes (Astra) also
   indent the list with a two-id selector; the cards need no indent. Only the classic checkout needs this -
   the block checkout and the admin preview have no #shipping_method for WooCommerce to target. */
body.bulcom-ds ul#shipping_method#shipping_method > li { padding: 0; text-indent: 0; margin: 0; }
body.bulcom-ds ul#shipping_method#shipping_method > li > label { display: block; }
body.bulcom-ds--tiles ul#shipping_method#shipping_method > li > label { display: flex; }
.bulcom-ds-shadow #shipping_method > li,
.bulcom-ds-shadow .bulcom-rates > .bulcom-rate-item { box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .05); }
.bulcom-ds-logos .bulcom-rate__logo { display: block; }
body.bulcom-ds #shipping_method > li::before { content: none; }
body.bulcom-ds #shipping_method > li:hover,
.bulcom-rates > .bulcom-rate-item:hover { border-color: #c7ccd6; }
body.bulcom-ds #shipping_method > li:has(> input:checked),
body.bulcom-ds #shipping_method > li:has(> input[type="hidden"]),
.bulcom-rates > .bulcom-rate-item.is-selected {
	border-color: var(--bulcom-accent);
	background: var(--bulcom-accent-soft);
}
body.bulcom-ds #shipping_method > li:has(> input:focus-visible),
.bulcom-rates > .bulcom-rate-item:has(input:focus-visible) {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .25);
}
body.bulcom-ds #shipping_method > li[hidden],
.bulcom-rates > .bulcom-rate-item[hidden] { display: none; }

/* The real radio stays in the form for keyboards and screen readers. A grouped type row is an
   li.bulcom-group-item rather than an li.bulcom-rate-item, so it is named too - otherwise its radio
   showed as a stray circle beside the row (as it did in the admin preview). */
body.bulcom-ds #shipping_method > li > input.shipping_method,
.bulcom-rate-item > label > input[type="radio"],
li.bulcom-group-item > label > input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}
body.bulcom-ds #shipping_method > li > label,
.bulcom-rate-item > label {
	display: block;
	/* Some themes (Kadence) set #shipping_method li { display:flex }; then a plain block label
	   shrinks to its content and the price cannot reach the right edge. Grow to fill the row. */
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: var(--bulcom-pad, 14px 16px);
	cursor: pointer;
	font-weight: inherit;
	line-height: 1.35;
}

.bulcom-rate {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}
/* The chosen row or card already shows itself — an accent border and tint, or (in a group) an
   accent left edge — so the little radio circle is redundant and dropped from every style. The
   real radio input stays in the form (hidden, above) for keyboards and screen readers. */
.bulcom-rate__radio { display: none; }
.bulcom-rate__logo { flex: 0 0 auto; display: none; }
.bulcom-rate__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bulcom-rate__title { font-weight: 600; }
.bulcom-rate__meta { font-size: .85em; color: var(--bulcom-muted); }
.bulcom-rate__meta:empty { display: none; }
/* The shop's own line about the option: where the shop is, what the service includes. */
.bulcom-rate__desc { display: block; margin-top: 2px; font-size: .85em; line-height: 1.35; color: var(--bulcom-muted); }
.bulcom-rate__desc:empty { display: none; }
.bulcom-rate__map { white-space: nowrap; color: var(--bulcom-accent); text-decoration: underline; }
.bulcom-rate__side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.bulcom-rate__price { font-weight: 700; white-space: nowrap; }
.bulcom-rate__price.is-pending { font-weight: 600; color: var(--bulcom-pending, var(--bulcom-muted)); }
/* The "paid to the courier" note is the same on every courier and simply restates that the row
   is the delivery fee, so it is dropped from the rows in every style; the order summary still
   carries it where it matters. */
.bulcom-rate__note { display: none; }
.bulcom-ds-note { display: block; margin: 10px 0 0; font-size: .82em; line-height: 1.45; color: var(--bulcom-muted); }
.bulcom-ds-note-row td { padding-top: 6px; border: 0; }
.bulcom-ds-note-row .bulcom-ds-note { margin: 0; }
.bulcom-rate__time { flex: 0 1 auto; margin-inline: auto; text-align: center; font-size: .8em; color: var(--bulcom-time, var(--bulcom-ok)); white-space: nowrap; }
.bulcom-rate__chevron { flex: 0 0 auto; color: var(--bulcom-muted); transition: transform .2s; }

.bulcom-logo--text {
	display: inline-block;
	font-weight: 800;
	font-style: italic;
	letter-spacing: -.01em;
	font-size: 1.05em;
	white-space: nowrap;
	line-height: 1;
}
/* Every logo cap below is min(<size>, 100%), never a flat pixel width: the image is then limited by its
   own slot as well, so a style (or a shop's CSS) that narrows the slot can never let the logo spill out
   over the price beside it. Cap the image, never only the slot. */
.bulcom-logo--image { display: block; max-width: min(120px, 100%); max-height: 32px; width: auto; height: auto; }
.bulcom-rate__logo { min-width: 0; max-width: 100%; }
.bulcom-logo--icon { color: var(--bulcom-muted); width: 26px; height: 26px; }

/* ---------- style: tiles ---------- */
body.bulcom-ds--tiles #shipping_method,
.bulcom-ds--tiles .bulcom-rates {
	display: grid;
	/* min(230px, 100%) rather than a flat 230px: in a container narrower than one tile the column shrinks
	   to the container instead of overflowing it, so the grid needs no width breakpoint of its own. */
	grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
	gap: 10px;
	align-items: stretch;
}
/* The tile is a flex row (label fills it); the picker panel, flex-basis 100%, must wrap to its own
   full-width line below, or on mobile it sits beside the tile and pushes the block off the right edge. */
body.bulcom-ds--tiles #shipping_method > li,
.bulcom-ds--tiles .bulcom-rates > .bulcom-rate-item { margin: 0; display: flex; flex-wrap: wrap; }
body.bulcom-ds--tiles #shipping_method > li > label,
.bulcom-ds--tiles .bulcom-rates > .bulcom-rate-item > label { flex: 1 1 auto; display: flex; align-items: center; }
body.bulcom-ds--tiles #shipping_method > li:has(> input:checked),
.bulcom-ds--tiles .bulcom-rates > .bulcom-rate-item.is-selected { box-shadow: inset 0 0 0 1px var(--bulcom-accent); }
/* A 2×2 tile: the courier name and its logo on the top line, the delivery type and the price on the
   bottom — name and price line up on the left, logo and amount on the right. */
.bulcom-ds--tiles .bulcom-rate,
body.bulcom-ds--tiles .bulcom-rate {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-rows: auto auto;
	align-items: center;
	gap: 3px 18px;
	width: 100%;
	text-align: left;
	min-height: 44px;
}
.bulcom-ds--tiles .bulcom-rate__meta::first-letter,
body.bulcom-ds--tiles .bulcom-rate__meta::first-letter { text-transform: uppercase; }
.bulcom-ds--tiles .bulcom-rate__main,
body.bulcom-ds--tiles .bulcom-rate__main { grid-column: 1; align-self: center; }
.bulcom-ds--tiles .bulcom-rate__title,
body.bulcom-ds--tiles .bulcom-rate__title { font-weight: 600; font-size: .95em; }
/* Logo only when the logos option is on; it sits at the top of the right column. */
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__logo,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__logo { display: flex; grid-column: 2; justify-self: end; align-items: center; }
.bulcom-ds--tiles .bulcom-logo--image,
body.bulcom-ds--tiles .bulcom-logo--image { max-height: 20px; max-width: min(76px, 100%); object-fit: contain; }
.bulcom-ds--tiles .bulcom-logo--text,
body.bulcom-ds--tiles .bulcom-logo--text { font-size: .95em; }
/* Price and note: the right column, right-aligned. Drops under the logo when one is shown. */
.bulcom-ds--tiles .bulcom-rate__side,
body.bulcom-ds--tiles .bulcom-rate__side {
	grid-column: 2;
	justify-self: end;
	display: flex;
	flex-flow: column;
	align-items: flex-end;
	gap: 2px;
	text-align: right;
	font-size: .85em;
}
.bulcom-ds--tiles .bulcom-rate__time,
body.bulcom-ds--tiles .bulcom-rate__time { grid-column: 2; justify-self: end; margin: 0; }
.bulcom-ds--tiles .bulcom-rate__price,
body.bulcom-ds--tiles .bulcom-rate__price { font-weight: 700; }
/* With logos on, place the four parts into the 2×2 grid directly — name ↔ logo on top, type ↔ price
   below — instead of stacking the price lopsidedly under the logo. */
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__main,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__main,
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__side,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__side { display: contents; }
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__title,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__title { grid-area: 1 / 1; align-self: center; }
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__logo,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__logo { grid-area: 1 / 2; justify-self: end; align-self: center; }
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__meta,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__meta { grid-area: 2 / 1; align-self: center; }
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__price,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__price { grid-area: 2 / 2; justify-self: end; align-self: center; }
/* A shop's own line, when set, runs the full width under the two rows. */
.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__desc,
body.bulcom-ds-logos.bulcom-ds--tiles .bulcom-rate__desc { grid-column: 1 / -1; }

/* ---------- style: accordion (and "grouped", which looks the same until a courier group opens) ---------- */
body.bulcom-ds--accordion #shipping_method,
body.bulcom-ds--grouped #shipping_method,
.bulcom-ds--accordion .bulcom-rates,
.bulcom-ds--grouped .bulcom-rates {
	display: block; /* one glued box, not gap-separated cards */
	gap: 0;
	border: 1px solid var(--bulcom-line);
	border-radius: var(--bulcom-radius);
	overflow: hidden;
	background: #fff;
}
body.bulcom-ds--accordion #shipping_method > li,
body.bulcom-ds--grouped #shipping_method > li,
.bulcom-ds--accordion .bulcom-rates > .bulcom-rate-item,
.bulcom-ds--grouped .bulcom-rates > .bulcom-rate-item {
	margin: 0;
	border: 0;
	border-radius: 0;
	border-top: 1px solid var(--bulcom-line);
	box-shadow: none;
}
body.bulcom-ds--accordion #shipping_method > li:first-child,
body.bulcom-ds--grouped #shipping_method > li:first-child,
.bulcom-ds--accordion .bulcom-rates > .bulcom-rate-item:first-child,
.bulcom-ds--grouped .bulcom-rates > .bulcom-rate-item:first-child { border-top: 0; }
body.bulcom-ds--accordion #shipping_method > li:has(> input:checked),
body.bulcom-ds--accordion #shipping_method > li:has(> input[type="hidden"]),
body.bulcom-ds--grouped #shipping_method > li:has(> input:checked),
body.bulcom-ds--grouped #shipping_method > li:has(> input[type="hidden"]),
.bulcom-ds--accordion .bulcom-rates > .bulcom-rate-item.is-selected,
.bulcom-ds--grouped .bulcom-rates > .bulcom-rate-item.is-selected { background: #f7f8fa; border-color: var(--bulcom-line); }
.bulcom-ds--accordion .bulcom-rate__logo,
body.bulcom-ds--accordion .bulcom-rate__logo,
.bulcom-ds--grouped .bulcom-rate__logo,
body.bulcom-ds--grouped .bulcom-rate__logo { display: block; width: 110px; max-width: 100%; }
.bulcom-ds--accordion .bulcom-rate__main,
body.bulcom-ds--accordion .bulcom-rate__main,
.bulcom-ds--grouped .bulcom-rate__main,
body.bulcom-ds--grouped .bulcom-rate__main { align-items: center; text-align: center; }
.bulcom-ds--accordion .bulcom-rate__meta::first-letter,
body.bulcom-ds--accordion .bulcom-rate__meta::first-letter,
.bulcom-ds--grouped .bulcom-rate__meta::first-letter,
body.bulcom-ds--grouped .bulcom-rate__meta::first-letter { text-transform: uppercase; }
/* The row is logo | name | price | chevron on one line — never wrapped, so the chevron
   stays beside the price (see the mobile exclusion in the 480px block below). Both couriers'
   logos are capped to the same height so one does not tower over the other. */
.bulcom-ds--accordion .bulcom-logo--image,
body.bulcom-ds--accordion .bulcom-logo--image,
.bulcom-ds--grouped .bulcom-logo--image,
body.bulcom-ds--grouped .bulcom-logo--image { max-height: 18px; max-width: min(90px, 100%); object-fit: contain; }
li:has(> input:checked) .bulcom-rate__chevron,
.bulcom-rate-item.is-selected .bulcom-rate__chevron { transform: rotate(180deg); color: inherit; }

/* ---------- style: grouped, on top of the shared box above (classic checkout only; the
   headers themselves are built by assets/js/courier-checkout.js from the already-rendered
   list, so none of this applies to a courier with only one delivery type, which stays a
   plain row — nor to anything until that script has run) ---------- */
/* A type row inside an open group: no logo (the header carries it), a small indent so it sits
   under its courier, and a transparent left edge that turns accent-coloured — together with a
   tint and accent type text — when the row is the chosen one. That is the selection cue, in place
   of the radio circle dropped across every style. */
/* Matched on the style class alone, not on body.<class>: the class is on <body> at the checkout but on
   the .bulcom-ds-root wrapper in the admin preview, so a body-prefixed rule silently does nothing there
   and the preview showed a type row with its logo and courier name still in place. The list is left out
   of the selectors for the same reason - it is #shipping_method at the classic checkout and .bulcom-rates
   in the preview and the block checkout. */
.bulcom-ds--grouped li.bulcom-group-item .bulcom-rate__logo { display: none; }
.bulcom-ds--grouped li.bulcom-group-item,
body.bulcom-ds--grouped #shipping_method li.bulcom-group-item { border-left: 3px solid transparent; }
.bulcom-ds--grouped li.bulcom-group-item > label { padding-left: 24px; }
.bulcom-ds--grouped li.bulcom-group-item:has(input:checked),
.bulcom-ds--grouped li.bulcom-group-item.is-selected,
body.bulcom-ds--grouped #shipping_method li.bulcom-group-item:has(input:checked),
body.bulcom-ds--grouped #shipping_method li.bulcom-group-item.is-selected { background: var(--bulcom-accent-soft); border-left-color: var(--bulcom-accent); }
.bulcom-ds--grouped li.bulcom-group-item:has(input:checked) .bulcom-rate__meta,
.bulcom-ds--grouped li.bulcom-group-item.is-selected .bulcom-rate__meta { color: var(--bulcom-accent); }
/* The row's name is left-aligned — it has no logo of its own to sit beside. */
.bulcom-ds--grouped li.bulcom-group-item .bulcom-rate__main { text-align: left; align-items: flex-start; }
/* The header already names the courier, so a type row drops the repeated courier name and
   shows only its type ("До офис"), promoted to the row's own label instead of a muted note. */
.bulcom-ds--grouped li.bulcom-group-item .bulcom-rate__title { display: none; }
.bulcom-ds--grouped li.bulcom-group-item .bulcom-rate__meta { font-size: .98em; font-weight: 600; color: var(--bulcom-ink, #334155); }
.bulcom-ds--grouped li.bulcom-group-head { background: none; }
.bulcom-ds--grouped li.bulcom-group-head:hover { background: #fafbfc; }
/* The header mirrors a plain row: logo at the left spanning both lines, the courier name and
   its "N ways to deliver" sub-line centred like a plain row's name and type, and the chevron
   trailing at the right where a price would sit — so a grouped courier lines up with a single
   courier row above or below it, same logo size and same centred name. */
.bulcom-group-head__btn {
	display: grid;
	grid-template-columns: 110px 1fr auto;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 12px;
	width: 100%;
	margin: 0;
	padding: var(--bulcom-pad, 14px 16px);
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
/* The toggle is a real <button>, which the theme (Astra and others) likes to paint with its
   accent colour on hover/focus/active. Pin it transparent in every state so only the row's own
   subtle hover shows — not a dark brand-coloured bar. */
.bulcom-group-head__btn:hover,
.bulcom-group-head__btn:focus,
.bulcom-group-head__btn:active { background: none; color: inherit; box-shadow: none; }
.bulcom-group-head__btn .bulcom-logo { display: block; width: auto; grid-column: 1; grid-row: 1 / 3; justify-self: start; }
.bulcom-group-head__name { grid-column: 2; grid-row: 1; min-width: 0; text-align: center; font-weight: 600; }
.bulcom-group-head__count { grid-column: 2; grid-row: 2; text-align: center; font-size: .85em; color: var(--bulcom-muted); }
.bulcom-group-head__chevron { grid-column: 3; grid-row: 1 / 3; color: var(--bulcom-muted); transition: transform .2s; }
.bulcom-group-head__btn[aria-expanded="true"] .bulcom-group-head__chevron { transform: rotate(180deg); }

/* ---------- where first: steps and tabs ---------- */
.bulcom-steps { display: flex; gap: 16px; margin: 0 0 12px; font-weight: 600; }
.bulcom-steps__step { display: inline-flex; align-items: center; gap: 6px; color: var(--bulcom-muted); }
.bulcom-steps__num {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #e5e7eb;
	color: #374151;
	font-size: 13px;
	line-height: 1;
}
.bulcom-steps__step.is-done { color: inherit; }
.bulcom-steps__step.is-done .bulcom-steps__num { background: var(--bulcom-accent); color: #fff; }
.bulcom-tabs-label { display: block; margin: 0 0 8px; font-weight: 600; }
.bulcom-tabs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
	gap: 8px;
	margin: 0 0 14px;
}
/* The step buttons sit beside the option list, not inside it, so the list's own container cannot
   measure them. These three are the elements that hold the buttons and the list together, one per
   context: the classic checkout's slot, the block checkout's package and the admin preview's root.
   Naming a container here costs nothing else - in pop-up mode the slot is itself position: fixed,
   which containment on the same element does not affect, and nothing fixed lives inside any of them
   (the map dialog and the backdrop are children of <body>). */
.bulcom-delivery-slot,
.bulcom-ds-package,
.bulcom-ds-root { container-type: inline-size; container-name: bulcom-delivery-block; width: 100%; max-width: 100%; }
@container bulcom-delivery-block (max-width: 420px) {
	/* Four kinds of delivery in a narrow column: auto-fit packs as many as fit, which is three, and
	   strands the fourth alone at the left of the next line. Two by two is the symmetric shape, and it
	   leaves each button wide enough for a long name ("Pickup from the shop"). Three or fewer buttons
	   fill their line already, so auto-fit is left to it. */
	.bulcom-tabs:has(> .bulcom-tab:nth-child(4)) { grid-template-columns: repeat(2, 1fr); }
}
.bulcom-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 8px;
	border: 1px solid var(--bulcom-line);
	border-radius: 10px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-weight: 600;
	font-size: .92em;
	cursor: pointer;
}
.bulcom-tab .bulcom-icon { color: var(--bulcom-muted); }
.bulcom-tab:hover { border-color: #c7ccd6; }
.bulcom-tab[aria-pressed="true"] { border-color: var(--bulcom-accent); background: var(--bulcom-accent-soft); }
.bulcom-tab[aria-pressed="true"] .bulcom-icon { color: var(--bulcom-accent); }

/* ---------- panel: summary and picker ---------- */
/* When a theme makes the option row a flex container (Kadence: #shipping_method li{display:flex}),
   the expanded picker panel wraps to its own line — force it to take the full row width, otherwise
   it shrinks to its content and the office list is narrower than the city field above it. */
.bulcom-rate-panel { flex: 1 0 100%; width: 100%; box-sizing: border-box; padding: 0 16px 14px; cursor: auto; }
.bulcom-ds--tiles .bulcom-rate-panel,
body.bulcom-ds--tiles .bulcom-rate-panel { padding: 0; }
.bulcom-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	padding-top: 12px;
	border-top: 1px dashed #cfd5df;
	font-size: .92em;
}
.bulcom-summary__label { color: var(--bulcom-muted); }
.bulcom-summary__value { flex: 1 1 auto; color: var(--bulcom-accent); font-weight: 600; }
.bulcom-summary__change {
	display: inline-flex;
	align-items: center;
	margin: -4px -8px;
	padding: 4px 8px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: inherit;
	box-shadow: none;
	cursor: pointer;
	transition: color .15s, background-color .15s;
}
.bulcom-panel [hidden] { display: none !important; }
.bulcom-picker { padding-top: 4px; }
.bulcom-office-row { margin: 0 0 6px; }
.bulcom-rate-panel .bulcom-picker { border-top: 1px dashed #cfd5df; margin-top: 0; padding-top: 10px; }
/* `.woocommerce form .form-row` outweighs a two-class selector of ours, so each of these also lists a
   form heavy enough to beat it. The lighter selector stays for any markup without the outer .bulcom-panel;
   the declarations are written once either way. */
.bulcom-picker .form-row,
.bulcom-panel .bulcom-picker .form-row { margin: 0 0 10px; padding: 0; width: auto; float: none; }
.bulcom-picker label,
.bulcom-picker .bulcom-label,
.bulcom-blocks-delivery label,
.bulcom-panel .bulcom-picker .form-row label,
.bulcom-panel .bulcom-picker .bulcom-label { display: block; margin: 0 0 4px; font-weight: 600; font-size: .9em; }
.bulcom-search { position: relative; display: block; }
.bulcom-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--bulcom-muted); pointer-events: none; }
.bulcom-picker input[type="text"],
.bulcom-picker input[type="search"],
.bulcom-blocks-delivery input[type="text"],
.bulcom-blocks-delivery input[type="search"] {
	width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid #cfd5df;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	color: inherit;
}
.bulcom-search input[type="text"],
.bulcom-search input[type="search"] { padding-left: 40px !important; }
.bulcom-picker input:focus,
.bulcom-blocks-delivery input:focus { outline: none; border-color: var(--bulcom-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }

.bulcom-city-row,
.bulcom-blocks-city { position: relative; }
.bulcom-city-results,
.bulcom-blocks-results {
	position: absolute;
	z-index: 99;
	left: 0;
	right: 0;
	max-height: 260px;
	overflow: auto;
	margin: 4px 0 0;
	padding: 4px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--bulcom-line);
	border-radius: 10px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}
.bulcom-city-results button,
.bulcom-blocks-results button {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
.bulcom-city-results button:hover,
.bulcom-city-results button:focus,
.bulcom-city-results button.is-active,
.bulcom-blocks-results button:hover,
.bulcom-blocks-results button:focus,
.bulcom-blocks-results button.is-active { background: #f1f4f9; }

.bulcom-office-tools { display: flex; gap: 8px; margin: 0 0 8px; align-items: stretch; }
.bulcom-office-tools .bulcom-search { flex: 1 1 auto; }
.bulcom-near {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	padding: 0 12px;
	min-height: 44px;
	border: 1px solid #cfd5df;
	border-radius: 10px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: .88em;
	font-weight: 600;
	cursor: pointer;
}
.bulcom-near:hover { border-color: var(--bulcom-accent); color: var(--bulcom-accent); }
.bulcom-offices {
	max-height: 290px;
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 2px;
}
.bulcom-panel .bulcom-offices label.bulcom-office,
.bulcom-office {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--bulcom-office-line, var(--bulcom-line));
	border-radius: 10px;
	background: var(--bulcom-office-surface, #fff);
	font-weight: 400;
	font-size: 1em;
	text-align: left;
	color: inherit;
	cursor: pointer;
	width: 100%;
	box-sizing: border-box;
}
button.bulcom-office { font: inherit; }
.bulcom-office[hidden] { display: none; }
.bulcom-office:hover { border-color: #c7ccd6; }
.bulcom-office:has(input:checked),
.bulcom-panel .bulcom-offices label.bulcom-office:has(input:checked),
.bulcom-office.is-selected {
	border-color: var(--bulcom-office-accent, var(--bulcom-accent));
	background: color-mix(in srgb, var(--bulcom-office-accent, var(--bulcom-accent)) 6%, var(--bulcom-office-surface, #fff));
}
.bulcom-panel .bulcom-office input[type="radio"] { flex: 0 0 auto; margin: 0; accent-color: var(--bulcom-office-accent, var(--bulcom-accent)); }
.bulcom-panel .bulcom-office span { display: block; line-height: 1.35; }
.bulcom-panel .bulcom-office .bulcom-office__tag { display: inline-block; }
.bulcom-office__text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.bulcom-office__name { font-weight: 600; font-size: .93em; }
.bulcom-office__address { font-size: .82em; color: var(--bulcom-muted); }
/* How to find the office or locker, in the courier's own words: quieter than its address. */
.bulcom-office__note { display: block; font-size: .78em; line-height: 1.35; color: var(--bulcom-muted); opacity: .85; }
.bulcom-office__tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: #eef2ff; color: #3730a3; font-size: .75em; font-weight: 600; vertical-align: 1px; }
.bulcom-office__km { flex: 0 0 auto; font-size: .82em; color: var(--bulcom-muted); white-space: nowrap; }
.bulcom-offices__empty { margin: 4px 0; color: var(--bulcom-muted); }
.bulcom-alert { color: #b32d2e; }

/* Block checkout: the plugin's options replace WooCommerce's list. */
body.bulcom-ds-blocks .wc-block-components-shipping-rates-control__package { display: none; }
.bulcom-ds-root { margin: 0 0 8px; }
.bulcom-ds-package + .bulcom-ds-package { margin-top: 16px; }
/* The block checkout wraps the options in a <fieldset>, which defaults to min-width: min-content and so
   refuses to shrink below its widest row — on a phone that pushes the whole delivery block off the right
   edge (the theme's overflow clip then hides, not fixes, it). Let it shrink to its container like any box. */
body.bulcom-ds .wc-block-checkout__shipping-option { min-width: 0; }

/* Classic checkout: the delivery row spans the order review table. */
body.bulcom-ds tr.bulcom-ds-row > th { display: none; }
body.bulcom-ds tr.bulcom-ds-row > td { text-align: left; padding-left: 0; padding-right: 0; }
.bulcom-ds-heading { display: block; margin: 0 0 10px; font-weight: 700; }

@container bulcom-delivery (max-width: 420px) {
	/* The search and the "nearest to me" button stop sharing a line. */
	.bulcom-office-tools { flex-direction: column; }
}

/* WooCommerce styles labels and inputs inside #shipping_method and .form-row strongly; restate ours. */
#shipping_method .bulcom-panel label.bulcom-office,
.bulcom-panel .bulcom-offices label.bulcom-office { display: flex; margin: 0; line-height: 1.35; }
#shipping_method .bulcom-panel label:not(.bulcom-office) { display: block; }
#shipping_method .bulcom-panel input[type="radio"] { margin: 0; }
.bulcom-panel .bulcom-picker .bulcom-search input.input-text,
.bulcom-panel .bulcom-picker .bulcom-search input,
.bulcom-panel .bulcom-picker input#bulcom_address_line { font-size: 15px; line-height: 1.4; }

@container bulcom-delivery (max-width: 420px) {
	.bulcom-ds:not(.bulcom-ds--tiles) .bulcom-rate__time,
	body.bulcom-ds:not(.bulcom-ds--tiles) .bulcom-rate__time { flex: 1 0 100%; order: 4; margin: 2px 0 0; text-align: left; }
	.bulcom-ds:not(.bulcom-ds--tiles):not(.bulcom-ds--accordion):not(.bulcom-ds--grouped) .bulcom-rate,
	body.bulcom-ds:not(.bulcom-ds--tiles):not(.bulcom-ds--accordion):not(.bulcom-ds--grouped) .bulcom-rate { flex-wrap: wrap; }
	/* Accordion and grouped want the one-line "logo | name | price | chevron" row. In a narrow block a
	   110px logo plus the price and chevron can leave the name nothing, so the logo shrinks (the image
	   itself, so it cannot spill over the price) and the name is allowed to wrap below - but only when it
	   genuinely has to. It keeps at least the width of its own longest word, so the row stays on one line
	   with a short price like "3,44 €" and flex moves the name down only for a long one such as "Още не е
	   изчислено". A fixed "always two lines" rule here looked broken at every ordinary price.
	   min-width: min-content only holds while whole words stay whole, hence the wrapping reset: themes set
	   overflow-wrap: break-word globally, which would collapse the minimum to a single character. */
	.bulcom-ds--accordion .bulcom-rate,
	.bulcom-ds--grouped .bulcom-rate { flex-wrap: wrap; }
	/* The base rules for these two carry a body-prefixed selector as well, which outweighs a class-only
	   one, so both forms are repeated here or the logo keeps its full 110px and crowds the name out. */
	.bulcom-ds--accordion .bulcom-rate__logo,
	body.bulcom-ds--accordion .bulcom-rate__logo,
	.bulcom-ds--grouped .bulcom-rate__logo,
	body.bulcom-ds--grouped .bulcom-rate__logo { width: auto; }
	.bulcom-ds--accordion .bulcom-logo--image,
	body.bulcom-ds--accordion .bulcom-logo--image,
	.bulcom-ds--grouped .bulcom-logo--image,
	body.bulcom-ds--grouped .bulcom-logo--image { max-width: min(72px, 100%); }
	.bulcom-ds--accordion .bulcom-rate__main,
	body.bulcom-ds--accordion .bulcom-rate__main,
	.bulcom-ds--grouped .bulcom-rate__main,
	body.bulcom-ds--grouped .bulcom-rate__main { flex: 1 1 auto; min-width: min-content; text-align: left; align-items: flex-start; }
	.bulcom-ds--accordion .bulcom-rate__title,
	.bulcom-ds--accordion .bulcom-rate__meta,
	.bulcom-ds--grouped .bulcom-rate__title,
	.bulcom-ds--grouped .bulcom-rate__meta { overflow-wrap: normal; word-break: normal; }
	/* The courier header stacks its name over its sub-line in the middle column, which in a narrow block is
	   too tight for the sub-line ("2 начина на доставка" broke into two cramped lines). Put the logo, the
	   name and the chevron on the first row and give the sub-line the whole width underneath, where it
	   fits on one line. */
	.bulcom-ds--grouped .bulcom-group-head__btn .bulcom-logo,
	.bulcom-ds--grouped .bulcom-group-head__chevron { grid-row: 1; }
	.bulcom-ds--grouped .bulcom-group-head__count { grid-column: 1 / -1; grid-row: 2; margin-top: 2px; }
}

/* ---------- style: standard (WooCommerce's own list) ---------- */
/* The delivery time WooCommerce prints under the option moves between the name and the price.
   Scoped to the shipping rates: the same classes are used by the payment methods and pickup locations. */
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: baseline;
	column-gap: 14px;
}
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__label-group { display: contents; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__label { grid-column: 1; grid-row: 1; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__secondary-label { grid-column: 3; grid-row: 1; text-align: right; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__description-group { grid-column: 2; grid-row: 1; margin: 0; text-align: center; }
/* Deliberately a media query, not a @container one: this is WooCommerce's own list, which the "standard"
   style only re-arranges, so it sits outside our container and WooCommerce makes it responsive itself.
   Everything inside the plugin's own list uses @container (see the top of this file). */
@media (max-width: 560px) {
	body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option-layout { grid-template-columns: minmax(0, 1fr) auto; }
	body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__secondary-label { grid-column: 2; grid-row: 1; }
	body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__description-group { grid-column: 1 / -1; grid-row: 2; text-align: left; }
}
/* The checkout names this style "bulcom-ds-standard" on <body>, the admin preview "bulcom-ds--standard"
   on .bulcom-ds-root - both are listed so the date looks the same in the preview as on the checkout. */
body.bulcom-ds-standard .bulcom-rate-date,
.bulcom-ds--standard .bulcom-rate-date { margin: 0 6px; font-size: .85em; color: var(--bulcom-ok, #15803d); white-space: nowrap; }

/* "The receiver pays": the delivery row of the block checkout shows the expected courier fee instead of "Free". */
.bulcom-has-receiver-fee .wc-block-components-totals-shipping .wc-block-components-totals-item__value > strong { display: none; }
.bulcom-has-receiver-fee .wc-block-components-totals-shipping .wc-block-components-totals-item__value::after { content: var(--bulcom-receiver-fee); font-weight: 600; white-space: nowrap; }
.bulcom-receiver-fee-rows .wc-block-components-totals-item__description { flex-basis: 100%; margin-top: 4px; font-size: .85em; font-weight: 400; opacity: .75; }

/* Classic checkout: the courier picker in the customer-details column. */
.bulcom-delivery-slot { margin: 18px 0 8px; }
.bulcom-delivery-slot__title { margin: 0 0 12px; }
.bulcom-delivery-slot__courier { font-weight: 400; opacity: .7; }
.bulcom-delivery-slot__subtitle { margin: 18px 0 8px; font-weight: 600; }
.bulcom-delivery-slot__package { margin: 12px 0 6px; font-weight: 600; }
/* A theme's own heading and paragraph spacing otherwise decides these gaps, and it wins: Kadence sets a
   logical margin (32px under the sub-heading, 36px over the title) from a selector heavier than a lone
   class, which left a wide empty band between "Адрес за доставка" and the first field. Restate ours with
   enough weight to hold - the same approach as the labels and inputs further up. */
body .bulcom-delivery-slot .bulcom-delivery-slot__title { margin: 0 0 12px; }
body .bulcom-delivery-slot .bulcom-delivery-slot__subtitle { margin: 14px 0 8px; }
body .bulcom-delivery-slot .bulcom-delivery-slot__package { margin: 12px 0 6px; }
.bulcom-delivery-slot #shipping_method { margin: 0 0 4px; padding: 0; list-style: none; }
/* No alignment override: the delivery line inherits the theme's own total-row alignment, so its price
   lines up with every other total (whichever side the theme puts them on) instead of being pulled to
   the edge. The courier name is a small label above the price. */
.bulcom-shipping-line__name { display: block; font-size: .9em; opacity: .8; }
.bulcom-shipping-line__price { display: block; }
.bulcom-shipping-line__desc { display: block; margin-top: 2px; font-size: .85em; line-height: 1.35; opacity: .75; font-weight: 400; }

/* ---------- style: standard, classic checkout (the plugin's plain list beside the customer details) ---------- */
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method {
	list-style: none;
	margin: 0 0 4px;
	padding: 0;
	border: 1px solid var(--bulcom-line);
	border-radius: var(--bulcom-radius);
	background: var(--bulcom-surface, #fff);
	overflow: hidden;
}
body.bulcom-ds-shadow .bulcom-delivery-slot--list ul#shipping_method#shipping_method { box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .05); }
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li {
	position: relative;
	margin: 0;
	padding: 0;
	text-indent: 0;
	list-style: none;
	border-top: 1px solid var(--bulcom-line);
	transition: background-color .15s;
}
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li::before { content: none; }
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li:first-child { border-top: 0; }
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li:hover { background: rgba(15, 23, 42, .025); }
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li:has(> input:checked),
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li:has(> input[type="hidden"]) {
	background: var(--bulcom-accent-soft);
	box-shadow: inset 3px 0 0 var(--bulcom-accent);
}
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li:has(> input:focus-visible) { outline: 2px solid var(--bulcom-accent); outline-offset: -2px; }
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li > input.shipping_method {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}
body .bulcom-delivery-slot--list ul#shipping_method#shipping_method > li > label {
	display: block;
	flex: 1 1 auto; /* fill the row when a theme makes the li a flex container */
	min-width: 0;
	margin: 0;
	padding: var(--bulcom-pad, 14px 16px);
	cursor: pointer;
	font-weight: inherit;
	line-height: 1.35;
}
body .bulcom-delivery-slot--list .bulcom-rate__logo .bulcom-logo--image { max-width: min(84px, 100%); max-height: 24px; }
/* In the section the heading already says "Delivery method": the tabs do not repeat it. */
.bulcom-delivery-slot .bulcom-tabs-label { display: none; }
/* Logos in cards stay the size of the text beside them (rows keep their larger logo). */
body.bulcom-ds--cards .bulcom-delivery-slot .bulcom-rate__logo .bulcom-logo--image { max-width: min(84px, 100%); max-height: 24px; }
/* The picker under the list starts right under its own title. */
.bulcom-delivery-slot > .bulcom-panel .bulcom-city-row { margin-top: 0; padding-top: 0; }

/* ---------- style: standard, block checkout (WooCommerce's option list in the plugin's colours, shape and density) ---------- */
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control {
	border: 1px solid var(--bulcom-line);
	border-radius: var(--bulcom-radius);
	background: var(--bulcom-surface, #fff);
	overflow: hidden;
}
body.bulcom-ds-shadow.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control { box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .05); }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control::after,
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option::after { content: none; display: none; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option {
	margin: 0;
	padding-top: var(--bulcom-pad-y, 14px);
	padding-bottom: var(--bulcom-pad-y, 14px);
	border-top: 1px solid var(--bulcom-line);
	box-shadow: none;
}
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option:first-child { border-top: 0; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option-checked {
	background: var(--bulcom-accent-soft);
	box-shadow: inset 3px 0 0 var(--bulcom-accent);
}
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__input:checked { border-color: var(--bulcom-accent); }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__input:checked::before { background: var(--bulcom-accent); }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__label { font-weight: 600; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__description { color: var(--bulcom-ok, #15803d); font-size: .85em; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__secondary-label { font-weight: 700; }

/* Card logos keep to the size of the text beside them on both checkouts (rows and tiles keep theirs).
   Matched on the style class alone so the admin preview, which carries it on .bulcom-ds-root rather than
   on <body>, caps the logo the same way instead of falling back to the larger default. */
.bulcom-ds--cards .bulcom-rates .bulcom-rate__logo .bulcom-logo--image { max-width: min(84px, 100%); max-height: 24px; }

body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option { padding-left: 16px; padding-right: 16px; }
body.bulcom-ds-standard .wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option:has(input:focus-visible) { outline: 2px solid var(--bulcom-accent); outline-offset: -2px; }

/* Preview of the standard template (design and template screens): the same plain list as the classic checkout. */
.bulcom-ds--standard .bulcom-rates {
	border: 1px solid var(--bulcom-line);
	border-radius: var(--bulcom-radius);
	background: var(--bulcom-surface, #fff);
	overflow: hidden;
}
.bulcom-ds-shadow.bulcom-ds--standard .bulcom-rates { box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .05); }
.bulcom-ds--standard .bulcom-rates > .bulcom-rate-item {
	margin: 0;
	border: 0;
	border-top: 1px solid var(--bulcom-line);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}
.bulcom-ds--standard .bulcom-rates > .bulcom-rate-item:first-child { border-top: 0; }
.bulcom-ds--standard .bulcom-rates > .bulcom-rate-item.is-selected { background: var(--bulcom-accent-soft); box-shadow: inset 3px 0 0 var(--bulcom-accent); }
/* Standard list: on a wide row the name and type sit centred in the space between the logo and the
   price, rather than hugging the logo with a long gap after them. On phones the two-line rule below
   rearranges this row, so the centring only shapes the desktop width. Both the live checkout
   (body.bulcom-ds-standard) and the admin preview (.bulcom-ds--standard) are covered so they match. */
body.bulcom-ds-standard .bulcom-rate__main,
.bulcom-ds--standard .bulcom-rate__main { align-items: center; text-align: center; }


/*
 * Buttons of the delivery picker on any theme. Themes style every <button> on hover and focus
 * (a filled background, white text); these keep the plugin's own quiet states instead.
 */
body .bulcom-panel .bulcom-summary__change:hover,
body .bulcom-panel .bulcom-summary__change:focus,
body .bulcom-rate-panel .bulcom-summary__change:hover,
body .bulcom-rate-panel .bulcom-summary__change:focus {
	background: var(--bulcom-accent-soft);
	color: var(--bulcom-accent);
	border: 0;
	box-shadow: none;
	text-decoration: none;
}
body .bulcom-panel .bulcom-summary__change:active { background: color-mix(in srgb, var(--bulcom-accent) 12%, transparent); }
body .bulcom-panel .bulcom-summary__change:focus-visible,
body .bulcom-rate-panel .bulcom-summary__change:focus-visible { outline: 2px solid var(--bulcom-accent); outline-offset: 1px; }

body .bulcom-panel .bulcom-near:hover,
body .bulcom-panel .bulcom-near:focus {
	background: #fff;
	border-color: var(--bulcom-accent);
	color: var(--bulcom-accent);
	box-shadow: none;
	text-decoration: none;
}
body .bulcom-panel .bulcom-near:focus-visible { outline: 2px solid var(--bulcom-accent); outline-offset: 1px; }

body .bulcom-tabs .bulcom-tab:hover,
body .bulcom-tabs .bulcom-tab:focus {
	background: #fff;
	border-color: #c7ccd6;
	color: inherit;
	box-shadow: none;
}
body .bulcom-tabs .bulcom-tab[aria-pressed="true"],
body .bulcom-tabs .bulcom-tab[aria-pressed="true"]:hover,
body .bulcom-tabs .bulcom-tab[aria-pressed="true"]:focus { border-color: var(--bulcom-accent); background: var(--bulcom-accent-soft); color: inherit; }
body .bulcom-tabs .bulcom-tab:focus-visible { outline: 2px solid var(--bulcom-accent); outline-offset: 1px; }

body .bulcom-city-results button:hover,
body .bulcom-city-results button:focus,
body .bulcom-blocks-results button:hover,
body .bulcom-blocks-results button:focus { background: #f1f4f9; color: inherit; border-color: transparent; box-shadow: none; }

body .bulcom-panel button.bulcom-office:hover,
body .bulcom-panel button.bulcom-office:focus { background: var(--bulcom-office-surface, #fff); color: inherit; box-shadow: none; }

/*
 * At rest too: a theme may paint every button inside the block checkout ("[class*=wc-block] button":
 * a filled background, white text, large padding), which beats a single class.
 */
body .bulcom-panel .bulcom-offices button.bulcom-office {
	padding: 10px 12px;
	border: 1px solid var(--bulcom-office-line, var(--bulcom-line));
	background: var(--bulcom-office-surface, #fff);
	color: inherit;
	font-weight: 400;
	line-height: 1.35;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}
body .bulcom-panel .bulcom-offices button.bulcom-office.is-selected,
body .bulcom-panel .bulcom-offices button.bulcom-office[aria-checked="true"] {
	border-color: var(--bulcom-office-accent, var(--bulcom-accent));
	background: color-mix(in srgb, var(--bulcom-office-accent, var(--bulcom-accent)) 6%, var(--bulcom-office-surface, #fff));
}
body .bulcom-panel button.bulcom-summary__change,
body .bulcom-rate-panel button.bulcom-summary__change {
	padding: 4px 8px;
	border: 0;
	background: transparent;
	color: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: inherit;
	box-shadow: none;
}
body .bulcom-tabs button.bulcom-tab {
	padding: 12px 8px;
	border: 1px solid var(--bulcom-line);
	background: #fff;
	color: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	box-shadow: none;
}
body .bulcom-tabs button.bulcom-tab[aria-pressed="true"] { border-color: var(--bulcom-accent); background: var(--bulcom-accent-soft); }
body .bulcom-panel .bulcom-office-tools button.bulcom-near {
	padding: 0 12px;
	border: 1px solid #cfd5df;
	background: #fff;
	color: inherit;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}

/* Delivery to a parcel locker is paid in advance: why cash on delivery is missing. */
.bulcom-locker-payment { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fef3c7; color: #92400e; font-size: 13px; line-height: 1.45; }

/* Selling to other countries: the country chosen above the delivery options (compact block checkout). */
.bulcom-country { margin: 0 0 12px; }
.bulcom-country label { display: block; margin: 0 0 4px; font-weight: 600; font-size: .92em; }
.bulcom-country select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #cfd5df; border-radius: 10px; background: #fff; font: inherit; }

/* The map of every office, under the locality search: kept apart from the field. */
.bulcom-map-inline--all { margin-top: 12px; }

/* The at-rest rules above are strong enough to beat a theme; their hover and focus follow suit. */
body .bulcom-panel .bulcom-office-tools button.bulcom-near:hover,
body .bulcom-panel .bulcom-office-tools button.bulcom-near:focus { border-color: var(--bulcom-accent); color: var(--bulcom-accent); background: #fff; }
body .bulcom-panel .bulcom-offices button.bulcom-office:hover { border-color: #c7ccd6; }
body .bulcom-panel .bulcom-offices button.bulcom-office.is-selected:hover,
body .bulcom-panel .bulcom-offices button.bulcom-office[aria-checked="true"]:hover { border-color: var(--bulcom-office-accent, var(--bulcom-accent)); }

/* Address in parts: the street or quarter, then number, block, entrance, floor and apartment side by side. */
.bulcom-street-row { position: relative; }
/* Number, block, entrance, floor and apartment: a wrapping row, not a fixed grid, because each field has
   to be at least as wide as its own label needs (min-width: min-content). A long label - "Апартамент", or
   a longer word in another language, in whatever font the theme sets - is then never broken across lines,
   and no pixel breakpoint has to be kept in step with the theme. The fields on a line share what is left
   and align on their inputs, so an unusually tall label cannot knock one out of line. */
.bulcom-address-details { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 8px 0 0; }
.bulcom-address-details .form-row,
.bulcom-panel .bulcom-address-details .form-row { flex: 1 1 min-content; min-width: min-content; display: flex; flex-direction: column; margin: 0; padding: 0; width: auto; float: none; }
/* Themes often set overflow-wrap: break-word globally. That lets a label split inside a word, which both
   looks wrong ("Апартаме / нт") and makes the field's min-content one character wide, so the min-width
   above stops protecting it. Keep whole words whole; the field is then sized to fit the label. */
.bulcom-address-details label { display: block; margin: 0 0 4px; font-size: .85em; overflow-wrap: normal; word-break: normal; hyphens: none; }
.bulcom-address-details input { width: 100%; min-width: 0; box-sizing: border-box; }

/* A narrow block, "Modern" cards and the "Standard" list: with a logo, the row goes to two lines — the
   courier logo and the price on the first, the courier name and the delivery type on the second — so the
   name is never squeezed into a sliver between a fixed logo and a fixed price. Without a logo there is
   nothing to squeeze past, so the row stays on one line (name and type on the left, price on the right);
   splitting it would strand the price alone on an empty first line. */
@container bulcom-delivery (max-width: 420px) {
	.bulcom-ds--cards .bulcom-rate,
	.bulcom-ds--standard .bulcom-rate,
	body.bulcom-ds-standard .bulcom-rate { flex-wrap: wrap; column-gap: 10px; row-gap: 4px; }
	.bulcom-ds-logos.bulcom-ds--cards .bulcom-rate__logo,
	.bulcom-ds--standard.bulcom-ds-logos .bulcom-rate__logo,
	body.bulcom-ds-standard.bulcom-ds-logos .bulcom-rate__logo { order: 2; }
	.bulcom-ds-logos.bulcom-ds--cards .bulcom-rate__side,
	.bulcom-ds--standard.bulcom-ds-logos .bulcom-rate__side,
	body.bulcom-ds-standard.bulcom-ds-logos .bulcom-rate__side { order: 3; margin-left: auto; flex-direction: row; align-items: baseline; justify-content: flex-end; gap: 8px; text-align: right; }
	.bulcom-ds-logos.bulcom-ds--cards .bulcom-rate__main,
	.bulcom-ds--standard.bulcom-ds-logos .bulcom-rate__main,
	body.bulcom-ds-standard.bulcom-ds-logos .bulcom-rate__main { order: 4; flex: 1 1 100%; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--bulcom-line); }
}

/* The admin preview's "Mobile" view needs no rules of its own any more: it is a narrow container
   (.bulcom-preview.is-mobile is capped at 360px) around the same list, so the @container queries above
   fire inside it exactly as they do on a phone. One set of rules, one behaviour. */

/* ---------- pop-up delivery: a summary line with "Change" that opens the list (in whatever style) as a
   modal. The list stays in the checkout form — only its look is the modal, toggled by a body class. ---------- */
body.bulcom-ds-popup .bulcom-dpopup__bar { display: flex; align-items: center; gap: 12px; border: 1px solid var(--bulcom-line); border-radius: 12px; padding: 12px 14px; background: #fff; cursor: pointer; }
body.bulcom-ds-popup .bulcom-dpopup__bar:hover { border-color: #c7ccd6; }
.bulcom-dpopup__sum { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.bulcom-dpopup__sum .bulcom-rate__logo { display: block; flex: 0 0 auto; }
.bulcom-dpopup__sum .bulcom-logo--image { max-height: 20px; max-width: min(84px, 100%); object-fit: contain; display: block; }
.bulcom-dpopup__lines { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.bulcom-dpopup__t { font-weight: 600; }
.bulcom-dpopup__s { font-size: .82em; color: var(--bulcom-muted); }
.bulcom-dpopup__p { font-weight: 700; white-space: nowrap; }
.bulcom-dpopup__change { flex: 0 0 auto; border: 1px solid #c7ccd6; background: #fff; color: #1e293b; border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.bulcom-dpopup__change:hover { background: #f7f8fa; }

body.bulcom-ds-popup .bulcom-delivery-slot {
	position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%);
	width: min(560px, calc(100vw - 32px)); max-height: 86vh; overflow: auto;
	background: #fff; border-radius: 16px; padding: 18px 18px 20px; z-index: 100000;
	box-shadow: 0 20px 60px rgba(15, 23, 42, .3);
	opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, transform .2s;
}
body.bulcom-ds-popup.bulcom-dpopup-open .bulcom-delivery-slot { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%); }
.bulcom-dpopup__backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 99999; opacity: 0; visibility: hidden; transition: opacity .2s; }
body.bulcom-dpopup-open .bulcom-dpopup__backdrop { opacity: 1; visibility: visible; }
.bulcom-dpopup__close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; background: transparent; font-size: 19px; line-height: 1; color: var(--bulcom-muted); cursor: pointer; }
.bulcom-dpopup__close:hover { color: var(--bulcom-ink, #1e293b); }
.bulcom-dpopup__done { width: 100%; margin-top: 14px; background: var(--bulcom-accent, #2563eb); color: #fff; border: 0; border-radius: 10px; padding: 12px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }

@media (max-width: 600px) {
	body.bulcom-ds-popup .bulcom-delivery-slot { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; transform: translateY(100%); }
	body.bulcom-ds-popup.bulcom-dpopup-open .bulcom-delivery-slot { transform: translateY(0); }
}
