/* ==========================================================================
   BRAVAS CRAFT KITCHEN - iPhone (iOS) & Android Uyumlu Dijital QR Menü
   Matches Reference Images (Card List + Full Detail View with Allergen Box)
   ========================================================================== */

:root,
[data-theme="light"] {
  --bg-primary: #F3F2EE;
  --bg-secondary: #EAE7E1;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-glass: rgba(243, 242, 238, 0.92);

  --text-primary: #1F2428;
  --text-heading-card: #6B7B88;
  --text-secondary: #52585E;
  --text-muted: #888E94;

  --accent: #D95B24;
  --accent-light: #E86A33;
  --accent-soft: rgba(217, 91, 36, 0.12);
  --green: #27944B;

  /* Allergen Box Colors (from 2nd Reference Image) */
  --allergen-bg: #FFF9F2;
  --allergen-border: #EDA872;
  --allergen-bar: #D96826;
  --allergen-title: #C65919;
  --allergen-pill-bg: #FFFFFF;
  --allergen-pill-border: #E5C8B0;
  --allergen-pill-text: #9E4E1E;

  --border-color: rgba(31, 36, 40, 0.08);
  --shadow-lg: 0 18px 40px rgba(31, 36, 40, 0.14);
  --shadow-card: 0 2px 10px rgba(31, 36, 40, 0.04);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg-primary: #12100E;
  --bg-secondary: #1C1815;
  --bg-card: #241F1B;
  --bg-elevated: #2E2722;
  --bg-glass: rgba(18, 16, 14, 0.90);

  --text-primary: #FAF5F0;
  --text-heading-card: #B8C4CE;
  --text-secondary: #C7BBAE;
  --text-muted: #8C7F73;

  --accent: #E86A33;
  --accent-light: #FF824D;
  --accent-soft: rgba(232, 106, 51, 0.16);
  --green: #38B261;

  --allergen-bg: #2B211A;
  --allergen-border: #8F4A22;
  --allergen-bar: #E86A33;
  --allergen-title: #FF9866;
  --allergen-pill-bg: #1F1814;
  --allergen-pill-border: #5E3720;
  --allergen-pill-text: #F2B591;

  --border-color: rgba(255, 245, 235, 0.08);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Plus Jakarta Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.45;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   DESKTOP SPLIT LAYOUT (Mobile App View + Live QR Stand Side Panel)
   ========================================================================== */

.workspace-shell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 36px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0;
}

.mobile-app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-primary);
  position: relative;
  padding-bottom: calc(32px + var(--safe-bottom));
}

.desktop-qr-dock {
  display: none;
}

@media (min-width: 960px) {
  .workspace-shell {
    padding: 28px 24px;
  }

  .mobile-app-container {
    width: 460px;
    flex-shrink: 0;
    border-radius: 36px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: clip;
  }

  .desktop-qr-dock {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 420px;
    position: sticky;
    top: 28px;
  }
}

/* ==========================================================================
   HERO HEADER
   ========================================================================== */

.hero-header {
  position: relative;
  padding: calc(16px + var(--safe-top)) 18px 20px;
  background:
    linear-gradient(180deg, rgba(20, 16, 14, 0.48) 0%, rgba(20, 16, 14, 0.86) 100%),
    url("https://www.bravas.com.tr/uploads/site/1787303746562-87bc6904-d94d-420d-a752-9167dd7b181b.webp") center/cover no-repeat;
}

.top-utility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(17, 14, 12, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FAF5F0;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38B261;
  box-shadow: 0 0 8px #38B261;
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(17, 14, 12, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FAF5F0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(17, 14, 12, 0.65);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-emblem {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #D95B24 0%, #B03A0B 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 900;
}

.brand-emblem-letter {
  font-size: 25px;
  line-height: 1;
}

.brand-emblem-sub {
  font-size: 8px;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.brand-titles h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #FFFFFF;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.brand-titles h1 span {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFB694;
  letter-spacing: 2px;
}

.brand-tagline {
  font-size: 12px;
  color: rgba(250, 245, 240, 0.86);
  margin-top: 4px;
}

/* ==========================================================================
   STICKY SEARCH & CATEGORY TABS
   ========================================================================== */

.sticky-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding-top: 10px;
}

.search-bar-Row {
  padding: 0 14px 10px;
}

.search-input-box {
  position: relative;
  width: 100%;
}

.search-input-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 38px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  box-shadow: var(--shadow-card);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-size: 14px;
}

.search-input:focus {
  border-color: var(--accent);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.clear-search-btn.visible {
  display: inline-flex;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(217, 91, 36, 0.3);
}

/* ==========================================================================
   MENU CARDS LIST (MATCHES 1ST UPLOADED IMAGE EXACTLY)
   ========================================================================== */

.menu-sections-container {
  padding: 14px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.menu-category-group {
  scroll-margin-top: 118px;
}

.category-group-header {
  margin-bottom: 12px;
  padding: 0 4px;
}

.category-group-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.4px;
}

.category-group-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.category-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* White rounded card like 1st reference screenshot */
.menu-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.menu-item-card:active {
  transform: scale(0.985);
}

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

/* Uppercase slate-blue/grey title like "KEBABİ", "CIZIRDAYAN BONFİLE" */
.menu-item-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-heading-card);
  line-height: 1.25;
  letter-spacing: 0.2px;
  margin-bottom: 7px;
  text-transform: uppercase;
}

/* "(1430 kcal) Izgara dana külbastı..." text */
.menu-item-desc {
  font-size: 13.8px;
  color: var(--text-secondary);
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item-price-row {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-tag {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
}

/* Right-side horizontal rounded thumbnail like 1st reference image */
.menu-item-media {
  width: 112px;
  height: 78px;
  border-radius: 13px;
  overflow: hidden;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.menu-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   PRODUCT DETAIL FULLSCREEN OVERLAY (MATCHES 2ND UPLOADED IMAGE EXACTLY)
   ========================================================================== */

.product-detail-page {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-primary);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease, visibility 0.28s;
  display: flex;
  flex-direction: column;
}

.product-detail-page.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

html.detail-modal-open,
body.detail-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

@media (min-width: 680px) {
  .product-detail-page {
    top: 16px;
    bottom: 16px;
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 640px;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    transform: translate(-50%, 16px);
    opacity: 0;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  }

  .product-detail-page.open {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.detail-hero-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  background: #2C2623;
  flex-shrink: 0;
}

.detail-hero-wrap.no-image {
  height: calc(74px + var(--safe-top));
  background: var(--bg-primary);
}

.detail-hero-wrap.no-image + .detail-body-card {
  margin-top: 0;
  padding-top: 12px;
}

.detail-hero-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-hero-wrap.no-image img {
  display: none;
}

/* Circular white back button on top-left like 2nd reference image */
.detail-back-btn {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #FFFFFF;
  color: #1F2428;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  z-index: 5;
}

.detail-back-btn:active {
  transform: scale(0.93);
}

/* Rounded top sheet body with subtle culinary watermark pattern like 2nd reference image */
.detail-body-card {
  position: relative;
  margin-top: -26px;
  flex: 1;
  border-radius: 28px 28px 0 0;
  background-color: var(--bg-primary);
  background-image: radial-gradient(rgba(150, 140, 125, 0.07) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  padding: 26px 20px calc(40px + var(--safe-bottom));
  z-index: 2;
}

.detail-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-header-row h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.2;
}

.detail-price-badge {
  font-size: 21px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

/* Orange-bordered ALERJEN UYARISI Box from 2nd reference image */
.allergen-warning-box {
  background: var(--allergen-bg);
  border: 1.5px solid var(--allergen-border);
  border-left: 7px solid var(--allergen-bar);
  border-radius: 14px;
  padding: 16px 16px 18px;
  margin-bottom: 20px;
}

.allergen-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--allergen-title);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

.allergen-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.allergen-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--allergen-pill-bg);
  border: 1px solid var(--allergen-pill-border);
  color: var(--allergen-pill-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.allergen-pill-icon {
  font-size: 15px;
}

/* Full Calorie + Ingredients paragraph underneath allergen box */
.detail-full-description {
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.55;
  font-weight: 400;
}

/* ==========================================================================
   QR CODE (BARKOD) STUDIO & MODAL
   ========================================================================== */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  max-height: 88dvh;
  background: var(--bg-card);
  border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--border-color);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: calc(22px + var(--safe-bottom));
}

.sheet-backdrop.open .bottom-sheet {
  transform: translateY(0);
}

.sheet-handle-bar {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: var(--text-muted);
  opacity: 0.4;
  margin: 10px auto 6px;
}

.sheet-content {
  padding: 16px 20px 8px;
}

.sheet-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.qr-card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.qr-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.qr-panel-header h3 {
  font-size: 17px;
  font-weight: 800;
}

.qr-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-secondary);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.qr-mode-btn {
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qr-mode-btn.active {
  background: var(--accent);
  color: #FFFFFF;
}

.qr-stand-preview {
  background: #FFFFFF;
  color: #14110F;
  border-radius: 22px;
  padding: 20px 18px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  border: 2px solid rgba(217, 91, 36, 0.25);
}

.qr-stand-top-brand {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #14110F;
}

.qr-stand-sub {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #D94E1F;
  margin-bottom: 12px;
}

.qr-svg-holder {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px auto 10px;
}

.qr-svg-holder svg {
  max-width: 220px;
  height: auto;
  border-radius: 12px;
}

.qr-stand-call {
  display: inline-block;
  background: #14110F;
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 99px;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.qr-url-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  color: #5C4E43;
  word-break: break-all;
  background: #F4EFEA;
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 6px;
}

.qr-controls-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.secondary-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.menu-footer {
  margin: 12px 14px 20px;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.menu-footer h4 {
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 10px;
}

.footer-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.footer-note {
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

.empty-state {
  text-align: center;
  padding: 42px 20px;
  color: var(--text-secondary);
}

@media print {
  body * {
    visibility: hidden;
  }
  #printableQrCard, #printableQrCard * {
    visibility: visible;
  }
  #printableQrCard {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    border: 2px solid #000;
    box-shadow: none;
  }
}
