/* ==========================================================================
   Treats N Eats — Styles
   Mobile-first ordering experience
   ========================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  --coral: #E63956;
  --coral-dark: #C42D47;
  --coral-light: #FF6B81;
  --coral-glow: rgba(230, 57, 86, 0.18);
  --navy: #1A1A2E;
  --navy-light: #2A2A42;
  --teal: #6ECDC0;
  --teal-light: #A8E6CF;
  --teal-glow: rgba(110, 205, 192, 0.18);
  --white: #FFFFFF;
  --cream: #FFF8F5;
  --pink-tint: #FFF0F2;
  --text: #2D2D3A;
  --text-light: #7A7A8E;
  --border: #EDE9E6;
  --success: #2ECC71;
  --whatsapp: #25D366;
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 20px rgba(26, 26, 46, 0.10);
  --shadow-lg: 0 8px 40px rgba(26, 26, 46, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-arabic: 'Cairo', sans-serif;
  --header-h: 60px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
}
html[dir="rtl"] body { font-family: var(--font-arabic); }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

/* ---------- 3. Screen System ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease-out-expo),
              transform 0.4s var(--ease-out-expo),
              visibility 0.4s;
  z-index: 1;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 2;
}
.screen.exiting {
  opacity: 0;
  transform: translateY(-12px);
  z-index: 1;
}

/* ---------- 4. Logo ---------- */
.logo { display: block; }
.logo--hero {
  width: 180px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(230, 57, 86, 0.2));
  animation: logo-entrance 0.8s var(--ease-spring) both;
}
.logo--header { width: 36px; height: auto; }

/* ---------- 5. Decorative Blobs ---------- */
.blob {
  position: absolute;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  pointer-events: none;
  opacity: 0.3;
  z-index: 0;
}
.blob--1 {
  width: 260px; height: 260px;
  top: -60px; right: -80px;
  background: linear-gradient(135deg, var(--coral-glow), var(--teal-glow));
  animation: blob-drift 12s ease-in-out infinite alternate;
}
.blob--2 {
  width: 200px; height: 200px;
  bottom: 10%; left: -60px;
  background: linear-gradient(225deg, var(--teal-glow), var(--coral-glow));
  animation: blob-drift 14s ease-in-out infinite alternate-reverse;
}
.blob--3 {
  width: 140px; height: 140px;
  top: 40%; right: -40px;
  background: var(--teal-glow);
  animation: blob-drift 10s ease-in-out infinite alternate;
}

/* ---------- 6. Loading Screen ---------- */
#screen-loading {
  align-items: center;
  justify-content: center;
  background: var(--cream);
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  z-index: 1;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--sm { width: 20px; height: 20px; border-width: 2px; }

/* ---------- 7. Branch Selection ---------- */
#screen-branch { background: var(--white); }
.branch-screen-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 48px 24px;
  z-index: 1;
}
#screen-branch .logo--hero { filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.1)); }
.branch-subtitle {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: rgba(0,0,0,0.5);
  margin: 16px 0 28px;
  letter-spacing: 0.02em;
}
html[dir="rtl"] .branch-subtitle { font-family: var(--font-arabic); font-weight: 600; }

.branch-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 380px;
}

.lang-picker {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}
.lang-pick {
  background: none;
  border: none;
  color: rgba(0,0,0,0.4);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.lang-pick[data-lang="ar"] { font-family: var(--font-arabic); }
.lang-pick.active {
  color: var(--coral);
  border-bottom-color: var(--coral);
}
.lang-pick:not(.active):hover {
  color: rgba(0,0,0,0.6);
}
.lang-pick-sep {
  color: rgba(0,0,0,0.15);
  font-size: 0.9rem;
}

.branch-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: rgba(0,0,0,0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring),
              background 0.3s ease,
              box-shadow 0.3s ease;
  animation: card-entrance 0.5s var(--ease-out-expo) both;
  -webkit-tap-highlight-color: transparent;
}
.branch-card:nth-child(2) { animation-delay: 0.1s; }
.branch-card:active,
.branch-card:hover {
  background: rgba(0,0,0,0.06);
  transform: scale(1.02);
  box-shadow: 0 4px 24px rgba(230, 57, 86, 0.15);
}
.branch-card::before,
.branch-card::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.12;
  pointer-events: none;
}
.branch-card::before {
  width: 60px; height: 60px;
  top: -12px; left: -12px;
  animation: card-blob-1 6s ease-in-out infinite alternate;
}
.branch-card::after {
  width: 40px; height: 40px;
  bottom: -10px; right: 20px;
  animation: card-blob-2 8s ease-in-out infinite alternate;
}
@keyframes card-blob-1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, 15px) scale(1.1); }
  100% { transform: translate(60px, -5px) scale(0.9); }
}
@keyframes card-blob-2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-25px, -10px) scale(1.15); }
  100% { transform: translate(-50px, 5px) scale(0.85); }
}

.branch-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--coral), var(--coral-light));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--white);
  letter-spacing: 0.04em;
}

.branch-card-text { flex: 1; z-index: 1; }
.branch-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--navy);
  line-height: 1.3;
}
html[dir="rtl"] .branch-card-name { font-family: var(--font-arabic); font-weight: 700; }
.branch-card-sub {
  font-size: 0.8rem;
  color: rgba(0,0,0,0.4);
  margin-top: 2px;
}

.branch-card-arrow {
  width: 28px; height: 28px;
  color: rgba(0,0,0,0.25);
  transition: transform 0.3s var(--ease-spring), color 0.3s;
  flex-shrink: 0;
}
html[dir="rtl"] .branch-card-arrow { transform: scaleX(-1); }
.branch-card:hover .branch-card-arrow,
.branch-card:active .branch-card-arrow {
  color: var(--coral-light);
  transform: translateX(4px);
}
html[dir="rtl"] .branch-card:hover .branch-card-arrow,
html[dir="rtl"] .branch-card:active .branch-card-arrow {
  transform: scaleX(-1) translateX(4px);
}

/* ---------- 8. Order Header ---------- */
.order-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 12px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.header-branch-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
}
html[dir="rtl"] .header-branch-name { font-family: var(--font-arabic); }

.btn-icon {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--navy);
  transition: background 0.2s;
}
.btn-icon:active { background: var(--pink-tint); }
.btn-icon--light { color: var(--white); }
.btn-icon--light:active { background: rgba(255,255,255,0.15); }

.btn-lang {
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: var(--pink-tint);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--coral);
  transition: background 0.2s, transform 0.2s var(--ease-spring);
}
html[dir="rtl"] .btn-lang { font-family: var(--font-arabic); }
.btn-lang:active { transform: scale(0.95); background: var(--coral-glow); }

/* ---------- 9. Order Body ---------- */
#screen-order { background: var(--cream); }
.order-body {
  flex: 1;
  padding: 16px 16px 40px;
  padding-top: calc(var(--header-h) + 16px);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
#screen-order .order-body { padding-top: 16px; }

/* ---------- 10. Menu Preview Cards (Dual Brand) ---------- */
.menu-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
  animation: card-entrance 0.5s var(--ease-out-expo) both;
}
.menu-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.menu-preview:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}
.menu-preview-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--navy);
  overflow: hidden;
}
.menu-preview-bg-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.menu-preview-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}
.menu-preview:hover .menu-preview-img { transform: scale(1.04); }
.menu-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(26,26,46,0.15) 0%, rgba(26,26,46,0.7) 100%);
  color: var(--white);
}
.menu-preview-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  text-align: center;
  line-height: 1.3;
}
html[dir="rtl"] .menu-preview-label { font-family: var(--font-arabic); }
.menu-page-count {
  font-size: 0.75rem;
  opacity: 0.8;
}
.menu-preview.loading .menu-preview-overlay {
  background: linear-gradient(180deg, rgba(26,26,46,0.3) 0%, rgba(26,26,46,0.6) 100%);
}
.menu-preview.loading .menu-preview-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}
/* Loaded state — image is visible, overlay becomes a subtle bottom bar */
.menu-preview.loaded .menu-preview-bg-logo { display: none; }
.menu-preview.loaded .menu-preview-overlay {
  background: linear-gradient(180deg, transparent 40%, rgba(26,26,46,0.75) 100%);
  justify-content: flex-end;
  padding-bottom: 10px;
}
.menu-preview.loaded .menu-preview-overlay svg { display: none; }
.menu-preview.loaded .menu-preview-label { font-size: 0.8rem; }
.menu-preview.loaded .menu-page-count { font-size: 0.7rem; }
.menu-previews[hidden] { display: none; }
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---------- 11. Order Form ---------- */
.order-form {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 20px 24px;
  box-shadow: var(--shadow-sm);
  animation: card-entrance 0.5s var(--ease-out-expo) 0.1s both;
}
.form-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--coral);
  margin-bottom: 20px;
}
html[dir="rtl"] .form-title { font-family: var(--font-arabic); font-weight: 700; }

.form-group {
  margin-bottom: 18px;
}
/* ── Form floating blobs ── */
.order-form {
  position: relative;
  overflow: hidden;
}
.order-form::before,
.order-form::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}
.order-form::before {
  width: 120px; height: 120px;
  top: 40px; right: -30px;
  animation: form-blob-1 8s ease-in-out infinite alternate;
}
.order-form::after {
  width: 80px; height: 80px;
  bottom: 120px; left: -20px;
  animation: form-blob-2 10s ease-in-out infinite alternate;
}
.order-form .form-title,
.order-form .form-group,
.order-form .form-error,
.order-form .submit-instruction,
.order-form .submit-buttons {
  position: relative;
  z-index: 1;
}
@keyframes form-blob-1 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-40px, 60px) scale(1.2); }
  66%  { transform: translate(-80px, 120px) scale(0.9); }
  100% { transform: translate(-30px, 200px) scale(1.1); }
}
@keyframes form-blob-2 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -50px) scale(1.15); }
  66%  { transform: translate(60px, -100px) scale(0.85); }
  100% { transform: translate(20px, -160px) scale(1.05); }
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  opacity: 0.7;
  margin-top: 4px;
}
.form-group .optional {
  font-weight: 400;
  color: var(--text-light);
  opacity: 0.7;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--coral);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--coral-glow);
}
.form-group input.invalid,
.form-group textarea.invalid {
  border-color: var(--coral);
  background: var(--pink-tint);
}

.form-error {
  padding: 10px 14px;
  background: var(--pink-tint);
  border-radius: var(--radius-sm);
  color: var(--coral-dark);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.submit-instruction {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
  font-weight: 500;
}
.submit-buttons {
  display: flex;
  gap: 10px;
}
.btn-submit {
  flex: 1;
  padding: 16px;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-submit--delivery {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  box-shadow: 0 4px 16px rgba(230, 57, 86, 0.3);
}
.btn-submit--pickup {
  background: linear-gradient(135deg, #4db8a9, var(--teal));
  box-shadow: 0 4px 16px var(--teal-glow);
}
html[dir="rtl"] .btn-submit { font-family: var(--font-arabic); font-weight: 700; }
.btn-submit:active:not(:disabled) {
  transform: scale(0.97);
}
.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ---------- 12. Success Screen ---------- */
#screen-success {
  align-items: center;
  justify-content: center;
  background: var(--cream);
  text-align: center;
  padding: 32px 24px;
}
.success-content { z-index: 1; max-width: 360px; }

.success-check { margin-bottom: 24px; }
.checkmark {
  width: 72px; height: 72px;
}
.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--success);
  animation: checkmark-circle 0.6s ease-in-out forwards;
}
.checkmark-kick {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: checkmark-kick 0.4s 0.4s ease-in-out forwards;
}

.success-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 12px;
}
html[dir="rtl"] .success-title { font-family: var(--font-arabic); }
.success-message {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 28px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: var(--whatsapp);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
  transition: transform 0.2s var(--ease-spring);
  margin-bottom: 14px;
}
html[dir="rtl"] .btn-whatsapp { font-family: var(--font-arabic); }
.btn-whatsapp:active { transform: scale(0.97); }

.btn-new-order {
  width: 100%;
  padding: 14px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  transition: background 0.2s, transform 0.2s var(--ease-spring);
}
html[dir="rtl"] .btn-new-order { font-family: var(--font-arabic); }
.btn-new-order:active { background: var(--cream); transform: scale(0.97); }

/* ---------- 13. Gallery ---------- */
.gallery {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: gallery-open 0.35s var(--ease-out-expo) both;
}
.gallery[hidden] { display: none; }

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 20px;
  flex-shrink: 0;
}
.gallery-counter {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}
.gallery-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  touch-action: none;
}
.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s var(--ease-out-expo);
  will-change: transform;
}
.gallery-track.dragging { transition: none; }

.gallery-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}
.gallery-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transform-origin: center center;
  transition: transform 0.15s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  color: var(--white);
  z-index: 10;
  transition: background 0.2s, transform 0.2s var(--ease-spring), opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.gallery-arrow:hover { background: rgba(255,255,255,0.25); }
.gallery-arrow:active { transform: translateY(-50%) scale(0.9); }
.gallery-arrow--prev { left: 12px; }
.gallery-arrow--next { right: 12px; }
html[dir="rtl"] .gallery-arrow--prev { left: auto; right: 12px; }
html[dir="rtl"] .gallery-arrow--next { right: auto; left: 12px; }
html[dir="rtl"] .gallery-arrow svg { transform: scaleX(-1); }
.gallery-arrow[disabled] { opacity: 0.2; pointer-events: none; }

/* Hide arrows on mobile — swipe is the natural gesture */
@media (max-width: 768px) {
  .gallery-arrow { display: none; }
}

/* ---------- 14. Error Overlay ---------- */
.error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}
.error-overlay[hidden] { display: none; }
.error-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: card-entrance 0.4s var(--ease-spring) both;
}
.error-card svg { margin: 0 auto 16px; }
.error-message {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ---------- 15. Animations ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes logo-entrance {
  from { opacity: 0; transform: scale(0.85) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes card-entrance {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blob-drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(15px, -10px) rotate(8deg); }
  100% { transform: translate(-10px, 12px) rotate(-4deg); }
}
@keyframes gallery-open {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes checkmark-circle {
  to { stroke-dashoffset: 0; }
}
@keyframes checkmark-kick {
  to { stroke-dashoffset: 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ---------- 16. RTL ---------- */
html[dir="rtl"] .btn-icon svg { transform: scaleX(-1); }
html[dir="rtl"] .btn-icon--light svg { transform: none; }
html[dir="rtl"] .branch-card::before { left: auto; right: -8px; }
html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group textarea { text-align: right; }
html[dir="rtl"] .gallery-header { flex-direction: row-reverse; }

/* ---------- 17. Utilities ---------- */
[hidden] { display: none !important; }

/* ---------- 18. Responsive (larger phones / tablets) ---------- */
@media (min-width: 480px) {
  .logo--hero { width: 220px; }
  .branch-cards { max-width: 420px; }
  .order-body { padding-left: 24px; padding-right: 24px; }
  .order-form { padding: 32px 28px; }
}
@media (min-width: 768px) {
  .logo--hero { width: 240px; }
  .branch-cards { max-width: 460px; }
  .order-body { max-width: 540px; }
}

/* ---------- 19. Grain Overlay ---------- */
#screen-branch::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.02;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
  z-index: 0;
}
