@import url(https://fonts.googleapis.com/css2?family=Cairo:wght@200..1000&display=swap);
.product-description {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.phone-block .iti {
  display: block !important;
}

@keyframes scaleBounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
.animate-btn {
  animation: scaleBounce 0.3s ease-in-out;
  border-color: #4CAF50 !important;
  background-color: #4CAF50 !important;
  color: white !important;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-pagination div {
  width: 100%;
}
@media (max-width: 576px) {
  .custom-pagination .justify-content-between {
    justify-content: center !important;
  }
}

html[dir=rtl],
html[dir=rtl] body,
html[dir=rtl] button,
html[dir=rtl] input,
html[dir=rtl] optgroup,
html[dir=rtl] select,
html[dir=rtl] textarea {
  font-family: "Cairo", sans-serif !important;
}

.product-title-slider {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-modal-dialog {
  min-width: 600px !important;
  max-width: 600px !important;
  margin: auto;
}

@media (max-width: 575.98px) {
  .order-modal-dialog {
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}
@media (max-width: 575px) {
  #toast-container > div {
    min-width: 300px !important;
  }
}
.rtl-phone-input input {
  padding-right: 73px !important;
}

.rtl-phone-input .iti__flag-container {
  right: 0 !important;
  left: auto !important;
}

.rtl-phone-input {
  direction: rtl;
  text-align: right;
}

.rtl-phone-input .iti {
  direction: rtl;
  text-align: right;
}

.modal-header .btn-close {
  padding: 0.5rem 0.5rem;
  margin: 0;
}

.main-content.rtl .recommended-product-section .product-slider .prev-arrow {
  left: 10px !important;
  right: auto !important;
}
.main-content.rtl .recommended-product-section .product-slider .next-arrow {
  left: 66px !important;
  right: auto !important;
}

/* Prevent accidental clicks on share buttons when modals are open */
body.modal-open .share,
body.modal-open #whatsapp-store-shareModel,
body.modal-open .btn-section.cursor-pointer {
  pointer-events: none !important;
}

/* Aggressive Fix: Hide share modal COMPLETELY when any other modal is open */
/* This prevents "ghost" links from capturing clicks in the background */
body.modal-open #whatsapp-store-shareModel:not(.show) {
  display: none !important;
}

/* Re-enable pointer events for the active modal content */
body.modal-open .modal.show {
  pointer-events: auto !important;
  display: block !important;
}

/* Ensure store modals are always on top of share modal */
#cartModal,
#orderNowModal {
  z-index: 1060 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.share-blocker {
  cursor: default;
  background: transparent;
}

[dir=rtl], .rtl {
  text-align: right !important;
}
[dir=rtl] .text-start, .rtl .text-start {
  text-align: right !important;
}
[dir=rtl] .text-end, .rtl .text-end {
  text-align: left !important;
}
[dir=rtl] .ms-auto, .rtl .ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}
[dir=rtl] .me-auto, .rtl .me-auto {
  margin-left: auto !important;
  margin-right: 0 !important;
}
[dir=rtl] .dropdown-menu, .rtl .dropdown-menu {
  text-align: right !important;
}
[dir=rtl] .btn-close, .rtl .btn-close {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Responsive mobile layout for cart table to prevent horizontal scrolling */
@media (max-width: 576px) {
  #cartModal .overflow-auto {
    overflow-x: hidden !important;
    /* Prevent horizontal scrolling */
  }
  #cartModal table {
    display: block !important;
    width: 100% !important;
    /* Product Details Cell (Always first) */
    /* Delete Button Cell (Always last) */
    /* Quantity Selector Cell */
    /* Total Price Cell */
    /* Unit Price Cell (only in 5-column layout) */
    /* RTL Layout Support */
    /* Footer grand total layout */
  }
  #cartModal table thead {
    display: none !important;
    /* Hide headers on mobile */
  }
  #cartModal table tbody, #cartModal table tfoot {
    display: block !important;
    width: 100% !important;
  }
  #cartModal table tbody tr {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
    width: 100% !important;
    margin-bottom: 0 !important;
  }
  #cartModal table tbody tr td:first-child {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding: 0 0 10px 0 !important;
    display: block !important;
  }
  #cartModal table tbody tr td:first-child .d-flex, #cartModal table tbody tr td:first-child .product-card-box {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
  }
  #cartModal table tbody tr td:first-child .product-img {
    width: 50px !important;
    height: 50px !important;
    flex-shrink: 0 !important;
  }
  #cartModal table tbody tr td:first-child h5, #cartModal table tbody tr td:first-child p, #cartModal table tbody tr td:first-child .restaurant-white {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
  }
  #cartModal table tbody tr td:first-child h5, #cartModal table tbody tr td:first-child p.restaurant-white:first-child {
    font-size: 16px !important;
    font-weight: 600 !important;
    padding-right: 35px !important;
    /* Prevent overlap with delete button */
  }
  #cartModal table tbody tr td:last-child {
    position: absolute !important;
    top: 15px !important;
    right: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
  }
  #cartModal table tbody tr td:has(.btn-group),
#cartModal table tbody tr td:has(.count-btn),
#cartModal table tbody tr td:has(.cart-qty-input) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    flex-grow: 0 !important;
  }
  #cartModal table tbody tr td:has(.btn-group) .btn-group, #cartModal table tbody tr td:has(.btn-group) .count-btn,
#cartModal table tbody tr td:has(.count-btn) .btn-group,
#cartModal table tbody tr td:has(.count-btn) .count-btn,
#cartModal table tbody tr td:has(.cart-qty-input) .btn-group,
#cartModal table tbody tr td:has(.cart-qty-input) .count-btn {
    margin: 0 !important;
  }
  #cartModal table tbody tr td[id^=total_] {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-align: right !important;
    flex-grow: 1 !important;
  }
  #cartModal table tbody tr td:not(:first-child):not(:last-child):not([id^=total_]):not(:has(.btn-group)):not(:has(.count-btn)):not(:has(.cart-qty-input)) {
    display: flex !important;
    align-items: center !important;
    padding: 0 10px 0 0 !important;
    font-size: 14px !important;
    color: #b5b5c3 !important;
    flex-grow: 0 !important;
  }
  #cartModal table[dir=rtl] tbody tr td:first-child h5,
#cartModal table[dir=rtl] tbody tr td:first-child p.restaurant-white:first-child, #cartModal table.rtl tbody tr td:first-child h5,
#cartModal table.rtl tbody tr td:first-child p.restaurant-white:first-child {
    padding-right: 0 !important;
    padding-left: 35px !important;
  }
  #cartModal table[dir=rtl] tbody tr td:last-child, #cartModal table.rtl tbody tr td:last-child {
    right: auto !important;
    left: 0 !important;
  }
  #cartModal table[dir=rtl] tbody tr td:not(:first-child):not(:last-child):not([id^=total_]):not(:has(.btn-group)):not(:has(.count-btn)):not(:has(.cart-qty-input)), #cartModal table.rtl tbody tr td:not(:first-child):not(:last-child):not([id^=total_]):not(:has(.btn-group)):not(:has(.count-btn)):not(:has(.cart-qty-input)) {
    padding: 0 0 0 10px !important;
  }
  #cartModal table tfoot tr {
    display: flex !important;
    justify-content: flex-end !important;
    padding: 15px 0 !important;
    width: 100% !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
  #cartModal table tfoot tr td {
    display: none !important;
  }
  #cartModal table tfoot tr td#grandTotalLine, #cartModal table tfoot tr td:has(#grandTotal) {
    display: block !important;
    width: 100% !important;
    text-align: right !important;
    padding: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
  }
}
