/* CW Request a Quote — frontend styles */

/* Hide the native WooCommerce add-to-cart button when replacement is active. */
.cw-raq-active form.cart .single_add_to_cart_button {
	display: none !important;
}

.cw-raq-add--done {
	opacity: 0.85;
}

/* Quote count link (header/menu) */
.cw-raq-count {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
}
.cw-raq-count__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: currentColor;
	color: #fff;
	font-size: 12px;
	line-height: 1;
}
.cw-raq-count__badge {
	background: #1d4ed8;
	color: #fff;
}

/* Quote request wrapper */
.cw-raq-wrap {
	margin: 0 0 2rem;
}
.cw-raq-empty {
	font-size: 1.05rem;
}

/* List table */
.cw-raq-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.75rem;
}
.cw-raq-table th,
.cw-raq-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
	vertical-align: middle;
}
.cw-raq-table thead th {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #6b7280;
}
.cw-raq-table__img {
	width: 64px;
}
.cw-raq-table__img img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}
.cw-raq-table__qty {
	width: 90px;
}
.cw-raq-qty {
	width: 70px;
	padding: 6px 8px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
}
.cw-raq-remove {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.4rem;
	line-height: 1;
	color: #9ca3af;
	padding: 0 4px;
}
.cw-raq-remove:hover {
	color: #dc2626;
}

/* Form */
.cw-raq-form__heading {
	margin: 1.5rem 0 0.75rem;
}
.cw-raq-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.25rem;
	margin-bottom: 0.5rem;
}
.cw-raq-field {
	margin: 0;
	display: flex;
	flex-direction: column;
	flex: 1 1 100%;
	min-width: 0;
}
/* Column widths. gap is 1.25rem, so subtract a proportional slice per column. */
.cw-raq-col--full {
	flex-basis: 100%;
}
.cw-raq-col--two-thirds {
	flex-basis: calc( 66.666% - 0.42rem );
}
.cw-raq-col--half {
	flex-basis: calc( 50% - 0.625rem );
}
.cw-raq-col--third {
	flex-basis: calc( 33.333% - 0.834rem );
}
.cw-raq-field--full {
	flex-basis: 100%;
}
.cw-raq-field label {
	font-weight: 600;
	margin-bottom: 0.35rem;
	font-size: 0.95rem;
}
.cw-raq-field input,
.cw-raq-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font: inherit;
}
.cw-raq-field input:focus,
.cw-raq-field textarea:focus {
	outline: none;
	border-color: #1d4ed8;
	box-shadow: 0 0 0 3px rgba( 29, 78, 216, 0.12 );
}
.cw-raq-req {
	color: #dc2626;
}
.cw-raq-submit {
	margin-top: 1.5rem;
}

/* Messages */
.cw-raq-message {
	margin-top: 1rem;
}
.cw-raq-message--success {
	padding: 1rem 1.25rem;
	border-radius: 8px;
	background: #e6f7ec;
	color: #15803d;
	font-weight: 600;
}
.cw-raq-message--error {
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: #fdecea;
	color: #b91c1c;
}

.cw-raq-checkbox {
	flex-direction: row;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}
.cw-raq-checkbox input {
	width: auto;
}

/* ---- Quote modal (cart-style) ---- */
/*
 * NOTE: We intentionally do NOT set `overflow:hidden` on <body> while the modal
 * is open. Optimisation plugins (e.g. FlyingPress "lazy render") wrap below-the-
 * fold sections in `content-visibility:auto`; changing the body scroll root can
 * make those sections collapse to their blank placeholders, i.e. the page looks
 * like it "disappears". A tiny bit of background scroll is a fair trade-off.
 */
.cw-raq-modal[hidden] {
	display: none;
}
.cw-raq-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	justify-content: flex-end;
}
.cw-raq-modal__overlay {
	position: absolute;
	inset: 0;
	background: var( --cw-modal-overlay, rgba( 15, 23, 42, 0.3 ) );
	animation: cw-raq-fade-in 0.22s ease;
}
@keyframes cw-raq-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
.cw-raq-modal__dialog {
	position: relative;
	width: 420px;
	max-width: 100%;
	height: 100%;
	background: #fff;
	box-shadow: -8px 0 30px rgba( 0, 0, 0, 0.15 );
	display: flex;
	flex-direction: column;
	animation: cw-raq-slide-in 0.22s ease;
}
@keyframes cw-raq-slide-in {
	from { transform: translateX( 100% ); }
	to { transform: translateX( 0 ); }
}
.cw-raq-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid #e5e7eb;
}
.cw-raq-modal__title {
	margin: 0;
	font-size: 1.15rem;
}
.cw-raq-modal__close {
	background: none;
	border: none;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 0;
}
.cw-raq-modal__close:hover {
	color: #111827;
}
.cw-raq-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: 12px 22px;
}
.cw-raq-modal__empty {
	padding: 2rem 0;
	color: #6b7280;
	text-align: center;
}
.cw-raq-modal__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.cw-raq-modal__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid #eef0f2;
}
.cw-raq-modal__thumb img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}
.cw-raq-modal__meta {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.cw-raq-modal__name {
	font-weight: 600;
	text-decoration: none;
	color: #111827;
}
.cw-raq-modal__qty {
	font-size: 0.85rem;
	color: #6b7280;
}
.cw-raq-modal__price {
	font-weight: 700;
	white-space: nowrap;
}
.cw-raq-modal__remove {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.3rem;
	line-height: 1;
	color: #9ca3af;
	padding: 0 2px;
}
.cw-raq-modal__remove:hover {
	color: #dc2626;
}
.cw-raq-modal__total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0 8px;
	font-size: 1.05rem;
}
.cw-raq-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 0 8px;
}
.cw-raq-modal__actions .button {
	width: 100%;
	text-align: center;
}
.cw-raq-modal-open {
	cursor: pointer;
}

@media ( max-width: 640px ) {
	.cw-raq-col--full,
	.cw-raq-col--two-thirds,
	.cw-raq-col--half,
	.cw-raq-col--third {
		flex-basis: 100%;
	}
	.cw-raq-modal__dialog {
		width: 100%;
	}
	.cw-raq-table thead {
		display: none;
	}
	.cw-raq-table,
	.cw-raq-table tbody,
	.cw-raq-table tr,
	.cw-raq-table td {
		display: block;
		width: 100%;
	}
	.cw-raq-table tr {
		border-bottom: 1px solid #e5e7eb;
		padding: 8px 0;
	}
	.cw-raq-table td {
		border: none;
		padding: 4px 0;
	}
}

/* =====================================================================
 * Theme-agnostic button styling.
 * The plugin's buttons often carry the theme "button" class or are plain
 * <button>/<a> elements, so page builders (Elementor, etc.) inject their own
 * idle/hover/active/focus styles. This layer resets those and defines our own
 * states. !important is used deliberately to win against high-specificity
 * builder rules regardless of the active theme.
 * ===================================================================== */

/* Shared reset for every interactive control the plugin renders. */
.cw-raq-add,
.cw-raq-add--single,
.cw-raq-add--link,
.cw-raq-submit-btn,
.cw-raq-modal-open,
.cw-raq-modal__cta,
.cw-raq-modal__continue,
.cw-raq-modal__close,
.cw-raq-remove,
.cw-raq-modal__remove,
.cw-raq-count {
	-webkit-appearance: none !important;
	appearance: none !important;
	margin: 0;
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	transform: none !important;
	outline: none !important;
	min-height: 0 !important;
	width: auto;
	font-family: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease,
		color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease !important;
}

/* --- Primary (solid) buttons --- */
.cw-raq-add,
.cw-raq-add--single,
.cw-raq-add--link,
.cw-raq-submit-btn,
.cw-raq-modal__cta {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px !important;
	border: 1px solid transparent !important;
	border-radius: var( --cw-btn-radius, 8px ) !important;
	background-color: var( --cw-btn-primary-bg, #1d4ed8 ) !important;
	color: var( --cw-btn-primary-text, #ffffff ) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
}
.cw-raq-add:hover,
.cw-raq-add--single:hover,
.cw-raq-add--link:hover,
.cw-raq-submit-btn:hover,
.cw-raq-modal__cta:hover,
.cw-raq-add:focus,
.cw-raq-add--single:focus,
.cw-raq-add--link:focus,
.cw-raq-submit-btn:focus,
.cw-raq-modal__cta:focus,
.cw-raq-add--link:visited,
.cw-raq-modal__cta:visited {
	background-color: var( --cw-btn-primary-bg-hover, #1a44bd ) !important;
	color: var( --cw-btn-primary-text, #ffffff ) !important;
	border-color: transparent !important;
}
.cw-raq-add:active,
.cw-raq-add--single:active,
.cw-raq-add--link:active,
.cw-raq-submit-btn:active,
.cw-raq-modal__cta:active {
	background-color: var( --cw-btn-primary-bg-active, #163a9f ) !important;
}
.cw-raq-add:focus-visible,
.cw-raq-add--single:focus-visible,
.cw-raq-submit-btn:focus-visible,
.cw-raq-modal__cta:focus-visible {
	box-shadow: 0 0 0 3px var( --cw-btn-ring, rgba( 29, 78, 216, 0.35 ) ) !important;
}
.cw-raq-add:disabled,
.cw-raq-add--single:disabled,
.cw-raq-submit-btn:disabled {
	opacity: 0.6 !important;
	cursor: default;
}
.cw-raq-add--done,
.cw-raq-add--done:hover {
	background-color: #15803d !important;
	opacity: 1 !important;
}

/* --- Secondary (outline) button: "Fortsätt handla" --- */
.cw-raq-modal__continue {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 12px 18px !important;
	border: 1px solid var( --cw-btn-secondary-border, #d1d5db ) !important;
	border-radius: var( --cw-btn-radius, 8px ) !important;
	background-color: var( --cw-btn-secondary-bg, #ffffff ) !important;
	color: var( --cw-btn-secondary-text, #1f2937 ) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
}
.cw-raq-modal__continue:hover,
.cw-raq-modal__continue:focus {
	background-color: var( --cw-btn-secondary-bg-hover, #f3f4f6 ) !important;
	color: var( --cw-btn-secondary-text, #111827 ) !important;
	border-color: var( --cw-btn-secondary-border-hover, #cbd2da ) !important;
}
.cw-raq-modal__continue:focus-visible {
	box-shadow: 0 0 0 3px var( --cw-btn-ring, rgba( 29, 78, 216, 0.2 ) ) !important;
}

/* --- Icon buttons: remove (×) and modal close --- */
.cw-raq-remove,
.cw-raq-modal__remove,
.cw-raq-modal__close {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 2px 6px !important;
	border: none !important;
	border-radius: 6px !important;
	background-color: transparent !important;
	color: #9ca3af !important;
	font-weight: 400 !important;
}
.cw-raq-remove:hover,
.cw-raq-modal__remove:hover,
.cw-raq-remove:focus,
.cw-raq-modal__remove:focus {
	background-color: rgba( 220, 38, 38, 0.08 ) !important;
	color: #dc2626 !important;
}
.cw-raq-modal__close:hover,
.cw-raq-modal__close:focus {
	background-color: rgba( 17, 24, 39, 0.06 ) !important;
	color: #111827 !important;
}
.cw-raq-remove:focus-visible,
.cw-raq-modal__remove:focus-visible,
.cw-raq-modal__close:focus-visible {
	box-shadow: 0 0 0 3px rgba( 156, 163, 175, 0.35 ) !important;
}

/* --- Count / modal-open link (header) --- */
.cw-raq-count,
.cw-raq-count:hover,
.cw-raq-count:focus,
.cw-raq-count:visited {
	color: inherit !important;
	background: transparent !important;
}
.cw-raq-modal-open {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	padding: 10px 18px !important;
	border: 1px solid var( --cw-btn-secondary-border, #d1d5db ) !important;
	border-radius: var( --cw-btn-radius, 8px ) !important;
	background-color: var( --cw-btn-secondary-bg, #ffffff ) !important;
	color: var( --cw-btn-secondary-text, #1f2937 ) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
}
.cw-raq-modal-open:hover,
.cw-raq-modal-open:focus {
	background-color: var( --cw-btn-secondary-bg-hover, #f3f4f6 ) !important;
	color: var( --cw-btn-secondary-text, #111827 ) !important;
	border-color: var( --cw-btn-secondary-border-hover, #cbd2da ) !important;
}
