.porterbuddy-widget-row td {
	border-top: none;
	padding-top: 0;
}

#porterbuddy-widget {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0.5em 0 0;
}

#porterbuddy-widget * {
	box-sizing: border-box;
}

.porterbuddy-loading,
.porterbuddy-error,
.porterbuddy-empty {
	font-style: italic;
}

.porterbuddy-selected-summary {
	color: #661aff;
	font-weight: 700;
	margin: 0 0 0.9em;
	text-align: center;
}

.porterbuddy-headings {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 0.5em;
	text-align: center;
	margin: 0 1.5em 0.35em;
}

.porterbuddy-window-heading {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.porterbuddy-window-day {
	font-weight: 700;
	color: #661aff;
	font-size: 1em;
}

.porterbuddy-window-date {
	color: #b6a6e8;
	font-size: 0.8em;
}

/* Wraps the box grid plus the shared start/end time labels, which are
   pinned to its top-left / bottom-right corners - one time axis for the
   whole row, matching Porterbuddy's own widget, rather than repeating the
   time inside every box. Padding reserves a gutter wide enough for the
   "19:00"/"22:00" labels so they never overlap the boxes. */
.porterbuddy-matrix-row {
	position: relative;
	padding: 0 2.6em;
}

/* Each side shows both the start (top) and end (bottom) time, stacked to
   span the full height of the box row. A higher z-index than the (also
   positioned) boxes guarantees these paint on top rather than getting
   clipped behind a box's own background. */
.porterbuddy-matrix-time {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 2.2em;
	font-size: 0.72em;
	font-weight: 600;
	color: #b6a6e8;
	white-space: nowrap;
}

.porterbuddy-matrix-time--left {
	left: 0;
	text-align: left;
}

.porterbuddy-matrix-time--right {
	right: 0;
	text-align: right;
}

.porterbuddy-window-grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 0.5em;
}

/* Direction-aware slide when paging with Prev/Next, so it's visually obvious
   new days appeared instead of the content just swapping in place. JS toggles
   these classes: first the outgoing page slides out (using this transition),
   then the incoming page is jumped to the opposite off-position with
   transitions suppressed, then that class is removed so it slides back to
   its resting position using this same transition. */
.porterbuddy-headings,
.porterbuddy-window-grid {
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.porterbuddy-slide-out-left {
	transform: translateX( -20px );
	opacity: 0;
}

.porterbuddy-slide-out-right {
	transform: translateX( 20px );
	opacity: 0;
}

.porterbuddy-slide-in-left {
	transition: none;
	transform: translateX( -20px );
	opacity: 0;
}

.porterbuddy-slide-in-right {
	transition: none;
	transform: translateX( 20px );
	opacity: 0;
}

.porterbuddy-window {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 6em;
	padding: 0.4em;
	border: 1px solid #e3d9fb;
	border-radius: 8px;
	color: #661aff;
	background-color: #f7f3ff;
	cursor: pointer;
	text-align: center;
}

.porterbuddy-window:hover {
	background-color: rgba( 102, 26, 255, 0.15 );
}

/* Native radio is kept for accessibility/keyboard use, but visually hidden -
   the box's own background colour plus a checkmark (below) show selection,
   matching Porterbuddy's own widget rather than showing a raw radio dot. */
.porterbuddy-window-radio {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.porterbuddy-window--selected,
.porterbuddy-window:has( .porterbuddy-window-radio:checked ) {
	background-color: #661aff;
	border-color: #661aff;
	color: #fff;
}

.porterbuddy-window--selected::after,
.porterbuddy-window:has( .porterbuddy-window-radio:checked )::after {
	content: '';
	position: absolute;
	top: 0.4em;
	right: 0.4em;
	width: 13px;
	height: 10px;
	background: url( 'data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2219.5%22%20height%3D%2215%22%20viewBox%3D%220%200%2019.5%2015%22%3E%3Cpath%20d%3D%22M16.5.5%2C6.3%2C10.8%2C3%2C7.5a1.8%2C1.8%2C0%2C0%2C0-2.5%2C0A1.8%2C1.8%2C0%2C0%2C0%2C.5%2C10L5%2C14.5a1.8%2C1.8%2C0%2C0%2C0%2C2.5%2C0L19%2C3A1.8%2C1.8%2C0%2C0%2C0%2C19%2C.5%2C1.8%2C1.8%2C0%2C0%2C0%2C16.5.5Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E' ) no-repeat center / contain;
}

.porterbuddy-window-price {
	font-weight: 700;
	font-size: 1.05em;
}

.porterbuddy-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 0.75em;
}

/* #porterbuddy-widget-prefixed compound selector + !important, and a full
   native-control reset (appearance/outline/background-image/line-height):
   WooCommerce/theme default <button> styling (WoodMart confirmed in this
   project's earlier widget-CSS debugging) can otherwise leave a browser- or
   theme-supplied border, gradient or outline showing through even after the
   background-color/border are overridden. */
#porterbuddy-widget .porterbuddy-nav-btn {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 999px !important;
	background-color: #efe9fc !important;
	background-image: none !important;
	box-shadow: none !important;
	outline: none !important;
	color: #ab9bd6 !important;
	padding: 0.5em 1.2em !important;
	font-family: inherit !important;
	font-weight: 700 !important;
	font-size: 0.7em !important;
	line-height: normal !important;
	letter-spacing: 0.03em !important;
	text-transform: uppercase !important;
	text-decoration: none !important;
	cursor: pointer !important;
}

#porterbuddy-widget .porterbuddy-nav-btn:not( :disabled ) {
	color: #661aff !important;
}

#porterbuddy-widget .porterbuddy-nav-btn:disabled {
	cursor: default !important;
	opacity: 0.7 !important;
}

#porterbuddy-widget .porterbuddy-nav-btn:hover:not( :disabled ),
#porterbuddy-widget .porterbuddy-nav-btn:focus:not( :disabled ) {
	background-color: #e4dbfc !important;
}

.porterbuddy-nav-next::after {
	content: ' \203A';
}

.porterbuddy-extras {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	margin: 0;
}

.porterbuddy-extras label {
	display: block;
}

.porterbuddy-courier-comment {
	width: 100%;
}

/* Mobile: the fixed em-based gutters reserved for the side time labels eat a
   disproportionate share of a narrow screen, leaving the boxes small and
   the whole picker looking cramped instead of using the available width.
   Tighten the gutters/gaps, let the boxes go square instead of the wide
   rectangle used on desktop, and center the Prev/Next buttons together
   instead of pinning them to the far edges of a now-narrow row. */
@media ( max-width: 480px ) {
	.porterbuddy-headings {
		margin: 0 2em 0.3em;
		gap: 0.35em;
	}

	.porterbuddy-matrix-row {
		padding: 0 2em;
	}

	.porterbuddy-matrix-time {
		width: 1.8em;
		font-size: 0.65em;
	}

	.porterbuddy-window-grid {
		gap: 0.35em;
	}

	.porterbuddy-window {
		aspect-ratio: 1 / 1;
		min-height: 0;
		padding: 0.3em;
	}

	.porterbuddy-window-price {
		font-size: 0.9em;
	}

	.porterbuddy-window-day {
		font-size: 0.9em;
	}

	.porterbuddy-nav {
		justify-content: center;
		gap: 0.75em;
	}
}
