/* A-med B2B Portál - frontend styles
   Namespaced with .ab2b- to avoid clashing with the active theme. */

.ab2b-company-banner {
	margin-bottom: 1em;
	padding: 0.6em 1em;
	background: #f4f6f7;
	border-left: 3px solid #2c6ecb;
	font-size: 0.95em;
}

/* Dashboard tiles */
.ab2b-welcome {
	margin-top: 0;
}

.ab2b-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin: 1.2em 0 2em;
}

.ab2b-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 24px 10px;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	text-align: center;
	text-decoration: none;
	color: #2c2c2c;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ab2b-tile:hover,
.ab2b-tile:focus {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
	color: #2c6ecb;
}

.ab2b-tile .dashicons {
	width: 32px;
	height: 32px;
	font-size: 32px;
	color: #2c6ecb;
}

.ab2b-tile-label {
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* Quick order block */
.ab2b-quick-order {
	margin-top: 1em;
}

.ab2b-qo-title {
	margin-bottom: 0.6em;
}

.ab2b-qo-header,
.ab2b-qo-row {
	display: grid;
	grid-template-columns: minmax(220px, 2.2fr) 1fr 0.9fr 0.9fr 1fr;
	gap: 14px;
	align-items: center;
}

.ab2b-qo-header {
	padding: 0 4px 8px;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b6b6b;
	border-bottom: 1px solid #e2e2e2;
}

.ab2b-qo-rows {
	display: flex;
	flex-direction: column;
}

.ab2b-qo-row {
	padding: 10px 4px;
	border-bottom: 1px solid #eee;
}

.ab2b-qo-row.is-added {
	opacity: 0.6;
}

.ab2b-col-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.ab2b-row-check {
	margin-top: 10px;
}

.ab2b-search-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
}

.ab2b-search-input {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 30px 8px 10px;
}

.ab2b-clear-row {
	position: absolute;
	top: 6px;
	right: 6px;
	border: none;
	background: transparent;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #888;
	padding: 4px 6px;
}

.ab2b-clear-row:hover {
	color: #c00;
}

.ab2b-product-name {
	margin-top: 4px;
	font-size: 0.85em;
	color: #444;
}

.ab2b-search-results {
	position: absolute;
	z-index: 20;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #ddd;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	max-height: 260px;
	overflow-y: auto;
	border-radius: 0 0 4px 4px;
}

.ab2b-search-result {
	padding: 8px 10px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
	font-size: 0.9em;
}

.ab2b-search-result:last-child {
	border-bottom: none;
}

.ab2b-search-result:hover,
.ab2b-search-result.is-active {
	background: #f0f6ff;
}

.ab2b-search-result .ab2b-sr-sku {
	font-weight: 700;
	margin-right: 6px;
}

.ab2b-search-result .ab2b-sr-name {
	color: #555;
}

.ab2b-search-empty {
	padding: 8px 10px;
	color: #888;
	font-size: 0.9em;
}

.ab2b-col-qty {
	display: flex;
	align-items: center;
	gap: 4px;
}

.ab2b-qty-minus,
.ab2b-qty-plus {
	width: 30px;
	height: 34px;
	border: 1px solid #ccc;
	background: #f7f7f7;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.ab2b-qty-input {
	width: 60px;
	height: 32px;
	text-align: center;
	box-sizing: border-box;
}

.ab2b-col-uom {
	font-size: 0.85em;
	color: #555;
}

.ab2b-badge,
.ab2b-stock-label {
	display: inline-block;
	font-size: 0.85em;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 3px;
}

.ab2b-stock-label.is-in-stock,
.ab2b-badge.ab2b-in-stock {
	background: #e6f6ea;
	color: #1e7d34;
}

.ab2b-stock-label.is-out-of-stock,
.ab2b-badge.ab2b-out-of-stock {
	background: #fbe9e9;
	color: #b32d2e;
}

.ab2b-subtotal-value {
	font-weight: 700;
}

.ab2b-qo-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 1.2em;
}

.ab2b-qo-message {
	font-size: 0.9em;
}

.ab2b-qo-message.is-success {
	color: #1e7d34;
}

.ab2b-qo-message.is-error {
	color: #b32d2e;
}

.ab2b-row-template {
	display: none !important;
}

/* Stock status table */
.ab2b-stock-search {
	display: flex;
	gap: 8px;
	margin: 1em 0;
}

.ab2b-stock-search input[type="search"] {
	flex: 1;
	max-width: 360px;
}

.ab2b-stock-table {
	width: 100%;
	border-collapse: collapse;
}

.ab2b-stock-table th,
.ab2b-stock-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
}

.ab2b-pagination {
	margin-top: 1em;
	display: flex;
	gap: 6px;
}

.ab2b-pagination a {
	padding: 4px 10px;
	border: 1px solid #ddd;
	border-radius: 3px;
	text-decoration: none;
}

.ab2b-pagination a.is-active {
	background: #2c6ecb;
	color: #fff;
	border-color: #2c6ecb;
}

/* Support page */
.ab2b-support-details {
	list-style: none;
	margin: 1em 0 0;
	padding: 0;
}

.ab2b-support-details li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

/* Small screens: stack the row grid */
@media (max-width: 700px) {
	.ab2b-qo-header {
		display: none;
	}

	.ab2b-qo-row {
		grid-template-columns: 1fr;
		gap: 6px;
		padding: 14px 4px;
	}

	.ab2b-col-qty,
	.ab2b-col-uom,
	.ab2b-col-stock,
	.ab2b-col-subtotal {
		display: flex;
		justify-content: space-between;
	}

	.ab2b-col-qty::before,
	.ab2b-col-uom::before,
	.ab2b-col-stock::before,
	.ab2b-col-subtotal::before {
		content: attr(data-label);
		font-weight: 700;
		font-size: 0.78em;
		text-transform: uppercase;
		color: #6b6b6b;
	}
}
