/* ==========================================================================
   BALAH CAFE MARRAKECH — CARTE NUMÉRIQUE
   Simple, Professionnel, Minimaliste et Efficace
   ========================================================================== */

/* 1. Design System & Variables */
:root {
  --color-bg-base: #F4EFEB;       /* Clean Studio Nude Beige */
  --color-text-main: #1C1A17;     /* High Contrast Charcoal */
  --color-text-muted: #6E6862;    /* Warm Muted Grey */
  
  /* Brand Accents */
  --color-brand: #C86A4B;         /* Terracotta Red-Clay */
  --color-brand-light: #E78F74;
  --color-accent: #D1AC7F;        /* Soft Desert Gold */
  --color-border: rgba(28, 26, 23, 0.1);
  --color-border-dark: rgba(28, 26, 23, 0.2);
  
  /* Layout Panel background (Clean Solid White Card) */
  --panel-bg: #FFFFFF;
  --panel-shadow: 0 4px 20px rgba(28, 26, 23, 0.03);
  --panel-shadow-hover: 0 8px 30px rgba(28, 26, 23, 0.06);
  
  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

/* 2. Reset & Base Layout */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Coffee Theme Charging / Loading Screen */
.coffee-loader-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color-bg-base);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
}

.coffee-loader-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.loader-cup-anim {
  width: 100px;
  height: 100px;
  margin-bottom: 1.2rem;
}

.loader-svg {
  width: 100%;
  height: 100%;
}

.loader-steam {
  opacity: 0;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: loaderSteam 2.5s infinite ease-in-out;
}

.l-steam-1 { animation-delay: 0s; }
.l-steam-2 { animation-delay: 0.5s; }
.l-steam-3 { animation-delay: 1s; }

@keyframes loaderSteam {
  0% {
    opacity: 0;
    stroke-dashoffset: 30;
    transform: translateY(2px);
  }
  40% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
    transform: translateY(-8px);
  }
}

.loader-drip {
  animation: loaderDripFlow 1.5s infinite linear;
}

@keyframes loaderDripFlow {
  0% {
    stroke-dashoffset: 15;
    opacity: 0.3;
  }
  50% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -15;
    opacity: 0.3;
  }
}

.loader-fill {
  transform-origin: bottom center;
  animation: loaderFillUp 1.2s ease-out forwards;
}

@keyframes loaderFillUp {
  0% {
    transform: scaleY(0.1);
    opacity: 0.3;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.loader-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  letter-spacing: 0.25em;
  color: var(--color-text-main);
  margin-bottom: 0.2rem;
  text-indent: 0.25em;
}

.loader-sub {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--color-brand);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.loader-progress-track {
  width: 160px;
  height: 3px;
  background-color: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.loader-progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--color-brand);
  border-radius: 3px;
  animation: fillProgressBar 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fillProgressBar {
  0% { width: 0%; }
  50% { width: 65%; }
  100% { width: 100%; }
}

.loader-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

body {
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  font-weight: 400;
}

/* Custom minimal scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-dark);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand);
}

/* 3. Main Fixed Header */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(244, 239, 235, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-grow: 1;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-text-main);
  line-height: 1;
  text-indent: 0.2em;
}

.location-coord {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.location-sub {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.lang-switcher {
  display: flex;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
  width: 105px;
  flex-shrink: 0;
}

.lang-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.35rem 0;
  border-radius: 18px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-align: center;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.lang-btn.active {
  background-color: var(--color-text-main);
  color: var(--color-bg-base);
}

.lang-btn:hover:not(.active) {
  color: var(--color-text-main);
}

.header-actions {
  width: 105px;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.btn-cart-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease;
}

.btn-cart-toggle:hover {
  background: var(--color-text-main);
  border-color: var(--color-text-main);
  color: var(--color-bg-base);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-brand);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 4. Menu Layout Container */
.menu-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8rem 1.5rem 3rem 1.5rem;
}

/* Hero Title section */
.hero-section {
  text-align: center;
  margin-bottom: 3rem;
}

/* Hero Coffee Crafting Animation */
.hero-coffee-anim-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.2rem;
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.coffee-brew-svg {
  width: 130px;
  height: 98px;
  overflow: visible;
  filter: drop-shadow(0 6px 16px rgba(168, 124, 92, 0.18));
}

.steam {
  opacity: 0;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: steamRise 3s infinite ease-in-out;
}

.steam-1 { animation-delay: 0s; }
.steam-2 { animation-delay: 0.7s; }
.steam-3 { animation-delay: 1.4s; }

@keyframes steamRise {
  0% {
    opacity: 0;
    stroke-dashoffset: 40;
    transform: translateY(3px);
  }
  35% {
    opacity: 0.9;
  }
  75% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
    transform: translateY(-12px);
  }
}

.espresso-stream {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: dripFlow 1.8s infinite linear;
}

@keyframes dripFlow {
  0% {
    stroke-dashoffset: 20;
    opacity: 0.3;
  }
  50% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -20;
    opacity: 0.3;
  }
}

.coffee-drop {
  animation: dropBounce 1.8s infinite ease-in;
}

@keyframes dropBounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(4px);
    opacity: 1;
  }
}

.coffee-fill {
  transform-origin: bottom center;
  animation: fillUp 3.5s ease-out forwards;
}

@keyframes fillUp {
  0% {
    transform: scaleY(0.1);
    opacity: 0.4;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.foam-layer {
  animation: foamRise 3.5s ease-out forwards;
}

@keyframes foamRise {
  0% {
    transform: translateY(10px) scaleX(0.7);
    opacity: 0.3;
  }
  100% {
    transform: translateY(0) scaleX(1);
    opacity: 1;
  }
}

@keyframes heroFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.arabic-greeting {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--color-brand);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.hero-title span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-brand);
}

.hero-desc {
  max-width: 550px;
  margin: 0 auto 2rem auto;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.store-meta {
  display: flex;
  justify-content: center;
  gap: 3rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  max-width: 500px;
  margin: 0 auto;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.meta-label {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.meta-val {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2rem;
  }
  .store-meta {
    gap: 1.5rem;
  }
}

/* 5. Sticky Category Nav Bar */
.category-nav {
  margin-bottom: 2.5rem;
  position: sticky;
  top: 70px;
  z-index: 90;
  background: rgba(244, 239, 235, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.category-scroll-wrapper {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.category-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all 0.2s ease;
}

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

.category-btn.active {
  background-color: var(--color-text-main);
  color: var(--color-bg-base);
  font-weight: 500;
}

@media (max-width: 600px) {
  .category-scroll-wrapper {
    justify-content: flex-start;
    padding-left: 0.5rem;
  }
  .category-nav {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }
}

/* 6. Product Cards & Layout Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
}

.menu-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--panel-shadow);
  transition: all 0.25s ease-out;
  cursor: pointer;
  overflow: hidden;
}

.menu-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-dark);
  box-shadow: var(--panel-shadow-hover);
}

/* Card with Image (Studio Unified Photos) */
.menu-card.card-featured {
  padding: 0;
  grid-row: span 2;
}

.card-img-wrapper {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background-color: var(--color-bg-base);
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

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

.menu-card:hover .card-img {
  transform: scale(1.03);
}

.card-badge-feat {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  color: var(--color-brand);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.card-featured-details {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Card Info elements */
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.item-title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text-main);
  line-height: 1.2;
}

.item-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-brand);
  white-space: nowrap;
}

.item-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.3rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border);
}

.item-label-cat {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.btn-card-select {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-border-dark);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-main);
  transition: all 0.2s ease;
}

.menu-card:hover .btn-card-select {
  background: var(--color-text-main);
  color: var(--color-bg-base);
  border-color: var(--color-text-main);
}

/* 7. Product Customizer Dialog Modal */
.item-dialog {
  border: none;
  background: transparent;
  max-width: 680px;
  width: 90%;
  margin: auto;
  overflow: visible;
}

.dialog-wrapper {
  background-color: var(--panel-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(28, 26, 23, 0.15);
  border: 1px solid var(--color-border-dark);
  position: relative;
}

.dialog-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFF;
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

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

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.dialog-image-area {
  position: relative;
  background-color: var(--color-bg-base);
  aspect-ratio: 3/4;
}

.dialog-image-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-icon-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--color-bg-base);
  color: var(--color-brand);
  gap: 0.8rem;
  padding: 1.5rem;
  text-align: center;
}

.dialog-content-area {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-height: 80vh;
  overflow-y: auto;
}

.dialog-header {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.item-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-brand);
  text-transform: uppercase;
}

.dialog-item-title {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.dialog-item-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-brand);
  margin-top: 0.2rem;
}

.dialog-item-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.dialog-details-meta {
  border-top: 1px solid var(--color-border);
  padding: 0.8rem 0;
  margin-bottom: 1rem;
}

.meta-pill {
  font-size: 0.75rem;
  display: flex;
  gap: 0.4rem;
  color: var(--color-text-muted);
}

.meta-pill strong {
  color: var(--color-text-main);
  font-weight: 500;
}

/* Customizer Form Options */
.customizer-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.2rem;
}

.custom-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.custom-group-title {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.options-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-label {
  cursor: pointer;
}

.pill-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-label span {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--color-border-dark);
  font-size: 0.75rem;
  color: var(--color-text-main);
  transition: all 0.2s ease;
}

.pill-label input:checked + span {
  background-color: var(--color-text-main);
  color: var(--color-bg-base);
  border-color: var(--color-text-main);
}

.dialog-action-row {
  margin-top: 0.8rem;
}

.btn-dialog-add {
  width: 100%;
  background-color: var(--color-brand);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-dialog-add:hover {
  background-color: #b05a3d;
}

@media (max-width: 600px) {
  .dialog-grid {
    grid-template-columns: 1fr;
  }
  .dialog-image-area {
    aspect-ratio: 16/10;
  }
  .dialog-content-area {
    padding: 1.5rem;
  }
  .item-dialog {
    width: 95%;
  }
}

/* Dialog Animation */
dialog[open] {
  opacity: 1;
  transform: scale(1);

  @starting-style {
    opacity: 0;
    transform: scale(0.97);
  }
}

dialog {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), display 0.3s allow-discrete, overlay 0.3s allow-discrete;
  transition-behavior: allow-discrete;
}

dialog::backdrop {
  background-color: rgba(28, 26, 23, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: display 0.3s allow-discrete, overlay 0.3s allow-discrete, background-color 0.3s ease, backdrop-filter 0.3s ease;
}

dialog[open]::backdrop {
  background-color: rgba(28, 26, 23, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  @starting-style {
    background-color: rgba(28, 26, 23, 0);
    backdrop-filter: blur(0px);
  }
}

/* WiFi Dialog Styles */
.wifi-dialog {
  border: none;
  background: transparent;
  max-width: 420px;
  width: 90%;
  margin: auto;
  overflow: visible;
}

.wifi-dialog .dialog-content-wrapper {
  background-color: var(--panel-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(28, 26, 23, 0.15);
  border: 1px solid var(--color-border-dark);
  position: relative;
  padding: 2.2rem 1.8rem 1.8rem 1.8rem;
}

.wifi-popup-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wifi-popup-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--color-text-main);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.wifi-popup-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  max-width: 280px;
  margin-bottom: 1.2rem;
}

.wifi-popup-qr-box {
  background: #FFF;
  border: 1px solid var(--color-border);
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 1.2rem;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wifi-popup-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wifi-popup-credentials {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.credential-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.cred-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.cred-val-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.cred-val-box strong {
  font-size: 0.95rem;
  color: var(--color-text-main);
}

.btn-copy-cred {
  background: transparent;
  border: none;
  color: var(--color-brand);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.btn-copy-cred:hover {
  color: var(--color-text-main);
  transform: scale(1.1);
}

/* Tooltip state */
.btn-copy-cred::after {
  content: 'Copié !';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background-color: var(--color-text-main);
  color: var(--color-bg-base);
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.btn-copy-cred.copied::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

.btn-wifi-toggle:hover {
  background: var(--color-text-main) !important;
  border-color: var(--color-text-main) !important;
  color: var(--color-bg-base) !important;
}

[dir="rtl"] .credential-item {
  text-align: right;
}

[dir="rtl"] .cred-val-box {
  flex-direction: row-reverse;
}

[dir="rtl"] .btn-copy-cred::after {
  content: 'تم النسخ !';
}

/* 8. Order Slip Drawer & Overlay */
.order-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background-color: var(--panel-bg);
  border-left: 1px solid var(--color-border);
  box-shadow: -10px 0 30px rgba(28, 26, 23, 0.05);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.order-drawer.open {
  transform: translateX(-420px);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(28, 26, 23, 0.3);
  opacity: 0;
  visibility: hidden;
  z-index: 199;
  transition: all 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.btn-drawer-close {
  position: absolute;
  right: 1.5rem;
  top: 1.6rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-main);
}

.drawer-title {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 600;
}

.drawer-subtitle {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.empty-cart-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--color-text-muted);
  gap: 0.5rem;
}

.empty-cart-state p {
  font-weight: 600;
  color: var(--color-text-main);
  font-size: 0.95rem;
}

.empty-cart-state span {
  font-size: 0.75rem;
  max-width: 180px;
}

/* Receipt Details */
.receipt-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-bottom: 1.2rem;
}

.receipt-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.receipt-dash {
  letter-spacing: -2px;
  margin: 0.3rem 0;
  opacity: 0.4;
}

.receipt-dash-double {
  letter-spacing: -2px;
  margin: 0.4rem 0;
  opacity: 0.4;
}

.cart-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.item-qty-name {
  display: flex;
  gap: 0.6rem;
}

.item-qty {
  color: var(--color-brand);
  font-weight: 600;
}

.cart-item-customizations {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  padding-left: 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-item-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-brand);
  font-size: 0.65rem;
  text-decoration: underline;
}

.receipt-totals {
  margin-top: 1.2rem;
  font-family: var(--font-mono);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin: 0.15rem 0;
}

.total-row {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.drawer-actions {
  padding: 1.2rem;
  border-top: 1px solid var(--color-border);
}

.btn-checkout-sim {
  width: 100%;
  background-color: var(--color-text-main);
  color: var(--color-bg-base);
  border: none;
  padding: 0.8rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-checkout-sim:hover {
  background-color: var(--color-brand);
}

@media (max-width: 480px) {
  .order-drawer {
    right: -100%;
    max-width: 100%;
  }
  .order-drawer.open {
    transform: translateX(-100%);
  }
}

/* 9. Footer Section */
.main-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 1.5rem 0;
  background-color: rgba(255, 255, 255, 0.4);
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.footer-tagline {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.footer-info {
  display: flex;
  gap: 3rem;
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.info-block h4 {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-main);
  text-transform: uppercase;
}

.info-block p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.copyright-coords {
  font-family: var(--font-mono);
  color: var(--color-brand);
}

@media (max-width: 500px) {
  .footer-info {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* 10. Passcode Gate Screen */
.gate-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color-bg-base);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.gate-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--color-border);
  padding: 2.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.gate-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
}

.gate-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

#gateForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#gateInput {
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: center;
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

#gateInput:focus {
  border-color: var(--color-border-dark);
}

.btn-gate-submit {
  background-color: var(--color-text-main);
  color: var(--color-bg-base);
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.btn-gate-submit:hover {
  opacity: 0.9;
}

.gate-error {
  color: #c94a4a;
  font-size: 0.75rem;
  margin-top: 1rem;
  font-weight: 500;
}

/* 11. WiFi Connection Panels */
.gate-wifi-box {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  padding: 1rem;
  border-radius: 10px;
  margin-top: 1.5rem;
  text-align: left;
}

.wifi-qr-wrapper {
  width: 70px;
  height: 70px;
  background: white;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.wifi-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wifi-info-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wifi-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text-main);
  text-transform: uppercase;
}

.wifi-ssid, .wifi-pass {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.wifi-ssid strong, .wifi-pass strong {
  color: var(--color-text-main);
  font-weight: 500;
}

/* Footer WiFi */
.footer-wifi-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.footer-wifi-qr {
  width: 55px;
  height: 55px;
  background: white;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.footer-wifi-details p {
  margin: 0;
  font-size: 0.75rem !important;
  color: var(--color-text-muted) !important;
}

.footer-wifi-details strong {
  color: var(--color-text-main);
  font-weight: 500;
}

/* 12. Right-to-Left (RTL) Arabic Styles */
[dir="rtl"] {
  text-align: right;
  font-family: 'Outfit', 'Cairo', 'Noto Sans Arabic', sans-serif;
}

[dir="rtl"] .logo-area {
  text-align: center !important;
}

[dir="rtl"] .logo-area * {
  text-align: center !important;
}

[dir="rtl"] .dialog-close-btn {
  right: auto;
  left: 1rem;
}

[dir="rtl"] .btn-drawer-close {
  right: auto;
  left: 1.5rem;
}

[dir="rtl"] .card-meta {
  flex-direction: row-reverse;
}

[dir="rtl"] .card-footer {
  flex-direction: row-reverse;
}

[dir="rtl"] .receipt-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .cart-item-info {
  text-align: right;
}

[dir="rtl"] .cart-item-price-del {
  flex-direction: row-reverse;
}

[dir="rtl"] .options-pills {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

[dir="rtl"] .dialog-details-meta {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

[dir="rtl"] .dialog-item-price {
  text-align: right !important;
}

[dir="rtl"] .dialog-item-desc {
  text-align: right !important;
}

[dir="rtl"] .custom-group-title {
  text-align: right !important;
}

[dir="rtl"] .gate-wifi-box {
  text-align: right !important;
  flex-direction: row-reverse;
}

[dir="rtl"] .wifi-info-details {
  align-items: flex-start;
}

[dir="rtl"] .footer-wifi-box {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-wifi-details {
  text-align: right;
}

/* Slide drawer transition direction swap */
[dir="rtl"] .order-drawer {
  right: auto;
  left: -420px;
  border-left: none;
  border-right: 1px solid var(--color-border);
  box-shadow: 10px 0 30px rgba(28, 26, 23, 0.05);
}

[dir="rtl"] .order-drawer.open {
  transform: translateX(420px);
}

/* Category buttons list reverse in RTL */
[dir="rtl"] .category-scroll-wrapper {
  flex-direction: row-reverse;
}
