/* =====================================================================
   FullRack — Invoice Builder (quote basket)
   Reuses the main design tokens; adds a two-column document layout
   ===================================================================== */

.fr-iq {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	gap: 1.75rem;
	align-items: start;
}

@media (max-width: 1080px) {
	.fr-iq { grid-template-columns: 1fr; }
	.fr-iq__side { order: -1; }
	.fr-iq-sticky { position: static !important; }
}

.fr-iq__main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

/* ---------- Cards ---------- */
.fr-iq-card {
	background: var(--raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
}
.fr-iq-card__hd {
	padding: 1.2rem 1.4rem;
	border-bottom: 1px solid var(--line);
	background: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent);
}
.fr-iq-card__hd h2 {
	margin: 0 0 .25rem;
	font-size: 1.15rem;
	letter-spacing: -.02em;
}
.fr-iq-card__hd p {
	margin: 0;
	font-size: .82rem;
	color: var(--muted);
}

/* ---------- Toolbar ---------- */
.fr-iq-toolbar {
	display: flex;
	gap: .6rem;
	padding: 1rem 1.4rem;
	border-bottom: 1px solid var(--line);
	flex-wrap: wrap;
}
.fr-iq-input {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--line);
	color: var(--text);
	padding: .65rem .85rem;
	border-radius: var(--radius-sm);
	font-family: inherit;
	font-size: .9rem;
	transition: border-color .15s, box-shadow .15s;
}
.fr-iq-input::placeholder { color: #4a5566; }
.fr-iq-input:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px var(--brand-glow);
}
.fr-iq-toolbar input[type="search"] { flex: 2; min-width: 200px; }
.fr-iq-toolbar select {
	flex: 1;
	min-width: 160px;
	background: var(--surface)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%238b98a9' stroke-width='1.5' d='m3 5 3 3 3-3'/%3E%3C/svg%3E")
		no-repeat;
	background-position: left .7rem center;
	background-size: 12px;
	border: 1px solid var(--line);
	color: var(--text);
	padding: .65rem 2rem .65rem .85rem;
	border-radius: var(--radius-sm);
	font-family: inherit;
	font-size: .88rem;
	appearance: none;
}
.fr-iq-toolbar select:focus { outline: none; border-color: var(--brand); }
.fr-iq-toolbar select option { background: var(--surface); color: var(--text); }

/* ---------- Product results ---------- */
.fr-iq-results {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: .7rem;
	padding: 1.1rem 1.4rem 1.4rem;
	max-height: 560px;
	overflow-y: auto;
}
.fr-iq-item {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: .85rem .9rem;
	text-align: start;
	transition: all .18s var(--ease);
	position: relative;
}
.fr-iq-item:hover { border-color: var(--brand); transform: translateY(-2px); }
.fr-iq-item.is-added { border-color: var(--brand); background: rgba(0, 229, 160, .06); }
.fr-iq-item__top { display: flex; align-items: flex-start; gap: .6rem; }
.fr-iq-item__thumb {
	width: 42px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 5px;
	background: var(--raised);
	border: 1px solid var(--line);
	object-fit: contain;
	padding: .25rem;
}
.fr-iq-item__thumb--ph { display: grid; place-items: center; color: #37465a; }
.fr-iq-item__title {
	font-size: .84rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.fr-iq-item__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	font-size: .72rem;
	color: var(--muted);
}
.fr-iq-item__sku { font-family: ui-monospace, Menlo, monospace; font-size: .68rem; }
.fr-iq-item__stock { color: var(--brand); }
.fr-iq-item__stock.is-low { color: var(--amber); }
.fr-iq-item__add {
	margin-top: .2rem;
	width: 100%;
	padding: .45rem;
	border-radius: 5px;
	border: 1px solid var(--line);
	background: var(--raised);
	color: var(--muted);
	font-family: inherit;
	font-size: .78rem;
	font-weight: 700;
	transition: all .15s;
}
.fr-iq-item:hover .fr-iq-item__add { border-color: var(--brand); color: var(--brand); }
.fr-iq-item.is-added .fr-iq-item__add { background: var(--brand); border-color: var(--brand); color: #04140e; }

.fr-iq-none { grid-column: 1 / -1; padding: 2.5rem 1rem; text-align: center; color: var(--muted); font-size: .88rem; }

/* ---------- Contact form ---------- */
.fr-iq-form { padding: 1.2rem 1.4rem 1.4rem; }
.fr-iq-grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: .9rem;
}
.fr-iq-field { display: flex; flex-direction: column; gap: .35rem; }
.fr-iq-field--full { grid-column: 1 / -1; }
.fr-iq-field label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.fr-iq-field label em { font-style: normal; color: var(--danger); }
.fr-iq-field textarea.fr-iq-input { resize: vertical; min-height: 80px; }

/* ---------- Sheet / summary ---------- */
.fr-iq-sticky { position: sticky; top: calc(var(--header-h) + 20px); }

.fr-iq-sheet {
	background: var(--raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	max-height: calc(100vh - var(--header-h) - 40px);
	display: flex;
	flex-direction: column;
}
.fr-iq-sheet__hd {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .6rem;
	padding: 1rem 1.2rem;
	border-bottom: 1px solid var(--line);
	background: #0a0f15;
}
.fr-iq-sheet__brand {
	display: block;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--text);
}
.fr-iq-sheet__title {
	display: block;
	font-size: .7rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--brand);
	font-family: ui-monospace, Menlo, monospace;
}
.fr-iq-sheet__clear {
	background: none;
	border: 0;
	color: var(--muted);
	font-family: inherit;
	font-size: .74rem;
	text-decoration: underline;
	cursor: pointer;
}
.fr-iq-sheet__clear:hover { color: var(--danger); }

.fr-iq-lines {
	flex: 1;
	overflow-y: auto;
	padding: .5rem 1.2rem;
	min-height: 120px;
}
.fr-iq-empty {
	text-align: center;
	color: #4a5566;
	font-size: .82rem;
	padding: 2rem .5rem;
	margin: 0;
}

.fr-iq-line {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: .3rem .7rem;
	padding: .7rem 0;
	border-bottom: 1px dashed var(--line);
}
.fr-iq-line:last-child { border-bottom: 0; }
.fr-iq-line__title {
	font-size: .82rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--text);
}
.fr-iq-line__title a { color: inherit; }
.fr-iq-line__title a:hover { color: var(--brand); }
.fr-iq-line__price {
	font-size: .78rem;
	font-family: ui-monospace, Menlo, monospace;
	color: var(--brand);
	white-space: nowrap;
	align-self: center;
}
.fr-iq-line__ctrl {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: .5rem;
	flex-wrap: wrap;
}
.fr-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--line);
	border-radius: 5px;
	overflow: hidden;
	background: var(--surface);
}
.fr-qty button {
	background: none;
	border: 0;
	color: var(--text);
	width: 26px;
	height: 28px;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: background .15s;
}
.fr-qty button:hover { background: var(--raised-2); color: var(--brand); }
.fr-qty input {
	width: 42px;
	background: none;
	border: 0;
	border-inline: 1px solid var(--line);
	color: var(--text);
	text-align: center;
	font-family: inherit;
	font-size: .82rem;
	padding: .3rem 0;
	-moz-appearance: textfield;
}
.fr-qty input::-webkit-outer-spin-button,
.fr-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fr-qty input:focus { outline: none; background: var(--raised-2); }
.fr-iq-line__sum {
	margin-inline-start: auto;
	font-size: .78rem;
	font-family: ui-monospace, Menlo, monospace;
	color: var(--muted);
}
.fr-iq-line__del {
	background: none;
	border: 0;
	color: #4a5566;
	cursor: pointer;
	font-size: .95rem;
	line-height: 1;
	padding: .2rem .3rem;
	border-radius: 4px;
}
.fr-iq-line__del:hover { color: var(--danger); background: rgba(255, 92, 92, .1); }

.fr-iq-totals {
	padding: .8rem 1.2rem;
	border-top: 1px solid var(--line);
	background: #0a0f15;
}
.fr-iq-total-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: .25rem 0;
	font-size: .82rem;
	color: var(--muted);
}
.fr-iq-total-row b {
	color: var(--text);
	font-family: ui-monospace, Menlo, monospace;
	font-size: .85rem;
}
.fr-iq-total-row em { font-style: normal; color: var(--brand); font-weight: 700; }
.fr-iq-total-row--discount b { color: var(--brand); }
.fr-iq-total-row--discount[hidden] { display: none; }
.fr-iq-total-row--grand {
	border-top: 1px solid var(--line);
	margin-top: .5rem;
	padding-top: .6rem;
	font-weight: 700;
	color: var(--text);
}
.fr-iq-total-row--grand b { color: var(--brand); font-size: 1.05rem; font-weight: 800; }

.fr-iq-foot {
	padding: 1rem 1.2rem 1.2rem;
	border-top: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	gap: .45rem;
}
.fr-iq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--line);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: .65rem 1rem;
	font-family: inherit;
	font-size: .85rem;
	font-weight: 700;
	cursor: pointer;
	transition: all .18s var(--ease);
	text-decoration: none;
}
.fr-iq-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.fr-iq-btn--primary { background: var(--brand); border-color: var(--brand); color: #04140e; }
.fr-iq-btn--primary:hover { background: #2ff0b4; border-color: #2ff0b4; color: #04140e; }
.fr-iq-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.fr-iq-note {
	margin: .5rem 0 0;
	font-size: .7rem;
	color: #4a5566;
	line-height: 1.7;
	text-align: center;
}

/* ---------- Quote paper (saved quote page) ---------- */
.fr-iq-paper {
	background: var(--raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: clamp(1.4rem, 4vw, 2.6rem);
	margin-top: 2rem;
}
.fr-iq-paper__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding-bottom: 1.2rem;
	margin-bottom: 1.2rem;
	border-bottom: 2px solid var(--brand);
}
.fr-iq-paper__head h2 { margin: 0 0 .2rem; font-size: 1.5rem; }
.fr-iq-paper__code {
	font-family: ui-monospace, Menlo, monospace;
	font-size: .76rem;
	color: var(--muted);
}
.fr-iq-paper__head time { font-size: .82rem; color: var(--muted); }

.fr-iq-paper__party {
	width: 100%;
	margin-bottom: 1.5rem;
	font-size: .85rem;
	border-collapse: collapse;
}
.fr-iq-paper__party th {
	text-align: start;
	color: var(--muted);
	font-weight: 600;
	width: 130px;
	padding: .3rem .5rem .3rem 0;
	vertical-align: top;
}
.fr-iq-paper__party td { padding: .3rem 0; color: var(--text); }

.fr-iq-paper__table {
	width: 100%;
	border-collapse: collapse;
	font-size: .85rem;
	margin-bottom: 1.5rem;
}
.fr-iq-paper__table th {
	background: var(--surface);
	color: var(--muted);
	font-weight: 700;
	font-size: .78rem;
	text-align: start;
	padding: .7rem .6rem;
	border: 1px solid var(--line);
	white-space: nowrap;
}
.fr-iq-paper__table td {
	padding: .7rem .6rem;
	border: 1px solid var(--line);
	color: var(--text);
	vertical-align: top;
}
.fr-iq-paper__table td:nth-child(n + 3),
.fr-iq-paper__table th:nth-child(n + 3),
.fr-iq-paper__table tfoot td { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; white-space: nowrap; }
.fr-iq-paper__table a { color: var(--text); }
.fr-iq-paper__table a:hover { color: var(--brand); }

.fr-iq-paper__table tfoot td {
	background: var(--surface);
	font-weight: 700;
	color: var(--text);
	border: 1px solid var(--line);
	text-align: left;
}
.fr-iq-paper__table tfoot td:last-child { text-align: left; font-weight: 800; }
.fr-iq-paper__table tfoot tr.is-disc td { color: var(--brand); }
.fr-iq-paper__table tfoot tr.is-total td {
	background: rgba(0, 229, 160, .08);
	border-color: rgba(0, 229, 160, .3);
	color: var(--brand);
	font-size: 1rem;
	font-weight: 800;
}

.fr-iq-paper__foot { display: flex; flex-wrap: wrap; gap: .6rem; }
.fr-iq-paper__foot .fr-iq-btn { width: auto; }

/* ---------- Print ---------- */
@media print {
	.fr-header, .fr-footer, .fr-topbar, .fr-mobile-bar,
	.fr-iq__main, .fr-iq__side, .fr-article, .fr-page-hero,
	.fr-iq-paper__foot { display: none !important; }
	body { background: #fff; color: #000; }
	.fr-iq-paper {
		border: 0;
		background: #fff;
		color: #000;
		margin: 0;
		padding: 0;
	}
	.fr-iq-paper h2,
	.fr-iq-paper__table a,
	.fr-iq-paper__party td { color: #000 !important; }
	.fr-iq-paper__table th,
	.fr-iq-paper__table td,
	.fr-iq-paper__table tfoot td { border-color: #ccc !important; background: #fff !important; color: #000 !important; }
	.fr-iq-paper__table tfoot tr.is-total td { color: #000 !important; font-weight: 800; }
	.fr-iq-paper__code,
	.fr-iq-paper__head time,
	.fr-iq-paper__party th { color: #444 !important; }
	.fr-iq-paper__head { border-bottom-color: #000 !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.fr-iq-sheet { max-height: none; }
	.fr-iq-lines { max-height: 320px; }
	.fr-iq-results { grid-template-columns: 1fr; max-height: none; padding: 1rem; }
	.fr-iq-toolbar { padding: .9rem 1rem; }
	.fr-iq-form { padding: 1rem; }
	.fr-iq-paper__table { font-size: .75rem; }
	.fr-iq-paper__table th, .fr-iq-paper__table td { padding: .45rem .35rem; }
}