@import url('template.css');

/* ========== Base / Reset ========== */
html,
body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto !important;
  touch-action: auto !important;
}

body {
  margin: 0;
  padding: 0;
  position: relative;
}

body.modal-open {
  overflow: hidden !important;
}

.page {
  display: block;
  padding-bottom: 1rem;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: block !important;
  overflow: visible !important;
  padding-bottom: 6rem;
}

main {
  display: block !important;
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
  padding-top: 7.6rem !important;
  padding-bottom: 6rem;
  -webkit-overflow-scrolling: touch;
}

/* ========== Header ========== */
header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1600;
  background: var(--bg-soft);
  padding: 0.65rem 0.75rem 0.2rem !important;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 52px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-left > div:last-child {
  min-width: 0;
}

.brand-left .logo-circle {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.brand-logo-image {
  object-fit: cover;
  display: block;
}

.brand-text-title,
.brand-text-sub {
  line-height: 1.15;
}

.brand-text-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.header-btn {
  flex: 0 0 auto;
  align-self: center;
}

/* ========== Tabs ========== */
.tab-row-wrap {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1499;
  background: var(--bg-soft);
  padding: 3px 0.75rem;
  margin: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-row,
.tab-row-wrap .tab-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 0;
  padding: 0.08rem 0 0.18rem;
  scrollbar-width: none;
}

#checkoutPage .tab-row-wrap {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1499;
  background: var(--bg-soft);
  padding: 2px 0.75rem 4px;
  margin: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========== Menu / Sections ========== */
.menu-category-section {
  scroll-margin-top: 7.8rem;
  margin-bottom: 1.2rem;
}

.section-head {
  margin-bottom: 0.65rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-items {
  display: grid;
  gap: 0.72rem;
}

.menu-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.78rem 0.82rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.menu-item-body {
  margin-bottom: 0.62rem;
}

.menu-item.has-image .menu-item-body {
  display: grid !important;
  grid-template-columns: 56px minmax(0, 1fr) !important;
  grid-template-areas:
    "image head"
    "desc desc" !important;
  column-gap: 0.65rem !important;
  row-gap: 0.5rem !important;
  align-items: start !important;
}

.menu-item:not(.has-image) .menu-item-body {
  display: block !important;
}

.menu-media {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #151515;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.menu-item.has-image .menu-media {
  grid-area: image !important;
}

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

.menu-content {
  margin: 5px 0 0;
  flex: 1 1 auto;
  min-width: 0;
}

.menu-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.menu-item.has-image .menu-head {
  grid-area: head !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 0.65rem !important;
  min-width: 0 !important;
  margin-bottom: 0 !important;
}

.menu-text {
  min-width: 0;
  flex: 1 1 auto;
}

.menu-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.menu-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item.has-image .menu-desc {
  grid-area: desc !important;
  display: block !important;
  width: 100% !important;
  margin-top: 0 !important;
  padding-top: 0.1rem;
  line-height: 1.4;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  overflow: visible !important;
}

.price {
  font-weight: 800;
  color: var(--yellow);
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 212, 0, 0.12);
  border: 1px solid rgba(255, 212, 0, 0.25);
  font-size: 0.68rem;
  color: var(--yellow);
  margin-top: 0.4rem;
}

.menu-item .btn {
  padding: 0.3rem 0.85rem;
}

/* ========== Footer Nav ========== */
.footer-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 0.75rem;
  z-index: 1500;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.nav-link.active,
.nav-link:hover {
  color: var(--yellow);
}

.cart-pill {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.25rem;
  font-size: 0.68rem;
}

/* ========== Modal ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 2500;
}

.modal-backdrop.active {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 430px;
  max-height: 88vh;
  overflow: auto;
  background: var(--bg-soft);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  padding: 1rem 1rem 1.2rem;
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.choice-group {
  margin: 0.9rem 0;
}

.choice-title {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: capitalize;
  letter-spacing: 0.12em;
  margin-bottom: 0.45rem;
}

.choice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 0.45rem;
  background: var(--card);
}

.choice-row input {
  margin-right: 0.55rem;
}

.choice-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.qty-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: var(--yellow);
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

/* ========== Forms ========== */
textarea,
input[type="text"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #181818;
  color: #fff;
}

.validation-note {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
}

.field-label {
  display: block;
}

.static-row {
  justify-content: flex-start;
}

/* ========== Checkout ========== */
.checkout-card {
  margin-bottom: 0.8rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.mini {
  font-size: 0.72rem;
  color: var(--muted);
}

.first-screen-card {
  margin-top: 5rem;
}

.start-buttons,
.checkout-actions,
.payment-method-list {
  display: grid;
  gap: 0.7rem;
}

#savedLocationText {
  background: #181818;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
}

#paymentMethodsCard {
  display: grid;
  gap: 0.55rem;
}

#paymentMethodsCard .field-label {
  margin-top: 0.1rem;
}

#paymentMethodsCard .grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

#paymentMethodsCard .choice-row {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

#paymentMethodsCard .choice-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#checkoutPage .summary-row strong .price-stack {
  align-items: flex-end;
}

#resetOrderBtn {
  display: none;
}

/* ========== Admin ========== */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: #111;
  color: #fff;
}

.admin-sidebar {
  background: #161616;
  border-right: 1px solid #2a2a2a;
  padding: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-sidebar a {
  display: block;
  color: #ddd;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  margin-bottom: 0.35rem;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: #262626;
  color: #fff;
}

.admin-main {
  padding: 1.2rem;
}

.panel {
  background: #1a1a1a;
  border: 1px solid #2f2f2f;
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.72rem;
  border-bottom: 1px solid #2a2a2a;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}

.data-table th {
  color: #bbb;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ========== Grids ========== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* ========== Alerts ========== */
.flash {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.flash.success {
  background: #16381a;
  color: #c0f6c8;
}

.flash.error {
  background: #401818;
  color: #ffd4d4;
}

/* ========== Buttons ========== */
.btn,
.header-btn,
.nav-link,
.tab,
.icon-btn {
  -webkit-tap-highlight-color: transparent;
}

.btn-red,
.btn-yellow,
.header-btn,
.btn.btn-ghost,
.btn.btn-outline-yellow,
.menu-item .btn,
.modal-sheet .btn,
.admin-main .btn {
  background: transparent !important;
  color: var(--yellow) !important;
  border: 1px solid rgba(255, 212, 0, 0.8) !important;
  box-shadow: none !important;
}

.btn-red:hover,
.btn-yellow:hover,
.header-btn:hover,
.btn.btn-ghost:hover,
.btn.btn-outline-yellow:hover,
.menu-item .btn:hover,
.modal-sheet .btn:hover,
.admin-main .btn:hover {
  background: rgba(255, 212, 0, 0.08) !important;
}

.btn-sm {
  padding: 0.42rem 0.7rem;
  font-size: 0.78rem;
}

/* ========== Prices ========== */
.price-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.05;
}

.price-usd {
  font-weight: 800;
  color: var(--yellow);
}

.price-lbp,
.price-lbp-inline {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin: 1rem 0 2rem;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.7rem;
  border: 1px solid rgba(255, 212, 0, 0.8);
  border-radius: 12px;
  color: var(--yellow);
  text-decoration: none;
}

.pagination a.active,
.pagination a:hover {
  background: rgba(255, 212, 0, 0.08);
}

/* ========== Language / Arabic ========== */
.lang-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem;
}

.lang-en {
  font-size: inherit;
  color: #ffd400;
  line-height: 1.2;
}

.lang-sep {
  font-size: 0.72em;
  color: var(--muted);
}

.lang-ar,
.ar-text {
  font-size: var(--ar-size, 1em);
  line-height: 1.35;
  direction: rtl;
  unicode-bidi: plaintext;
  font-family: Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif;
}

.menu-title .lang-ar {
  --ar-size: 1em;
  color: #d8d8d8;
}

.section-title .lang-ar {
  --ar-size: 0.9em;
  color: #f1f1f1;
}

.choice-title .lang-ar {
  --ar-size: 0.95em;
  color: #d8d8d8;
}

.choice-row .lang-ar {
  --ar-size: 0.92em;
  color: #d8d8d8;
}

.modal-sheet .lang-ar {
  --ar-size: 0.92em;
}

.admin-mini-ar {
  direction: rtl;
  unicode-bidi: plaintext;
  font-family: Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif;
  color: var(--muted);
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    height: auto;
    position: static;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .app {
    border-radius: 0;
    max-width: 430px;
  }

  main {
    padding-top: 7.35rem !important;
  }

  .tab-row-wrap {
    top: 60px;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .tab {
    min-width: auto;
    padding: 0.45rem 1rem;
  }

  .menu-category-section {
    scroll-margin-top: 7.55rem;
  }

  .menu-item {
    padding: 0.7rem 0.72rem;
  }

  .menu-item-body {
    margin-bottom: 0.58rem;
  }

  .menu-item.has-image .menu-item-body {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    column-gap: 0.58rem !important;
    row-gap: 0.45rem !important;
  }

  .menu-media {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 10px;
  }

  .menu-title {
    font-size: 0.96rem;
  }

  .menu-desc {
    font-size: 0.90rem;
    line-height: 1.35;
  }

  .site-footer {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    text-align: center;
    font-size: .75rem;
    color: var(--muted);
    padding: .8rem 0 1.2rem;
    opacity: .8;
  }

  .site-footer a {
    color: var(--yellow);
    text-decoration: none;
  }

  .site-footer a:hover {
    text-decoration: underline;
  }
}