:root {
  /* Light Theme Variables */
  --bg-color: #f8f9fa;
  --card-bg: #fff;
  --text-color: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --input-bg: #fff;
  --input-border: #ced4da;
  --input-color: #212529;
  --modal-bg: #fff;
  --header-bg: #fff;
  --price-color: #198754;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme='dark'] {
  /* Dark Theme Variables */
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-color: #fff;
  --text-muted: #aaa;
  --border-color: #333;
  --input-bg: #333;
  --input-border: #444;
  --input-color: #fff;
  --modal-bg: #1e1e1e;
  --header-bg: #1e1e1e;
  --price-color: #2fb344;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Genel Stiller */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  padding-top: 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* Ana içerik alanı */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  box-shadow: 0 2px 4px var(--shadow-color);
  background-color: var(--header-bg) !important;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s, border-color 0.3s;
  z-index: 1030;
}

/* Slider */
#mainSlider {
  margin-bottom: 2rem;
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.carousel-item {
  height: 450px;
  overflow: hidden;
  border-radius: 8px;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slider içerik karartma */
.carousel-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

/* Slider yazıları */
.carousel-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1.5rem;
  text-align: left;
  z-index: 1;
}

.carousel-caption h5 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-caption p {
  font-size: 1rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
}

/* Slider kontrolleri */
.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all 0.3s ease;
}

.carousel-control-prev {
  left: 1rem;
}

.carousel-control-next {
  right: 1rem;
}

#mainSlider:hover .carousel-control-prev,
#mainSlider:hover .carousel-control-next {
  opacity: 1;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Slider göstergeleri */
.carousel-indicators {
  margin-bottom: 1rem;
}

.carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  margin: 0 4px;
}

.carousel-indicators .active {
  background-color: #fff;
}

/* Responsive ayarlar */
@media (min-width: 768px) {
  .carousel-item {
    height: 400px;
  }

  .carousel-caption h5 {
    font-size: 2rem;
  }

  .carousel-caption p {
    font-size: 1.1rem;
  }

  body {
    padding-bottom: 4rem;
  }
}

@media (max-width: 768px) {
  #mainSlider {
    margin: -1rem -0.5rem 1rem;
    border-radius: 0;
    padding: 0;
  }

  .carousel-item {
    border-radius: 0;
  }

  .carousel-caption {
    padding: 1rem;
  }
}

/* Kategoriler */
.category-box {
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 1rem;
  transition: all 0.3s ease;
  height: 200px;
  overflow: hidden;
  flex-direction: column;
  position: relative;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  text-decoration: none;
}

.category-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2),
    rgba(0, 0, 0, 0.6)
  );
}

.category-box h6 {
  margin: 0;
  font-weight: 600;
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.category-box:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

/* Mobil Alt Menü */
.mobile-bottom-menu {
  background-color: var(--card-bg);
  padding: 5px 0;
  box-shadow: 0 -2px 10px var(--shadow-color);
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s, border-color 0.3s;
  z-index: 1021;
}

.mobile-bottom-menu .btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-color);
  padding: 4px;
}

.mobile-bottom-menu i {
  font-size: 1.25rem;
}

.mobile-bottom-menu span {
  font-size: 0.75rem;
}

/* Eski dikey düzeni kaldıralım */
.mobile-bottom-menu .btn {
  justify-content: flex-start; /* İçeriği sola yasla */
  width: 100%;
  white-space: nowrap;
}

/* Değerlendirme Yıldızları */
.rating {
  display: flex;
  gap: 5px;
  font-size: 1.5rem;
}

.rating i {
  cursor: pointer;
  color: var(--text-muted);
}

.rating i.active {
  color: #ffc107;
}

/* Ürün Kartları */
.product-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.text-color {
  color: var(--text-color) !important;
}

/* Normal ürün kartındaki açıklama (2 satır) */
.product-card .description {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Ürün Modal */
.product-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 500px;
  background: var(--card-bg);
  border-radius: 12px;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.product-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

.product-modal .product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
}

.product-modal .product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.product-modal .close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.product-modal .content {
  padding: 1rem;
}

.product-modal h6 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.product-modal .description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.product-modal .category {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.product-modal .price {
  color: var(--price-color);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Ürün görseli */
.product-image {
  position: relative;
  padding-bottom: 80%;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ürün detayları */
.product-card h6 {
  margin: 0.5rem 0;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.9rem;
  line-height: 1.2;
}

.product-card .price {
  margin-top: auto;
  color: var(--price-color);
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0px;
}

/* İçerik kısmını flex ile büyütüp fiyatı alta sabitlemek için */
.product-card {
  display: flex;
  flex-direction: column;
}

.product-card > *:not(.price) {
  flex: 0 0 auto;
}

/* Boş alanı doldurması için bir ara div ekleyelim */
.product-card .spacer {
  flex: 1 1 auto;
}

/* Mobil görünüm */
@media (max-width: 768px) {
  .product-modal {
    width: 95%;
  }

  .product-modal .product-image {
    padding-top: 100%;
  }

  .product-modal h6 {
    font-size: 1rem;
  }

  .product-modal .description {
    font-size: 0.85rem;
  }

  .product-modal .price {
    font-size: 1.1rem;
  }
}

/* Kategori Sekmeleri */
.category-tabs {
  position: sticky;
  top: 56px;
  background-color: var(--card-bg);
  z-index: 1020;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s;
}

.scroll-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: thin; /* Firefox için */
  scrollbar-color: #198754 var(--bg-color); /* Firefox için */
}

/* Webkit (Chrome, Safari) için scroll stilleri */
.scroll-container::-webkit-scrollbar {
  -webkit-appearance: none;
  height: 6px;
}

.scroll-container::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 3px;
  -webkit-border-radius: 3px;
}

.scroll-container::-webkit-scrollbar-thumb {
  background: #198754;
  border-radius: 3px;
  -webkit-border-radius: 3px;
}

/* iOS için özel scroll görünümü */
@supports (-webkit-touch-callout: none) {
  .scroll-container {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }

  .scroll-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .scroll-container::-webkit-scrollbar-thumb {
    background-color: #198754;
    border-radius: 3px;
    -webkit-border-radius: 3px;
  }

  .scroll-container::-webkit-scrollbar-track {
    background-color: var(--bg-color);
    border-radius: 3px;
    -webkit-border-radius: 3px;
  }
}

.nav-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 0; /* Alt boşluğu kaldır */
}

.nav-pills .nav-link {
  white-space: nowrap;
  color: var(--text-color);
  transition: color 0.3s;
  margin-bottom: 0; /* Alt boşluğu kaldır */
}

.nav-pills .nav-link.active {
  background-color: #198754;
}

/* Kategori Sekme Görselleri */
.category-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.nav-pills .nav-link {
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.nav-pills .nav-link:not(.active):hover {
  background-color: var(--input-bg);
}

.tab-content {
  padding-top: 20px;
}

@media (max-width: 768px) {
  .product-card {
    padding: 8px;
  }

  .product-card.expanded {
    width: 95%;
    padding: 12px;
  }

  .product-card h6 {
    font-size: 0.85rem;
  }

  .product-card .description {
    font-size: 0.75rem;
  }

  .product-card .price {
    font-size: 0.9rem;
  }

  .product-image {
    height: 173px;
    padding-bottom: 0;
  }

 .category-box {
    /* Mevcut `height` değerini kaldırıp aspect-ratio ekliyoruz. */
    height: auto;
    aspect-ratio: 1 / 1; /* Genişlik ne olursa olsun, yüksekliği aynı oranda ayarlar (kare) */
    background-size: cover;
    background-position: center center;
}

  .category-tabs {
    top: 56px;
  }

  .nav-pills {
    padding-bottom: 0.25rem;
  }

  .category-thumb {
    width: 32px;
    height: 32px;
  }

  .nav-pills .nav-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }

  /* Mobil menü için alt padding */
  .tab-content {
    padding-bottom: 60px;
  }

  .categories-section {
    padding-bottom: 60px;
  }

  body {
    padding-bottom: 50px;
  }
}

/* Back Button */
.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8f9fa;
  border: none;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: #e9ecef;
}

.back-btn i {
  font-size: 1.25rem;
}

/* Theme Toggle Button */
.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-color);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
  position: relative;
  z-index: 1031;
  pointer-events: auto;
}

.theme-toggle:hover {
  background-color: var(--input-bg);
}

.theme-toggle i {
  font-size: 1.25rem;
  transition: transform 0.3s;
  pointer-events: none;
}

[data-theme='dark'] .theme-toggle i {
  transform: rotate(180deg);
}

/* Header */
header {
  background-color: var(--header-bg) !important;
  border-bottom: 1px solid var(--border-color);
}

.navbar {
  background-color: var(--header-bg) !important;
}

/* Category Tabs */
.category-tabs {
  background-color: var(--card-bg);
  border-color: var(--border-color);
}

.nav-pills .nav-link:not(.active) {
  color: var(--text-color);
}

.nav-pills .nav-link:not(.active):hover {
  background-color: var(--input-bg);
}

/* Product Cards */
.product-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 8px;
}

.product-card h6 {
  color: var(--text-color);
}

/* Mobile Bottom Menu */
.mobile-bottom-menu {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
}

.mobile-bottom-menu .btn {
  color: var(--text-color);
}

/* Modals */
.modal-content {
  background-color: var(--modal-bg);
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

.modal-header {
  background-color: var(--modal-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
}

.modal-header .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-body {
  background-color: var(--modal-bg);
}

#featuredProductModal .modal-body img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

#featuredProductModal .price {
  color: var(--price-color);
  font-weight: 600;
  font-size: 1.1rem;
}

#featuredProductModal .text-color {
  color: var(--text-color);
}

@media (max-width: 768px) {
  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    border-radius: 10px;
  }

  .modal-header .modal-title {
    font-size: 1rem;
  }

  #featuredProductModal .price {
    font-size: 1rem;
  }
}

/* Forms */
.form-control {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-color);
}

.form-control:focus {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-color);
}

/* Header içindeki diğer elementler için */
.navbar-brand,
.wifi-btn {
  position: relative;
  z-index: 1031;
  color: var(--input-color);
}

/* Sıralama İkonu */
.sort-handle {
  cursor: move;
  color: var(--text-muted);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sort-handle:hover {
  color: var(--text-color);
}

.sort-handle i {
  font-size: 1.25rem;
}

/* Sürükleme sırasındaki görünüm */
.sortable-ghost {
  opacity: 0.5;
  background-color: var(--input-bg) !important;
}

.sortable-chosen {
  background-color: var(--card-bg);
}

/* Tablo satırları için hover efekti */
.table-striped tbody tr:hover {
  background-color: var(--input-bg);
}

/* Footer */
.footer {
  margin-top: 50px;
  background-color: var(--card-bg);
  padding: 1rem 0;
  width: 100%;
  border-top: 1px solid var(--border-color);
}

.footer p {
  margin: 0;
  color: var(--text-color);
  font-size: 0.9rem;
  line-height: 1.4;
}

.footer a {
  color: var(--price-color);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

.footer a:hover {
  color: var(--text-color);
  text-decoration: underline;
}

@media (max-width: 767px) {
  .footer {
    margin-top: 0px;
    margin-bottom: 76px; /* Mobile bottom menu height */
  }
}

/* Garson çağırma butonu */
.waiter-call-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #198754;
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1030;
}

.waiter-call-btn:hover {
  transform: scale(1.1);
  background: #146c43;
}

.waiter-call-btn i {
  font-size: 1.5rem;
}

/* Sevilen ürünler carousel stilleri */
.featured-products-carousel {
  position: relative;
  padding: 0 10px;
}

.featured-products-carousel .row {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 10px;
}

.featured-products-carousel .row::-webkit-scrollbar {
  display: none;
}

.featured-products-carousel .btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.featured-products-carousel .btn:hover {
  background-color: var(--price-color);
  border-color: var(--price-color);
  color: white;
}

.featured-products-carousel .btn i {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .featured-products-carousel .btn {
    width: 28px;
    height: 28px;
  }

  .featured-products-carousel .btn i {
    font-size: 0.875rem;
  }
}

.featured-products-section .section-title {
  font-size: 1.4rem;
  position: relative;
  color: #198754;
  padding-left: 10px;
  border-left: 4px solid #198754;
}

.featured-products-section .product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 0;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.featured-products-section .product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.featured-products-section .product-image {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.featured-products-section .product-image {
    
    padding-top: 0;
    aspect-ratio: 1 / 1;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.featured-products-section .card-body {
  padding: 0.75rem !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-products-section .card-title {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-products-section .price {
  font-weight: 600;
  font-size: 1rem;
  color: var(--price-color);
  margin: 0;
}

.featured-products-section .product-card:hover .product-image img {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .featured-products-section .product-image {
    padding-top: 100%; /* Mobilde de kare olarak kalsın */
  }

  .featured-products-section .section-title {
    font-size: 1.2rem;
  }

  .featured-products-section .card-title {
    font-size: 0.85rem;
  }

  .featured-products-section .price {
    font-size: 0.9rem;
  }
}

/* Mobil görünüm için ek stiller */
@media (max-width: 767px) {
  .waiters-header .form-check {
    margin-top: 0.5rem;
  }

  .waiters-header .form-switch {
    min-height: 32px;
    display: flex;
    align-items: center;
  }

  .waiters-card {
    margin-bottom: 1rem;
  }
}
