/**
 * M3W Warehouse styles.
 *
 * Colours reuse the Elementor global palette where available
 * (var(--e-global-color-*)) with sane fallbacks.
 */

/* ------------------------------------------------------------------ */
/* Info buttons (product page, cart, fast search)                      */
/* ------------------------------------------------------------------ */

/*
 * These rules are a first-paint fallback only (in case JS hasn't run yet,
 * or is disabled). The authoritative colouring happens in JS
 * (window.M3W.paintInfoButton, in modal.js) via inline style + 'important',
 * because theme .button/.alt styles can carry enough class-selector
 * specificity to beat a plain CSS class rule even when that rule also uses
 * !important - inline !important always wins regardless of selector
 * specificity, so colouring is done there instead of chased here.
 *
 * Keep the two shades of grey/green below in sync with INFO_BTN_GREY /
 * INFO_BTN_FOUND in assets/js/modal.js.
 */
.m3w-info-btn {
	background: #b5b5b5 !important; /* grey = no data, "on request" */
	background-image: none !important;
	color: #000 !important;
	border: none !important;
	padding: 8px 12px !important;
	margin: 0 !important;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.m3w-info-btn.m3w-info-found {
	background: #bfe4c0 !important; /* pale green = data available */
	background-image: none !important;
}

.m3w-info-btn.m3w-btn-loading {
	opacity: 0.6;
	cursor: wait;
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.m3w-modal {
	display: none; /* modal.js switches to flex */
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.55);
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.m3w-modal-content {
	position: relative;
	background: #fff;
	max-width: 480px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 24px;
	border-radius: 6px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/*
 * !important throughout: this is a plain <button> with no theme-specific
 * classes, so the theme's generic `button { ... }` rule (background,
 * padding, colour - often itself !important) otherwise wins outright.
 */
.m3w-modal-close {
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	background: transparent !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	font-size: 26px !important;
	line-height: 1 !important;
	text-transform: none !important;
	cursor: pointer;
	color: #666 !important;
	padding: 4px 8px !important;
}

.m3w-modal-close:hover {
	background: transparent !important;
	color: #000 !important;
}

#m3w-modal-table {
	width: 100%;
	margin: 10px 0;
	border-collapse: collapse;
}

#m3w-modal-table th,
#m3w-modal-table td {
	border: 1px solid #ddd;
	padding: 6px 10px;
	text-align: left;
}

#m3w-modal-table th {
	background: #f5f5f5;
}

.m3w-modal-price-info {
	font-size: 0.9em;
	color: #444;
}

#m3w-modal-notfound {
	display: none;
	padding: 12px 0;
}

/* ------------------------------------------------------------------ */
/* Cart                                                                */
/* ------------------------------------------------------------------ */

.m3w-cart-price {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.m3w-cart-unit-price {
	white-space: nowrap;
}

.m3w-grey-btn {
	background: #b5b5b5 !important;
	background-image: none !important;
	color: #000 !important;
}

#m3w-cart-overlay {
	display: none; /* cart.js switches to flex */
	position: fixed;
	inset: 0;
	z-index: 100001;
	background: rgba(255, 255, 255, 0.85);
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* ------------------------------------------------------------------ */
/* Fast search tables                                                  */
/* ------------------------------------------------------------------ */

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

.m3w-var-table th,
.m3w-var-table td {
	border: 1px solid #e0e0e0;
	padding: 5px 8px;
	vertical-align: middle;
}

.m3w-var-table thead th {
	background: #f7f7f7;
	white-space: nowrap;
}

.m3w-filter-row input {
	width: 100%;
	min-width: 90px;
	padding: 3px 6px;
	box-sizing: border-box;
}

.m3w-qty {
	width: 70px;
	padding: 3px 6px;
}

.m3w-fs-limit-note {
	color: #c0392b;
}

/* Action buttons in table rows */

.m3w-add-btn {
	border: none !important;
	padding: 6px 10px !important;
	margin: 0 !important;
	font-weight: bold !important;
	cursor: pointer;
	white-space: nowrap;
}

.m3w-do-poptavky {
	background: var(--e-global-color-secondary, #4caf50) !important;
	background-image: none !important;
	color: #fff !important;
}

.m3w-do-seznamu {
	background: green !important;
	background-image: none !important;
	color: #fff !important;
}

.m3w-v-seznamu {
	background: limegreen !important;
	background-image: none !important;
	color: #fff !important;
	cursor: default;
}

.m3w-remove-btn {
	background: transparent !important;
	background-image: none !important;
	border: none !important;
	cursor: pointer;
	font-size: 16px;
	color: #000 !important;
}

.m3w-sort-button {
	background: transparent !important;
	border: none !important;
	color: grey !important;
	cursor: pointer;
	padding: 0 2px !important;
	margin: 0 !important;
}

#m3w-favtable-buttons {
	margin: 10px 0 24px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ------------------------------------------------------------------ */
/* Misc                                                                */
/* ------------------------------------------------------------------ */

.m3w-hidden {
	display: none;
}

.m3w-row-highlight {
	outline: 2px solid var(--e-global-color-secondary, #4caf50);
	background: #f2fbf2;
}