/* =============================================================
   Offertlista för WooCommerce – Stylesheet
   ============================================================= */

/* ---------------------------------------------------------------
   1. Hide native WooCommerce add-to-cart button on single pages.
   Only applied when body has .offertlista-active (added by PHP
   when our hooks are running for the current visitor).
   --------------------------------------------------------------- */
.offertlista-active.single-product form.cart .single_add_to_cart_button,
.offertlista-active.single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button {
	display: none !important;
}

/* ---------------------------------------------------------------
   2. "Lägg till" button on single product pages
   --------------------------------------------------------------- */
.offertlista-single-wrap {
	margin-top: 12px;
}

.offertlista-single-wrap .offertlista-add-to-list {
	width: 100%;
}

/* ---------------------------------------------------------------
   3. Feedback notices
   --------------------------------------------------------------- */
.offertlista-notice {
	display: none;
	margin-top: 8px;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 0.875em;
	line-height: 1.4;
}

.offertlista-notice--success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.offertlista-notice--error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Floating notice for loop buttons */
.offertlista-notice--floating {
	display: inline-block;
	position: absolute;
	z-index: 100;
	white-space: nowrap;
	margin-top: 4px;
	left: 0;
}

/* Brief visual on button after add */
.offertlista-btn--added {
	opacity: 0.7;
	transition: opacity 0.3s ease;
}

/* ---------------------------------------------------------------
   4. Offertlista page layout
   --------------------------------------------------------------- */
#offertlista-container {
	display: flex;
	gap: 48px;
	align-items: flex-start;
}

#offertlista-list-section {
	flex: 1 1 55%;
	min-width: 0;
}

#offertlista-form-section {
	flex: 1 1 40%;
	min-width: 280px;
}

/* Responsive – stack on small screens */
@media ( max-width: 767px ) {
	#offertlista-container {
		flex-direction: column;
		gap: 32px;
	}

	#offertlista-list-section,
	#offertlista-form-section {
		flex: none;
		width: 100%;
	}
}

/* ---------------------------------------------------------------
   5. Empty state
   --------------------------------------------------------------- */
.offertlista-empty {
	padding: 24px 0;
	color: #666;
	font-style: italic;
}

/* ---------------------------------------------------------------
   6. Product table
   --------------------------------------------------------------- */
.offertlista-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
}

.offertlista-table th {
	text-align: left;
	padding: 8px 12px;
	border-bottom: 2px solid #ddd;
	font-weight: 600;
	font-size: 0.875em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #333;
}

.offertlista-table td {
	padding: 12px 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.offertlista-row:last-child td {
	border-bottom: none;
}

/* Product cell */
.offertlista-product-cell {
	display: flex;
	align-items: center;
	gap: 12px;
}

.offertlista-product-img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	flex-shrink: 0;
	border: 1px solid #eee;
	border-radius: 4px;
}

.offertlista-no-img {
	width: 64px;
	height: 64px;
	background: #f5f5f5;
	border-radius: 4px;
}

.offertlista-product-name {
	font-size: 0.9375em;
	line-height: 1.4;
}

/* ---------------------------------------------------------------
   7. Remove button
   --------------------------------------------------------------- */
.offertlista-remove-item {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.5em;
	color: #aaa;
	padding: 4px 8px;
	line-height: 1;
	transition: color 0.2s;
	flex-shrink: 0;
	min-width: 32px;
	min-height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.offertlista-remove-item:hover {
	color: #c00;
}

/* ---------------------------------------------------------------
   8. Qty controls
   --------------------------------------------------------------- */
.offertlista-qty-cell {
	width: 140px;
}

.offertlista-qty-wrap {
	display: flex;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	width: fit-content;
}

.offertlista-qty-btn {
	background: #f5f5f5;
	border: none;
	cursor: pointer;
	padding: 6px 10px;
	font-size: 1em;
	line-height: 1;
	color: #555;
	transition: background 0.15s;
	flex-shrink: 0;
}

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

.offertlista-qty-input {
	width: 48px;
	text-align: center;
	border: none;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	padding: 6px 4px;
	font-size: 0.9375em;
	-moz-appearance: textfield;
}

.offertlista-qty-input::-webkit-outer-spin-button,
.offertlista-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
}

/* ---------------------------------------------------------------
   9. Update button
   --------------------------------------------------------------- */
.offertlista-update-btn {
	margin-top: 4px;
}

.offertlista-btn--updated {
	opacity: 0.8;
}

/* ---------------------------------------------------------------
   10. Quote request form
   --------------------------------------------------------------- */
#offertlista-form-section h3 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 1.25em;
	font-weight: 600;
}

.offertlista-field {
	margin-bottom: 16px;
}

.offertlista-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	font-size: 0.9375em;
}

.offertlista-field label .required {
	color: #c00;
	margin-left: 2px;
}

.offertlista-field label .optional {
	font-weight: 400;
	color: #888;
	font-size: 0.875em;
}

.offertlista-field input[type="text"],
.offertlista-field input[type="email"],
.offertlista-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.9375em;
	color: #333;
	transition: border-color 0.2s;
}

.offertlista-field input[type="text"]:focus,
.offertlista-field input[type="email"]:focus,
.offertlista-field textarea:focus {
	outline: none;
	border-color: #aaa;
	box-shadow: 0 0 0 2px rgba(0,0,0,0.07);
}

.offertlista-field textarea {
	resize: vertical;
	min-height: 110px;
}

/* Custom file upload */
.offertlista-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
}

.offertlista-file-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.offertlista-file-btn {
	flex-shrink: 0;
	background-color: #f0f0f0 !important;
	border-color: #ccc !important;
	color: #444 !important;
	box-shadow: none !important;
}

.offertlista-file-btn:hover {
	background-color: #e0e0e0 !important;
	border-color: #bbb !important;
	color: #333 !important;
}

.offertlista-file-name {
	font-size: 0.875em;
	color: #666;
	word-break: break-all;
}

.offertlista-submit-row {
	margin-top: 20px;
}

.offertlista-submit-btn {
	width: 100%;
}

/* ---------------------------------------------------------------
   11. Form response / error messages
   --------------------------------------------------------------- */
.offertlista-response {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 4px;
	font-size: 0.9em;
}

.offertlista-response--error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.offertlista-response--success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

/* ---------------------------------------------------------------
   12. Success message (post-submit)
   --------------------------------------------------------------- */
.offertlista-success {
	padding: 24px 28px;
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	border-radius: 6px;
	font-size: 1.05em;
	line-height: 1.6;
}
