/* Razhur Booking — frontend (RTL Persian) */

.razhur-booking {
	direction: rtl;
	text-align: right;
	width: 100%;
	font-family: inherit;
	line-height: 1.7;
	color: #1f2937;
}

/*
 * Many themes cap body content in a narrow "prose" column. When the booking
 * form is dropped into such a container, let it break out and use the full
 * width of the surrounding content area instead of that narrow column.
 */
.entry-content:has( > .razhur-booking ),
.prose:has( > .razhur-booking ),
.wp-block-post-content:has( > .razhur-booking ) {
	max-width: none !important;
}

.razhur-booking *,
.razhur-booking *::before,
.razhur-booking *::after {
	box-sizing: border-box;
}

.razhur-booking h3 {
	margin: 0 0 16px;
	font-size: 18px;
}

/* Steps indicator */
.razhur-steps-indicator {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	counter-reset: razhur-step;
}

.razhur-steps-indicator li {
	flex: 1 1 0;
	min-width: 60px;
	text-align: center;
	font-size: 12px;
	color: #9ca3af;
	padding: 8px 4px;
	border-radius: 8px;
	background: #f3f4f6;
	position: relative;
}

.razhur-steps-indicator li.is-active {
	color: #fff;
	background: #2563eb;
	font-weight: 700;
}

.razhur-steps-indicator li.is-done {
	color: #059669;
	background: #d1fae5;
}

/* Options (category / consultant) */
.razhur-options {
	display: grid;
	gap: 10px;
}

/* Consultant step: 3 cards per row on desktop */
.razhur-options[data-list="consultant"] {
	grid-template-columns: 1fr;
}

@media ( min-width: 768px ) {
	.razhur-options[data-list="consultant"] {
		grid-template-columns: repeat( 3, 1fr );
	}
}

.razhur-option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	width: 100%;
	text-align: right;
	padding: 14px 16px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
	font-size: 15px;
}

.razhur-option:hover {
	border-color: #2563eb;
	box-shadow: 0 2px 8px rgba( 37, 99, 235, .12 );
}

.razhur-option-title {
	font-weight: 700;
}

.razhur-option-meta {
	font-size: 13px;
	color: #6b7280;
}

/* Consultant cards with avatar */
.razhur-option-consultant {
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

.razhur-booking-consultant-avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	background: #e5e7eb;
}

/* Frozen (mode-unavailable) categories */
.razhur-option.is-frozen {
	opacity: .5;
	cursor: not-allowed;
	border-style: dashed;
}

.razhur-option.is-frozen:hover {
	border-color: #e5e7eb;
	box-shadow: none;
}

/* Delivery-mode picker */
.razhur-mode-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.razhur-mode-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 28px 16px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s, background .15s;
}

.razhur-mode-card:hover {
	border-color: #2563eb;
	box-shadow: 0 2px 8px rgba( 37, 99, 235, .12 );
}

.razhur-mode-card.is-selected {
	border-color: #2563eb;
	background: #eff6ff;
}

.razhur-mode-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 52px;
	line-height: 1;
	background: none;
	border: none;
	padding: 0;
}

.razhur-mode-icon img.emoji {
	display: block !important;
	width: 1em !important;
	height: 1em !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: none !important;
	vertical-align: baseline !important;
}

.razhur-mode-label {
	font-weight: 700;
	font-size: 15px;
}

/* Date + time */
.razhur-datetime {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.razhur-datepicker {
	flex: 1 1 280px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 12px;
	background: #fff;
}

.razhur-dp-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.razhur-dp-title {
	font-weight: 700;
}

.razhur-dp-nav {
	border: none;
	background: #f3f4f6;
	border-radius: 8px;
	width: 32px;
	height: 32px;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
}

.razhur-dp-nav:hover {
	background: #e5e7eb;
}

.razhur-dp-grid {
	display: grid;
	grid-template-columns: repeat( 7, 1fr );
	gap: 4px;
}

.razhur-dp-dow {
	text-align: center;
	font-size: 12px;
	color: #9ca3af;
	padding: 4px 0;
}

.razhur-dp-day {
	aspect-ratio: 1;
	border: 2px solid transparent;
	border-radius: 8px;
	background: #f9fafb;
	cursor: pointer;
	font-size: 14px;
	-webkit-tap-highlight-color: transparent;
}

.razhur-dp-day:focus {
	outline: none;
}

.razhur-dp-day:focus-visible:not( .is-selected ) {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
}

.razhur-dp-day:hover:not( :disabled ):not( .is-selected ) {
	border-color: #2563eb;
}

.razhur-dp-day.is-today:not( .is-selected ) {
	font-weight: 700;
	color: #2563eb;
}

.razhur-dp-day.is-selected,
.razhur-dp-day.is-selected:hover,
.razhur-dp-day.is-selected:focus,
.razhur-dp-day.is-selected:focus-visible {
	background: #2563eb;
	border-color: #1d4ed8;
	color: #fff;
	font-weight: 700;
}

.razhur-dp-day.is-past,
.razhur-dp-day:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.razhur-slots {
	flex: 1 1 220px;
}

.razhur-slots-hint {
	color: #6b7280;
	font-size: 14px;
}

.razhur-slots-list {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 96px, 1fr ) );
	gap: 8px;
}

.razhur-slot {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	padding: 8px 6px;
	cursor: pointer;
	font-size: 14px;
	direction: ltr;
}

.razhur-slot:hover {
	border-color: #2563eb;
	background: #eff6ff;
}

/* Fields */
.razhur-field {
	margin-bottom: 14px;
}

.razhur-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
}

.razhur-field input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
}

.razhur-field input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba( 37, 99, 235, .15 );
}

/* Summary */
.razhur-summary {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 16px;
	margin: 0 0 16px;
	padding: 16px;
	background: #f9fafb;
	border-radius: 10px;
}

.razhur-summary dt {
	color: #6b7280;
	font-size: 14px;
}

.razhur-summary dd {
	margin: 0;
	font-weight: 600;
}

/* Actions / buttons */
.razhur-actions {
	display: flex;
	gap: 10px;
	margin-top: 18px;
}

.razhur-btn {
	padding: 10px 20px;
	border-radius: 8px;
	border: 1px solid #d1d5db;
	background: #fff;
	cursor: pointer;
	font-size: 15px;
	font-family: inherit;
}

.razhur-btn.razhur-primary {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
	font-weight: 700;
}

.razhur-btn.razhur-primary:hover {
	background: #1d4ed8;
}

/* Success */
.razhur-success {
	text-align: center;
}

.razhur-success-label {
	color: #6b7280;
	margin-bottom: 8px;
}

.razhur-code {
	font-size: 28px;
	font-weight: 800;
	letter-spacing: 4px;
	direction: ltr;
	color: #059669;
	margin-bottom: 16px;
}

.razhur-success-note {
	max-width: 420px;
	margin: 0 0 16px;
	/* Force horizontal centring: the theme's `.entry-content.prose p` rule
	   has higher specificity and otherwise collapses the auto margins. */
	margin-inline: auto !important;
	padding: 12px 14px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	color: #92400e;
	font-size: 14px;
	line-height: 1.9;
	text-align: center;
}

.razhur-qr {
	display: inline-block;
	/* Generous white padding = the QR "quiet zone" cameras need to detect it. */
	padding: 24px;
	background: #fff;
	/* Square corners: rounding the frame interferes with QR detection. */
	border-radius: 0;
	margin-bottom: 16px;
	line-height: 0;
}

.razhur-qr img,
.razhur-qr canvas {
	display: block;
	width: 200px;
	height: 200px;
	/* Override theme globals (canvas{max-width:100%} / img{border-radius,box-shadow,margin}). */
	max-width: 100%;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
}

.razhur-success .razhur-summary {
	text-align: right;
}

/* Notice + loading */
.razhur-booking-notice {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 14px;
}

.razhur-empty {
	color: #6b7280;
	padding: 12px;
	text-align: center;
}

.razhur-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px;
	color: #6b7280;
}

/*
 * The display:flex above is an author rule and would otherwise override the
 * browser's [hidden]{display:none}, leaving the spinner permanently visible.
 * Restore the hidden behaviour explicitly.
 */
.razhur-loading[hidden] {
	display: none;
}

.razhur-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #c7d2fe;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: razhur-spin .8s linear infinite;
}

@keyframes razhur-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* ---------------- Events ---------------- */

.razhur-events {
	direction: rtl;
	text-align: right;
	font-family: inherit;
	line-height: 1.7;
	color: #1f2937;
}

.razhur-events *,
.razhur-events *::before,
.razhur-events *::after {
	box-sizing: border-box;
}

.razhur-events-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 20px;
}

.razhur-event-card {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
}

.razhur-event-image {
	aspect-ratio: 16 / 9;
	background: #f3f4f6;
	overflow: hidden;
}

.razhur-event-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.razhur-event-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1 1 auto;
}

.razhur-event-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.razhur-event-meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 14px;
	color: #4b5563;
}

.razhur-event-meta-label {
	font-weight: 600;
	color: #1f2937;
}

.razhur-event-spots {
	color: #047857;
	font-weight: 600;
}

.razhur-event-short {
	margin: 0;
	font-size: 14px;
	color: #4b5563;
}

.razhur-event-card .razhur-event-reserve,
.razhur-event-detail .razhur-event-reserve {
	margin-top: auto;
}

/* Single event view */
.razhur-events-single {
	max-width: 720px;
	margin: 0 auto;
}

.razhur-event-detail {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	padding-bottom: 20px;
}

.razhur-event-detail .razhur-event-title,
.razhur-event-detail .razhur-event-meta,
.razhur-event-detail .razhur-event-description,
.razhur-event-detail .razhur-event-reserve {
	margin-inline: 20px;
}

.razhur-event-detail .razhur-event-title {
	margin-top: 20px;
	margin-bottom: 12px;
	font-size: 22px;
}

.razhur-event-detail .razhur-event-meta {
	margin-bottom: 16px;
}

.razhur-event-description {
	margin-bottom: 20px;
	font-size: 15px;
}

/* Reserve flow shell */
.razhur-event-booking {
	margin-top: 24px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 20px;
	background: #fff;
}

.razhur-event-booking[hidden] {
	display: none;
}

.razhur-event-booking-title {
	margin: 12px 0 16px;
	font-size: 18px;
	font-weight: 700;
}

.razhur-event-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	color: #4338ca;
	background: #e0e7ff;
	border-radius: 6px;
	padding: 1px 6px;
}
