/* ==========================================================================
   El-Sawy Restaurants — 2-Page A4 Print-Ready Table Menu QR Kit
   Palette: Crimson Red (#c4161c -> #8f0d12) + Saffron Gold (#f6b91c / #ffd24c)
   Typography: Cairo (700, 800, 900) + IBM Plex Sans Arabic
   ========================================================================== */

:root {
  --crimson-bright: #d41b22;
  --crimson-main: #c4161c;
  --crimson-deep: #8f0d12;
  --crimson-darkest: #5e070a;
  --gold-main: #f6b91c;
  --gold-bright: #ffd24c;
  --gold-warm: #e29e0b;
  --obsidian: #14100e;
  --paper-white: #ffffff;
  --cream-soft: #fff8e7;

  /* Subtle seamless culinary pattern (forks, grills/skewers, peppers, plates) */
  --culinary-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffd24c' stroke-opacity='0.11' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3C!-- Plate circle --%3E%3Ccircle cx='30' cy='30' r='14'/%3E%3Ccircle cx='30' cy='30' r='9'/%3E%3C!-- Fork --%3E%3Cpath d='M86 14v12m-4-12v8c0 3 2 5 4 5s4-2 4-5v-8m-4 13v16'/%3E%3C!-- Knife --%3E%3Cpath d='M98 14c3 4 3 12 0 16v13'/%3E%3C!-- Grill skewer (Kofta) --%3E%3Cpath d='M18 88h36'/%3E%3Crect x='25' y='83' width='8' height='10' rx='3'/%3E%3Crect x='36' y='83' width='8' height='10' rx='3'/%3E%3C!-- Chili pepper --%3E%3Cpath d='M84 74c3 0 6 3 6 8 0 8-7 15-15 17 3-6 4-13 3-19 0-4 3-6 6-6z'/%3E%3Cpath d='M85 74c0-3 2-5 4-6'/%3E%3C/g%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Cairo", "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  background-color: #1f1716;
  color: var(--paper-white);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ==================== SCREEN-ONLY CONTROL TOOLBAR ==================== */
.screen-toolbar {
  position: relative;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 24px;
  background: rgba(20, 16, 14, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(246, 185, 28, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.toolbar-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--gold-bright);
}

.toolbar-sep {
  color: rgba(255, 255, 255, 0.35);
}

.toolbar-sub {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sticker-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

.switch-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.switch-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.switch-btn.is-active {
  background: var(--gold-main);
  color: var(--obsidian);
}

.switch-btn:focus-visible,
.action-btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.action-btn {
  appearance: none;
  border: none;
  font-family: "Cairo", "IBM Plex Sans Arabic", sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.action-btn:active {
  transform: translateY(0);
}

.action-primary {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-main) 100%);
  color: var(--obsidian);
  box-shadow: 0 3px 12px rgba(246, 185, 28, 0.35);
}

.action-secondary {
  background: #2b211f;
  color: #ffffff;
  border: 1px solid rgba(255, 210, 76, 0.45);
}

/* ==================== STAGE & EXACT A4 SHEETS ==================== */
.pages-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 28px 16px 48px;
}

.a4-page {
  width: 210mm;
  height: 297mm;
  position: relative;
  overflow: hidden;
  background:
    var(--culinary-pattern),
    radial-gradient(circle at 50% 42%, var(--crimson-bright) 0%, var(--crimson-main) 45%, var(--crimson-deep) 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  page-break-inside: avoid;
  break-inside: avoid;
}

.a4-page:not(:last-child) {
  page-break-after: always;
  break-after: page;
}

/* Scale down cleanly on narrow screens while keeping exact A4 proportions */
@media screen and (max-width: 840px) {
  .screen-toolbar {
    padding: 10px 12px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .sticker-switcher {
    flex-wrap: wrap;
  }

  .pages-stage {
    padding: 16px 8px 32px;
    gap: 18px;
  }

  .a4-page {
    zoom: 0.44;
  }
}

@media screen and (min-width: 520px) and (max-width: 840px) {
  .a4-page {
    zoom: 0.62;
  }
}

/* ==================== PAGE 1: LUXURY COUNTER & WALL POSTER ==================== */
.page-poster {
  padding: 8mm;
  display: flex;
}

.poster-outer-frame {
  flex: 1;
  display: flex;
  border: 2.4mm solid var(--gold-main);
  border-radius: 7mm;
  padding: 2.2mm;
  background: linear-gradient(180deg, rgba(255, 210, 76, 0.14) 0%, rgba(143, 13, 18, 0.18) 100%);
  box-shadow: inset 0 0 0 0.6mm rgba(255, 210, 76, 0.35);
}

.poster-inner-border {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border: 0.8mm solid rgba(255, 210, 76, 0.68);
  border-radius: 5mm;
  padding: 7mm 9mm 6.5mm;
  background:
    var(--culinary-pattern),
    radial-gradient(circle at 50% 44%, rgba(212, 27, 34, 0.94) 0%, rgba(196, 22, 28, 0.96) 52%, rgba(128, 10, 14, 0.98) 100%);
}

/* Top Golden Ribbon Banner */
.top-gold-ribbon {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-main) 100%);
  color: var(--obsidian);
  padding: 2.6mm 13mm;
  border-radius: 2.5mm;
  border: 0.7mm solid #8c5900;
  box-shadow: 0 2.5mm 6mm rgba(0, 0, 0, 0.28);
}

.ribbon-text {
  font-size: 16.5pt;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.ribbon-wing {
  position: absolute;
  top: 2mm;
  width: 6.5mm;
  height: 100%;
  background: var(--gold-warm);
  z-index: -1;
}

.ribbon-wing-right {
  right: -4.5mm;
  clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%);
}

.ribbon-wing-left {
  left: -4.5mm;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 30% 50%);
}

/* Brand Logo & Headline */
.poster-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2.5mm;
  width: 100%;
}

.logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48mm;
  width: 100%;
}

.brand-logo-img {
  max-height: 48mm;
  max-width: 82mm;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3mm 5mm rgba(0, 0, 0, 0.36));
}

.poster-headline {
  margin: 0;
  font-size: 27pt;
  font-weight: 900;
  line-height: 1.2;
  color: var(--gold-bright);
  text-shadow: 0 1mm 3mm rgba(0, 0, 0, 0.38);
}

.poster-callout {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 14.5pt;
  font-weight: 700;
  line-height: 1.35;
  color: var(--paper-white);
  background: rgba(20, 16, 14, 0.28);
  border: 0.45mm solid rgba(255, 210, 76, 0.55);
  border-radius: 3.5mm;
  padding: 2.2mm 7mm;
}

/* Centerpiece QR Code */
.poster-qr-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 1mm 0;
}

.qr-card-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--paper-white);
  border: 2.6mm solid var(--gold-main);
  border-radius: 8mm;
  padding: 6.5mm 6.5mm 4.5mm;
  box-shadow:
    0 5mm 14mm rgba(0, 0, 0, 0.42),
    0 0 0 1mm rgba(20, 16, 14, 0.15);
}

.qr-corner {
  position: absolute;
  color: var(--crimson-main);
  display: flex;
  pointer-events: none;
}

.qr-corner-tr { top: 2.2mm; right: 2.2mm; }
.qr-corner-tl { top: 2.2mm; left: 2.2mm; }
.qr-corner-br { bottom: 2.2mm; right: 2.2mm; }
.qr-corner-bl { bottom: 2.2mm; left: 2.2mm; }

.qr-cutlery-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 9mm;
  height: 9mm;
  border-radius: 50%;
  background: var(--gold-bright);
  color: var(--crimson-deep);
  border: 0.6mm solid var(--crimson-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1mm 3mm rgba(0, 0, 0, 0.2);
}

.qr-cutlery-right {
  right: -5.5mm;
}

.qr-cutlery-left {
  left: -5.5mm;
}

.poster-qr-mount {
  width: 94mm;
  height: 94mm;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-qr-mount svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-url-caption {
  margin-top: 2mm;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 10pt;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--obsidian);
  background: var(--cream-soft);
  border: 0.35mm solid rgba(196, 22, 28, 0.25);
  border-radius: 2mm;
  padding: 0.8mm 4mm;
}

/* 3 Horizontal Steps */
.poster-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.5mm;
}

.step-item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(20, 16, 14, 0.34);
  border: 0.5mm solid rgba(255, 210, 76, 0.6);
  border-radius: 3.5mm;
  padding: 2.8mm 3mm;
}

.step-text {
  font-size: 11pt;
  font-weight: 800;
  color: var(--paper-white);
  line-height: 1.3;
  white-space: nowrap;
}

/* Golden Footer Strip */
.poster-footer {
  width: 100%;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-main) 100%);
  color: var(--obsidian);
  border-radius: 4mm;
  border: 0.6mm solid #8c5900;
  padding: 3.5mm 6mm;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5mm;
  box-shadow: 0 2mm 6mm rgba(0, 0, 0, 0.25);
}

.footer-address {
  font-size: 11.5pt;
  font-weight: 800;
  line-height: 1.35;
}

.footer-phones {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 12.5pt;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* ==================== PAGE 2: CUT-READY STICKERS SHEET ==================== */
.page-stickers {
  padding: 6.5mm;
  display: flex;
  flex-direction: column;
  gap: 3.5mm;
}

.stickers-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.2mm 5mm;
  background: rgba(20, 16, 14, 0.36);
  border: 0.45mm solid rgba(255, 210, 76, 0.55);
  border-radius: 3mm;
  flex-shrink: 0;
}

.sheet-title {
  font-size: 11.5pt;
  font-weight: 800;
  color: var(--gold-bright);
}

.sheet-cut-hint {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 10pt;
  font-weight: 700;
  color: var(--paper-white);
}

.stickers-grid {
  flex: 1;
  display: grid;
  gap: 0;
  border: 0.45mm dashed rgba(255, 210, 76, 0.72);
  border-radius: 2mm;
  overflow: hidden;
  min-height: 0;
}

/* Default: 8 stickers (2 cols x 4 rows) */
.stickers-grid[data-count="8"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

/* 6 stickers (2 cols x 3 rows) */
.stickers-grid[data-count="6"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

/* 12 stickers (3 cols x 4 rows) */
.stickers-grid[data-count="12"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.sticker-cell {
  position: relative;
  display: flex;
  padding: 2.4mm;
  border: 0.4mm dashed rgba(255, 255, 255, 0.58);
  min-height: 0;
  min-width: 0;
}

.sticker-cut-icon {
  position: absolute;
  top: -1.8mm;
  left: 2mm;
  font-size: 8pt;
  line-height: 1;
  color: var(--gold-bright);
  opacity: 0.9;
  pointer-events: none;
}

.sticker-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background:
    var(--culinary-pattern),
    radial-gradient(circle at 50% 45%, var(--crimson-bright) 0%, var(--crimson-main) 55%, var(--crimson-deep) 100%);
  border: 1.1mm solid var(--gold-main);
  border-radius: 4mm;
  padding: 2.4mm 3mm;
  text-align: center;
  overflow: hidden;
}

.sticker-header-pill {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-main) 100%);
  color: var(--obsidian);
  font-weight: 900;
  line-height: 1.2;
  border-radius: 2mm;
  padding: 0.8mm 5mm;
  border: 0.4mm solid #8c5900;
  white-space: nowrap;
}

.sticker-callout {
  margin: 0;
  font-weight: 800;
  color: var(--paper-white);
  line-height: 1.2;
  white-space: nowrap;
}

.sticker-qr-frame {
  background: var(--paper-white);
  border: 0.9mm solid var(--gold-bright);
  border-radius: 3.2mm;
  padding: 1.6mm;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1.5mm 4mm rgba(0, 0, 0, 0.28);
}

.sticker-qr-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sticker-footer-strip {
  width: 100%;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-main) 100%);
  color: var(--obsidian);
  border-radius: 2.2mm;
  padding: 1.1mm 2.5mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3mm;
}

.sticker-footer-cta {
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.sticker-footer-address {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-weight: 700;
  line-height: 1.15;
  opacity: 0.92;
  white-space: nowrap;
}

/* Size presets for 8, 6, 12 stickers */
.stickers-grid[data-count="8"] .sticker-header-pill { font-size: 10.5pt; }
.stickers-grid[data-count="8"] .sticker-callout { font-size: 11.5pt; }
.stickers-grid[data-count="8"] .sticker-qr-frame { width: 34mm; height: 34mm; }
.stickers-grid[data-count="8"] .sticker-footer-cta { font-size: 9pt; }
.stickers-grid[data-count="8"] .sticker-footer-address { font-size: 7.5pt; }

.stickers-grid[data-count="6"] .sticker-card { padding: 3.6mm 4.5mm; }
.stickers-grid[data-count="6"] .sticker-header-pill { font-size: 12.5pt; padding: 1.2mm 7mm; }
.stickers-grid[data-count="6"] .sticker-callout { font-size: 14pt; }
.stickers-grid[data-count="6"] .sticker-qr-frame { width: 46mm; height: 46mm; padding: 2.2mm; }
.stickers-grid[data-count="6"] .sticker-footer-cta { font-size: 10.5pt; }
.stickers-grid[data-count="6"] .sticker-footer-address { font-size: 8.5pt; }

.stickers-grid[data-count="12"] .sticker-cell { padding: 1.6mm; }
.stickers-grid[data-count="12"] .sticker-card { padding: 1.8mm 2mm; border-width: 0.85mm; border-radius: 3mm; }
.stickers-grid[data-count="12"] .sticker-header-pill { font-size: 8.8pt; padding: 0.6mm 3.5mm; }
.stickers-grid[data-count="12"] .sticker-callout { font-size: 9.2pt; }
.stickers-grid[data-count="12"] .sticker-qr-frame { width: 28mm; height: 28mm; padding: 1.2mm; border-radius: 2.4mm; }
.stickers-grid[data-count="12"] .sticker-footer-cta { font-size: 7.4pt; }
.stickers-grid[data-count="12"] .sticker-footer-address { font-size: 6.4pt; }

/* Inline SVG Logo Fallback */
.logo-fallback-svg {
  max-height: 46mm;
  width: auto;
  display: block;
}

/* ==================== PRINT MEDIA (EXACT 2 A4 PAGES) ==================== */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .screen-toolbar {
    display: none !important;
  }

  .pages-stage {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    display: block !important;
  }

  .a4-page {
    zoom: 1 !important;
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
