/**
 * Smart Restaurant Menu - Main Styles
 * Swiggy/Zomato style, mobile-first
 */

:root {
	--srm-accent: #e74c3c;
	--srm-accent-dark: #c0392b;
	--srm-bg: #f8f9fa;
	--srm-card-bg: #ffffff;
	--srm-text: #2c3e50;
	--srm-text-muted: #7f8c8d;
	--srm-border: #ecf0f1;
	--srm-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	--srm-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
	--srm-radius: 12px;
	--srm-radius-sm: 8px;
	--srm-transition: 0.25s ease;
	--srm-sticky-offset: 0px;
}

.srm-menu-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	color: var(--srm-text);
	background: var(--srm-bg);
	padding: 1rem 0 2rem;
}

/* Top-level Section Tabs (Menu | Lunch Combos) */
.srm-section-tabs-wrap {
	background: var(--srm-card-bg);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	padding: 1rem;
	margin: 0 -1rem 1.5rem;
}

.srm-section-tabs {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.srm-section-tab {
	padding: 0.75rem 1.5rem;
	border: 2px solid var(--srm-border);
	border-radius: var(--srm-radius);
	background: var(--srm-card-bg);
	color: var(--srm-text);
	font-size: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: all var(--srm-transition);
}

.srm-section-tab:hover {
	border-color: var(--srm-accent);
	color: var(--srm-accent);
}

.srm-section-tab.srm-tab-active {
	background: var(--srm-accent);
	border-color: var(--srm-accent);
	color: #fff;
}

.srm-section-content {
	display: none;
}

.srm-section-content.srm-section-active {
	display: block;
}

/* Lunch Combos header */
.srm-lunch-combos-header {
	text-align: center;
	margin-bottom: 1.5rem;
	padding: 0 1rem;
}

.srm-lunch-combos-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 0.25rem;
}

.srm-lunch-combos-subtitle {
	font-size: 0.9rem;
	color: var(--srm-text-muted);
	margin: 0;
}

.srm-lunch-combos-container .srm-category-tabs-wrap {
	display: none;
}

/* Category Tabs - Sticky horizontal scroll */
.srm-category-tabs-wrap {
	position: sticky;
	top: var(--srm-sticky-offset, 0px);
	z-index: 100;
	background: var(--srm-card-bg);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	padding: 0.75rem 0;
	margin: 0 -1rem 1.5rem;
}

.srm-category-tabs-wrap.srm-tabs-fixed {
	position: fixed;
	z-index: 150;
	margin: 0;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.srm-tabs-placeholder {
	display: none;
	width: 100%;
}

.srm-tabs-placeholder.srm-placeholder-active {
	display: block;
}

.srm-category-tabs-wrap::after,
.srm-category-tabs-wrap::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 24px;
	pointer-events: none;
	z-index: 2;
}

.srm-category-tabs-wrap::before {
	left: 0;
	background: linear-gradient(to right, var(--srm-card-bg), transparent);
}

.srm-category-tabs-wrap::after {
	right: 0;
	background: linear-gradient(to left, var(--srm-card-bg), transparent);
}

.srm-category-tabs {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 0 1rem;
	scroll-behavior: smooth;
}

.srm-category-tabs::-webkit-scrollbar {
	display: none;
}

.srm-tab {
	flex-shrink: 0;
	padding: 0.5rem 1rem;
	border: 2px solid var(--srm-border);
	border-radius: var(--srm-radius);
	background: var(--srm-card-bg);
	color: var(--srm-text);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--srm-transition);
	white-space: nowrap;
}

.srm-tab:hover {
	border-color: var(--srm-accent);
	color: var(--srm-accent);
}

.srm-tab.srm-tab-active {
	background: var(--srm-accent);
	border-color: var(--srm-accent);
	color: #fff;
}

/* Category Sections */
.srm-items-container {
	padding: 0 0.5rem;
}

.srm-category-section {
	margin-bottom: 2rem;
	scroll-margin-top: 100px;
}

.srm-category-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 1rem;
	padding: 0 0.5rem;
	color: var(--srm-text);
}

/* Items Grid */
.srm-items-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

.srm-item-card {
	background: var(--srm-card-bg);
	border-radius: var(--srm-radius);
	overflow: hidden;
	box-shadow: var(--srm-shadow);
	transition: box-shadow var(--srm-transition);
	position: relative;
	display: flex;
	flex-direction: column;
}

.srm-item-card:hover {
	box-shadow: var(--srm-shadow-hover);
}

/* Badge */
.srm-item-badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 2;
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
}

.srm-badge-veg {
	background: #27ae60;
	color: #fff;
}

.srm-badge-nonveg {
	background: #e74c3c;
	color: #fff;
}

/* Image */
.srm-item-image-wrap {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--srm-border);
}

.srm-item-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--srm-transition);
}

.srm-item-card:hover .srm-item-image {
	transform: scale(1.05);
}

.srm-item-image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
}

/* Content */
.srm-item-content {
	padding: 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.srm-item-title {
	margin: 0 0 0.25rem;
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.3;
}

.srm-item-trigger {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	font-weight: 600;
	color: #000;
	text-align: left;
	cursor: pointer;
	text-decoration: none;
	display: inline;
}

.srm-item-trigger:hover {
	color: #000;
	text-decoration: underline;
}

.srm-item-desc {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	color: var(--srm-text-muted);
	line-height: 1.4;
	flex: 1;
}

.srm-item-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: auto;
}

.srm-item-price {
	font-size: 1rem;
	font-weight: 700;
	color: var(--srm-accent);
}

.srm-order-btn {
	display: inline-block;
	padding: 0.4rem 1rem;
	background: var(--srm-accent);
	color: #fff !important;
	border-radius: var(--srm-radius-sm);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	transition: background var(--srm-transition);
	border: none;
	cursor: pointer;
}

.srm-order-btn:hover {
	background: var(--srm-accent-dark);
	color: #fff !important;
}

/* Empty states */
.srm-no-categories,
.srm-no-items {
	text-align: center;
	padding: 2rem;
	color: var(--srm-text-muted);
}

/* Modal */
.srm-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.srm-modal.srm-modal-open {
	opacity: 1;
	visibility: visible;
}

.srm-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
}

.srm-modal-content {
	position: relative;
	background: var(--srm-card-bg);
	border-radius: var(--srm-radius);
	max-width: 480px;
	width: 100%;
	max-height: 90vh;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	transform: scale(0.95);
	transition: transform 0.3s ease;
}

.srm-modal-open .srm-modal-content {
	transform: scale(1);
}

body.srm-modal-open-body {
	overflow: hidden;
}

.srm-modal-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 10;
	width: 36px;
	height: 36px;
	border: none;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.srm-modal-close:hover {
	background: rgba(0, 0, 0, 0.7);
}

.srm-modal-body {
	overflow-y: auto;
	max-height: 90vh;
}

.srm-modal-loading {
	padding: 1.5rem;
}

.srm-modal-data {
	padding: 0;
}

.srm-modal-image-wrap {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--srm-border);
	position: relative;
}

.srm-modal-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.srm-modal-image-placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.srm-modal-image-placeholder::before {
	content: "🍽";
	font-size: 3rem;
	opacity: 0.5;
}

.srm-modal-info {
	padding: 1.5rem;
}

.srm-modal-badge {
	display: inline-block;
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
}

.srm-modal-badge.srm-badge-veg {
	background: #27ae60;
	color: #fff;
}

.srm-modal-badge.srm-badge-nonveg {
	background: #e74c3c;
	color: #fff;
}

.srm-modal-badge:empty {
	display: none;
}

.srm-modal-title {
	margin: 0 0 0.75rem;
	font-size: 1.4rem;
	font-weight: 700;
}

.srm-modal-description {
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--srm-text-muted);
	margin-bottom: 1rem;
}

.srm-modal-description p:last-child {
	margin-bottom: 0;
}

.srm-modal-price-wrap {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.srm-modal-price {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--srm-accent);
}

.srm-modal-order {
	margin-left: auto;
}

/* Skeleton loaders */
.srm-skeleton {
	background: linear-gradient(90deg, #ecf0f1 25%, #e0e0e0 50%, #ecf0f1 75%);
	background-size: 200% 100%;
	animation: srm-skeleton-pulse 1.5s ease-in-out infinite;
	border-radius: var(--srm-radius-sm);
}

@keyframes srm-skeleton-pulse {
	0%, 100% { background-position: 200% 0; }
	50% { background-position: -200% 0; }
}

.srm-skeleton-image {
	height: 120px;
	margin-bottom: 1rem;
}

.srm-skeleton-title {
	height: 24px;
	width: 70%;
	margin-bottom: 0.75rem;
}

.srm-skeleton-text {
	height: 16px;
	width: 100%;
	margin-bottom: 0.5rem;
}

.srm-skeleton-text:last-of-type {
	width: 60%;
}
