/* ============================================================
   S Grand Lounge - Luxury Product & Menu System
   Theme System: Dark Mode (Default) & Light Mode
   ============================================================ */

:root {
  /* Dark Theme Palette (Default) */
  --bg-main: #0a0a0d;
  --bg-card: #141419;
  --bg-elevated: #1e1e26;
  --border-color: rgba(229, 193, 88, 0.15);
  --text-main: #ffffff;
  --text-muted: #a0a0ab;
  --accent-gold: #e5c158;
  --accent-gold-dark: #b8860b;
  --discount-red: #e74c3c;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s ease-in-out;
}

[data-theme="light"] {
  /* Light Theme Palette */
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --bg-elevated: #f1f3f5;
  --border-color: rgba(184, 134, 11, 0.2);
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent-gold: #b8860b;
  --accent-gold-dark: #8b6508;
  --shadow-main: 0 8px 25px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Arial, system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  padding-bottom: 90px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header & Banner */
.hero-header {
  position: relative;
  background: radial-gradient(circle at top, var(--bg-elevated) 0%, var(--bg-main) 100%);
  padding: 30px 20px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.brand-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  max-width: 220px;
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(229, 193, 88, 0.2));
}

.brand-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.theme-toggle-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-gold);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  background: var(--accent-gold);
  color: #000;
}

.admin-link-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.admin-link-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Controls & Sticky Header (Search + View Toggle + Sticky Categories) */
.controls-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 13, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px 4px 16px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .controls-wrapper {
  background: rgba(248, 249, 250, 0.95);
}

.search-view-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.search-box-wrapper {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 42px 10px 16px;
  border-radius: 25px;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
  height: 40px;
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(229, 193, 88, 0.2);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-gold);
  font-size: 0.95rem;
}

.clear-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

.clear-search.visible {
  display: block;
}

/* View Mode Toggle Switch (Grid / List) Beside Search */
.view-mode-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 2px;
  height: 40px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 18px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn.active {
  background: var(--accent-gold);
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(229, 193, 88, 0.3);
}

/* Sticky Category Filter Bar */
.sticky-category-bar {
  padding: 4px 0 6px 0;
}

.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 4px 4px 4px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 22px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cat-chip.active, .cat-chip:hover {
  background: var(--accent-gold);
  color: #000;
  font-weight: 700;
  border-color: var(--accent-gold);
}

.cat-chip.active {
  transform: scale(1.03);
  box-shadow: 0 3px 10px rgba(229, 193, 88, 0.3);
}

/* Products Container & Grid Layout */
.products-wrapper {
  max-width: 1200px;
  margin: 16px auto 0 auto;
  padding: 0 12px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* List View Override */
.products-grid.list-view {
  grid-template-columns: 1fr !important;
}

.products-grid.list-view .product-card {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px;
}

.products-grid.list-view .product-img-box {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  margin-bottom: 0;
}

/* Product Card Styling */
.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-main);
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-gold);
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--discount-red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.product-img-box {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--bg-elevated);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.product-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-wrapper {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 193, 88, 0.08);
  border: 1px solid rgba(229, 193, 88, 0.2);
  padding: 5px 10px;
  border-radius: 8px;
  width: fit-content;
}

.price-current {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.price-old {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--discount-red);
  text-decoration-thickness: 1.5px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .products-wrapper {
    padding: 0 8px;
  }

  .products-grid {
    gap: 8px;
  }

  .product-card {
    padding: 8px;
    border-radius: 12px;
  }

  .product-img-box {
    height: 120px;
    margin-bottom: 6px;
    border-radius: 8px;
  }

  .product-title {
    font-size: 0.88rem;
    margin-bottom: 3px;
  }

  .product-desc {
    font-size: 0.7rem;
    margin-bottom: 6px;
  }

  .product-price-wrapper {
    padding: 4px 8px;
    width: 100%;
    justify-content: space-between;
  }

  .price-current {
    font-size: 0.92rem;
  }

  .price-old {
    font-size: 0.72rem;
  }
}

/* Modal Popup */
body.modal-open, html.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: modalFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@keyframes modalFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--bg-elevated);
  border: none;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 10;
}

.modal-img-main {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.modal-gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.thumb-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
}

.thumb-img.active {
  border-color: var(--accent-gold);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-section {
  margin-bottom: 18px;
}

.modal-section h4 {
  font-size: 0.85rem;
  color: var(--accent-gold);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ingredients-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ingredient-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

/* Category Section Heading for Scroll-Spy Grouping */
.category-section {
  margin-bottom: 35px;
  scroll-margin-top: 105px;
}

.category-section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--accent-gold);
  font-size: 0.85rem;
}

.category-section-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  padding: 0 10px;
}

.category-section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.category-section-title i {
  color: var(--accent-gold);
  font-size: 1.05rem;
}

.category-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Mobile PWA Fixed Bottom Navigation Bar */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(20, 20, 25, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  padding: 0 10px;
}

[data-theme="light"] .bottom-nav-bar {
  background: rgba(255, 255, 255, 0.94);
}

.bottom-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  padding: 6px 12px;
  border-radius: 12px;
  flex: 1;
  max-width: 90px;
}

.bottom-nav-btn i {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.bottom-nav-btn.active, .bottom-nav-btn:hover {
  color: var(--accent-gold);
}

.bottom-nav-btn.active i {
  transform: translateY(-2px) scale(1.1);
}

/* Team Modal & Cards Layout */
.luxury-modal {
  max-width: 580px !important;
}

.text-center {
  text-align: center !important;
}

.modal-header-icon {
  width: 56px;
  height: 56px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 12px auto;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  max-height: none;
  overflow: visible;
  padding: 4px;
}

.team-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.team-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-3px);
}

.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.team-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.team-role {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(229, 193, 88, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.team-bio {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Wi-Fi Card & QR Modal */
.wifi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.wifi-qr-box {
  background: #ffffff;
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 220px;
  margin: 0 auto;
}

.wifi-qr-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
}

.qr-hint {
  font-size: 0.75rem;
  color: #555555;
  margin-top: 8px;
  font-weight: 500;
}

.wifi-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wifi-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.wifi-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wifi-label i {
  color: var(--accent-gold);
}

.wifi-value {
  color: var(--text-main);
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.copy-wifi-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  color: #000;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(229, 193, 88, 0.25);
}

.copy-wifi-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(229, 193, 88, 0.4);
}

.copy-wifi-btn.copied {
  background: #2ec4b6;
  color: #fff;
}

/* PWA Installation Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: 16px;
  max-width: 450px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 1500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  background: #000;
  padding: 2px;
  border: 1px solid var(--border-color);
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
}

.pwa-banner-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.pwa-banner-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-install-btn {
  background: var(--accent-gold);
  color: #000;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.pwa-install-btn:hover {
  transform: scale(1.05);
}

.pwa-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.pwa-close-btn:hover {
  color: var(--text-main);
}




/* Keep public modal content scrollable without changing the page position. */
.modal-overlay.active .modal-box {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#teamModal .team-grid {
  max-height: none;
  overflow: visible;
  touch-action: pan-y;
}

@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-start;
    padding: 10px;
  }

  .modal-overlay.active .modal-box {
    max-height: calc(100dvh - 20px);
    margin: auto 0;
  }
}

/* Turkish/LTR layout. Arabic mode remains RTL through the html dir attribute. */
html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .search-input {
  padding: 10px 16px 10px 42px;
}

html[dir="ltr"] .search-icon {
  left: 14px;
  right: auto;
}

html[dir="ltr"] .clear-search {
  right: 14px;
  left: auto;
}

html[dir="ltr"] .theme-toggle-btn {
  right: 20px;
  left: auto;
}

html[dir="ltr"] .admin-link-btn {
  left: 20px;
  right: auto;
}

html[dir="ltr"] .product-info,
html[dir="ltr"] .modal-product-content,
html[dir="ltr"] .team-member-info,
html[dir="ltr"] .wifi-info {
  text-align: left;
}
