/* Cafe Raz Menu — mobile app UI (cream + pistachio) */

:root {
	--crm-cream: #F6F0E7;
	--crm-cream-dark: #E8DFD2;
	--crm-pistachio: #6F9264;
	--crm-pistachio-dark: #4F6E45;
	--crm-pistachio-soft: rgba(111, 146, 100, 0.16);
	--crm-ink: #1F2A1C;
	--crm-muted: #7A8476;
	--crm-white: #FFFdf9;
	--crm-radius: 20px;
	--crm-shadow: 0 6px 20px rgba(47, 58, 42, 0.07);
	--crm-font: "Vazirmatn", "Tahoma", sans-serif;
}

html.crm-standalone-html {
	height: 100%;
	background: var(--crm-cream);
	margin-top: 0 !important;
}

body.crm-standalone {
	margin: 0;
	padding: 0;
	min-height: 100%;
	min-height: 100dvh;
	background: var(--crm-cream);
	font-family: var(--crm-font);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

body.crm-standalone #wpadminbar {
	display: none !important;
}

body.crm-standalone .crm-app {
	min-height: 100dvh;
	max-width: 430px;
	margin: 0 auto;
	overflow: visible;
	box-shadow: none;
	border-radius: 0;
}

@media (min-width: 768px) {
	body.crm-standalone {
		background: #ddd5c8;
	}

	body.crm-standalone .crm-app {
		box-shadow: 0 0 0 1px rgba(47, 58, 42, 0.05), 0 20px 50px rgba(47, 58, 42, 0.12);
		min-height: 100dvh;
	}
}

.crm-app {
	font-family: var(--crm-font);
	direction: rtl;
	text-align: right;
	color: var(--crm-ink);
	background: var(--crm-cream);
	min-height: 70vh;
	max-width: 430px;
	margin: 0 auto;
	padding: 1.1rem 1rem 2.5rem;
	padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	position: relative;
}

.crm-app *,
.crm-app *::before,
.crm-app *::after {
	box-sizing: border-box;
}

/* Header */
.crm-header {
	margin-bottom: 1.1rem;
}

.crm-brand {
	display: flex;
	align-items: center;
	gap: 0.7rem;
}

.crm-brand-mark {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--crm-white);
	box-shadow: var(--crm-shadow);
}

.crm-brand-name {
	margin: 0;
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var(--crm-pistachio-dark);
}

.crm-brand-tag {
	margin: 0.1rem 0 0;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	color: var(--crm-pistachio);
	text-transform: uppercase;
}

/* Category icons — app style: filled active */
.crm-cats {
	display: flex;
	gap: 0.55rem;
	overflow-x: auto;
	padding: 0.15rem 0 0.9rem;
	margin: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.crm-cats::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.crm-cat {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	border: none;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
	color: var(--crm-muted);
	width: 68px;
	transition: color 0.2s;
}

.crm-cat-icon {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 1.4rem;
	line-height: 1;
	background: var(--crm-white);
	box-shadow: 0 2px 10px rgba(47, 58, 42, 0.06);
	color: var(--crm-pistachio-dark);
	transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.crm-cat-icon svg {
	display: block;
}

.crm-cat.is-active {
	color: var(--crm-pistachio-dark);
	font-weight: 700;
}

.crm-cat.is-active .crm-cat-icon {
	background: var(--crm-pistachio);
	color: #fff;
	box-shadow: 0 6px 16px rgba(111, 146, 100, 0.35);
	transform: scale(1.04);
}

.crm-cat-label {
	font-size: 0.68rem;
	width: 100%;
	text-align: center;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Filter chips */
.crm-filters {
	display: flex;
	gap: 0.4rem;
	overflow-x: auto;
	padding-bottom: 1rem;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.crm-filters::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.crm-chip {
	flex: 0 0 auto;
	border: none;
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0.48rem 1rem;
	border-radius: 999px;
	background: var(--crm-white);
	color: var(--crm-ink);
	cursor: pointer;
	transition: background 0.2s, color 0.2s, transform 0.15s;
	box-shadow: 0 1px 4px rgba(47, 58, 42, 0.04);
}

.crm-chip.is-active {
	background: var(--crm-pistachio);
	color: #fff;
}

.crm-chip:active {
	transform: scale(0.97);
}

/* Cards — app list */
.crm-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.crm-empty {
	text-align: center;
	color: var(--crm-muted);
	padding: 2rem 1rem;
}

.crm-card {
	display: flex;
	gap: 0.85rem;
	background: var(--crm-white);
	border-radius: var(--crm-radius);
	padding: 0.7rem;
	box-shadow: var(--crm-shadow);
	transition: transform 0.2s, box-shadow 0.2s;
}

.crm-card.is-hidden {
	display: none;
}

.crm-card[data-available="0"] {
	opacity: 0.65;
}

.crm-card-media {
	position: relative;
	flex: 0 0 100px;
	width: 100px;
	height: 100px;
	border-radius: 16px;
	overflow: hidden;
	background: var(--crm-cream-dark);
}

.crm-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.crm-badge-off {
	position: absolute;
	top: 6px;
	right: 6px;
	font-size: 0.62rem;
	font-weight: 700;
	padding: 0.15rem 0.4rem;
	border-radius: 6px;
	background: #8a7a6a;
	color: #fff;
}

.crm-card-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.2rem;
	padding: 0.15rem 0.1rem 0.15rem 0;
}

.crm-card-title {
	margin: 0;
	font-size: 0.98rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--crm-ink);
}

.crm-card-meta {
	margin: 0;
	font-size: 0.75rem;
	color: var(--crm-muted);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.2rem;
}

.crm-meta-rating {
	color: #C4A035;
	font-weight: 700;
}

.crm-meta-rating.is-empty {
	color: var(--crm-muted);
	font-weight: 500;
}

.crm-meta-dot {
	opacity: 0.5;
}

.crm-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.35rem;
}

.crm-price {
	font-weight: 800;
	font-size: 0.95rem;
	color: var(--crm-pistachio-dark);
}

/* Circular + like coffee app */
.crm-btn-plus {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 50%;
	background: var(--crm-pistachio-dark);
	color: #fff;
	font-size: 1.35rem;
	font-weight: 400;
	line-height: 1;
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(79, 110, 69, 0.3);
	transition: transform 0.15s, background 0.2s;
	padding: 0;
	font-family: inherit;
}

.crm-btn-plus span {
	display: block;
	margin-top: -1px;
}

.crm-btn-plus:hover {
	background: var(--crm-pistachio);
}

.crm-btn-plus:active {
	transform: scale(0.92);
}

/* ========== Modal (fixed to viewport, not trapped) ========== */
.crm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	font-family: var(--crm-font);
	direction: rtl;
}

.crm-modal[hidden] {
	display: none !important;
}

.crm-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(31, 42, 28, 0.48);
	border: none;
	padding: 0;
	cursor: pointer;
}

.crm-modal-panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 430px;
	max-height: min(92dvh, 920px);
	background: var(--crm-cream);
	border-radius: 28px 28px 0 0;
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
	animation: crm-sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.crm-modal-close {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--crm-white);
	color: var(--crm-ink);
	cursor: pointer;
	display: grid;
	place-items: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	padding: 0;
}

.crm-modal-scroll {
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	flex: 1 1 auto;
	min-height: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.crm-modal-scroll::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.crm-modal-hero {
	position: relative;
	height: 240px;
	flex-shrink: 0;
	background: #ddd5c8;
	overflow: hidden;
}

.crm-gallery {
	position: relative;
	width: 100%;
	height: 100%;
	direction: ltr;
	overflow: hidden;
	touch-action: pan-y;
}

.crm-gallery-track {
	display: flex;
	height: 100%;
	width: 100%;
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.crm-gallery-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	border: none;
	padding: 0;
	margin: 0;
	background: #ddd5c8;
	cursor: zoom-in;
	overflow: hidden;
	display: block;
	position: relative;
}

.crm-gallery-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	pointer-events: none;
	user-select: none;
}

.crm-gallery-slide.is-placeholder {
	cursor: default;
	display: grid;
	place-items: center;
	background: linear-gradient(160deg, #e8dfd2, #d9d0c2);
}

.crm-gallery-slide.is-placeholder img {
	width: 42%;
	height: auto;
	max-height: 55%;
	object-fit: contain;
	border-radius: 20px;
	box-shadow: 0 8px 24px rgba(47, 58, 42, 0.12);
}

.crm-gallery-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 253, 249, 0.92);
	color: var(--crm-ink);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	display: grid;
	place-items: center;
	padding: 0;
}

.crm-gallery-prev { left: 10px; }
.crm-gallery-next { right: 10px; }

.crm-gallery-dots {
	position: absolute;
	bottom: 12px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 6px;
	z-index: 2;
	pointer-events: none;
}

.crm-gallery-dot {
	pointer-events: auto;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: rgba(255, 255, 255, 0.55);
	cursor: pointer;
}

.crm-gallery-dot.is-active {
	background: #fff;
	transform: scale(1.2);
	box-shadow: 0 0 0 2px rgba(79, 110, 69, 0.35);
}

.crm-gallery-hint {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(31, 42, 28, 0.45);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	z-index: 2;
	opacity: 0.9;
}

/* Lightbox */
.crm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.crm-lightbox[hidden] {
	display: none !important;
}

.crm-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 10, 0.88);
	cursor: pointer;
}

.crm-lightbox img {
	position: relative;
	z-index: 1;
	max-width: min(96vw, 900px);
	max-height: 88vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.crm-lightbox-close {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	font-size: 1.6rem;
	cursor: pointer;
	line-height: 1;
}

.crm-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	font-size: 1.6rem;
	cursor: pointer;
	display: grid;
	place-items: center;
}

.crm-lightbox-prev { left: 12px; }
.crm-lightbox-next { right: 12px; }

.crm-modal-content {
	padding: 1.15rem 1.2rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
}

.crm-modal-head {
	margin-bottom: 0.85rem;
}

.crm-modal-content h2,
#crm-modal-title {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--crm-pistachio-dark);
	line-height: 1.3;
}

.crm-modal-meta {
	margin: 0;
	font-size: 0.84rem;
	color: var(--crm-muted);
	line-height: 1.45;
}

.crm-modal-price {
	margin: 0.55rem 0 0;
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--crm-pistachio-dark);
}

.crm-modal-desc {
	font-size: 0.92rem;
	line-height: 1.75;
	color: var(--crm-ink);
}

.crm-modal-desc p {
	margin: 0 0 0.65rem;
}

.crm-reviews {
	margin-top: 1.35rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(47, 58, 42, 0.08);
}

.crm-reviews h3,
.crm-review-form-wrap h3 {
	margin: 0 0 0.7rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--crm-pistachio-dark);
}

.crm-review-item {
	background: var(--crm-white);
	border-radius: 14px;
	padding: 0.75rem 0.85rem;
	margin-bottom: 0.5rem;
	box-shadow: 0 2px 8px rgba(47, 58, 42, 0.04);
}

.crm-review-item .crm-r-head {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.8rem;
	margin-bottom: 0.3rem;
}

.crm-review-item .crm-r-author {
	font-weight: 700;
}

.crm-review-item .crm-r-stars {
	color: #C4A035;
}

.crm-review-item .crm-r-body {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--crm-muted);
}

.crm-review-empty {
	font-size: 0.85rem;
	color: var(--crm-muted);
	margin: 0 0 0.5rem;
}

.crm-review-form-wrap {
	margin-top: 1.15rem;
}

.crm-review-form label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 0.3rem;
	color: var(--crm-ink);
}

.crm-review-form input[type="text"],
.crm-review-form input[type="email"],
.crm-review-form textarea {
	width: 100%;
	font-family: inherit;
	font-size: 0.9rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--crm-cream-dark);
	border-radius: 12px;
	background: var(--crm-white);
	color: var(--crm-ink);
	margin-bottom: 0.65rem;
}

.crm-review-form input:focus,
.crm-review-form textarea:focus {
	outline: 2px solid var(--crm-pistachio);
	outline-offset: 1px;
	border-color: transparent;
}

.crm-btn-submit {
	width: 100%;
	border: none;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	padding: 0.8rem;
	border-radius: 14px;
	background: var(--crm-pistachio-dark);
	color: #fff;
	cursor: pointer;
}

.crm-btn-submit:hover {
	background: var(--crm-pistachio);
}

.crm-btn-submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.crm-form-msg {
	font-size: 0.85rem;
	padding: 0.5rem 0.65rem;
	border-radius: 8px;
	margin-bottom: 0.65rem;
}

.crm-form-msg.is-ok {
	background: var(--crm-pistachio-soft);
	color: var(--crm-pistachio-dark);
}

.crm-form-msg.is-err {
	background: #fde8e8;
	color: #8b3a3a;
}

.crm-stars-input {
	display: inline-flex;
	flex-direction: row-reverse;
	gap: 0.2rem;
	margin-bottom: 0.65rem;
	position: relative;
}

.crm-stars-input input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 1px;
	height: 1px;
}

.crm-stars-input label {
	font-size: 1.6rem;
	color: #cfc8bc;
	cursor: pointer;
	transition: color 0.15s, transform 0.15s;
	line-height: 1;
	margin: 0 !important;
}

.crm-stars-input label:hover,
.crm-stars-input label:hover ~ label,
.crm-stars-input input:checked ~ label {
	color: #C4A035;
}

.crm-stars-input label:hover {
	transform: scale(1.08);
}

@keyframes crm-sheet-up {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

@media (min-width: 768px) {
	body:not(.crm-standalone) .crm-app {
		max-width: 430px;
		margin: 1.5rem auto;
		border-radius: 28px;
		box-shadow: var(--crm-shadow);
		min-height: auto;
	}

	.crm-modal {
		align-items: center;
		padding: 1.25rem;
	}

	.crm-modal-panel {
		border-radius: 28px;
		max-height: min(88vh, 760px);
	}
}

body.crm-modal-open {
	overflow: hidden;
}

.single-raz_menu_item .crm-stars-input {
	margin-top: 0.35rem;
}
