/* BestRestrn Next Generation — Modern UI Engine */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #e63946;
  --primary-hover: #d62828;
  --primary-light: #fff0f1;
  --secondary: #1d3557;
  --secondary-hover: #14213d;
  --accent: #f77f00;
  --accent-light: #fef3e2;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --font-ar: 'Tajawal', sans-serif;
  --font-en: 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body {
  font-family: var(--font-ar);
}

html[dir="ltr"] body {
  font-family: var(--font-en);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.header-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.brand-logo span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.1rem;
}

/* Hero Search Banner */
.hero-section {
  background: linear-gradient(135deg, #1d3557 0%, #0f172a 100%);
  color: #ffffff;
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 1rem;
  text-align: center;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #cbd5e1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.search-box-wrapper {
  background: #ffffff;
  padding: 0.6rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.search-input-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  padding: 0.6rem 1rem;
  border-right: 1px solid var(--border);
}

html[dir="rtl"] .search-input-group {
  border-right: none;
  border-left: 1px solid var(--border);
}

.search-input-group:last-child {
  border: none;
}

.search-input-group input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-main);
  background: transparent;
}

.search-autocomplete-dropdown {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 100;
  display: none;
  max-height: 380px;
  overflow-y: auto;
}

/* Category Quick Pills */
.category-pills-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1.5rem 0 0.5rem;
  scrollbar-width: none;
}

.category-pills-row::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.cat-pill:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Card Grids */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Deal Card */
.deal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.deal-card-img-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  background: #e2e8f0;
  overflow: hidden;
}

.deal-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.deal-card:hover .deal-card-img-wrap img {
  transform: scale(1.04);
}

.deal-discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow);
}

html[dir="rtl"] .deal-discount-badge {
  right: auto;
  left: 10px;
}

.deal-verified-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

html[dir="rtl"] .deal-verified-badge {
  right: auto;
  left: 10px;
}

.deal-card-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.deal-rest-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.deal-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

.deal-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.deal-price-current {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
}

.deal-price-old {
  font-size: 0.875rem;
  text-decoration: line-through;
  color: var(--text-muted);
}

.deal-savings-tag {
  background: var(--success-light);
  color: var(--success);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Restaurant Card */
.rest-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rest-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.rest-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  background: #f1f5f9;
  overflow: hidden;
  flex-shrink: 0;
}

.rest-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rest-info-wrap {
  flex: 1;
}

.rest-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.rest-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge-rating {
  background: #fef08a;
  color: #854d0e;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
}

/* Section Titles */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    height: 60px;
  }
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .search-box-wrapper {
    flex-direction: column;
    padding: 0.75rem;
  }
  .search-input-group {
    border: none !important;
    width: 100%;
    padding: 0.4rem 0;
  }
  .search-box-wrapper .btn {
    width: 100%;
  }
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
  }
}
