/*
 * Terra Reservations widget styles.
 *
 * Uses the same CSS custom-property names the active theme already
 * defines (--background-teal, --text-terracot, --font-family, etc.) so it
 * inherits the live palette automatically, with baked-in fallback values
 * so it still looks intentional under any theme that doesn't define them.
 */

.terra-res-button {
	cursor: pointer;
	border: none;
	font: inherit;
}

.terra-res-panel {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.terra-res-panel[hidden] {
	display: none;
}

.terra-res-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.terra-res-card {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 90vh;
	overflow-y: auto;
	background: var(--background-white, #fff);
	border-radius: 16px;
	padding: 24px 24px 20px;
	box-sizing: border-box;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	font-family: var(--font-family, inherit);
}

/* Inline mode renders the card directly in the page flow, no overlay. */
.terra-res[data-mode="inline"] .terra-res-panel {
	position: static;
	display: block;
	background: none;
	padding: 0;
}

.terra-res[data-mode="inline"] .terra-res-card {
	max-width: 480px;
	box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.08);
	margin: 0 auto;
}

.terra-res-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--gray-scale-700, #555);
}

.terra-res-title {
	font-family: var(--font-family, inherit);
	font-weight: 500;
	font-size: 22px;
	color: var(--text-terracot, #1f4341);
	margin: 0 0 14px;
	text-align: center;
}

.terra-res-row {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
}

.terra-res-field {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.terra-res-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--gray-scale-700, #555);
}

.terra-res-field select,
.terra-res-field input,
.terra-res-field textarea {
	font-family: var(--font-family, inherit);
	font-size: 15px;
	padding: 8px 10px;
	border: 1px solid var(--gray-scale-300, #ccc);
	border-radius: 8px;
	background: var(--gray-scale-50, #f5f5f5);
	box-sizing: border-box;
	width: 100%;
}

.terra-res-field select:focus,
.terra-res-field input:focus,
.terra-res-field textarea:focus {
	outline: 2px solid var(--background-teal, #1f4341);
	outline-offset: 1px;
}

.terra-res-date-quick {
	display: flex;
	gap: 6px;
}

.terra-res-date-chip {
	flex: 1;
	padding: 4px 8px;
	border-radius: 100px;
	border: 1px solid var(--background-teal, #1f4341);
	background: transparent;
	color: var(--background-teal, #1f4341);
	font-family: var(--font-family, inherit);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.terra-res-date-chip:hover,
.terra-res-date-chip[aria-pressed="true"] {
	background: var(--background-teal, #1f4341);
	color: var(--text-white, #fff);
}

.terra-res-date-chip:focus-visible {
	outline: 2px solid var(--text-terracot, #b5533e);
	outline-offset: 2px;
}

.terra-res-party-note {
	margin: -8px 0 8px;
	font-size: 12px;
	color: var(--gray-scale-700, #777);
}

.terra-res-party-note a {
	color: var(--background-teal, #1f4341);
	font-weight: 600;
	text-decoration: none;
}

.terra-res-slots-label {
	font-weight: 600;
	font-size: 14px;
	color: var(--text-black, #111);
	margin-bottom: 8px;
}

.terra-res-slots-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

.terra-res-slots-head .terra-res-slots-label {
	margin-bottom: 0;
}

.terra-res-slots-head.is-collapsed .terra-res-slots-label {
	display: none;
}

.terra-res-slots-toggle {
	flex-shrink: 0;
	margin-left: auto;
	padding: 0;
	border: none;
	background: none;
	font-family: var(--font-family, inherit);
	font-size: 13px;
	font-weight: 600;
	color: var(--background-teal, #1f4341);
	text-decoration: underline;
	cursor: pointer;
}

.terra-res-slots-toggle[hidden],
.terra-res-slots.is-collapsed {
	display: none;
}

.terra-res-slots-toggle:focus-visible {
	outline: 2px solid var(--text-terracot, #b5533e);
	outline-offset: 2px;
}

.terra-res-slots {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin-bottom: 16px;
}

.terra-res-slot {
	padding: 7px 2px;
	border-radius: 100px;
	border: none;
	font-family: var(--font-family, inherit);
	font-weight: 500;
	font-size: 13px;
	cursor: pointer;
	text-align: center;
	background: var(--background-teal, #1f4341);
	color: var(--text-white, #fff);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.terra-res-slot:hover {
	background: #2e5755;
}

.terra-res-slot[aria-pressed="true"] {
	outline: 2px solid var(--text-terracot, #b5533e);
	outline-offset: 2px;
}

.terra-res-slot.is-full {
	background: transparent;
	border: 1px solid var(--background-teal, #1f4341);
	color: var(--background-teal, #1f4341);
}

.terra-res-slots-empty {
	grid-column: 1 / -1;
	font-size: 14px;
	color: var(--gray-scale-700, #555);
	text-align: center;
	padding: 12px 0;
}

.terra-res-contact-fields {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
}

.terra-res-contact-fields .terra-res-row {
	margin-bottom: 0;
}

.terra-res-field textarea {
	resize: vertical;
}

.terra-res-contact-fields[hidden] {
	display: none;
}

/* Honeypot: hidden off-screen via CSS (not display:none/type=hidden),
   so unsophisticated bots that only skip hidden/invisible inputs by type
   still fill it in and get caught. Real users never see or reach it. */
.terra-res-honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.terra-res-message {
	margin: 0;
	font-size: 13px;
}

.terra-res-message:empty {
	display: none;
}

.terra-res-message.is-error {
	color: #b3261e;
}

.terra-res-message.is-success {
	color: var(--background-teal, #1f4341);
}

.terra-res-submit {
	width: 100%;
	margin-top: 4px;
	padding: 11px 24px;
	border: none;
	border-radius: 100px;
	background: var(--background-teal, #1f4341);
	color: var(--text-white, #fff);
	font-family: var(--font-family, inherit);
	font-weight: 500;
	font-size: 16px;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.terra-res-submit:hover {
	background: #2e5755;
}

.terra-res-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.terra-res-step[hidden] {
	display: none;
}

body.terra-res-lock-scroll {
	overflow: hidden;
}

/* --- Clarity additions -------------------------------------------------- */

/* The dialog itself takes focus when it opens; the ring belongs on controls. */
.terra-res-card:focus {
	outline: none;
}

/* "Afternoon" / "Evening" headings inside the time grid. */
.terra-res-slot-group {
	grid-column: 1 / -1;
	margin-top: 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gray-scale-700, #777);
}

.terra-res-slot-group:first-child {
	margin-top: 0;
}

.terra-res-slots-notice {
	grid-column: 1 / -1;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fbeceb;
	color: #b3261e;
	font-size: 13px;
	text-align: center;
}

/* One-line "what you are about to request" above the contact fields. */
.terra-res-review {
	margin: 0;
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--gray-scale-50, #f5f5f5);
	font-size: 14px;
	font-weight: 600;
	color: var(--text-terracot, #1f4341);
	text-align: center;
}

.terra-res-review:empty {
	display: none;
}

/* Under the summary when the chosen time is full: the request will join
   the waitlist, not ask for a table. */
.terra-res-full-note {
	margin: 8px 0 0;
	padding: 8px 12px;
	border-radius: 8px;
	background: #fbf3e2;
	color: #7a5a14;
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
}

.terra-res-full-note[hidden] {
	display: none;
}

/* Per-field messages sit right under the field they are about. */
.terra-res-error {
	display: none;
	font-size: 12px;
	color: #b3261e;
}

.terra-res-field.has-error .terra-res-error {
	display: block;
}

.terra-res-field.has-error input,
.terra-res-field.has-error textarea {
	border-color: #b3261e;
	background: #fff7f6;
}

/* Success screen: say what was requested and what happens next. */
.terra-res-summary {
	margin: 0 0 12px;
	padding: 12px;
	border-radius: 8px;
	background: var(--gray-scale-50, #f5f5f5);
	font-weight: 600;
	text-align: center;
	color: var(--text-terracot, #1f4341);
}

.terra-res-next {
	margin: 0 0 20px;
	font-size: 13px;
	color: var(--gray-scale-700, #555);
}

/* The theme styles .reservations-button only inside its own block, so the
   success screen's Close button needs the same treatment as Submit here. */
.terra-res-step[data-step="success"] [data-terra-res-close] {
	width: 100%;
	padding: 14px 24px;
	border: none;
	border-radius: 100px;
	background: var(--background-teal, #1f4341);
	color: var(--text-white, #fff);
	font-family: var(--font-family, inherit);
	font-weight: 500;
	font-size: 16px;
	cursor: pointer;
}

.terra-res-step[data-step="success"] [data-terra-res-close]:hover {
	background: #2e5755;
}

.terra-res-slot:focus-visible,
.terra-res-close:focus-visible,
.terra-res-submit:focus-visible {
	outline: 2px solid var(--text-terracot, #b5533e);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.terra-res-card {
		padding: 20px 16px 16px;
	}

	.terra-res-slots {
		grid-template-columns: repeat(3, 1fr);
	}

	.terra-res-review {
		font-size: 13px;
		padding: 8px;
	}
}

@media (max-width: 340px) {
	.terra-res-row {
		flex-direction: column;
	}
}
