/**
 * Woo Stock Notifications — frontend styles
 *
 * Sections:
 * 1. Product-page request box
 * 2. Shared message colors
 * 3. Customer requests wrapper
 * 4. Freshness / stale notice
 * 5. Customer request tabs + toolbar
 * 6. Customer request panels
 * 7. Customer request bulk actions
 * 8. Customer request table
 * 9. Customer request row actions and statuses
 * 10. Customer request pagination and per-page controls
 * 11. Product table
 * 12. Mobile adjustments
 */


/* -------------------------------------------------------------------------
 * 1. Product-page request box
 * ------------------------------------------------------------------------- */

.wsn-request-box {
	margin: 1.5rem 0;
	padding: 1rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
}

.wsn-request-intro {
	margin: 0 0 0.5rem;
}

.wsn-request-note {
	margin: 0 0 0.75rem;
	font-size: 0.95em;
	color: #555;
}

.wsn-request-button {
	margin-top: 0.25rem;
}

.wsn-request-login,
.wsn-request-login-action,
.wsn-customer-requests-action {
	margin: 0.75rem 0 0;
}

.wsn-request-login:first-child {
	margin-top: 0;
}

.wsn-login-button,
.wsn-customer-requests-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}


/* -------------------------------------------------------------------------
 * 2. Shared message colors
 * ------------------------------------------------------------------------- */

.wsn-request-message,
.wsn-customer-requests-message,
.wsn-product-table-message {
	margin: 0 0 0.75rem;
}

.wsn-request-message:empty,
.wsn-customer-requests-message:empty,
.wsn-product-table-message:empty {
	display: none;
}

.wsn-message-success {
	color: #1f6f3f;
}

.wsn-message-error {
	color: #9f1d1d;
}

.wsn-message-info {
	color: #555;
}


/* -------------------------------------------------------------------------
 * 3. Customer requests wrapper
 * ------------------------------------------------------------------------- */

.wsn-customer-requests {
	margin: 1.5rem 0;
}


/* -------------------------------------------------------------------------
 * 4. Freshness / stale notice
 * ------------------------------------------------------------------------- */

.wsn-customer-requests-stale {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin: 0 0 0.9rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid rgba(31, 111, 63, 0.25);
	border-radius: 8px;
	background: #e7f5ec;
	color: #1f6f3f;
}

.wsn-customer-requests-stale[hidden] {
	display: none;
}

.wsn-customer-requests-refresh {
	margin: 0;
}


/* -------------------------------------------------------------------------
 * 5. Customer request tabs + toolbar
 * ------------------------------------------------------------------------- */

.wsn-customer-requests-toolbar {
	display: flex;
	gap: 0.75rem;
	align-items: flex-end;
	justify-content: space-between;
	margin: 0;
	padding: 0;
	background: transparent;
}

.wsn-customer-requests-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	align-items: flex-end;
	margin: 0;
	padding: 0;
	background: transparent;
}

.wsn-customer-requests-toolbar-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-left: auto;
	padding: 0 0 0.35rem;
}

.wsn-customer-requests-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 0.38rem 0.9rem;
	border: 0;
	border-radius: 8px 8px 0 0;
	background: var(--wsn-customer-tab-link-bg, #ffffff);
	color: var(--wsn-customer-tab-link-text, #1f2933);
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.wsn-customer-requests-tab:hover,
.wsn-customer-requests-tab:focus {
	text-decoration: underline;
}

.wsn-customer-requests-tab.is-active {
	background: var(--wsn-customer-tab-current-bg, #d5ead7);
	color: var(--wsn-customer-tab-current-text, #1f2933);
}


/* -------------------------------------------------------------------------
 * 6. Customer request panels
 * ------------------------------------------------------------------------- */

.wsn-customer-requests-panels {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 0 8px 8px 8px;
	background: #fff;
}

.wsn-customer-requests-panel[hidden] {
	display: none;
}

.wsn-customer-requests-panel[data-wsn-panel="inactive"] {
	background: #eeeeee;
}

.wsn-customer-requests-panel[data-wsn-panel="inactive"] .wsn-customer-requests-scroll {
	background: #eeeeee;
}

.wsn-customer-requests-panel[data-wsn-panel="inactive"] .wsn-customer-requests-table th {
	background: #e2e2e2;
}

.wsn-customer-requests-scroll {
	overflow-x: auto;
	overflow-y: visible;
}

.wsn-customer-requests-empty {
	margin: 0;
	padding: 1rem;
	color: #555;
}


/* -------------------------------------------------------------------------
 * 7. Customer request bulk actions
 * ------------------------------------------------------------------------- */

.wsn-customer-requests-bulk {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	align-items: center;
	padding: 0;
	background: transparent;
	font-size: 0.95rem;
	line-height: 1.3;
}

.wsn-customer-requests-bulk[hidden] {
	display: none;
}

.wsn-customer-requests-bulk-label {
	font-size: inherit;
	line-height: inherit;
	color: #555;
}

.wsn-customer-requests-bulk-bottom {
	justify-content: flex-end;
	margin: 0.75rem 0 0;
}

.wsn-customer-requests-bottom-actions {
	display: block;
}

.wsn-customer-requests .wsn-customer-bulk-action.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #6d8c78;
	font: inherit;
	font-size: inherit;
	line-height: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.wsn-customer-requests-bulk[data-wsn-bulk-context="inactive"] .wsn-customer-bulk-action[data-wsn-bulk-action="delete"]::before {
	content: "|";
	display: inline-block;
	margin: 0 0.45rem 0 0;
	color: #555;
	text-decoration: none;
	opacity: 0.75;
}

.wsn-customer-requests .wsn-customer-bulk-action.button:hover,
.wsn-customer-requests .wsn-customer-bulk-action.button:focus {
	background: transparent;
	color: #6d8c78;
	text-decoration: none;
}

.wsn-customer-requests .wsn-customer-bulk-action.button:disabled {
	background: transparent;
	color: #6d8c78;
	cursor: not-allowed;
	opacity: 0.45;
	text-decoration: underline;
}


/* -------------------------------------------------------------------------
 * 8. Customer request table
 * ------------------------------------------------------------------------- */

.wsn-customer-requests-table {
	width: 100%;
	min-width: 760px;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.wsn-customer-requests-table th,
.wsn-customer-requests-table td {
	padding: 0.55rem 0.7rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.10);
	text-align: left;
	vertical-align: middle;
}

.wsn-customer-requests-table th {
	background: #f7f7f7;
	font-weight: 700;
	white-space: nowrap;
}

.wsn-customer-requests-table tbody tr:last-child td {
	border-bottom: 0;
}

.wsn-customer-request-select-column {
	width: 42px;
	text-align: center;
}

.wsn-customer-request-select-column input[type="checkbox"] {
	margin: 0;
}

.wsn-customer-request-product {
	font-weight: 600;
}

.wsn-customer-request-product a {
	text-decoration: none;
}

.wsn-customer-request-product a:hover,
.wsn-customer-request-product a:focus {
	text-decoration: underline;
}

.wsn-customer-request-created,
.wsn-customer-request-updated,
.wsn-customer-request-last-notified {
	white-space: nowrap;
}


/* -------------------------------------------------------------------------
 * 9. Customer request row actions and statuses
 * ------------------------------------------------------------------------- */

.wsn-customer-request-actions {
	display: flex;
	gap: 0.45rem;
	flex-wrap: wrap;
	align-items: center;
	white-space: nowrap;
}

.wsn-customer-request-action {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.92em;
	line-height: 1.2;
	text-decoration: underline;
	cursor: pointer;
}

.wsn-customer-request-button {
	appearance: none;
}

.wsn-customer-request-action:hover,
.wsn-customer-request-action:focus {
	text-decoration: none;
}

.wsn-customer-request-action:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.wsn-customer-request-status-inactive {
	color: #555;
}

.wsn-customer-request-status-sent {
	color: #555;
}


/* -------------------------------------------------------------------------
 * 10. Customer request pagination and per-page controls
 * ------------------------------------------------------------------------- */

.wsn-customer-requests-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	justify-content: center;
	padding: 0.85rem;
	border-top: 1px solid rgba(0, 0, 0, 0.10);
}

.wsn-customer-requests-page-link,
.wsn-customer-requests-page-current {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
}

.wsn-customer-requests-page-link {
	text-decoration: underline;
}

.wsn-customer-requests-page-link:hover,
.wsn-customer-requests-page-link:focus {
	text-decoration: none;
}

.wsn-customer-requests-page-link.is-disabled {
	color: #777;
	text-decoration: none;
	cursor: default;
}

.wsn-customer-requests-page-current {
	color: #555;
}

.wsn-customer-requests-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	align-items: center;
	justify-content: flex-end;
	margin: 0.75rem 0 0;
	font-size: 0.95rem;
	line-height: 1.3;
}

.wsn-customer-requests-controls label,
.wsn-customer-requests-controls span {
	font-size: inherit;
	line-height: inherit;
	color: #555;
}

.wsn-customer-requests-controls select {
	min-height: 34px;
}

.wsn-customer-requests-controls .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #6d8c78;
	font: inherit;
	font-size: inherit;
	line-height: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.wsn-customer-requests-controls .button:hover,
.wsn-customer-requests-controls .button:focus {
	background: transparent;
	color: #6d8c78;
	text-decoration: none;
}


/* -------------------------------------------------------------------------
 * 11. Product table
 * ------------------------------------------------------------------------- */

.wsn-product-table-wrap {
	margin: 1.5rem 0;
}

.wsn-product-table-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	align-items: center;
	justify-content: flex-end;
	margin: 0.75rem 0 0;
	font-size: 0.95rem;
	line-height: 1.3;
}

.wsn-product-table-controls label,
.wsn-product-table-controls span {
	font-size: inherit;
	line-height: inherit;
	color: #555;
}

.wsn-product-table-controls select {
	min-height: 34px;
}

.wsn-product-table-controls .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #6d8c78;
	font: inherit;
	font-size: inherit;
	line-height: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.wsn-product-table-controls .button:hover,
.wsn-product-table-controls .button:focus {
	background: transparent;
	color: #6d8c78;
	text-decoration: none;
}

.wsn-product-table-empty {
	margin: 0;
	padding: 1rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	color: #555;
	background: #fff;
}

.wsn-product-table-scroll {
	overflow: auto;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	background: #fff;
}

.wsn-product-table {
	width: 100%;
	min-width: 860px;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.wsn-product-table th,
.wsn-product-table td {
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.10);
	text-align: left;
	vertical-align: middle;
}

.wsn-product-table th {
	background: #f7f7f7;
	font-weight: 700;
	white-space: nowrap;
}

.wsn-product-table tbody tr:last-child td {
	border-bottom: 0;
}

.wsn-product-table-image-column,
.wsn-product-table-image {
	width: 92px;
}

.wsn-product-table-image img {
	display: block;
	width: 72px;
	height: 72px;
	max-width: 72px;
	object-fit: cover;
	border-radius: 0;
}

.wsn-product-table-name {
	font-weight: 700;
}

.wsn-product-table-image-link {
	display: inline-block;
}

.wsn-product-table-name-link {
	color: inherit;
	text-decoration: none;
}

.wsn-product-table-name-link:hover,
.wsn-product-table-name-link:focus {
	text-decoration: underline;
}

.wsn-product-table-description {
	max-width: 420px;
	color: #555;
}

.wsn-product-table-description p {
	margin: 0 0 0.5rem;
}

.wsn-product-table-description p:last-child {
	margin-bottom: 0;
}

.wsn-product-table-price {
	white-space: nowrap;
	font-weight: 600;
}

.wsn-product-table-action {
	white-space: nowrap;
}

.wsn-product-table-buy,
.wsn-product-table-notify {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	border-radius: 999px;
}

.wsn-product-table-notify:disabled {
	cursor: not-allowed;
	opacity: 0.65;
}

.wsn-product-table-notify.is-registered {
	background: transparent;
	border: 1px solid #6d8c78;
	box-shadow: none;
	color: #6d8c78;
}

button.wsn-product-table-notify.is-registered {
	cursor: not-allowed;
	opacity: 0.65;
}

a.wsn-product-table-notify.is-registered {
	cursor: pointer;
	opacity: 1;
	text-decoration: none;
}

.wsn-product-table-notify.is-registered:hover,
.wsn-product-table-notify.is-registered:focus {
	background: transparent;
	color: #6d8c78;
	filter: none;
	text-decoration: none;
}

.wsn-product-table-row.is-unavailable .wsn-product-table-name,
.wsn-product-table-row.is-unavailable .wsn-product-table-price {
	color: #555;
}

.wsn-product-table-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	justify-content: center;
	padding: 0.85rem;
}

.wsn-product-table-page-link,
.wsn-product-table-page-current {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
}

.wsn-product-table-page-link {
	text-decoration: underline;
}

.wsn-product-table-page-link:hover,
.wsn-product-table-page-link:focus {
	text-decoration: none;
}

.wsn-product-table-page-link.is-disabled {
	color: #777;
	text-decoration: none;
	cursor: default;
}

.wsn-product-table-page-current {
	color: #555;
}


/* -------------------------------------------------------------------------
 * 12. Mobile adjustments
 * ------------------------------------------------------------------------- */

@media (max-width: 700px) {
	.wsn-customer-requests-toolbar {
		display: block;
	}

	.wsn-customer-requests-toolbar-actions {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		margin: 0.75rem 0 0;
		padding: 0;
	}

	.wsn-customer-requests-tabs {
		overflow-x: auto;
		margin-bottom: 0.75rem;
	}

	.wsn-customer-requests-tab {
		flex: 0 0 auto;
		border-radius: 8px;
	}

	.wsn-customer-requests {
		--wsn-customer-requests-mobile-edge: 1.9rem;
	}

	.wsn-customer-requests-panels {
		width: calc(100% + (var(--wsn-customer-requests-mobile-edge) * 2));
		max-width: none;
		margin-left: calc(var(--wsn-customer-requests-mobile-edge) * -1);
		margin-right: calc(var(--wsn-customer-requests-mobile-edge) * -1);
		border-left: 0;
		border-right: 0;
		border-radius: 0;
		box-sizing: border-box;
		overflow-x: hidden;
	}

	.wsn-customer-requests-bulk {
		flex-wrap: nowrap;
		align-items: center;
		gap: 0.35rem;
		font-size: 0.95rem;
		line-height: 1.3;
	}

	.wsn-customer-requests-bulk-label {
		flex: 0 0 auto;
		font-size: inherit;
		line-height: inherit;
	}

	.wsn-customer-requests-bulk-bottom {
		justify-content: flex-start;
		margin: 0.75rem 0 0;
	}

	.wsn-customer-requests .wsn-customer-bulk-action.button {
		width: auto;
		justify-content: flex-start;
		font-size: inherit;
		line-height: inherit;
		white-space: nowrap;
	}

	.wsn-customer-requests-controls,
	.wsn-product-table-controls {
		flex-wrap: nowrap;
		align-items: center;
		justify-content: flex-start;
		font-size: 0.95rem;
		line-height: 1.3;
	}

	.wsn-customer-requests-controls label,
	.wsn-customer-requests-controls span,
	.wsn-product-table-controls label,
	.wsn-product-table-controls span {
		flex: 0 0 auto;
		font-size: inherit;
		line-height: inherit;
	}

	.wsn-customer-requests-controls select,
	.wsn-product-table-controls select {
		flex: 0 0 auto;
		width: auto;
		max-width: 6rem;
	}

	.wsn-customer-requests-controls .button,
	.wsn-product-table-controls .button {
		width: auto;
		justify-content: flex-start;
		font-size: inherit;
		line-height: inherit;
		white-space: nowrap;
	}

	.wsn-customer-requests-stale,
	.wsn-customer-requests-pagination,
	.wsn-product-table-pagination {
		align-items: stretch;
	}

	.wsn-customer-requests-stale .button,
	.wsn-product-table-buy,
	.wsn-product-table-notify {
		width: 100%;
		justify-content: center;
	}

	.wsn-customer-requests-scroll {
		overflow-x: visible;
	}

	.wsn-customer-requests-table {
		width: 100%;
		min-width: 0;
		table-layout: auto;
	}

	.wsn-customer-requests-table th,
	.wsn-customer-requests-table td {
		padding: 0.55rem 0.5rem;
	}

	.wsn-customer-request-select-column {
		width: 34px;
	}

	.wsn-customer-request-product,
	.wsn-customer-request-product-column {
		overflow-wrap: anywhere;
	}

	.wsn-customer-request-actions {
		gap: 0.35rem;
		white-space: normal;
	}

	.wsn-customer-request-action {
		white-space: nowrap;
	}

	.wsn-customer-requests-table .wsn-customer-request-created,
	.wsn-customer-requests-table .wsn-customer-request-updated,
	.wsn-customer-requests-table .wsn-customer-request-last-notified {
		display: none;
	}

	/* Product table compact mobile layout:
	 * Image | Product name + price | Action
	 */
	.wsn-product-table-wrap {
		--wsn-product-table-mobile-edge: 1.8rem;

		width: calc(100% + (var(--wsn-product-table-mobile-edge) * 2));
		max-width: none;
		margin-left: calc(var(--wsn-product-table-mobile-edge) * -1);
		margin-right: calc(var(--wsn-product-table-mobile-edge) * -1);
		box-sizing: border-box;
		overflow-x: hidden;
	}

	.wsn-product-table-scroll {
		overflow-x: hidden;
		border-left: 0;
		border-right: 0;
		border-radius: 0;
	}

	.wsn-product-table {
		display: block;
		width: 100%;
		min-width: 0;
		max-width: none;
		border-collapse: separate;
		border-spacing: 0;
		font-size: 0.92rem;
		box-sizing: border-box;
	}

	.wsn-product-table thead {
		display: none;
	}

	.wsn-product-table tbody {
		display: block;
		width: 100%;
	}

	.wsn-product-table-row {
		display: grid;
		grid-template-columns: 52px minmax(0, 1fr) 76px;
		column-gap: 0.45rem;
		row-gap: 0.16rem;
		align-items: center;
		padding: 0.5rem 0;
		border-bottom: 1px solid rgba(0, 0, 0, 0.10);
	}

	.wsn-product-table tbody tr:last-child {
		border-bottom: 0;
	}

	.wsn-product-table td {
		display: block;
		min-width: 0;
		padding: 0;
		border-bottom: 0;
	}

	.wsn-product-table-image {
		grid-column: 1;
		grid-row: 1 / span 2;
		width: 52px;
		margin: 0;
		padding: 0 0 0.2rem;
		align-self: start;
	}

	.wsn-product-table-image-link {
		display: block;
		margin: 0;
		padding: 0;
		line-height: 0;
	}

	.wsn-product-table-image img {
		display: block;
		width: 52px;
		height: 52px;
		max-width: 52px;
		margin: 0;
		padding: 0;
		border-radius: 0;
		object-fit: cover;
	}

	.wsn-product-table-name {
		grid-column: 2;
		grid-row: 1;
		font-size: 0.95rem;
		line-height: 1.25;
		overflow-wrap: anywhere;
	}

	.wsn-product-table-name-link {
		display: inline;
	}

	.wsn-product-table-description {
		display: none;
	}

	.wsn-product-table td.wsn-product-table-description {
		display: none;
	}

	.wsn-product-table-price {
		grid-column: 2;
		grid-row: 2;
		font-size: 0.9rem;
		font-weight: 600;
		line-height: 1.25;
		white-space: normal;
	}

	.wsn-product-table-action {
		grid-column: 3;
		grid-row: 1 / span 2;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		box-sizing: border-box;
		padding: 0 0.35rem 0 0.45rem;
		border-left: 1px solid rgba(0, 0, 0, 0.10);
		white-space: normal;
	}

	.wsn-product-table-action .button,
	.wsn-product-table-buy,
	.wsn-product-table-notify {
		box-sizing: border-box;
		width: calc(100% - 0.35rem);
		max-width: calc(100% - 0.35rem);
		min-height: 32px;
		margin: 0 0.35rem 0 0;
		padding: 0.35rem 0.45rem;
		font-size: 0.84rem;
		line-height: 1.15;
		text-align: center;
		white-space: normal;
	}

	.wsn-product-table-pagination,
	.wsn-product-table-controls,
	.wsn-product-table-message {
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}
}
