/**
 * Know-how B2B rules — frontend.
 *
 * Colours mirror the live product page (blue section header, white card,
 * amber nudge). Everything is a custom property so the theme can retune it
 * without overriding rules.
 */

.kbr-order,
.kbr-order .kbr-form {
	box-sizing: border-box;
	width: 100%;
}

.kbr-order {
	--kbr-accent: #334eac;
	--kbr-accent-ink: #fff;
	--kbr-card: #fff;
	--kbr-border: #334eac38;
	--kbr-ink: #15192b;
	--kbr-muted: #8a8f9c;
	--kbr-nudge-bg: #fef3c7;
	--kbr-nudge-border: #fde68a;
	--kbr-radius: 18px;

	background: none;
	border: 0;
	color: var(--kbr-ink);
	margin: 0 0 1.5rem;
}

.kbr-order__head {
	background: var(--kbr-accent);
	color: var(--kbr-accent-ink);
	font-weight: 700;
	padding: 0.85rem 1.1rem;
}

.kbr-order__body {
	padding: 1.1rem;
}

.kbr-order__meta {
	color: var(--kbr-muted);
	font-size: 13.5px;
	font-weight: 700;
	margin: 0 0 14px;
	font-size: 12.5px;
	font-weight: 400;
}

.kbr-order__meta strong {
	color: var(--kbr-ink);
	margin-right: 8px;
}

.kbr-sep {
	color: var(--kbr-border);
}

.kbr-table {
	border-collapse: collapse;
	width: 100%;
}

.kbr-table th,
.kbr-table td {
	border: 0;
	border-bottom: 1px solid var(--kbr-border);
	box-shadow: none;
	padding: 6px;
	text-align: left;
	vertical-align: middle;
}

.kbr-table thead th {
	color: var(--kbr-muted);
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 0 6px 8px;
	font-size: 11px;
	font-weight: 700;
}

.kbr-table tbody tr:last-child th,
.kbr-table tbody tr:last-child td {
	border-bottom: 0;
}

.kbr-table__right {
	text-align: right;
}

.kbr-table__stock {
	color: var(--kbr-muted);
	font-size: 0.88rem;
}

.kbr-table__term {
	font-weight: 600;
}

.kbr-table__rowtotal small {
	color: var(--kbr-muted);
	display: block;
	font-size: 11.5px;
	font-weight: 400;
}

.kbr-table-scroll {
	overflow-x: auto;
}

.kbr-swatch {
	border: 1px solid rgba(0, 0, 0, 0.22);
	border-radius: 50%;
	display: inline-block;
	height: 16px;
	margin-right: 0.5rem;
	vertical-align: middle;
	width: 16px;
}

.kbr-swatch--image {
	background-position: center;
	background-size: cover;
}

.kbr-stepper {
	align-items: stretch;
	border: 1px solid var(--kbr-border);
	border-radius: 100px;
	display: inline-flex;
	overflow: hidden;
	height: 38px;
}

.kbr-stepper__btn {
	background: transparent;
	border: 0;
	color: var(--kbr-muted);
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 0.45rem 0.7rem;
}

.kbr-stepper__btn:hover {
	background: #f4f6fb;
	color: var(--kbr-ink);
}

.kbr-qty {
	-moz-appearance: textfield;
	border: 0;
	font-weight: 700;
	max-width: 52px;
	padding: 0.4rem 0.2rem;
	text-align: center;
	width: 52px;
	font-size: 14px;
}

.kbr-qty::-webkit-outer-spin-button,
.kbr-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.kbr-qty--cell {
	border: 1px solid var(--kbr-border);
	border-radius: 8px;
	width: 3.75rem;
}

.kbr-qty:focus-visible,
.kbr-stepper__btn:focus-visible,
.kbr-add:focus-visible {
	outline: 2px solid var(--kbr-accent);
	outline-offset: 1px;
}

.kbr-cell-empty {
	color: var(--kbr-border);
}

.kbr-simple {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
}

.kbr-simple__prices {
	display: flex;
	flex-direction: column;
	text-align: right;
}

.kbr-simple__stock {
	color: var(--kbr-muted);
	font-size: 0.88rem;
}

.kbr-simple__subtotal {
	font-weight: 700;
}

.kbr-total {
	align-items: baseline;
	border-top: 2px solid #15192b;
	display: flex;
	font-weight: 700;
	gap: 0.6rem;
	margin-top: 0.4rem;
	padding-top: 0.75rem;
}

.kbr-total__qty {
	color: var(--kbr-muted);
	font-size: 0.88rem;
	font-weight: 400;
}

.kbr-total__price {
	margin-left: auto;
}

.kbr-nudge {
	background: var(--kbr-nudge-bg);
	border: 1px solid var(--kbr-nudge-border);
	border-radius: 12px;
	font-size: 13.5px;
	margin: 14px 0 0;
	padding: 0.7rem 0.9rem;
	color: #713f12;
	line-height: 1.4;
	padding: 10px 14px;
}

.kbr-notice {
	color: #a3262b;
	font-size: 0.92rem;
	margin: 0.75rem 0 0;
}

.kbr-actions {
	align-items: center;
	display: flex;
	gap: 1rem;
	margin-top: 1rem;
	flex-wrap: wrap;
}

.kbr-add[disabled] {
	cursor: not-allowed;
	opacity: 0.55;
}

.kbr-cart-link {
	font-size: 0.92rem;
}

@media (max-width: 600px) {
	.kbr-table--list thead {
		display: none;
	}

	.kbr-table--list tbody tr {
		border-bottom: 1px solid var(--kbr-border);
		display: grid;
		gap: 0.25rem 0.75rem;
		grid-template-columns: 1fr auto;
		padding: 0.6rem 0;
	}

	.kbr-table--list tbody th,
	.kbr-table--list tbody td {
		border: 0;
		padding: 0;
	}

	.kbr-table--list tbody td:last-child {
		text-align: right;
	}
}

.kbr-notice--success {
	color: #1f7a3d;
}

.kbr-notice--warning {
	color: #8a6100;
}

.kbr-table--grid tbody td,
.kbr-table--grid thead th {
	text-align: center !important;
}

.kbr-table--grid tbody td:first-child,
.kbr-table--grid thead th:first-child {
	text-align: left !important;
}

.kbr-table--grid tbody td:last-child,
.kbr-table--grid thead th:last-child {
	text-align: right !important;
}

.kbr-order .kbr-table tbody th {
	text-wrap: nowrap;
}

.kbr-qty--cell {
	width: 100%;
	max-width: 100%;
	border-top: 1px solid #e6e6e9;
}

.kbr-table__rowtotal {
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 0 6px 8px !important;
	font-size: 13.5px;
	font-weight: 700;
}

/* --- Sections ----------------------------------------------------------- */

.kbr-section {
	background: var(--kbr-card);
	border: 1.5px solid var(--kbr-border);
	border-radius: var(--kbr-radius);
	box-sizing: border-box;
	margin: 0 0 1rem;
	overflow: hidden;
	width: 100%;
}

.kbr-section__head {
	align-items: center;
	background: var(--kbr-accent);
	color: var(--kbr-accent-ink);
	display: flex;
	gap: 0.7rem;
	padding: 0.85rem 1.1rem;
}

.kbr-section__badge {
	align-items: center;
	background: var(--kbr-accent-ink);
	border-radius: 50%;
	color: var(--kbr-accent);
	display: inline-flex;
	flex: 0 0 auto;
	font-size: 12.5px;
	font-weight: 700;
	height: 26px;
	justify-content: center;
	width: 26px;
}

.kbr-section__title {
	color: inherit;
	margin: 0;
	font-size: 15.5px;
	font-weight: 700;
}

.kbr-section__meta {
	font-size: 0.82rem;
	margin-left: auto;
	opacity: 0.85;
}

.kbr-section__body {
	padding: 22px 26px 24px;
}

@media (max-width: 768px) {
	.kbr-section__body {
		padding: 16px 10px 18px;
	}
}

.wapf-field-container {
  padding: 0 5px 0px 5px !important;
}

.wapf-wrapper {
  margin: 0 0 0px -5px !important;
}

/* --- Summary (section 3) ------------------------------------------------ */

.kbr-summary {
	background: #fffaf3;
	border-radius: 14px;
	padding: 16px;
}

.kbr-summary__lines {
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
}

.kbr-summary__line {
	align-items: baseline;
	display: flex;
	gap: 0.5rem;
	padding: 0.2rem 0;
	font-size: 13.5px;
}

.kbr-summary__meta {
	color: var(--kbr-muted);
	font-size: 0.85rem;
}

.kbr-summary__amount {
	margin-left: auto;
	white-space: nowrap;
}

.kbr-summary__empty {
	color: var(--kbr-muted);
	font-size: 0.9rem;
}

.kbr-summary__total {
	align-items: baseline;
	border-top: 1px solid var(--kbr-border);
	display: flex;
	font-weight: 700;
	padding-top: 0.7rem;
}

.kbr-summary__total-label {
	font-size: 15px;
}

.kbr-summary__total-value {
	color: var(--kbr-accent);
	font-size: 24px;
	font-weight: 800;
	margin-left: auto;
}

.kbr-summary__unit {
	color: var(--kbr-muted);
	display: flex;
	font-size: 0.88rem;
	padding-top: 0.25rem;
	font-size: 12.5px;
}

.kbr-summary__unit span:last-child {
	margin-left: auto;
}

.kbr-summary__note {
	color: var(--kbr-muted);
	font-size: 0.78rem;
	margin: 0.6rem 0 0;
}

/* --- Personalisation (section 2) ---------------------------------------- */
/* Skins the add-ons plugin's own markup. Selectors are grouped per plugin so a
   swap only touches this block. */

.kbr-addons .wapf-field-container+.wapf-field-container {
	margin-top: 1rem;
}

.kbr-addons .wapf-field-label label {
	color: var(--kbr-muted);
	font-size: 0.85rem;
	font-weight: 600;
}

/* Only the technique group's own heading is hidden — the section header already
   says "Personalizacija", so "Tehnika" above the radios is noise. Every other
   field keeps its label: the upload needs "Naložite logotip", and a text field
   needs "Pozicija logotipa" to mean anything. */
.kbr-addons .wapf-field-radio > .wapf-field-label label {
	display: none !important;
}

.kbr-addons .wapf-checkable {
	border: 1px solid var(--kbr-border);
	border-radius: 10px;
	margin-bottom: 0.5rem;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.kbr-addons .wapf-checkable:hover {
	border-color: #c9d2ea;
}

.kbr-addons .wapf-checkable.wapf-checked {
	background: #eef2ff;
	border-color: var(--kbr-accent);
}

.kbr-addons .wapf-input-label {
	align-items: center;
	cursor: pointer;
	display: flex;
	gap: 0.7rem;
	margin: 0;
	padding: 0.7rem 0.9rem;
}

.kbr-addons .wapf-label-text {
	flex: 1 1 auto;
	font-weight: 600;
	font-size: 14px;
}

.wapf input[type="checkbox"],
.wapf input[type="radio"] {
	margin-top: 0px;
	width: 18px !important;
	height: 18px !important;
	accent-color: #334eac !important;
}

/* The store writes "priprava 25,00 € enkratno" into the label; the bracketed
   amount is the per-unit price, pushed right as in the design. */
.kbr-addons .wapf-pricing-hint {
	color: var(--kbr-ink);
	font-weight: 600;
	margin-left: auto;
	white-space: nowrap;
}

.kbr-addons select,
.kbr-addons input[type="text"],
.kbr-addons input[type="number"] {
	border: 1px solid var(--kbr-border);
	border-radius: 8px;
	padding: 0.55rem 0.7rem;
	width: 100%;
}

/* File upload field — rendered as the dashed drop box in the design.
   The plugin gives us a bare <input type="file"> plus a description, so the
   label and description are repositioned around a full-width hit area. */

.kbr-addons .wapf-field-file {
	display: grid;
	grid-template-areas:
		"icon label"
		"icon desc"
		"input input";
	grid-template-columns: auto 1fr;
	padding: 0.85rem 1rem;
	position: relative;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	border: 1.5px dashed #334eac38;
	background: #fffaf3;
	color: #334eac;
	border-radius: 12px;
	padding: 12px 14px !important;
	margin-left: 5px;
	margin-right: 5px;
	margin-top: 0 !important;
}

.label-above .wapf-field-label {
	margin-bottom: 0px !important;
}

.kbr-addons .wapf-field-file:hover,
.kbr-addons .wapf-field-file:focus-within {
	background: #f7f9ff;
	border-color: var(--kbr-accent);
}

/* The upload glyph, drawn rather than shipped as an asset. */
.kbr-addons .wapf-field-file::before {
	content: "";
	width: 18px;
	height: 18px;
	background-color: var(--kbr-accent);

	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M6 10l6-6 6 6'/%3E%3Cpath d='M4 20h16'/%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='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M6 10l6-6 6 6'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E") center / contain no-repeat;

	grid-area: icon;
	align-self: center;
	margin-right: 0.85rem;
}

.kbr-addons .wapf-field-file .wapf-field-label {
	grid-area: label;
}

.kbr-addons .wapf-field-file .wapf-field-label label {
	color: var(--kbr-ink);
	font-weight: 600;
	font-size: 13.5px;
	line-height: 1.25;
}

.kbr-addons .wapf-field-file .wapf-field-description {
	color: var(--kbr-muted);
	font-size: 11.5px;
	grid-area: desc;
}

.kbr-addons .wapf-field-file .wapf-field-input {
	grid-area: input;
}

/* Cover the whole card so anywhere in it opens the file picker, while staying a
   real focusable input rather than a click-forwarding div. */
.kbr-addons .wapf-field-file input[type="file"] {
	cursor: pointer;
	height: 100%;
	left: 0;
	opacity: 0;
	position: absolute;
	top: 0;
	width: 100%;
}

.kbr-addons .wapf-field-file input[type="file"]:focus-visible {
	opacity: 1;
	outline: 2px solid var(--kbr-accent);
}

/* Once a file is chosen the plugin prints its name here. */
.kbr-addons .wapf-field-file .wapf-file-name,
.kbr-addons .wapf-field-file .wapf-uploaded-file {
	color: var(--kbr-ink);
	font-size: 0.85rem;
	font-weight: 600;
	grid-area: input;
	position: relative;
	z-index: 1;
}


/* Themes commonly style table headings with their own borders and backgrounds,
   which showed through as a second line under each colour name. */
.kbr-order .kbr-table,
.kbr-order .kbr-table tr,
.kbr-order .kbr-table thead,
.kbr-order .kbr-table tbody {
	background: none;
	border: 0;
}

.kbr-order .kbr-table tbody th {
	background: none;
	font-weight: 600;
	text-decoration: none;
}

.kbr-order .kbr-table tr {
	font-size: 13.5px;
}


/* The add-ons plugin prints its own Product / Options / Grand totals block.
   It duplicates section 3, is not in the design, and its "Product total" reads
   0,00 € anyway because it prices from a single quantity field. Targeted by its
   real class rather than a wildcard, so an option field that happens to mention
   a total is not hidden with it. */
.kbr-addons .wapf-product-totals {
	/* !important is load-bearing here: the plugin writes style="display: block"
	   onto this element inline and rewrites it whenever it recalculates, so a
	   plain rule loses every time. */
	display: none !important;
}

/* --- Rows with a quantity ---------------------------------------------- */

.kbr-table tbody tr.kbr-row--filled>th,
.kbr-table tbody tr.kbr-row--filled>td {
	background: #334eac0a;
}

/* --- Gated sections ----------------------------------------------------- */
/* Until the order qualifies, the later sections are shown but not usable: the
   shopper can see what is coming without being able to fill it in. The body is
   also marked inert in JS, because blur and pointer-events leave a field
   perfectly reachable by keyboard. */

.kbr-section--locked .kbr-section__head {
	background: #94a1cc;
}

.kbr-section--locked .kbr-section__badge {
	color: #94a1cc;
}

.kbr-section--locked .kbr-section__body > :not([data-kbr-gate-exempt]) {
	filter: blur(3px);
	opacity: 0.55;
	pointer-events: none;
	user-select: none;
}

.kbr-section__meta:empty {
	display: none;
}

@media (prefers-reduced-motion: no-preference) {

	.kbr-section__head,
	.kbr-section__body {
		transition: background-color 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
	}
}

/* --- The quantity notice, now in section 1 ------------------------------ */

.kbr-notice {
	background: #fef2f2;
	border: 1px solid #f3c6c6;
	border-radius: 12px;
	font-size: 13.5px;
	margin: 14px 0 0;
	color: #a3262b;
	line-height: 1.4;
	padding: 10px 14px;
}

.kbr-notice--success {
	background: #e8f6ec;
	border-color: #b8e2c4;
	color: #1f7a3d;
}

.kbr-notice--warning {
	background: var(--kbr-nudge-bg);
	border-color: var(--kbr-nudge-border);
	color: #8a6100;
}

/* --- Reassurance points ------------------------------------------------- */

.kbr-order .buytrust {
	border-top: 1px solid var(--kbr-border);
	display: grid;
	gap: 0.45rem 1.5rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	list-style: none;
	margin: 1rem 0 0;
	padding: 1rem 0 0;
}

.kbr-order .buytrust li {
	align-items: center;
	color: var(--kbr-ink);
	display: flex;
	font-size: 12.5px;
	gap: 6px;
	margin: 0;
}

.kbr-order .buytrust svg {
	color: #1f7a3d;
	flex: 0 0 auto;
}

/* @media (max-width: 520px) {
	.kbr-order .buytrust {
		grid-template-columns: minmax(0, 1fr);
	}
} */

.kbr-add {
	background-color: #16a34a !important;
	color: #fff !important;
	padding: 0 22px !important;
	border: 1px solid #16a34a !important;
	border-radius: 4px !important;
	transition: 0.3s !important;
	font-size: 15.5px !important;
	font-weight: 600 !important;
	letter-spacing: 3% !important;
	text-transform: initial !important;
	height: 50px !important;
	transition: background .15s, transform .15s, box-shadow .15s !important;
	display: inline-flex !important;
	white-space: nowrap !important;
	border-radius: 100px !important;
	justify-content: center !important;
	align-items: center !important;
	gap: 8px !important;
	max-width: unset !important;
	flex: 1;
}

.kbr-add:hover {
	background-color: #15803d !important;
	color: #fff !important;
	border: 1px solid #15803d !important;
	transform: translateY(-1px) !important;
}


.kbr-inquiry-open {
	background-color: #334eac !important;
	border: 1px solid #334eac !important;
	color: #fff !important;
	padding: 0 22px !important;
	border-radius: 4px !important;
	transition: 0.3s !important;
	font-size: 15.5px !important;
	font-weight: 600 !important;
	letter-spacing: 3% !important;
	text-transform: initial !important;
	height: 50px !important;
	transition: background .15s, transform .15s, box-shadow .15s !important;
	display: inline-flex !important;
	white-space: nowrap !important;
	border-radius: 100px !important;
	justify-content: center !important;
	align-items: center !important;
	gap: 8px !important;
	max-width: unset !important;
	flex: 1;
}

.kbr-inquiry-open:hover {
	background-color: #26397f !important;
	border: 1px solid #26397f !important;
	color: #fff !important;
	transform: translateY(-1px) !important;
}

/* --- Buyable vs unbuyable state (Add to Cart disabled) ------------------- */
/* .kbr-order--unbuyable is toggled by the frontend script whenever Add to Cart
   is unavailable — an out-of-stock row with a quantity. It drives all three
   swaps below, so the button, the links and the note can never disagree. */

/* Hide Add to Cart entirely when it cannot be used. */
.kbr-order--unbuyable [data-kbr-add] {
	display: none !important;
}

/* The "in-stock items" link and the reassurance note are mutually exclusive.
   Styling is the store's; only the show/hide is driven by the state class. */
.buy__hurry {
	display: none;
}

.kbr-order--unbuyable .buy__hurry {
	color: #4b5060;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	font-size: 13px;
	display: flex;
	text-decoration: none;
}

.buy__hurry b {
	color: #334eac;
}

.kbr-order--unbuyable .buy__cta-note {
	display: none;
}

.buy__cta-note {
	text-align: center;
	color: #8a8f9c;
	font-size: 12px;
	margin-top: 10px;
}

/* When Add to Cart is out, the inquiry button turns green — it is now the
   primary action. Reverts by itself when the state class is gone. */
.kbr-order--unbuyable .kbr-inquiry-open {
	background: #16a34a;
}

/* WooCommerce's "View cart" link appears beside the button after an AJAX add.
   Both layouts already offer their own cart link, so this one is duplication. */
.woocommerce a.added_to_cart {
	display: none;
}
