/* ===== Menu Page Styles ===== */

/* Loader */
.loader {
  position: fixed; inset: 0;
  background: var(--black);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-logo img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; border: 3px solid var(--gold); }
.loader-text { font-size: 24px; font-weight: 800; color: var(--gold); margin-bottom: 20px; }

/* Header */
.menu-header {
  position: relative;
  min-height: 380px;
  display: flex; flex-direction: column;
}
.cover-wrap { position: absolute; inset: 0; overflow: hidden; }
.cover-img { width: 100%; height: 100%; object-fit: cover; }
.cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.85) 100%);
}

.header-top {
  position: relative;
  padding: 20px 20px 0;
  display: flex;
  justify-content: flex-start;
}
.header-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  text-decoration: none;
}
.icon-btn:hover { background: rgba(212,175,55,0.4); border-color: var(--gold); }

.restaurant-info {
  position: relative;
  margin-top: auto;
  padding: 20px;
  text-align: center;
}
.restaurant-logo-wrap {
  width: 90px; height: 90px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  overflow: hidden;
  background: var(--dark2);
  box-shadow: var(--shadow-gold);
}
.restaurant-logo { width: 100%; height: 100%; object-fit: cover; }
.restaurant-name {
  font-size: 28px; font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 4px;
}
.restaurant-tagline {
  color: var(--gold);
  font-size: 14px; font-weight: 500;
  margin-bottom: 10px;
}
.restaurant-meta {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  font-size: 12px; color: rgba(255,255,255,0.8);
}

/* Toolbar */
.toolbar {
  background: var(--dark);
  border-bottom: 1px solid var(--dark4);
  padding: 12px 16px;
  display: flex; gap: 10px; align-items: center;
  z-index: 100;
}
.toolbar.sticky { position: sticky; top: 0; }

.search-wrap {
  flex: 1;
  position: relative;
  display: flex; align-items: center;
}
.search-icon { position: absolute; right: 12px; font-size: 16px; color: var(--gray); pointer-events: none; }
.search-input {
  padding: 10px 40px 10px 40px;
  border-radius: 25px;
  font-size: 14px;
  background: var(--dark2);
}
.clear-btn {
  position: absolute; left: 12px;
  background: none; border: none;
  color: var(--gray); font-size: 14px; cursor: pointer;
}
.clear-btn:hover { color: var(--white); }

.btn-whatsapp {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border-radius: 25px;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
  border: none;
}
.btn-whatsapp:hover { box-shadow: 0 4px 15px rgba(37,211,102,0.4); transform: translateY(-1px); }

/* Categories */
.categories-bar {
  background: var(--dark);
  border-bottom: 1px solid var(--dark4);
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.categories-bar::-webkit-scrollbar { display: none; }
.categories-inner { display: flex; padding: 10px 16px; gap: 8px; width: max-content; }

.cat-btn {
  padding: 8px 18px;
  border-radius: 25px;
  background: var(--dark2);
  border: 1.5px solid var(--dark4);
  color: var(--gray);
  font-family: var(--font);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.cat-btn:hover { border-color: var(--gold); color: var(--gold); }
.cat-btn.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #000;
  border-color: transparent;
  box-shadow: var(--shadow-gold);
}

/* Results info */
.results-info {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--gray);
}

/* Products Grid */
.products-section { padding: 20px 16px; min-height: 300px; }

.section-title {
  font-size: 20px; font-weight: 800;
  color: var(--white);
  padding: 16px 0 12px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--dark4);
  margin-bottom: 16px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.4;
  margin-right: 10px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Product Card */
.product-card {
  background: var(--dark2);
  border: 1px solid var(--dark4);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease;
}
.product-card:hover {
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  transform: translateY(-4px);
}
.product-card.unavailable { opacity: 0.6; }
.product-card.unavailable:hover { transform: none; }

.product-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--dark3);
}
.product-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-img { transform: scale(1.05); }

.product-emoji-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 60px;
  background: linear-gradient(135deg, var(--dark3), var(--dark4));
}

.product-badges {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; flex-wrap: wrap; gap: 4px;
}

.unavail-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.unavail-tag {
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.2);
}

.product-body {
  padding: 14px 16px;
  flex: 1;
  display: flex; flex-direction: column;
}
.product-name {
  font-size: 16px; font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.4;
}
.product-desc {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 12px;
}
.product-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.product-price {
  font-size: 18px; font-weight: 800;
  color: var(--gold);
}
.product-availability {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}
.avail-yes { background: rgba(56,161,105,0.15); color: #68D391; }
.avail-no { background: rgba(136,136,136,0.15); color: var(--gray); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--gray); }

/* Footer */
.menu-footer {
  background: var(--dark2);
  border-top: 1px solid var(--dark4);
  margin-top: 40px;
}
.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 32px 20px;
  text-align: center;
}
.footer-logo {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 16px;
}
.footer-logo img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.footer-logo span { font-size: 18px; font-weight: 800; color: var(--gold); }
.footer-divider { height: 1px; background: var(--dark4); margin: 16px 0; }
.footer-contact { display: flex; gap: 20px; justify-content: center; margin-bottom: 16px; }
.footer-link {
  display: flex; align-items: center; gap: 6px;
  color: var(--gray); font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--gold); }
.footer-copy { font-size: 12px; color: var(--gray); }

/* Product Detail Modal */
.detail-img { width: 100%; height: 250px; object-fit: cover; }
.detail-emoji { width: 100%; height: 200px; display: flex; align-items: center; justify-content: center; font-size: 80px; background: var(--dark3); }
.detail-body { padding: 20px; }
.detail-name { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.detail-desc { color: var(--gray); font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.detail-price { font-size: 26px; font-weight: 900; color: var(--gold); margin-bottom: 12px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

/* --- Premium ATC Modal Refined --- */
.atc-full-card { display: flex; flex-direction: column; background: var(--dark1); border-radius: 24px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.atc-img-container { 
  width: 100%; 
  height: 220px; /* تقليل الارتفاع ليكون أكثر تناسقاً */
  background: var(--dark3); 
  position: relative; 
  cursor: zoom-in;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--dark4);
}
.atc-main-img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; /* لضمان ملء المساحة بشكل جميل */
  transition: transform 0.3s ease;
}
.atc-img-container:hover .atc-main-img { transform: scale(1.05); }

/* --- Lightbox Styles --- */
.lightbox-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.95);
  display: none; align-items: center; justify-content: center;
  z-index: 10000; cursor: zoom-out;
  backdrop-filter: blur(10px);
}
.lightbox-overlay.open { display: flex; animation: fadeIn 0.3s ease; }
.lightbox-img { max-width: 90%; max-height: 85%; border-radius: 12px; box-shadow: 0 0 30px rgba(0,0,0,0.5); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  .menu-header { min-height: 320px; }
  .restaurant-name { font-size: 22px; }
  .products-grid { grid-template-columns: 1fr; }
  .product-img-wrap { height: 160px; }
  .toolbar { padding: 10px 12px; gap: 8px; }
  .btn-whatsapp span { display: none; }
}

@media (min-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .products-section { max-width: 1200px; margin: 0 auto; }
  .toolbar { max-width: 1200px; margin: 0 auto; }
}

/* ===== زر "أضف للسلة" على الكارد ===== */
.add-to-cart-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #000;
  border: none; border-radius: 20px;
  font-family: var(--font); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.add-to-cart-btn:hover { box-shadow: var(--shadow-gold); transform: scale(1.05); }

.extras-hint {
  font-size: 11px; color: var(--gray);
  margin-bottom: 8px;
  background: rgba(212,175,55,0.07);
  padding: 4px 8px; border-radius: 6px;
  display: inline-block;
}

/* ===== زر السلة العائم ===== */
.cart-float-btn {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #000;
  border: none; border-radius: 50px;
  font-family: var(--font); font-size: 15px; font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(212,175,55,0.45);
  transition: var(--transition);
  animation: floatBounce 2s ease-in-out infinite;
}
.cart-float-btn:hover { transform: translateX(-50%) scale(1.05); box-shadow: 0 12px 40px rgba(212,175,55,0.6); }

@keyframes floatBounce { 0%,100% { box-shadow: 0 8px 32px rgba(212,175,55,0.45); } 50% { box-shadow: 0 12px 40px rgba(212,175,55,0.65); } }

.cart-badge {
  background: #E53E3E;
  color: #fff;
  font-size: 12px; font-weight: 900;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cart-btn-total { font-size: 13px; font-weight: 700; opacity: 0.85; }

/* ===== مودال السلة ===== */
.cart-modal-box {
  max-width: 500px;
  display: flex; flex-direction: column;
  max-height: 90vh;
}

.cart-empty {
  padding: 48px 20px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}

.cart-items-list {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
}
.cart-items-list::-webkit-scrollbar { width: 4px; }
.cart-items-list::-webkit-scrollbar-thumb { background: var(--dark4); border-radius: 2px; }

.cart-item {
  display: flex; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--dark4);
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}
.cart-item:last-child { border: none; }

.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.cart-item-base-price { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.cart-item-extras { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cart-item-extras span {
  font-size: 11px; color: var(--gold);
  background: rgba(212,175,55,0.1);
  padding: 2px 8px; border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.2);
}
.cart-item-note { font-size: 11px; color: var(--gray); margin-top: 4px; font-style: italic; }

.cart-item-controls {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.cart-item-total { font-size: 15px; font-weight: 800; color: var(--gold); }
.cart-item-remove {
  background: none; border: none;
  color: var(--gray); font-size: 16px;
  cursor: pointer; transition: color 0.2s;
  padding: 2px;
}
.cart-item-remove:hover { color: #FC8181; }

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--dark4);
  background: var(--dark2);
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  font-size: 16px; font-weight: 700;
}
.cart-total-amount { font-size: 20px; font-weight: 900; color: var(--gold); }

/* ===== التحكم بالكمية ===== */
.qty-control {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  width: 32px; height: 32px;
  background: var(--dark3);
  border: 1.5px solid var(--dark4);
  color: var(--white);
  border-radius: 50%; font-size: 18px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.qty-btn:hover { background: var(--gold); color: #000; border-color: var(--gold); }
.qty-num { font-size: 16px; font-weight: 800; min-width: 24px; text-align: center; }
.qty-lg { width: 40px; height: 40px; font-size: 22px; }
.qty-lg-num { font-size: 22px; font-weight: 900; min-width: 32px; }

/* ===== مودال إضافة للسلة ===== */
.atc-body { padding: 16px 20px; }
.atc-prod-name { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.atc-prod-desc { color: var(--gray); font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.atc-prod-price { font-size: 24px; font-weight: 900; color: var(--gold); margin-bottom: 16px; transition: var(--transition); }
.atc-section-title { font-size: 13px; font-weight: 700; color: var(--gray-light); margin-bottom: 10px; letter-spacing: 0.3px; }

.extras-list { margin-bottom: 16px; }
.extra-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--dark3);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--dark4);
  transition: border-color 0.2s;
}
.extra-row:has(.qty-num:not(:empty)):hover { border-color: rgba(212,175,55,0.3); }
.extra-info { display: flex; flex-direction: column; gap: 2px; }
.extra-name { font-size: 14px; font-weight: 600; }
.extra-price { font-size: 12px; color: var(--gold); font-weight: 700; }

@media (max-width: 480px) {
  .cart-float-btn { bottom: 16px; padding: 12px 20px; font-size: 14px; }
  .atc-prod-name { font-size: 17px; }
}

