/* ==========================================================================
   QuoteKit for WooCommerce – Frontend Styles
   All colours/sizes pulled from CSS custom properties set by the plugin.
   ========================================================================== */

/* --------------------------------------------------------------------------
   "Add to quote" button – single product & loop
   -------------------------------------------------------------------------- */
.qk-add-to-quote-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	/* Colors: if --qk-primary is set (custom appearance on), use it; otherwise inherit WC button styles */
	background-color: var(--qk-primary, var(--wc-button-color, #2271b1));
	color: var(--qk-btn-text, #ffffff) !important;
	border: none;
	border-radius: var(--qk-btn-radius, 4px);
	padding: var(--qk-btn-padding, 10px 20px);
	font-family: var(--qk-font, inherit);
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.qk-add-to-quote-btn:hover,
.qk-add-to-quote-btn:focus {
	background-color: var(--qk-btn-hover, #135e96);
	color: var(--qk-btn-text, #ffffff) !important;
	text-decoration: none;
}

.qk-add-to-quote-btn[disabled],
.qk-add-to-quote-btn.disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.qk-add-to-quote-btn.qk-in-list {
	background-color: var(--qk-in-list-bg, #6c757d);
}

.qk-add-to-quote-btn.qk-in-list:hover {
	background-color: var(--qk-in-list-bg-hover, #5a6268);
}

/* Single product wrap keeps qty + button together */
.qk-single-button-wrap {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 1em;
}

.qk-single-button-wrap .quantity {
	margin: 0;
}

/* Update Qty + View Quote pair shown after product is added */
.qk-single-button-group {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 0;
	/* Keeps it vertically centred when form.cart is not a flex container */
	vertical-align: middle;
}

.qk-single-button-group .qk-update-qty-btn,
.qk-single-button-group .qk-go-to-quote-btn {
	margin: 0;
}

/* Space between buttons when injected directly inside form.cart by JS */
.qk-update-qty-btn + .qk-go-to-quote-btn {
	margin-left: 10px;
}

/* --------------------------------------------------------------------------
   Mini widget (floating count badge)
   -------------------------------------------------------------------------- */
.qk-mini-widget {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9999;
	background: var(--qk-primary, #2271b1);
	color: var(--qk-btn-text, #fff);
	border-radius: 50px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
	transition: transform 0.2s ease;
}

.qk-mini-widget:hover {
	transform: translateY(-2px);
}

.qk-mini-widget-link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	color: var(--qk-btn-text, #fff) !important;
	text-decoration: none !important;
	font-family: var(--qk-font, inherit);
	font-size: 0.9em;
	font-weight: 600;
}

.qk-mini-icon {
	font-size: 1.1em;
	line-height: 1;
}

.qk-mini-count {
	background: rgba(255, 255, 255, 0.3);
	border-radius: 20px;
	padding: 1px 8px;
	font-size: 0.85em;
	font-weight: 700;
}

@media (max-width: 480px) {
	.qk-mini-label { display: none; }
	.qk-mini-widget-link { padding: 10px 14px; }
}

/* --------------------------------------------------------------------------
   Quote page layout
   -------------------------------------------------------------------------- */
.qk-quote-page {
	font-family: var(--qk-font, inherit);
}

/* Empty state */
.qk-empty-state {
	text-align: center;
	padding: 40px 20px;
}

.qk-empty-message {
	font-size: 1.1em;
	color: #555;
	margin-bottom: 16px;
}

.qk-back-to-shop {
	display: inline-block;
}

/* Success message */
.qk-success-message {
	background: #d1fae5;
	border-left: 4px solid #10b981;
	color: #065f46;
	padding: 16px 20px;
	border-radius: var(--qk-box-radius, 6px);
	margin: 20px 0;
	font-weight: 500;
}

/* Admin notice (only visible to shop managers) */
.qk-admin-notice {
	background: #fff8e1;
	border-left: 4px solid #f59e0b;
	padding: 14px 18px;
	border-radius: 4px;
	margin: 16px 0;
}

/* --------------------------------------------------------------------------
   Product table
   -------------------------------------------------------------------------- */
.qk-products-table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--qk-font, inherit);
	background: var(--qk-box-bg, #ffffff);
	border: 1px solid var(--qk-table-border, #e2e4e7);
	border-radius: var(--qk-box-radius, 6px);
	overflow: hidden;
	margin-bottom: 16px;
	box-shadow: var(--qk-box-shadow, none);
}

.qk-products-table thead {
	background: var(--qk-th-bg, #f1f2f3);
}

.qk-products-table thead th {
	padding: 12px 14px;
	text-align: left;
	font-weight: 600;
	color: var(--qk-th-text, #333333);
	border-bottom: 2px solid var(--qk-table-border, #e2e4e7);
	font-family: var(--qk-font, inherit);
}

.qk-products-table tbody tr {
	border-bottom: 1px solid var(--qk-table-border, #e2e4e7);
	transition: background 0.15s;
}

.qk-products-table tbody tr:last-child {
	border-bottom: none;
}

.qk-products-table tbody tr:nth-child(even) {
	background: var(--qk-table-stripe, #f8f9fa);
}

.qk-products-table tbody td {
	padding: 12px 14px;
	vertical-align: middle;
	font-family: var(--qk-font, inherit);
}

/* Column: Remove */
.qk-col-remove {
	width: 36px;
	text-align: center;
}

/* Column: Image */
.qk-col-image {
	width: 72px;
}

.qk-col-image img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

/* Column: Name */
.qk-col-name a {
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

.qk-col-name a:hover {
	color: var(--qk-primary, #2271b1);
}

.qk-sku {
	display: block;
	font-size: 0.8em;
	color: #888;
	margin-top: 2px;
}

/* Column: Qty */
.qk-qty-input {
	width: 70px;
	padding: 5px 8px;
	border: 1px solid var(--qk-table-border, #e2e4e7);
	border-radius: 4px;
	text-align: center;
	font-size: 0.95em;
}

/* Remove button */
.qk-remove-item {
	background: none;
	border: none;
	color: #c0392b;
	font-size: 1.2em;
	cursor: pointer;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 4px;
	transition: background 0.15s;
}

.qk-remove-item:hover {
	background: #fde8e8;
}

/* Table actions bar */
.qk-table-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-bottom: 24px;
}

.qk-clear-list {
	color: #c0392b !important;
	border-color: #c0392b !important;
	background: transparent !important;
}

.qk-clear-list:hover {
	background: #c0392b !important;
	color: #fff !important;
}

/* --------------------------------------------------------------------------
   Form section spacing
   -------------------------------------------------------------------------- */
.qk-form-section {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--qk-table-border, #e2e4e7);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
	.qk-col-image,
	.qk-col-sku,
	.qk-col-subtotal {
		display: none;
	}

	.qk-products-table thead th,
	.qk-products-table tbody td {
		padding: 10px 8px;
		font-size: 0.9em;
	}
}
