/* @itZEN-CONFIG SECURITY=strict VERSIONING=2025-06-23-2015 LOG=enable */
/* @itZEN-FILE FILE=layout.css | PATH=/assets/css/layout.css | STATUS=RESPONSIVE-MOBILE-LOGO-BANNER-OPTIMIZED */
/* @itZEN-BUSINESS-LOGIC: Layout principal avec topbar, menu latéral et contenu, adapté tablette/mobile sans casser desktop. Objectif : bannière visible, logo compact, contenu principal lisible. */

body {
  padding-top: 128px;
  padding-bottom: 140px;
  background-color: #f8f9fa;
}

body.with-categories-menu {
  padding-bottom: 8px;
  padding-left: 8px;
}

.fs-xs {
  font-size: 0.85rem
}

.cursor-pointer {
  cursor: pointer;
}

.restaurant-logo-container {
  margin-top: -128px;
  z-index: 1030;
  background-color: #f8f9fa;
}

/* When screen width is less than 992px */
@media (max-width: 991.98px) {
  .restaurant-logo-container {
    margin-top: -240px;
    margin-bottom: 102px;
  }
}

/* Restaurant Header */
.restaurant-header {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: white;
  box-shadow: 0 -3px 8px rgba(0,0,0,0.1);
}

.restaurant-name {
  font-size: 0.85rem;
  font-weight: bold;
  margin: 0;
}

.restaurant-location {
  color: #666;
  font-size: 0.75rem;
}

/* Desktop Layout */
@media (min-width: 992px) {
  body {
    padding-left: 185px;
  }

  .menu-nav-mobile {
    display: none;
  }

  .categories-sidebar {
    position: fixed;
    top: 128px;
    left: 0;
    width:185px;
    height: calc(100vh - 100px - 120px);
    background-color: white;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;
    padding: 12px;
    z-index: 998;
  }

  .categories-sidebar h3 {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
  }

  .categories-sidebar::-webkit-scrollbar {
    width: 6px;
  }

  .categories-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .categories-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
  }

  .category-card {
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .category-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
  }

  .category-card img {
    height: 100px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
    padding-right: 3px;
    padding-left: 3px;
    padding-top: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 14px;
  }

  .category-card .card-body {
    padding: 9px;
    text-align: center;
  }

  .category-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
  }

  .card-img-top.emoji-icon {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 72px;
    line-height: 1;
  }

  .cart-bar {
    left: 300px;
  }
}

/* Mobile Layout */
@media (max-width: 991px) {
  .categories-sidebar {
    display: none;
  }

  body {
    padding-top: 240px;
  }

  .menu-nav-mobile {
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    z-index: 999;
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  }

  .menu-nav-mobile::-webkit-scrollbar {
    height: 6px;
  }

  .menu-nav-mobile::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .menu-nav-mobile::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
  }

  .categories-mobile {
    display: flex;
    gap: 8px;
    padding: 0 12px;
  }

  .category-mobile-item {
    flex: 0 0 80px;
    cursor: pointer;
    transition: transform 0.2s;
  }

  .category-mobile-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
  }

  .category-mobile-card:hover {
    transform: translateY(-5px);
  }

  .category-mobile-card img {
    height: 68px;
    width: 100%;
    object-fit: cover;
    padding-right: 3px;
    padding-left: 3px;
    padding-top: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 14px;
  }

  .emoji-icon {
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 38px;
    line-height: 1;
  }

  .category-mobile-card .card-body {
    padding: 4px;
    text-align: center;
    background-color: white;
  }

  .category-mobile-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
  }

}

.card-text {
  white-space: pre-wrap;              /* Preserve line breaks */
  overflow: hidden;                   /* Hide overflowed text */
  display: -webkit-box;               /* Use flexbox-based truncation */
  -webkit-line-clamp: 3;              /* Approx. 140 chars depending on width/font */
  -webkit-box-orient: vertical;       /* Vertical truncation */
  text-overflow: ellipsis;            /* Add "..." at the end */
  word-wrap: break-word;              /* Wrap long words properly */
  max-height: 6em;                    /* Optional: limit height for consistency */
}

/* Product Lists */
.product-section {
  margin-bottom: 22px;
  background-color: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 0;
}

.voir-tout {
  color: #00a68f;
  text-decoration: none;
  font-weight: 600;
}

.voir-tout:hover {
  text-decoration: underline;
}

.products-container {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  display: flex;
  gap: 15px;
//padding-bottom: 10px;
}

.product-card {
  flex: 0 0 210px;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.product-card img {
  height: 190px;
  object-fit: cover;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding-right: 3px;
  padding-left: 3px;
  padding-top: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 14px;
}

.product-badges-container {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 10;
}

.product-badge {
  background-color: white;
  padding: 2px 6px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
}

.product-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.product-rating .fa-star {
  color: #00a68f;
  margin-right: 3px;
}

.product-price {
  color: #666;
  text-decoration: line-through;
  font-size: 0.9rem;
}

.product-price-new {
  color: #000;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Bottom and Top Navigation */
/* Shared styles for both top and bottom navigation bars */
.top-nav,
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  background-color: white;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Position-specific overrides */
.top-nav {
  top: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* shadow below */
}

.bottom-nav {
  bottom: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1); /* shadow above */
}

/* Common nav layout */
.top-nav .nav,
.bottom-nav .nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0;
}

/* Common nav link styles */
.top-nav .nav-link,
.bottom-nav .nav-link {
  color: #666;
  text-align: center;
  padding: 5px 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

/* Icons */
.top-nav .nav-link i,
.bottom-nav .nav-link i {
  font-size: 1.3rem;
  margin-bottom: 5px;
}

/* Active + Hover states */
.top-nav .nav-link.active,
.bottom-nav .nav-link.active,
.top-nav .nav-link:hover,
.bottom-nav .nav-link:hover {
  color: #00a68f;
}


/* Icons */
.top-nav .nav-link i,
.bottom-nav .nav-link i {
  font-size: 1.3rem;
  margin-bottom: 5px;
}

/* Active and hover states */
.top-nav .nav-link.active,
.bottom-nav .nav-link.active,
.top-nav .nav-link:hover,
.bottom-nav .nav-link:hover {
  color: #00a68f;
}


/* Cart Bar */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  padding: 6px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  z-index: 999;
}

.cart-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.btn-pay {
  background-color: #00a68f;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-pay:hover {
  background-color: #008c76;
  color: white;
}


.btn-cart {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  background-color: #f8f9fa;
  color: #000;
  border: 1px solid #dee2e6;
  padding: 12px 4px;
  border-radius: 8px;
  font-weight: 600;
  position: relative; /* Needed for absolute badge positioning */
}

.btn-cart i {
  font-size: 1.2rem;
  position: relative; /* Needed for the badge to be relative to the icon */
}

.cart-badge {
  position: absolute; /* Position relative to the icon */
  top: -6px;
  right: -28px;
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}


.btn-clear {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.btn-clear:hover {
  background-color: #c82333;
  color: white;
}

/* Scrollbar styling */
.products-container::-webkit-scrollbar {
  height: 8px;
}

.products-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.products-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.products-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}