/* =========================================================
   UniDash Restaurant Home (EatSure-style)
   File: assets/css/restaurant-home.css
   ========================================================= */

/* ---------- Hero Section ---------- */
.ud-rh-wrap {
  min-height: 100vh;
  background: var(--ud-bg);
}

.ud-rh-hero {
  position: relative;
  min-height: 380px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1a1a1a;
}

.ud-rh-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
}

.ud-rh-hero-inner {
  position: relative;
  z-index: 2;
  /* Align with global header/footer width (no design change, just consistent gutters) */
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 32px;
}

/* ---------- EatSure-like hero row (left brand image) ---------- */
.ud-rh-hero-row {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 44px;
  align-items: center;
}

.ud-rh-brand {
  width: 360px;
  height: 360px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ud-rh-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ud-rh-hero-right {
  min-width: 0;
}

.ud-rh-hero-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 980px) {
  .ud-rh-hero-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .ud-rh-brand {
    width: 100%;
    height: 240px;
  }
}

.ud-rh-logo {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.ud-rh-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ud-rh-titlebox {
  flex: 1;
  min-width: 0;
  color: #fff;
  padding-top: 8px;
}

.ud-rh-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 8px 0;
  color: #fff;
}

.ud-rh-tagline {
  font-size: 16px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
}

.ud-rh-offers-section {
  margin-top: 24px;
}

.ud-rh-offers-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px 0;
}

.ud-rh-offers-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ud-rh-offer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ud-text-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ud-rh-offer-icon {
  font-size: 18px;
}

.ud-rh-offer-text {
  line-height: 1.3;
}

/* ---------- Body Section ---------- */
.ud-rh-body {
  /* Align with global header/footer width (keeps left/right edges consistent) */
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.ud-rh-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

/* ---------- Left Sidebar ---------- */
.ud-rh-left {
  position: sticky;
  top: 80px;
  background: var(--ud-bg);
}

.ud-rh-left-head {
  font-size: 20px;
  font-weight: 800;
  color: var(--ud-text-strong);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ud-border-subtle);
}

.ud-rh-cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ud-rh-cat {
  position: relative;
  padding: 10px 12px 10px 18px;
  cursor: pointer;
  color: #202124;
  background: transparent;
}

.ud-rh-cat:hover {
  background: #f8f9fa;
}

/* left vertical bar */
.ud-rh-cat.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--ud-primary); /* UniDash magenta */
  border-radius: 2px;
}

/* Active category count: bold + black + inline (no subscript look) */
.ud-rh-cat {
  display: flex;
  align-items: center;            /* keeps count vertically centered */
  justify-content: space-between; /* name left, count right */
  gap: 10px;
}

.ud-rh-cat-count {
  line-height: 1;      /* prevents “subscript” feel */
  margin: 0;
  padding: 0;
  transform: none;
  vertical-align: baseline;
}

/* when active: make bold + black */
.ud-rh-cat.active {
  color: var(--ud-text-main); /* black (same as text) */
  font-weight: 700;           /* bold */
}

/* when active: make count bold + black */
.ud-rh-cat.active .ud-rh-cat-count {
  color: var(--ud-text-main); /* black (same as text) */
  font-weight: 700;           /* bold */
}

.ud-rh-price-wrapper {
  display:flex;
  align-items: baseline;
}

.ud-rh-currency-label {
  font-size: 25px !important;
  font-weight: 800 !important;
  line-height: 1;
  display: inline-block;
}

/* ---------- Right Content ---------- */
.ud-rh-right {
  min-height: 500px;
}

.ud-rh-right-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ud-border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.ud-rh-right-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--ud-text-strong);
  margin: 0;
}

.ud-rh-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ud-rh-search {
  position: relative;
}

.ud-rh-search input {
  width: 280px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ud-border-subtle);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ud-text-main);
  background: var(--ud-bg);
  outline: none;
  transition: all 0.2s;
}

.ud-rh-search input:focus {
  border-color: var(--ud-primary);
  box-shadow: 0 0 0 3px rgba(184, 27, 132, 0.1);
}

.ud-rh-search input::placeholder {
  color: var(--ud-text-muted);
}

/* Sort Button */
.ud-rh-sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 40px;
  border: 1px solid var(--ud-border-subtle);
  border-radius: 8px;
  background: var(--ud-bg);
  color: var(--ud-text-strong);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ud-rh-sort-btn:hover {
  border-color: var(--ud-primary);
}

.ud-rh-sort-icon {
  width: 18px;
  height: 18px;
  filter: var(--ud-primary);
}

/* ---------- Items Grid - RECTANGULAR CARDS ---------- */
.ud-rh-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.ud-rh-item-section {
  grid-column: 1 / -1;
  scroll-margin-top: 120px;
}

.ud-rh-item-section + .ud-rh-item-section {
  margin-top: 18px;
}

.ud-rh-item-section-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
  color: #1f2933;
}

.ud-rh-item-section-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.ud-rh-item {
  position: relative;
  background: var(--ud-bg);
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.ud-rh-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ud-rh-bogo-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 85px;
  height: 33px;
  z-index: 1000;
  pointer-events: none;
  object-fit: contain;
}

.ud-rh-item-img {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 5px 5px 0 0;
  z-index: 1;
}

.ud-rh-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ud-rh-item-no-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 100%);
}

.ud-rh-item-body {
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 1;
}

.ud-rh-item-name {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.ud-rh-item-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ud-rh-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #d1fae5;
  color: #065f46;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  width: fit-content;
}

.ud-rh-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.ud-rh-price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.ud-rh-currency {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.ud-rh-price {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

/* Original price shown struck-through (red) when an offer price is active */
.ud-rh-price-original {
  font-size: 14px;
  font-weight: 600;
  color: #EF4444;
  text-decoration: line-through;
  text-decoration-color: #EF4444;
  text-decoration-thickness: 2px;
  margin-right: 4px;
}

.ud-rh-add-btn {
  padding: 8px 24px;
  border: 1.5px solid var(--ud-primary);
  border-radius: 6px;
  background: transparent;
  color: var(--ud-primary);
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
  cursor: pointer;
  transition: all 0.2s;
}

.ud-rh-add-btn:hover {
  background: var(--ud-primary);
  color: #fff;
}

.ud-rh-add-btn:active {
  transform: scale(0.98);
}

.ud-cart-qty-control {
  height: 36px;
  min-width: 128px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid var(--ud-primary);
  border-radius: 14px;
  background: #fff;
  color: var(--ud-primary);
  overflow: hidden;
}

.ud-cart-qty-btn {
  width: 42px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ud-primary);
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
}

.ud-cart-qty-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ud-cart-qty-value {
  min-width: 42px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #111;
  border-left: 1px solid rgba(124, 58, 237, 0.22);
  border-right: 1px solid rgba(124, 58, 237, 0.22);
}

/* ---------- Sort Modal ---------- */
.ud-rh-sort-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.ud-rh-sort-modal.active {
  display: flex;
}

.ud-rh-sort-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.ud-rh-sort-dialog {
  position: relative;
  width: 90%;
  max-width: 450px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.ud-rh-sort-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.ud-rh-sort-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.ud-rh-sort-close {
  width: 28px;
  height: 28px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ud-rh-sort-close:hover {
  background: #e5e7eb;
}

.ud-rh-sort-main {
  display: flex;
  min-height: 200px;
}

.ud-rh-sort-sidebar {
  width: 140px;
  background: #f9fafb;
  padding: 16px 0;
}

.ud-rh-sort-tab {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}

.ud-rh-sort-tab.active {
  background: #ede9fe;
  color: var(--ud-primary);
  border-right: 3px solid var(--ud-primary);
}

.ud-rh-sort-options {
  flex: 1;
  padding: 16px 20px;
}

.ud-rh-sort-radio {
  display: flex;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
}

.ud-rh-sort-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0 12px 0 0;
  cursor: pointer;
  accent-color: var(--ud-primary);
}

.ud-rh-sort-radio span {
  font-size: 15px;
  color: #111827;
}

.ud-rh-sort-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
}

.ud-rh-sort-clear-btn {
  flex: 1;
  padding: 10px 20px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  background: transparent;
  color: #374151;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.ud-rh-sort-clear-btn:hover {
  border-color: #9ca3af;
}

.ud-rh-sort-apply-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--ud-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.ud-rh-sort-apply-btn:hover {
  background: var(--ud-brand);
}

/* ---------- Skeleton Loader ---------- */
.ud-rh-skel {
  background: var(--ud-bg);
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  animation: pulse 1.5s ease-in-out infinite;
}

.ud-rh-skel .b {
  height: 220px;
  background: #e5e5e5;
}

.ud-rh-skel .t {
  height: 20px;
  background: #e5e5e5;
  margin: 12px 16px 8px;
  border-radius: 4px;
}

.ud-rh-skel .t2 {
  height: 16px;
  background: #e5e5e5;
  margin: 0 16px 16px;
  width: 60%;
  border-radius: 4px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ud-rh-grid {
    grid-template-columns: 200px 1fr;
    gap: 24px;
  }

  .ud-rh-items {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .ud-rh-hero-inner {
    padding: 24px 16px;
  }

  .ud-rh-hero-card {
    gap: 16px;
  }

  .ud-rh-logo {
    width: 80px;
    height: 80px;
  }

  .ud-rh-title {
    font-size: 24px;
  }

  .ud-rh-body {
    padding: 24px 16px 40px;
  }

  .ud-rh-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ud-rh-left {
    position: static;
    border-bottom: 1px solid var(--ud-border-subtle);
    padding-bottom: 16px;
  }

  .ud-rh-cats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .ud-rh-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .ud-rh-item-img {
    height: 180px;
  }

  .ud-rh-right-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ud-rh-search input {
    width: 100%;
  }

  .ud-rh-filters {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ud-rh-title {
    font-size: 20px;
  }

  .ud-rh-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .ud-rh-item-img {
    height: 160px;
  }

  .ud-rh-item-name {
    font-size: 14px;
  }

  .ud-rh-item-desc {
    font-size: 12px;
  }

  .ud-rh-price {
    font-size: 16px;
  }

  .ud-rh-add-btn {
    padding: 6px 16px;
    font-size: 12px;
  }

  .ud-rh-bogo-badge {
    width: 75px;
    height: 29px;
  }

  .ud-rh-sort-dialog {
    width: 95%;
  }
}

/* ===== RESPONSIVE: VERY SMALL MOBILE (400px) ===== */
@media (max-width: 400px) {
  .ud-rh-hero-inner {
    padding: 16px 12px;
  }

  .ud-rh-hero-card {
    gap: 12px;
  }

  .ud-rh-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
  }

  .ud-rh-title {
    font-size: 18px;
  }

  .ud-rh-tagline {
    font-size: 14px;
  }

  .ud-rh-body {
    padding: 16px 12px 30px;
  }

  .ud-rh-left-head {
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .ud-rh-cats {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ud-rh-cat {
    padding: 8px 10px 8px 14px;
    font-size: 13px;
  }

  .ud-rh-right-title {
    font-size: 20px;
  }

  .ud-rh-search input {
    width: 100%;
    height: 36px;
    font-size: 13px;
    padding: 0 12px;
  }

  .ud-rh-sort-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .ud-rh-items {
    gap: 8px;
  }

  .ud-rh-item-img {
    height: 140px;
  }

  .ud-rh-item-body {
    padding: 8px 10px 0;
  }

  .ud-rh-item-name {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .ud-rh-item-desc {
    font-size: 11px;
    margin-bottom: 6px;
    -webkit-line-clamp: 1;
  }

  .ud-rh-item-footer {
    padding: 8px 10px;
  }

  .ud-rh-currency {
    font-size: 12px;
  }

  .ud-rh-price {
    font-size: 14px;
  }

  .ud-rh-add-btn {
    padding: 5px 12px;
    font-size: 11px;
  }

  .ud-rh-bogo-badge {
    width: 65px;
    height: 26px;
    top: -3px;
    left: -3px;
  }

  .ud-rh-offer-item {
    padding: 8px 12px;
    font-size: 12px;
    gap: 8px;
  }

  .ud-rh-offer-icon {
    font-size: 16px;
  }

  /* Sort Modal on small screens */
  .ud-rh-sort-main {
    flex-direction: column;
    min-height: auto;
  }

  .ud-rh-sort-sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding: 8px 12px;
  }

  .ud-rh-sort-tab {
    white-space: nowrap;
    padding: 8px 14px;
  }

  .ud-rh-sort-tab.active {
    border-right: none;
    border-bottom: 3px solid var(--ud-primary);
  }

  .ud-rh-sort-options {
    padding: 12px 16px;
  }

  .ud-rh-sort-radio {
    padding: 10px 0;
  }

  .ud-rh-sort-footer {
    padding: 12px 16px;
  }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .ud-rh-hero {
    min-height: 280px;
  }

  .ud-rh-brand {
    width: 200px;
    height: 200px;
  }

  .ud-rh-logo {
    width: 70px;
    height: 70px;
  }

  .ud-rh-title {
    font-size: 22px;
  }

  .ud-rh-grid {
    grid-template-columns: 180px 1fr;
    gap: 20px;
  }

  .ud-rh-items {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .ud-rh-item-img {
    height: 120px;
  }
}

/* =========================================================
   HERO: Applicable Offers (ud-id-offers-row) - title + bars + scroll
   ========================================================= */

/* Show title + separators ONLY when offers strip is visible */
.ud-rh-hero .ud-id-offers-strip{
  margin-top: 18px;
  padding-top: 14px;
  padding-bottom: 10px;

  /* the two horizontal bars */
  border-top: 1px solid rgba(255,255,255,.35);
  border-bottom: 1px solid rgba(255,255,255,.35);

  /* make sure it can shrink and allow inner scrolling */
  min-width: 0;
}

/* "Applicable Offers" text */
.ud-rh-hero .ud-id-offers-strip::before{
  content: "Applicable Offers";
  display: block;
  margin: 0 0 10px 0;

  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

/* Force horizontal scrolling to work (even if other CSS overrides it) */
.ud-rh-hero .ud-id-offers-row{
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;

  max-width: 100%;
  min-width: 0;

  -webkit-overflow-scrolling: touch;
  padding: 0 0 8px;

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
}

.ud-rh-hero .ud-id-offers-row::-webkit-scrollbar{ height: 6px; }
.ud-rh-hero .ud-id-offers-row::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.35);
  border-radius: 999px;
}

/* Promotions reuse the menu layout with an image-only, uncropped hero. */
.ud-rh-hero.ud-rh-hero--promotion {
  min-height: 0;
  max-width: 1280px;
  margin: 0 auto;
  background: transparent;
}
.ud-rh-hero--promotion > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 720;
  object-fit: contain;
}
