:root {
  --bg-main: #f8faf9;
  --bg-card: #ffffff;
  --bg-subtle: #f0f4f2;
  --border-color: #e2e8e5;
  --text-main: #13221b;
  --text-muted: #5e7167;
  --brand-primary: #15803d;
  --brand-primary-hover: #166534;
  --brand-accent: #b45309;
  --brand-badge-bg: #dcfce7;
  --brand-badge-text: #166534;
  --collab-badge-bg: #fef3c7;
  --collab-badge-text: #92400e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg-main: #0e1713;
  --bg-card: #16241e;
  --bg-subtle: #1f332b;
  --border-color: #274036;
  --text-main: #ecfdf5;
  --text-muted: #94a39b;
  --brand-primary: #22c55e;
  --brand-primary-hover: #16a34a;
  --brand-accent: #f59e0b;
  --brand-badge-bg: #064e3b;
  --brand-badge-text: #6ee7b7;
  --collab-badge-bg: #451a03;
  --collab-badge-text: #fde68a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-tagline {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-subtle);
}

.search-hero {
  padding: 2.5rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.search-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.search-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  max-width: 650px;
  margin: 0 auto;
}

.search-bar input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem 1.5rem;
  width: 100%;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.friterie-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.friterie-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.friterie-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.badge-certified {
  background: var(--brand-badge-bg);
  color: var(--brand-badge-text);
}

.badge-collab {
  background: var(--collab-badge-bg);
  color: var(--collab-badge-text);
}

.friterie-address {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.friterie-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Detail View & Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
}

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

.modal-header-wrap {
  padding-right: 2.75rem;
  margin-bottom: 1.25rem;
}

.modal-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.modal-title-row h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.menu-category-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem 0;
  color: var(--brand-primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.25rem;
}

.menu-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.menu-item-info {
  flex: 1;
  min-width: 0;
}

.menu-item-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.menu-item-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.menu-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.price-tag {
  font-weight: 700;
  font-size: 0.95rem;
}

.cart-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-main);
  color: var(--bg-card);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  z-index: 200;
  max-width: 90vw;
}

@media (max-width: 768px) {
  .search-hero {
    padding: 1.5rem 1rem;
  }
  .search-hero h1 {
    font-size: 1.6rem;
  }
  .search-bar {
    flex-direction: column;
    padding: 0.75rem;
  }
  .search-bar input {
    width: 100%;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .modal-content {
    padding: 1.25rem;
    max-height: 95vh;
  }
  .menu-item-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .menu-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .cart-bar {
    flex-direction: column;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Admin Specific */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-primary);
  margin: 0.25rem 0;
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

th {
  background: var(--bg-subtle);
  font-weight: 700;
}

/* Modals z-index hierarchy */
#friterie-modal {
  z-index: 1000;
}

#cart-modal {
  z-index: 1100;
}

#group-modal {
  z-index: 1150;
}

/* Contact actions bar */
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.contact-btn {
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}

/* Authentic Photos Gallery */
.photos-section {
  margin: 1.25rem 0;
}

.photos-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.photos-scroll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.photo-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
}

.photo-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
  background: #000;
}

.photo-card img:hover {
  transform: scale(1.02);
}

.photo-card-info {
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  background: var(--bg-card);
}

.photo-card-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.photo-card-caption {
  color: var(--text-muted);
}

/* Verified Facebook Feed Box */
.fb-feed-box {
  background: rgba(24, 119, 242, 0.05);
  border: 1px solid rgba(24, 119, 242, 0.25);
  border-radius: var(--radius);
  padding: 0.9rem;
  margin: 1rem 0;
}

.fb-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  font-weight: 700;
  color: #1877F2;
  font-size: 0.88rem;
}

.fb-feed-header a {
  color: #1877F2;
  text-decoration: none;
  font-size: 0.8rem;
}

.fb-feed-header a:hover {
  text-decoration: underline;
}

.fb-post {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.83rem;
  line-height: 1.4;
}

.fb-post:last-child {
  margin-bottom: 0;
}

.fb-post-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

/* Sticky Cart Bar inside Friterie Detail Modal */
.inline-friterie-cart-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
  border-top: 2px solid var(--border-color);
  padding: 0.85rem 1rem;
  margin: 1.25rem -1.75rem -1.75rem -1.75rem;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  z-index: 20;
}

@media (max-width: 768px) {
  .inline-friterie-cart-bar {
    margin: 1rem -1.25rem -1.25rem -1.25rem;
    flex-direction: column;
    text-align: center;
    gap: 0.6rem;
  }
  .inline-friterie-cart-bar .btn {
    width: 100%;
  }
}

/* Cart Modal Items */
.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.cart-item-row:last-child {
  border-bottom: none;
}

.cart-item-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.cart-item-format {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.cart-qty-btn:hover {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.cart-qty-val {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

