.ccb-widget {
	--ccb-accent: #5c3a21;
	max-width: 480px;
	width: 100%;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	box-sizing: border-box;
	overflow-wrap: break-word;
}

.ccb-widget * {
	box-sizing: border-box;
}

.ccb-widget h3 {
	margin: 0 0 16px;
	font-size: 1.25rem;
	color: #222;
}

.ccb-step {
	display: none;
}

.ccb-step.ccb-active {
	display: block;
}

.ccb-field {
	margin-bottom: 16px;
}

.ccb-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 0.95rem;
	color: #333;
}

.ccb-field input[type="date"],
.ccb-field input[type="text"],
.ccb-field input[type="tel"],
.ccb-field input[type="number"],
.ccb-field select,
.ccb-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 8px;
	font-size: 1rem;
}

.ccb-field textarea {
	resize: vertical;
	min-height: 60px;
}

.ccb-btn {
	display: inline-block;
	background: var(--ccb-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 12px 20px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
}

.ccb-btn:hover {
	opacity: 0.9;
}

.ccb-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ccb-btn-link {
	background: none;
	color: var(--ccb-accent);
	width: auto;
	padding: 8px 0;
	font-weight: 600;
	text-decoration: underline;
}

.ccb-slots {
	/* Auto-fill wraps as many buttons per row as fit, instead of a fixed
	   3-column grid — this is what keeps ~27 half-hour time slots (split
	   across AM/PM) wrapping cleanly at any screen width instead of
	   squeezing into 3 columns on a phone. */
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
	gap: 8px;
	margin-bottom: 16px;
}

.ccb-slot-btn {
	padding: 10px 6px;
	border: 1px solid var(--ccb-accent);
	background: #fff;
	color: var(--ccb-accent);
	border-radius: 8px;
	font-size: 0.85rem;
	line-height: 1.3;
	cursor: pointer;
	text-align: center;
	white-space: nowrap;
	min-height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ccb-slot-btn:hover,
.ccb-slot-btn.ccb-selected {
	background: var(--ccb-accent);
	color: #fff;
}

/* AM / PM choice on Step 1, right under the date field — two large tap
   targets, unselected by default (outlined, like a slot button) and
   filled solid once picked, so it's clear which one is currently
   chosen while the customer is still filling in the rest of the form. */
.ccb-period-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
}

.ccb-period-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 16px 10px;
	border: 1px solid var(--ccb-accent);
	background: #fff;
	color: var(--ccb-accent);
	border-radius: 8px;
	cursor: pointer;
	font-family: inherit;
}

.ccb-period-btn span:first-child {
	font-size: 1rem;
	font-weight: 700;
}

.ccb-period-btn:hover {
	opacity: 0.9;
}

.ccb-period-btn.ccb-selected {
	background: var(--ccb-accent);
	color: #fff;
}

@media (max-width: 420px) {
	.ccb-period-choices {
		grid-template-columns: 1fr;
	}
}

.ccb-message {
	padding: 12px 14px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 0.95rem;
}

.ccb-message.ccb-error {
	background: #fdeaea;
	color: #a10000;
}

.ccb-message.ccb-success {
	background: #e7f6ec;
	color: #1a6b3c;
}

.ccb-message.ccb-info {
	background: #eef6f8;
	color: #0e5a63;
}

.ccb-loading,
.ccb-empty {
	color: #666;
	font-size: 0.95rem;
}

.ccb-summary {
	background: #f7f7f7;
	border-radius: 8px;
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 0.95rem;
}

.ccb-summary strong {
	color: #222;
}

/* Package info panel shown under the package <select> in Step 3 —
   updates to show the description, included items, and cup count for
   whichever package is currently selected. Packages themselves are
   managed in WordPress (Settings → Coffee Cart Booking), not here. */
.ccb-package-info {
	background: #f7f7f7;
	border: 1px solid #ececec;
	border-radius: 8px;
	padding: 12px 14px;
	margin: -6px 0 16px;
	font-size: 0.9rem;
	color: #444;
}

.ccb-package-info:empty {
	display: none;
	margin: 0;
	padding: 0;
	border: none;
}

.ccb-package-info p {
	margin: 0 0 8px;
}

.ccb-package-info p:last-child {
	margin-bottom: 0;
}

.ccb-package-info ul {
	margin: 0 0 8px;
	padding-left: 18px;
}

.ccb-package-info li {
	margin-bottom: 4px;
}

.ccb-package-info .ccb-package-cups {
	font-weight: 600;
	color: var(--ccb-accent);
}

/* Mobile: tighten padding and let slot buttons shrink a bit further so
   everything still wraps cleanly on narrow phone screens. */
@media (max-width: 480px) {
	.ccb-widget {
		padding: 16px;
		border-radius: 8px;
	}

	.ccb-widget h3 {
		font-size: 1.1rem;
	}

	.ccb-slots {
		grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
		gap: 6px;
	}

	.ccb-slot-btn {
		font-size: 0.8rem;
		padding: 8px 4px;
	}

	.ccb-btn,
	.ccb-field input,
	.ccb-field select,
	.ccb-field textarea {
		font-size: 16px; /* prevents iOS Safari from auto-zooming in on focus */
	}
}
