/**
 * CFS Quote Builder — base styles.
 *
 * Intentionally minimal. The active theme is expected to override most
 * visual styling (colours, fonts, spacing). These rules provide a working
 * layout and the toast/badge components that the JS depends on.
 *
 * @package CrescentFireSafety
 */

/* =====================================================================
   Toast notification
   ===================================================================== */

.cfs-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	z-index: 99999;
	padding: 12px 24px;
	background: #1a1a1a;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
	max-width: 90vw;
	text-align: center;
}

.cfs-toast--visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* =====================================================================
   Quote count badge (in header / nav)
   ===================================================================== */

.cfs-quote-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	background: #d32f2f;
	border-radius: 10px;
	vertical-align: super;
}

/* =====================================================================
   Notices (success / error)
   ===================================================================== */

.cfs-quote-notice {
	padding: 16px 20px;
	margin-bottom: 24px;
	border-radius: 4px;
	font-size: 15px;
	line-height: 1.5;
}

.cfs-quote-notice--success {
	background: #e8f5e9;
	border: 1px solid #a5d6a7;
	color: #2e7d32;
}

.cfs-quote-notice--error {
	background: #fbe9e7;
	border: 1px solid #ef9a9a;
	color: #c62828;
}

.cfs-quote-notice ul {
	margin: 0;
	padding: 0 0 0 20px;
}

.cfs-quote-notice li {
	margin-bottom: 4px;
}

/* =====================================================================
   Quote cart table
   ===================================================================== */

.cfs-quote-cart {
	margin-bottom: 32px;
}

.cfs-quote-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 12px;
}

.cfs-quote-table th,
.cfs-quote-table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid #e0e0e0;
}

.cfs-quote-table th {
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #616161;
	background: #fafafa;
}

.cfs-quote-table__product {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* Ensure the product column cells behave as flex in tbody as well. */
.cfs-quote-table td.cfs-quote-table__product {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cfs-quote-thumb {
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
}

.cfs-quote-table__qty {
	width: 120px;
	text-align: center;
}

.cfs-quote-table__actions {
	width: 60px;
	text-align: center;
}

.cfs-quote-table__price {
	width: 140px;
}

.cfs-quote-total {
	font-size: 14px;
	color: #757575;
}

/* =====================================================================
   Quantity controls
   ===================================================================== */

.cfs-qty-control {
	display: inline-flex;
	align-items: center;
	gap: 0;
	border: 1px solid #ccc;
	border-radius: 4px;
	overflow: hidden;
}

.cfs-qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: #f5f5f5;
	color: #333;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
	padding: 0;
}

.cfs-qty-btn:hover {
	background: #e0e0e0;
}

.cfs-qty-btn:active {
	background: #d0d0d0;
}

.cfs-qty-value {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 32px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	background: #fff;
}

/* =====================================================================
   Remove button
   ===================================================================== */

.cfs-remove-from-quote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	color: #d32f2f;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.15s ease;
	padding: 0;
}

.cfs-remove-from-quote:hover {
	background: #fbe9e7;
}

/* =====================================================================
   Quote submission form
   ===================================================================== */

.cfs-quote-form {
	max-width: 600px;
}

.cfs-form-row {
	margin-bottom: 20px;
}

.cfs-form-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 14px;
	color: #333;
}

.cfs-required {
	color: #d32f2f;
	margin-left: 2px;
}

.cfs-optional {
	font-weight: 400;
	font-size: 12px;
	color: #999;
	margin-left: 4px;
}

.cfs-form-input,
.cfs-form-select,
.cfs-form-textarea {
	display: block;
	width: 100%;
	padding: 10px 12px;
	font-size: 15px;
	line-height: 1.5;
	color: #333;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	transition: border-color 0.15s ease;
	box-sizing: border-box;
}

.cfs-form-input:focus,
.cfs-form-select:focus,
.cfs-form-textarea:focus {
	outline: none;
	border-color: #1976d2;
	box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.15);
}

.cfs-form-textarea {
	resize: vertical;
	min-height: 80px;
}

.cfs-form-row--submit {
	margin-top: 28px;
}

/* =====================================================================
   Buttons
   ===================================================================== */

.cfs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.cfs-btn--primary {
	background: #1976d2;
	color: #fff;
}

.cfs-btn--primary:hover {
	background: #1565c0;
}

.cfs-btn--whatsapp {
	background: #25d366;
	color: #fff;
}

.cfs-btn--whatsapp:hover {
	background: #1ebe5d;
}

/* =====================================================================
   Add-to-quote button (on product cards / single product pages)
   ===================================================================== */

.cfs-add-to-quote {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: #1976d2;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s ease;
	text-decoration: none;
}

.cfs-add-to-quote:hover {
	background: #1565c0;
}

.cfs-add-to-quote:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* =====================================================================
   Empty state
   ===================================================================== */

.cfs-quote-empty {
	padding: 40px 20px;
	text-align: center;
	color: #757575;
	font-size: 15px;
}

/* =====================================================================
   Mobile responsive
   ===================================================================== */

@media (max-width: 600px) {
	.cfs-quote-table th,
	.cfs-quote-table td {
		padding: 8px 6px;
		font-size: 13px;
	}

	.cfs-quote-table__price {
		display: none;
	}

	.cfs-quote-table th.cfs-quote-table__price {
		display: none;
	}

	.cfs-qty-btn {
		width: 28px;
		height: 28px;
	}

	.cfs-qty-value {
		min-width: 28px;
		height: 28px;
		font-size: 13px;
	}

	.cfs-quote-thumb {
		width: 36px;
		height: 36px;
	}

	.cfs-quote-form {
		max-width: 100%;
	}

	.cfs-btn {
		width: 100%;
		text-align: center;
	}

	.cfs-toast {
		bottom: 16px;
		left: 12px;
		right: 12px;
		transform: translateY(20px);
		max-width: none;
	}

	.cfs-toast--visible {
		transform: translateY(0);
	}
}
