/* RTL layout and global styles */
 /*#DishDetailsPopup {
  
  font-family: sans-serif;
  background-color: #fff;
  color: #000;
} */

/*#DishDetailsPopup {
  display:none;	
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
} */

#modal-header-dishDetails {
  background: linear-gradient(to right, black, #431C7C);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#modal-header-dishDetails h2 {
  margin: 0;
  font-size: 25px;
  margin-left: 25px;
}
#close-btn-new-order_details {
  position: absolute;
  left: 16px;           /* ⬅️ צד שמאל */
  top: 4%;
  transform: translateY(-50%);
  
  font-size: 48px;      /* ⬅️ גדול */
  font-weight: 300;
  color: #fff;
  cursor: pointer;

  width: 40px;          /* ⬅️ אזור לחיצה */
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;

  transition: background 0.2s ease;
}

#close-btn-new-order_details:hover {
  background: rgba(255,255,255,0.15);
}

#dish-popup-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.segment-section {
  margin-bottom: 36px;
}

.segment-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: #431C7C;
}

.segment-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segment-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; /* Start from right in RTL */
  gap: 10px; /* space between items */
  direction: rtl; /* right-to-left layout */
  margin-bottom: 15px;
}

.segment-button {
  flex: 0 0 calc(25% - 10px); /* 4 per row, minus gap */
  box-sizing: border-box;
  border: 1px solid #431C7C;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  background-color: #fff;
  transition: all 0.2s ease-in-out;
  font-size: 14px;
  white-space: nowrap;
}


.segment-button.selected {
  background-color: #431C7C !important;
  color: white !important;
  font-weight: bold;
  border: 1px solid #431C7C !important;
}

.dish-remarks-section {
  border-right: 4px solid #431C7C;
  padding-right: 8px;
}

.dish-remarks-section .segment-title {
  color: #431C7C;
  font-size: 15px;
  margin-bottom: 6px;
}

.dish-remarks-section .optional {
  font-size: 12px;
  color: #888;
  font-weight: normal;
}

.dish-remarks-input {
  width: 100%;
  resize: none;
  min-height: 70px;

  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;

  border-radius: 10px;
  border: 1px solid rgba(67, 28, 124, 0.3);
  background: #faf8fd;

  outline: none;
}

.dish-remarks-input:focus {
  border-color: #431C7C;
  background: #fff;
}


/* Optional: limit segment button width on small screens */
@media (max-width: 400px) {
  .segment-button {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Footer price section (if you add one later) */
#dialog-footer {
  padding: 12px 16px;
  background-color: #f1f1f1;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  color: #431C7C;
  border-top: 1px solid #ddd;
}

/* Hide section utility (used in JS if segment is empty) */
.hidden {
  display: none !important;
}

#dish-footer {
  display: flex;
  justify-content: space-between;
  flex-direction: row-reverse;
  align-items: center;
  padding: 12px 16px;
  background-color: #431C7C;
  color: white;
  font-size: 18px;
  position: sticky;
  bottom: 0;
  border-top: 1px solid #ccc;
  z-index: 10;
}

#add-to-cart-btn {
  background-color: #ffffff;
  color: #431C7C;
  font-size: 16px;
  padding: 10px 30px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
  margin-right:20px;
}

#add-to-cart-btn:hover {
  background-color: #f0f0f0;
}

.main-dish-row td {
  font-weight: bold;
  color: #431C7C; /* Purple */
}

/* Sub item row styling */
.sub-item-row td {
  font-weight: normal;
  color: #000; /* Black */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.row-animate {
  animation: fadeIn 0.5s ease-in-out;
}



.columns-neworder {
  display: flex;
  justify-content: space-between;
  width: 98%;
  margin-bottom: 10px;
  height: 100%;
  
}

.dishes-container {
  width: 30%; /* Adjust width as needed */
  height: 100%; /* Adjust height as needed */
  overflow-y: scroll;
  padding: 10px;
  border-left: 2px solid #ddd;
}

#middle-order {
	width:30%;
	overflow: hidden;
}

#total-amount-order {
	height: 50px;
	background: linear-gradient(270deg, #431C7C, #6E44A5);
	color: white;
	width: 96%;
	padding: 10px 10px 0px 0px;
    font-size: 25px;
	font-weight: bold;
	border-radius: 10px;
}
#modal-content-new-order {
	height: 80%;font-size:18px;
}

#middle-order-summary {
	color: black;
	width: 100%;
    padding: 10px 0px 0px 0px;
    font-size: 17px;
}

#middle-order-summary h2 {
  font-size: 20px;
  margin-bottom: 15px;
  text-align: center;
}

#order-items-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

#order-items-table th, #order-items-table td {
  border: 1px solid #ddd;
  padding: 8px;
}

#order-items-table th {
  background-color: #636363;
  color: white;
}

#order-items-table th:nth-child(1),
#order-items-table td:nth-child(1) {
  width: 70%;
  word-wrap: break-word; /* Ensures long text wraps */
  white-space: pre-wrap; /* Allows text wrapping */
}

#order-items-table th:nth-child(2),
#order-items-table td:nth-child(2) {
  width: 15%;
}

#order-items-table th:nth-child(3),
#order-items-table td:nth-child(3) {
  width: 15%;
}


.dishes-container label {
  display: block;
  font-size: 19px;
  font-weight: bold;
  color: black;
  margin-top: 15px;
  margin-bottom: 10px;
}

.dish-button {
  display: block;
  width: 90%; /* Set button width to 90% of container */
  margin: 5px auto; /* Center button and give space above and below */
  border: 3px solid #583d7d;
  background-color: #e0dceb;
  color: black;
  
  font-size: 16px;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box; /* Ensures padding is included in width */
}

/* .dish-button:hover {
  background-color: green;
} */

#dish-popup-content {
	height: 80%;
	font-size:18px;
}


#left-order {
	width:40%;
}

/* Sections */
.section {
  flex: 1; /* Each section takes equal space */
  margin-bottom: 10px; /* Spacing between sections */
  border-radius: 8px; /* Optional: Rounded corners */
}

.numpad-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  
}

.numpad-row {
  display: flex;
  justify-content: space-between; /* Spreads buttons evenly */
  margin-bottom: 10px; /* Space between rows */
}

.numpad-button {
  flex: 1; /* All buttons have equal width */
  margin: 5px; /* Space between buttons */
  padding: 15px 10px;
  font-size: 18px;
  font-weight: bold;
  background-color: #e0dceb; /* Light purple background */
  border: 2px solid #583d7d; /* Purple border */
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  color: black;
}

.numpad-button:hover {
  background-color: #d0c6e5; /* Slightly darker hover effect */
}

.numpad-button:active {
  background-color: #c0b4d8; /* Active press effect */
}

.action-buttons-container {
    display: flex;
    flex-wrap: wrap; /* Wraps buttons to fit if needed */
    justify-content: space-between;
    padding: 10px;
    height: 35%; /* Adjust height for the section */
	margin-top: 40px;
}

.action-button, #refund {
    flex: 1 1 calc(33.33% - 20px); /* 3 buttons per row with spacing */
    margin: 5px;
    padding: 10px 10px;
    font-size: 16px;
    font-weight: bold;
    background-color: white; /* Light purple */
    border: 2px solid #583d7d; /* Purple border */
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
	gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: black;
    white-space: nowrap;
	height: 30%;
}



.action-button:hover {
    background-color: #d0c6e5; /* Hover effect */
}

.action-button:active {
    background-color: #c0b4d8; /* Active effect */
}

#refund:active {
	 background-color: red; 
	 color: white;
}

/* Confirmation Button Section */
#confirmation-button-container, #clear-order-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0px;
    height: 15%; /* Adjust height for the section */
}

#confirmation-button, #ClearOrder {
    width: 95%; /* Full-width confirmation button */
    padding: 12px 10px;
    font-size: 23px;
    font-weight: bold;
    background: linear-gradient(270deg, #431C7C, #6E44A5);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#ClearOrder {
	position: absolute;
    width: 20%;
    bottom: 20px;
    color: white;
    background: red;	
}

#confirmation-button:hover {
    background-color: #6E44A5; /* Slightly brighter hover */
}

#confirmation-button:active {
    background-color: #341162; /* Darker active state */
}

.segment-section.error {
  border-right-color: #E53935 !important;
  background: rgba(229, 57, 53, 0.05);
}

.segment-section.error .segment-title {
  color: #E53935 !important;
}

/* === Error Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #E53935, #C62828);
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 99999;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Dish header layout === */
.dish-header-section {
  margin-bottom: 20px;
}

.dish-header-row {
  display: flex;
  flex-direction: row-reverse; /* תמונה מימין */
  gap: 14px;
  align-items: flex-start;
}

.dish-image-wrapper {
  flex-shrink: 0;
}

.dish-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 16px; /* עגול-מרובע */
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.25s ease;
}

.dish-thumb:hover {
  transform: scale(1.05);
}

.dish-text-wrapper {
  flex: 1;
}

.section-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 16px;
  line-height: 1.4;
  color: #333;
}

/* === Image preview overlay === */
.image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.25s ease;
}

.image-overlay.hidden {
  display: none;
}

.image-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 20px;
  animation: zoomIn 0.25s ease;
}

.image-overlay-close {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 42px;
  color: white;
  cursor: pointer;
  font-weight: 300;
}

@keyframes zoomIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}



@media (max-height: 750px) {
  .numpad-button {
    height: 50%; /* Adjust button height for small screens */
    padding: 5px; /* Reduce padding to maintain proportions */
    font-size: 16px; /* Slightly smaller font for better fit */
  }
  
  .numpad-row {
	  
	  margin-bottom: 1px; /* Space between rows */
	}
	
	#modal-content-new-order {
		height:75%;
	}
	
	#confirmation-button-container {
		height:25%
	}
}


 #DishDetailsPopup {
  display:none;	
  position: fixed;
  top: 0%;
  
  width: 100%;
  height: 100%;
  background-color: white;
  border: 5px solid #431C7C; /* Purple rounded border */
  border-radius: 15px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 9990;
}