/* Digital Menu - Main Frontend Styles */
.items-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.items-wrapper details.item-block {
  margin: 0 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05) !important;
  padding: 0 !important;
  overflow: hidden;
}

.items-wrapper details.item-block>summary {
  list-style: none;
  padding: 10px 12px;
  margin: 0;
  border-radius: 12px;
  background: #ff9900;
  border: 1px solid #e68a00;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  line-height: 1.2;
  color: #fff;
  text-align: start;
}

.items-wrapper details.item-block>summary::-webkit-details-marker {
  display: none;
}

.items-wrapper details.item-block>summary::marker {
  content: '';
}

.items-wrapper .dm-item-summary::after {
  content: '';
  display: none;
}

.items-wrapper .dm-item-summary::before {
  content: '☰';
  color: #9ca3af;
  font-weight: 700;
  flex: 0 0 auto;
}

/* Direction: Arabic wants the icon on the left, English on the right */
html[dir="ltr"] .items-wrapper summary.dm-item-summary::before {
  order: 2;
  margin-inline-start: 10px;
  margin-inline-end: 0;
}

html[dir="ltr"] .items-wrapper summary.dm-item-summary .dm-item-title {
  order: 1;
}

.items-wrapper .dm-item-summary,
.items-wrapper .dm-item-title {
  color: #000 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.items-wrapper .dm-item-title {
  font-weight: 800;
  color: #000 !important;
}

.items-wrapper details.item-block>summary .dm-item-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.items-wrapper .dm-item-body {
  padding: 12px;
}

.upload-image-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ff9900;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, transform .05s, box-shadow .2s;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .10);
}

.upload-image-btn:hover {
  background: #e68500;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.upload-image-btn:active {
  transform: translateY(1px);
}

.items-wrapper .item-block .remove-image-btn {
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  background: #ef4444 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15) !important;
  cursor: pointer !important;
}

.items-wrapper .dm-item-body .item-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.items-wrapper .dm-item-body .item-actions button {
  border: 1px solid #e0e6eb;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

@media (max-width:600px) {
  .items-wrapper .dm-item-body {
    padding: 12px !important;
  }

  .items-wrapper .item-block input[type="text"] {
    height: 42px !important;
  }

  .items-wrapper .item-block .image-preview img {
    width: 96px;
    height: 96px;
  }
}

.add-item-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ff9900;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  outline: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .10);
  cursor: pointer;
  transition: background .2s, transform .05s, box-shadow .2s;
  margin-top: 10px;
}

.add-item-btn:hover {
  background: #e68500;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.add-item-btn:active {
  transform: translateY(1px);
}

#tab-analytics #dm-traffic {
  background: #fff;
  border: 1px solid #eef1f4;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
  padding: 16px;
  position: relative;
  z-index: 0;
}

.product-cart-slide {
  position: relative;
  cursor: pointer;
  transition: transform .2s ease;
}

.product-cart-slide:hover {
  transform: scale(1.02);
}

.cart-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ff9900 0%, #e68500 100%);
  color: #fff;
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: bold;
  font-size: var(--dm-font-xs, 14px);
  box-shadow: 0 3px 8px rgba(255, 153, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 10;
  transition: all .2s ease;
}

html[dir="rtl"] .cart-badge {
  left: auto;
  right: 10px;
}

/* ============================
   Favorites (frontend)
   ============================ */
.dm-fav-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: #fff;
  color: #111;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-inline-start: 8px;
  flex: 0 0 auto;
}

.dm-fav-btn.is-active {
  background: var(--dm-add-bg);
  border-color: var(--dm-add-bg);
  color: var(--dm-add-text);
}

.dm-fav-highlight {
  outline: 3px solid rgba(255, 153, 0, 0.35);
  outline-offset: 4px;
  border-radius: 16px;
}

.dm-fav-item .dm-fav-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dm-fav-item .dm-fav-title {
  font-weight: 900;
  font-size: 15px;
  color: #111827;
}

.dm-fav-item .dm-fav-meta {
  color: #6b7280;
  font-weight: 800;
}

/* Modals & Bottom Bar */
.dm-bottom-bar {
  position: fixed;
  bottom: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  background: #fff;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 99999;
}

.dm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000000 !important;
}

.dm-modal-overlay.dm-open {
  display: flex !important;
}

.dm-modal {
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  position: relative;
  z-index: 1000001 !important;
  max-height: 90vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
}

/* Better RTL/LTR for mixed Arabic/Latin strings inside inputs/selects */
select,
option {
  unicode-bidi: plaintext;
}

.dm-assistant-highlight {
  outline: 3px solid rgba(255, 153, 0, .55);
  border-radius: 12px;
}

body.dm-modal-open {
  overflow: hidden;
}

/* Tab Content Visibility */
.category-items {
  display: none;
}

.category-items.active {
  display: block;
}

/* Admin Edit Tab Content Visibility */
.edit-tab-content {
  display: none;
}

.edit-tab-content.active {
  display: block;
}

/* Favorites Modal Enhancements */
.dm-fav-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid #f3f4f6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease;
}

.dm-fav-item:active {
  transform: scale(0.98);
}

.dm-fav-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  flex-shrink: 0;
}

.dm-fav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-fav-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dm-fav-title {
  font-weight: bold;
  font-size: 14px;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 2px;
}

.dm-fav-meta {
  font-size: var(--dm-font-xs, 14px);
  color: var(--dm-add-bg, #6b7280);
  font-weight: 600;
  margin-top: 2px;
}

.dm-fav-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.dm-fav-actions button {
  padding: 6px 12px;
  font-size: var(--dm-font-sm, 15px);
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #374151;
}

.dm-fav-actions button:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.dm-fav-add-btn {
  background: var(--dm-add-bg, #f59e0b) !important;
  color: var(--dm-add-text, #fff) !important;
  border: none !important;
}

.dm-fav-add-btn:hover {
  opacity: 0.9;
}

/* Adjusting modal padding for list */
#dm-cust-favorites {
  padding: 4px;
}

/* Mobile Responsiveness for Favorites */
@media (max-width: 500px) {
  .dm-fav-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .dm-fav-main {
    flex: 1;
    min-width: 120px;
  }

  .dm-fav-actions {
    width: 100%;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    justify-content: flex-start;
  }

  .dm-fav-actions button {
    flex: 1;
    text-align: center;
    padding: 8px 5px;
    font-size: var(--dm-font-xs, 14px);
  }
}

/* إخفاء أشرطة التمرير في المودالات مع الحفاظ على ميزة السحب */
.dm-modal::-webkit-scrollbar,
.dm-modal-content::-webkit-scrollbar,
.dm-cart-dialog::-webkit-scrollbar,
.dm-cart-body::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
#dm-options-modal .modal-content::-webkit-scrollbar,
#dm-cart-modal .modal-content::-webkit-scrollbar,
#dm-search-modal .modal-content::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.dm-modal,
.dm-modal-content,
.dm-cart-dialog,
.dm-cart-body,
.modal-content {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}