/* Overlay */
.ro-modal {
	position: fixed; inset: 0;
	display: none;
	z-index: 100000;
}
.ro-modal.is-open { display: block; }
.ro-modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(15, 23, 42, .6);
	backdrop-filter: blur(2px);
}

/* Dialog */
.ro-modal__dialog {
	position: relative;
	max-width: 540px;
	width: calc(100% - 32px);
	max-height: 88vh;
	margin: 6vh auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 0;
}
.ro-modal__dialog::-webkit-scrollbar { width: 8px; }
.ro-modal__dialog::-webkit-scrollbar-thumb { background: #cfd8dc; border-radius: 4px; }
.ro-modal__dialog::-webkit-scrollbar-track { background: transparent; }

/* Close button */
.ro-modal__close {
	position: sticky;
	float: right;
	top: 8px; right: 12px;
	background: transparent;
	border: 0;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #64748b;
	padding: 4px 8px;
	z-index: 2;
}
.ro-modal__close:hover { color: #0f172a; }

/* Sticky title */
#ro-modal h3 {
	position: sticky;
	top: 0;
	margin: 0;
	padding: 18px 24px 12px;
	background: #fff;
	border-bottom: 1px solid #eef2f7;
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
	z-index: 1;
}

/* Form body */
#ro-form { padding: 16px 24px 0; }
#ro-form label {
	display: block;
	margin: 14px 0 6px;
	font-weight: 600;
	font-size: 13px;
	color: #334155;
}
#ro-form label:first-child { margin-top: 4px; }
#ro-form .required { color: #dc2626; margin-left: 2px; }

#ro-form textarea,
#ro-form select,
#ro-form input[type=file] {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	font: inherit;
	color: #0f172a;
	transition: border-color .15s, box-shadow .15s;
}
#ro-form textarea,
#ro-form select {
	padding: 9px 10px;
}
#ro-form textarea { resize: vertical; min-height: 90px; }
#ro-form input[type=file] { padding: 8px; background: #f8fafc; font-size: 13px; }
#ro-form textarea:focus,
#ro-form select:focus,
#ro-form input[type=file]:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

/* Image previews */
.ro-image-preview {
	display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap;
}
.ro-image-preview img {
	width: 84px; height: 84px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
}

/* Time slot grid */
.ro-slot-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 8px;
	margin-top: 4px;
}
.ro-slot-grid .ro-slot {
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 12.5px;
	font-weight: 500;
	color: #334155;
	cursor: pointer;
	text-align: center;
	transition: background .15s, border-color .15s, color .15s;
}
.ro-slot-grid .ro-slot:hover {
	background: #e2e8f0;
	border-color: #94a3b8;
}
.ro-slot-grid .ro-slot.is-selected {
	background: #2563eb;
	border-color: #1d4ed8;
	color: #fff;
	box-shadow: 0 2px 6px rgba(37, 99, 235, .3);
}
.ro-slot-loading, .ro-slot-empty {
	font-size: 13px;
	color: #64748b;
	margin: 6px 0;
	padding: 6px 0;
}

/* Sticky footer */
.ro-form__footer {
	position: sticky;
	bottom: 0;
	margin: 20px -24px 0;
	padding: 14px 24px;
	background: #fff;
	border-top: 1px solid #eef2f7;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	z-index: 1;
}
.ro-form__notice {
	font-size: 13px;
	flex: 1;
	min-width: 0;
}
.ro-form__notice.is-error { color: #b91c1c; }
.ro-form__notice.is-success { color: #15803d; }

.ro-submit {
	background: #2563eb !important;
	border-color: #1d4ed8 !important;
	color: #fff !important;
	padding: 8px 18px !important;
	border-radius: 6px !important;
	font-weight: 600 !important;
}
.ro-submit:hover { background: #1d4ed8 !important; }
.ro-submit:disabled { opacity: .65; cursor: not-allowed; }

/* Trigger button on view-order page */
.ro-view-order-action { margin-top: 16px; }

/* Small screens */
@media (max-width: 520px) {
	.ro-modal__dialog {
		margin: 3vh auto;
		max-height: 94vh;
		border-radius: 8px;
	}
	#ro-modal h3 { padding: 14px 18px 10px; font-size: 16px; }
	#ro-form { padding: 12px 18px 0; }
	.ro-form__footer { margin: 16px -18px 0; padding: 12px 18px; }
	.ro-slot-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
