/* ============================================
   QR MAKER — Menu Styles (Clean Rewrite)
   ============================================ */

/* ===== 1. Reset ===== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Cairo", Tahoma, Arial;
}

/* ===== 2. Variables ===== */
:root {
  --bg: #ffffff;
  --card: #f6f6f6;
  --text: #222;
  --accent: #ff9800;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ===== 3. Container ===== */
.menu-container {
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

/* ===== 4. Titles ===== */
h1, h2 {
  text-align: center;
  margin-bottom: 15px;
}

/* ===== 5. Place Info Header ===== */
.place-info {
  background: #fff;
  border-radius: 18px;
  padding: 65px 20px 20px;
  margin-bottom: 25px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
  position: relative;
  border-top: 4px solid var(--accent);
}

.place-info img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

/* ===== 6. Header Action Buttons ===== */
.place-actions-right,
.place-actions-left {
  position: absolute;
  top: 12px;
  display: flex;
  gap: 8px;
}

.place-actions-right { right: 12px; }
.place-actions-left  { left: 12px; }

.place-info .action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.place-info .action-btn.cart-btn {
  width: 54px;
  height: 54px;
  font-size: 24px;
  background-color: #25d366;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
}

.place-info .action-btn.cart-btn:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}

.place-info .action-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}

.place-info .cart-btn {
  background: #222;
  color: #fff;
}

/* Cart Badge */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  pointer-events: none;
}

.place-info .admin-btn {
  background: #111;
  color: #fff;
  padding: 0 10px;
  width: auto;
  border-radius: 20px;
}

.place-info .qr-btn {
  background: #fff;
  border: 1px solid #ddd;
  color: #333;
}

/* ===== 7. WhatsApp Button ===== */
.place-info #whatsappBtn {
  position: static;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-info #whatsappBtn .wa-icon {
  width: 18px;
  height: 18px;
  background: url("https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg")
              no-repeat center;
  background-size: contain;
}

/* ===== 8. Categories ===== */
.category {
  background: #fff;
  border-radius: 14px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  border: 1px solid #f0f0f0;
}

.category-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--accent), #ffb74d);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: filter 0.2s;
}

.category-header:hover {
  filter: brightness(1.05);
}

.category-header img {
  height: 150px;
  width: 140px;
  border-radius: 8px;
  object-fit: cover;
}

/* ===== 9. Items ===== */
.items {
  display: none;
  padding: 15px;
  max-height: 70vh;
  overflow-y: auto;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.item img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
}

.item-details,
.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-name {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.item-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.item-price {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #27ae60;
}

/* ===== 10. Favorite Checkbox ===== */
.fav-check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid #333;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.fav-check.checked {
  background: #25d366;
  border-color: #25d366;
}

.fav-check.checked::after {
  content: "\2714";
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

/* ===== 11. Cart / Invoice ===== */
#favBox {
  height: 400px;
  overflow-y: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 380px;
  background: #ffffff;
  color: #000;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  z-index: 9999;
  display: none;
  border: 1px solid #e5e7eb;
}

#favBox h3 {
  margin: 0 0 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.fav-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.fav-item:last-child {
  border-bottom: none;
}

.fav-item strong {
  font-size: 15px;
}

.fav-item div {
  font-size: 13px;
  color: #555;
}

.fav-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #1e293b;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
}

.qty-btn:hover {
  background: #0f172a;
}

#favTotal {
  background: #16a34a;
  color: #ffffff !important;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  margin-top: 10px;
}

#favTotal * {
  color: #ffffff !important;
}

/* ===== 12. Delivery Button ===== */
#orderDeliveryBtn {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(135deg, #25d366, #1da851);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#orderDeliveryBtn:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

#orderDeliveryBtn:active {
  transform: scale(.97);
}

/* ===== 13. Order Form Overlay ===== */
.order-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.order-box {
  background: #ffffff;
  color: #000;
  width: 92%;
  max-width: 380px;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  animation: popUp 0.3s ease;
}

@keyframes popUp {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.order-box h3 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.order-box input,
.order-box textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  font-size: 14px;
  background: #f9fafb;
  color: #000;
  transition: border-color 0.2s;
}

.order-box input:focus,
.order-box textarea:focus {
  border-color: #25d366;
  outline: none;
}

.order-box .order-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, #25d366, #1da851);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.order-box .order-btn:active {
  transform: scale(.97);
}

.order-box .cancel-btn {
  width: 100%;
  margin-top: 8px;
  background: #f1f5f9;
  color: #333;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.order-box .cancel-btn:hover {
  background: #e2e8f0;
}

/* ===== 14. WhatsApp Branches Panel ===== */
#whatsappBranches {
  position: fixed;
  right: 15px;
  bottom: 220px;
  width: 240px;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.25);
  border: 1px solid #e5e7eb;
  z-index: 1001;
  display: none;
  animation: waFadeUp .25s ease;
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes waFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#whatsappBranches h4 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 15px;
}

.branch-btn {
  background: #25D366;
  color: #ffffff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  transition: all .2s ease;
}

.branch-btn:last-child {
  margin-bottom: 0;
}

.branch-btn:hover {
  background: #1ebe5d;
  transform: scale(.97);
}

/* ===== 15. QR Box ===== */
.qr-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  border: 1px solid #e5e7eb;
  z-index: 10000;
}

/* ===== 16. Places Grid ===== */
.places-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.place-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  border: 1px solid #f0f0f0;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  transition: all .25s ease;
}

.place-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 36px rgba(0,0,0,.14);
  border-color: var(--accent);
}

.place-card h3 {
  margin: 8px 0 4px;
  font-size: 18px;
  color: #222;
}

.place-card p {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.place-meta {
  font-size: 12px;
  color: #94a3b8;
}

/* Show Places Button */
.show-places-btn {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: #fff;
  border: none;
  padding: 14px 40px;
  font-size: 17px;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  display: block;
  margin: 20px auto;
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.35);
  transition: all .25s ease;
}

.show-places-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(74, 144, 226, 0.45);
}

/* Delete Places Button */
.delete-places-btn {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px 0;
  font-weight: 600;
  display: none;
  transition: background 0.2s;
}

.delete-places-btn:hover {
  background: #b91c1c;
}

/* Search Box */
.search-box {
  margin: 15px 0;
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #4a90e2;
  outline: none;
}

.search-box button {
  background: #1976d2;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.search-box button:hover {
  background: #1565c0;
}

/* ===== 17. Price Selector (JS-generated) ===== */
.price-selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.price-selector-box {
  background: #fff;
  padding: 18px;
  border-radius: 12px;
  min-width: 260px;
  box-shadow: 0 12px 36px rgba(0,0,0,.25);

  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}


.price-selector-box h4 {
  margin: 0 0 12px;
  text-align: center;
}

.price-option-btn {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.price-option-btn:hover {
  background: #f0f0f0;
  border-color: var(--accent);
}

/* ===== 18. Admin Login Popup ===== */
.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.admin-login-box {
  background: #fff;
  width: 300px;
  padding: 24px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: pop .25s ease;
}

.admin-login-box h3 {
  margin: 0 0 16px;
}

.admin-login-box input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  font-size: 14px;
  transition: border-color 0.2s;
}

.admin-login-box input:focus {
  border-color: #333;
  outline: none;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-actions button {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

#adminSubmitBtn {
  background: #111;
  color: #fff;
}

#adminSubmitBtn:hover {
  background: #000;
}

#adminCancelBtn {
  background: #f1f5f9;
  color: #333;
}

#adminCancelBtn:hover {
  background: #e2e8f0;
}

@keyframes pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Logo Row (menu-view) */
.logo-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
}

#logo {
  max-width: 90px;
  height: auto;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .place-info .action-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .place-info #whatsappBtn .wa-icon {
    width: 16px;
    height: 16px;
  }

  .item {
    padding: 10px;
  }

  .item img {
    width: 70px;
    height: 70px;
  }

  .item-name {
    font-size: 14px;
  }

  .item-desc {
    font-size: 11px;
  }

  .fav-check {
    width: 20px;
    height: 20px;
  }

  #favBox {
    bottom: 70px;
  }

  #favTotal {
    font-size: 16px;
  }

  .places-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .order-box {
    max-width: 94%;
    padding: 16px;
  }
}
/* ===== رسالة تمت الإضافة للسلة ===== */
.added-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.added-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}
