/* =============================================
   KANAFA HOME — Mobile App Layout (phones only)
   Active when <html> has .m-app (added by mobile-app.js at ≤768px)
   ============================================= */

:root {
  --m-nav-h: 70px;
  --m-bar-h: 58px;
  --m-safe-b: env(safe-area-inset-bottom, 0px);
  --m-card: #ffffff;
  --m-soft: rgba(73, 34, 26, 0.10);
  --m-radius: 18px;
}
[data-theme="dark"] { --m-card: #242525; }

/* Hidden everywhere unless app mode is on */
#mAppBar, #mBottomNav, #mCatsView, #mSettingsView { display: none; }

/* ---------- Base ---------- */
html.m-app body {
  padding-bottom: calc(var(--m-nav-h) + var(--m-safe-b) + 12px) !important;
  -webkit-tap-highlight-color: transparent;
}

/* Hide desktop chrome */
html.m-app #header,
html.m-app #footer,
html.m-app .announcement-bar,
html.m-app #backToTop,
html.m-app .cart-fixed-container,
html.m-app .scroll-progress,
html.m-app .newsletter-section { display: none !important; }

/* ---------- Top App Bar ---------- */
html.m-app #mAppBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 3000;
  height: calc(var(--m-bar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
#mAppBar .m-bar-side { width: 40px; display: flex; align-items: center; justify-content: center; }
#mAppBar .m-bar-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--bg-2); border: 1px solid var(--border);
  font-size: 0.95rem;
}
#mAppBar .m-bar-btn[hidden] { visibility: hidden; display: flex; }
#mAppBar .m-bar-center { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
#mAppBar .m-logo { height: 36px; width: auto; display: block; }
#mAppBar .m-bar-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="dark"] #mAppBar .m-logo,
[data-theme="dark"] .m-set-foot .m-logo { filter: brightness(0) invert(1); }

/* ---------- Bottom Navigation (glass pill) ---------- */
html.m-app #mBottomNav {
  display: flex;
  position: fixed;
  left: 14px; right: 14px;
  bottom: calc(12px + var(--m-safe-b));
  height: var(--m-nav-h);
  z-index: 6000;
  padding: 0 8px;
  justify-content: space-around;
  align-items: stretch;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.25)),
    rgba(250, 249, 246, 0.55);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255,255,255,0.8),
    inset 0 -1px 0 rgba(0,0,0,0.04);
}
[data-theme="dark"] #mBottomNav {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(20, 20, 20, 0.62) !important;
  border-color: rgba(255,255,255,0.10) !important;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.10) !important;
}

.m-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.72rem; font-weight: 700;
  position: relative;
  background: none; border: none; font-family: inherit;
  padding-bottom: 6px;
  transition: color 0.25s ease;
}
.m-nav-item .m-nav-ic {
  position: relative;
  font-size: 1.3rem; line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.m-nav-dot {
  position: absolute; bottom: 7px; left: 50%;
  width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: var(--gold);
  transform: scale(0); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.m-nav-item.active { color: var(--gold); }
.m-nav-item.active .m-nav-ic { transform: translateY(-2px); }
.m-nav-item.active .m-nav-dot { transform: scale(1); }
.m-nav-item:active .m-nav-ic { transform: scale(0.88); }
.m-nav-badge {
  position: absolute; top: -8px; inset-inline-end: -12px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--gold); color: #fff;
  font-size: 0.62rem; font-weight: 700; line-height: 18px; text-align: center;
}
.m-nav-badge.empty { display: none; }
.m-nav-badge.bump { animation: mBump 0.45s ease; }
@keyframes mBump { 0%{transform:scale(1)} 40%{transform:scale(1.35)} 100%{transform:scale(1)} }

/* ---------- Tabs visibility (home page) ---------- */
html.m-app.m-home-page main > section { display: none !important; }
html.m-app.m-home-page[data-mtab="home"] main > #hero:not(.m-off),
html.m-app.m-home-page[data-mtab="home"] main > .stats-section:not(.m-off),
html.m-app.m-home-page[data-mtab="home"] main > #categories:not(.m-off),
html.m-app.m-home-page[data-mtab="home"] main > #aboutUs:not(.m-off),
html.m-app.m-home-page[data-mtab="home"] main > #features:not(.m-off) { display: block !important; }
html.m-app.m-home-page[data-mtab="cats"] main > #mCatsView { display: block !important; }
html.m-app.m-home-page[data-mtab="settings"] main > #mSettingsView { display: block !important; }

html.m-app.m-home-page .whatsapp-fixed-container { display: none !important; }
html.m-app .whatsapp-fixed-container { bottom: calc(var(--m-nav-h) + var(--m-safe-b) + 22px) !important; }

/* =============================================
   HOME — calm & luxurious (phones)
   ============================================= */
:root { --lux-ink: #262422; --lux-gold: #49221a; --lux-gold-2: #e6cbbd; --lux-line: rgba(38,36,34,0.10); --lux-panel: #49221a; }
[data-theme="dark"] { --lux-ink: #ece6dc; --lux-gold: #49221a; --lux-line: rgba(255,255,255,0.08); --lux-panel: #49221a; }

/* ---------- Hero: full-bleed, soft ---------- */
html.m-app .hero-section { margin: 0 !important; border-radius: 0 0 34px 34px; overflow: hidden; box-shadow: none; }
html.m-app .hero-section,
html.m-app .hero-slider,
html.m-app .slide,
html.m-app .slide .container { min-height: 560px !important; min-height: 76svh !important; }
html.m-app .slide .container { padding: 0 24px !important; flex-direction: column !important; justify-content: flex-end !important; align-items: stretch !important; }
html.m-app .slide-overlay {
  background:
    linear-gradient(to bottom, rgba(20,18,16,0.45) 0%, rgba(20,18,16,0) 22%),
    linear-gradient(to top, rgba(20,18,16,0.88) 0%, rgba(20,18,16,0.35) 48%, rgba(20,18,16,0.08) 100%) !important;
}
html.m-app .slide.active .slide-bg-img img,
html.m-app [lang="ar"] .slide.active .slide-bg-img img { animation: luxZoom 9s cubic-bezier(.2,.6,.2,1) forwards !important; filter: brightness(0.92) saturate(0.92) !important; }
@keyframes luxZoom { from { transform: scale(1.14); } to { transform: scale(1); } }
html.m-app .slide-content,
html.m-app html[lang="ar"] .slide-content { padding: 0 0 70px !important; text-align: start !important; animation: none !important; }
html.m-app .slide.active .slide-content > * { animation: luxUp 1s cubic-bezier(.22,1,.36,1) both; }
html.m-app .slide.active .slide-content > *:nth-child(1) { animation-delay: .15s; }
html.m-app .slide.active .slide-content > *:nth-child(2) { animation-delay: .3s; }
html.m-app .slide.active .slide-content > *:nth-child(3) { animation-delay: .45s; }
html.m-app .slide.active .slide-content > *:nth-child(4) { animation-delay: .6s; }
@keyframes luxUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
html.m-app .slide-tag {
  display: inline-flex !important; align-items: center; gap: 12px;
  background: none !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important;
  color: #e6cbbd !important; font-size: 0.74rem !important; font-weight: 700 !important; margin-bottom: 14px !important;
}
html.m-app .slide-tag::before { display: none !important; }
html.m-app .slide-content h1 { font-size: 2.15rem !important; font-weight: 700 !important; line-height: 1.3 !important; margin-bottom: 12px !important; letter-spacing: 0 !important; }
html.m-app .slide-content h1 em { color: #e6cbbd !important; font-weight: 700; }
html.m-app .slide-content p { font-size: 0.9rem !important; color: rgba(255,255,255,0.72) !important; line-height: 1.85 !important; margin-bottom: 24px !important; max-width: 92% !important; }
html.m-app .slide-actions { justify-content: flex-start !important; align-items: center; gap: 22px !important; }
html.m-app .slide-actions .btn-primary {
  background: #f6f2ec !important; color: #262422 !important; border: 0 !important;
  padding: 13px 28px !important; border-radius: 999px !important; font-weight: 700 !important; box-shadow: none !important;
}
html.m-app .slide-actions .btn-outline {
  background: none !important; border: 0 !important; text-decoration: none !important;
  border-radius: 0 !important; padding: 4px 0 !important; color: #fff !important;
}
html.m-app .slider-controls { display: flex !important; bottom: 30px !important; }
html.m-app .slider-prev, html.m-app .slider-next { display: none !important; }
html.m-app .dot { width: 16px !important; height: 2px !important; border-radius: 2px !important; background: rgba(255,255,255,0.35) !important; animation: none !important; }
html.m-app .dot.active { width: 34px !important; background: #fff !important; }
html.m-app #hero-particles, html.m-app .liquid-blobs { display: none !important; }

/* ---------- Stats: one floating strip ---------- */
html.m-app .stats-section {
  position: relative; z-index: 5;
  margin: -38px 18px 0 !important; padding: 18px 4px !important;
  background: var(--m-card) !important; border: 1px solid var(--lux-line) !important; border-radius: 24px;
  box-shadow: 0 20px 44px rgba(20,18,16,0.10);
}
html.m-app .stats-section .container { padding: 0 !important; }
html.m-app .stats-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 0 !important; }
html.m-app .stat-item {
  background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  padding: 2px 4px !important; transform: none !important;
}
html.m-app .stat-item + .stat-item { border-inline-start: 1px solid var(--lux-line) !important; }
html.m-app .stat-item::before, html.m-app .stat-icon { display: none !important; }
html.m-app .stat-num {
  font-size: 1.45rem !important; font-weight: 700 !important;
  background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--lux-ink) !important;
}
html.m-app .stat-label { font-size: 0.66rem !important; color: var(--text-muted) !important; margin-top: 6px !important; line-height: 1.4; }

/* ---------- Section headings ---------- */
html.m-app .categories-section,
html.m-app .about-us-section { padding: 44px 0 20px !important; background: transparent !important; }
html.m-app .section-header { margin-bottom: 22px !important; padding: 0 20px; }
html.m-app .section-tag {
  display: inline-flex !important; align-items: center; gap: 10px;
  background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
  animation: none !important; transform: none !important;
  color: var(--lux-gold) !important; font-size: 0.74rem !important; font-weight: 700 !important; margin-bottom: 10px !important;
}
html.m-app .section-tag::before, html.m-app .section-tag::after { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .55; }
html.m-app .section-header h2 { font-size: 1.6rem !important; font-weight: 700 !important; line-height: 1.4 !important; color: var(--gold) !important; }
html.m-app .section-header h2::after { display: none !important; }

/* ---------- Categories: arched gallery ---------- */
html.m-app .categories-section .container { padding: 0 !important; max-width: none; }
html.m-app .categories-grid {
  display: flex !important; gap: 14px !important;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: 6px 20px 18px; scrollbar-width: none;
}
html.m-app .categories-grid::-webkit-scrollbar { display: none; }
html.m-app .cat-card,
html.m-app .cat-card.large {
  flex: 0 0 56%; height: auto !important; aspect-ratio: 3 / 4.3;
  border-radius: 999px 999px 26px 26px !important; border: 0 !important;
  scroll-snap-align: center; box-shadow: 0 16px 34px rgba(20,18,16,0.12);
  grid-column: auto !important; grid-row: auto !important;
}
html.m-app .cat-card img { transform: none !important; }
html.m-app .cat-card::after { display: none !important; }
html.m-app .cat-overlay {
  justify-content: flex-end !important; align-items: center !important; padding: 0 12px 24px !important;
  background: linear-gradient(to top, rgba(20,18,16,0.72) 0%, rgba(20,18,16,0) 55%) !important;
}
html.m-app .cat-card .cat-tag {
  background: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important;
  font-size: 1.02rem !important; font-weight: 700 !important; text-align: center;
  display: flex !important; flex-direction: column; align-items: center; gap: 8px;
}
html.m-app .cat-card .cat-tag::after { display: none !important; }
html.m-app .cat-card:active { transform: scale(0.97) !important; }

/* ---------- About: arched portrait with offset frame ---------- */
html.m-app .about-inner { display: flex !important; flex-direction: column !important; gap: 28px !important; text-align: center; }
html.m-app .about-image {
  order: -1; width: 74%; margin: 0 auto; aspect-ratio: 4 / 5; max-height: none !important;
  border-radius: 999px 999px 26px 26px !important; overflow: visible !important; box-shadow: none !important;
  position: relative;
}
html.m-app .about-image::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 1px solid var(--lux-gold); transform: translate(12px, 12px); z-index: 0;
}
html.m-app[dir="rtl"] .about-image::before { transform: translate(-12px, 12px); }
html.m-app .about-image img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transform: none !important; }
html.m-app .about-text { padding: 0 8px; }
html.m-app .about-text .section-tag { margin-bottom: 12px !important; }
html.m-app .about-text h2 { font-size: 1.5rem !important; font-weight: 700 !important; line-height: 1.5 !important; margin-bottom: 12px !important; color: var(--gold) !important; }
html.m-app .about-text p { font-size: 0.92rem !important; line-height: 2 !important; color: var(--text-muted) !important; margin: 0 !important; }
html.m-app .about-text::after { content: ''; display: block; width: 40px; height: 1px; background: var(--lux-gold); margin: 22px auto 0; }

/* ---------- After-sales services: dark numbered panel ---------- */
html.m-app .features-section {
  margin: 28px 12px 0; padding: 42px 0 14px !important; border-radius: 32px;
  background: var(--lux-panel) !important; position: relative; overflow: hidden;
}
html.m-app .features-section::before {
  content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  top: -130px; inset-inline-end: -90px; border: 1px solid rgba(230,203,189,0.18);
  box-shadow: 0 0 0 40px rgba(230,203,189,0.03), 0 0 0 80px rgba(230,203,189,0.02);
}
html.m-app .features-section .section-header h2 { color: #f6f2ec !important; }
html.m-app .features-section .section-tag { color: var(--lux-gold-2) !important; }
html.m-app .features-grid { display: block !important; counter-reset: feat; padding: 0 4px; }
html.m-app .features-grid.stagger-children > * { opacity: 1; transform: none; animation: none !important; }
html.m-app .feature-card {
  display: grid !important; grid-template-columns: 50px 1fr auto; column-gap: 16px; row-gap: 3px; align-items: center;
  text-align: start !important; background: transparent !important; border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 20px 4px !important; counter-increment: feat; overflow: visible !important;
}
html.m-app .feature-card:last-child { border-bottom: 0 !important; }
html.m-app .feature-card::before { display: none !important; }
html.m-app .feature-card::after {
  content: counter(feat, decimal-leading-zero) !important;
  position: static !important; grid-column: 3; grid-row: 1 / 3;
  width: auto !important; height: auto !important; background: none !important; transform: none !important;
  font-size: 1.5rem; font-weight: 700; color: rgba(230,203,189,0.45); line-height: 1;
}
html.m-app .feat-icon {
  grid-row: 1 / 3; width: 50px !important; height: 50px !important; margin: 0 !important;
  background: transparent !important; border: 1px solid rgba(230,203,189,0.4); border-radius: 50% !important;
  color: var(--lux-gold-2) !important; font-size: 1.05rem !important; animation: none !important;
}
html.m-app .feat-icon::after { display: none !important; }
html.m-app .feature-card h3 { grid-column: 2; margin: 0 !important; color: #f6f2ec !important; font-size: 0.98rem !important; font-weight: 700 !important; }
html.m-app .feature-card p { grid-column: 2; margin: 0 !important; color: rgba(236,230,220,0.58) !important; font-size: 0.8rem !important; line-height: 1.75 !important; }

/* ---------- Motion: slow, soft reveals (no blur, no bounce) ---------- */
html.m-app [data-reveal] { filter: none !important; opacity: 0; transform: translateY(26px) !important; }
html.m-app [data-reveal].revealed {
  opacity: 1; transform: none !important;
  transition: opacity 1.1s cubic-bezier(.22,1,.36,1), transform 1.1s cubic-bezier(.22,1,.36,1) !important;
}
/* Image "curtain" reveal: the card/frame is observed, the picture inside is unveiled */
html.m-app .cat-card[data-reveal],
html.m-app .about-image[data-reveal] { transform: none !important; opacity: 1; }
html.m-app .cat-card[data-reveal] img,
html.m-app .about-image[data-reveal] img { clip-path: inset(100% 0 0 0 round 999px 999px 26px 26px); transition: clip-path 1.3s cubic-bezier(.65,0,.35,1); }
html.m-app .cat-card[data-reveal] .cat-overlay { opacity: 0; transition: opacity .8s ease .6s; }
html.m-app .cat-card[data-reveal].revealed img,
html.m-app .about-image[data-reveal].revealed img { clip-path: inset(0 0 0 0 round 999px 999px 26px 26px); }
html.m-app .cat-card[data-reveal].revealed .cat-overlay { opacity: 1; }
html.m-app .cat-card[data-reveal] { box-shadow: none; transition: box-shadow .8s ease .5s !important; }
html.m-app .cat-card[data-reveal].revealed { box-shadow: 0 16px 34px rgba(20,18,16,0.12); }
/* hero text is shown by its own animation */
html.m-app .slide-content[data-aos] { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  html.m-app [data-reveal], html.m-app [data-reveal] img, html.m-app .cat-card[data-reveal] .cat-overlay { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

/* ---------- Generic view container ---------- */
.m-view { padding: 16px 14px 10px; animation: mViewIn 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes mViewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.m-view-head { margin: 4px 2px 16px; }
.m-view-head h2 { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.m-view-head p { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Categories view ---------- */
.m-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-cat-card {
  position: relative; border-radius: var(--m-radius); overflow: hidden;
  aspect-ratio: 1 / 1.08; background: var(--bg-3);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  text-align: start; padding: 0; display: block; width: 100%;
  transition: transform 0.2s ease;
}
.m-cat-card:active { transform: scale(0.97); }
.m-cat-card.wide { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.m-cat-card img { width: 100%; height: 100%; object-fit: cover; }
.m-cat-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
}
.m-cat-info { position: absolute; inset-inline: 12px; bottom: 12px; z-index: 2; color: #fff; }
.m-cat-info strong { display: block; font-size: 1rem; font-weight: 700; line-height: 1.25; }
.m-cat-info span { font-size: 0.74rem; opacity: 0.85; }
.m-cat-arrow {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.22); backdrop-filter: blur(6px);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
}

/* Category products */
.m-prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-prod {
  background: var(--m-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.m-prod-img { position: relative; aspect-ratio: 1; background: var(--bg-3); }
.m-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.m-prod-badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: var(--gold); color: #fff; font-size: 0.64rem; font-weight: 700;
  padding: 3px 8px; border-radius: 8px;
}
.m-prod-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.m-prod-name {
  font-size: 0.82rem; font-weight: 700; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.2em;
}
.m-prod-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.m-prod-price { font-size: 0.85rem; font-weight: 700; color: var(--gold); line-height: 1.2; }
.m-prod-old { display: block; font-size: 0.68rem; color: var(--text-muted); text-decoration: line-through; font-weight: 700; }
.m-prod-add {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px;
  background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; transition: transform 0.15s ease, background 0.2s ease;
}
.m-prod-add:active { transform: scale(0.88); }
.m-prod-add.done { background: #25D366; }

.m-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.m-empty i { font-size: 2.4rem; color: var(--gold); opacity: 0.6; margin-bottom: 12px; display: block; }

/* ---------- Settings view ---------- */
.m-count { font-size: 0.8rem; color: var(--text-muted); margin: 0 2px 12px; }

/* Profile card */
.m-profile {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px; margin-bottom: 8px; border-radius: 22px; text-align: start;
  background: linear-gradient(135deg, #5a2c22 0%, #49221a 55%, #2f150f 100%);
  color: #fff; font-family: inherit; box-shadow: 0 12px 28px rgba(0,0,0,0.15);
  position: relative; overflow: hidden;
}
.m-profile::after {
  content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%;
  inset-inline-end: -50px; top: -60px; background: rgba(73, 34, 26,0.25);
}
.m-profile .m-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 700; color: #fff; position: relative; z-index: 1;
}
.m-profile-txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.m-profile-txt strong { display: block; font-size: 1.02rem; font-weight: 700; }
.m-profile-txt small { display: block; font-size: 0.78rem; opacity: 0.75; margin-top: 2px; }
.m-profile .m-chev { color: rgba(255,255,255,0.7); position: relative; z-index: 1; }
.m-profile-cta {
  position: relative; z-index: 1; flex-shrink: 0;
  background: var(--gold); color: #fff; font-size: 0.78rem; font-weight: 700;
  padding: 8px 14px; border-radius: 999px;
}

/* Flat list like native settings */
.m-list { margin-top: 6px; }
.m-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 18px 4px; text-align: start;
  color: var(--text); font-family: inherit; font-size: 1rem; font-weight: 700;
  background: none; border: none; text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.m-row:active { opacity: 0.6; }
.m-row-ic { width: 26px; flex-shrink: 0; display: flex; justify-content: center; font-size: 1.2rem; color: var(--text); }
.m-row-txt { flex: 1; min-width: 0; }
.m-row-val { font-size: 0.82rem; color: var(--text-muted); font-weight: 700; }
.m-chev { color: var(--text-muted); font-size: 0.85rem; }
.m-check { color: var(--gold); font-size: 1.25rem; }
.m-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); }

/* Segmented control */
.m-seg { display: inline-flex; background: var(--bg-3); border-radius: 14px; padding: 4px; gap: 2px; }
.m-seg button {
  padding: 8px 14px; border-radius: 10px; font-size: 0.85rem; font-weight: 700;
  color: var(--text-muted); font-family: inherit; transition: all 0.2s ease;
}
.m-seg button.active { background: var(--m-card); color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.m-seg.full { display: flex; width: 100%; margin-bottom: 8px; }
.m-seg.full button { flex: 1; padding: 11px; }

/* Switch */
.m-switch { position: relative; width: 54px; height: 32px; flex-shrink: 0; }
.m-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.m-switch span { position: absolute; inset: 0; background: var(--bg-3); border-radius: 16px; transition: background 0.25s ease; border: 1px solid var(--border); }
.m-switch span::before {
  content: ''; position: absolute; width: 26px; height: 26px; top: 2px; inset-inline-start: 2px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.m-switch input:checked + span { background: var(--gold); border-color: var(--gold); }
.m-switch input:checked + span::before { transform: translateX(22px); }
[dir="rtl"] .m-switch input:checked + span::before { transform: translateX(-22px); }

/* Account page */
.m-acc { padding-top: 6px; }
.m-acc-avatar {
  width: 104px; height: 104px; border-radius: 50%; margin: 6px auto 26px;
  background: var(--bg-3); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.3rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--border);
}
[data-theme="dark"] .m-acc-avatar { background: #0f0f0f; color: #fff; }
.m-ff { position: relative; margin-top: 22px; }
.m-ff label {
  position: absolute; top: -10px; inset-inline-start: 16px;
  padding: 0 6px; background: var(--bg); z-index: 1;
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
}
.m-ff input, .m-ff select {
  width: 100%; height: 60px; padding: 0 18px; padding-inline-end: 52px;
  border-radius: 18px; border: 1px solid var(--border);
  background: var(--m-card); color: var(--text);
  font-family: inherit; font-size: 1rem; font-weight: 700;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
.m-ff input[readonly] { color: var(--text-muted); }
.m-ff input.ltr { direction: ltr; text-align: left; }
[dir="rtl"] .m-ff input.ltr { text-align: right; }
.m-ff input:focus, .m-ff select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(73, 34, 26,0.14); }
.m-ff input.invalid { border-color: #e5484d; }
.m-ff-edit, .m-ff-caret {
  position: absolute; top: 50%; transform: translateY(-50%);
  inset-inline-end: 18px; color: var(--text-muted); font-size: 1.15rem; pointer-events: none;
}
.m-ff input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; inset: 0; width: 100%; }
.m-err { color: #e5484d; font-size: 0.8rem; margin-top: 10px; min-height: 1em; }
.m-link-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 4px; font-family: inherit; font-size: 1rem; font-weight: 700;
  color: #e0736f; background: none; border: none;
}
.m-link-btn i { font-size: 1.15rem; width: 22px; text-align: center; }
.m-btn {
  width: 100%; margin-top: 22px; height: 58px; border-radius: 20px;
  background: var(--gold); color: #fff; font-weight: 700; font-size: 1rem; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.15s ease;
}
.m-btn:active { transform: scale(0.98); }
.m-note { font-size: 0.74rem; color: var(--text-muted); text-align: center; margin-top: 12px; }

/* Social */
.m-social { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }
.m-social a {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--m-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 1.05rem;
}

/* Settings footer */
.m-set-foot { text-align: center; padding: 22px 10px 28px; }
.m-set-foot .m-logo { height: 54px; width: auto; margin: 0 auto 12px; }
.m-set-foot p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.8; }
.m-set-foot a { color: var(--gold); font-weight: 700; text-decoration: none; direction: ltr; unicode-bidi: isolate; }

/* ---------- Side cart sits above the bottom bar ---------- */
html.m-app .side-cart {
  width: 100% !important;
  height: calc(100% - var(--m-nav-h) - var(--m-safe-b) - 20px) !important;
  border-radius: 0 0 24px 24px;
}
html.m-app .cart-overlay { bottom: 0; }
html.m-app .cart-footer-mini { padding-bottom: 18px !important; }

/* ---------- Product modal above nav ---------- */
html.m-app .product-modal { z-index: 7000 !important; }

/* ---------- Toast ---------- */
.m-toast {
  position: fixed; left: 50%; bottom: calc(var(--m-nav-h) + var(--m-safe-b) + 26px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--dark); color: #fff; padding: 11px 18px; border-radius: 14px;
  font-size: 0.85rem; font-weight: 700; z-index: 8000; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.m-toast.show { opacity: 1; transform: translate(-50%, 0); }
.m-toast i { color: var(--gold); margin-inline-end: 6px; }

/* ---------- Inner pages (contact, privacy, product...) ---------- */
html.m-app:not(.m-home-page) main { padding-top: 6px; }
html.m-app:not(.m-home-page) .contact-section,
html.m-app:not(.m-home-page) .product-page-wrapper { padding: 24px 0 !important; }
html.m-app:not(.m-home-page) .page-banner { margin: 12px; border-radius: 20px; padding: 36px 0 !important; }

@media (prefers-reduced-motion: reduce) {
  .m-view { animation: none; }
}

/* Date field aligns with the rest in RTL */
[dir="rtl"] .m-ff input[type="date"] { text-align: right; }
[dir="rtl"] .m-ff input[type="date"]::-webkit-date-and-time-value { text-align: right; }

/* ---------- Home: no top bar (logo lives in the intro) ---------- */
html.m-app.m-home-page[data-mtab="home"] #mAppBar { display: none !important; }


/* ---------- In-app contact ---------- */
.m-row-2 .m-row-txt small { display: block; font-size: 0.76rem; color: var(--text-muted); font-weight: 700; margin-bottom: 2px; }
.m-row-2 .m-row-txt span { display: block; font-size: 0.95rem; line-height: 1.5; }
.m-wa-big {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; border-radius: 18px; background: #25D366; color: #fff !important;
  font-weight: 700; font-size: 1rem; text-decoration: none; box-shadow: 0 10px 24px rgba(37,211,102,0.3);
}
.m-wa-big i { font-size: 1.35rem; }
.m-map { margin-top: 18px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); height: 220px; background: var(--bg-3); }
.m-map iframe { width: 100%; height: 100%; border: 0; display: block; }
[data-theme="dark"] .m-map iframe { filter: invert(90%) hue-rotate(180deg) brightness(0.85); }
.m-btn.ghost-btn { background: var(--m-card); color: var(--text); border: 1px solid var(--border); margin-top: 12px; text-decoration: none; }

/* ---------- In-app documents ---------- */
.m-doc { color: var(--text); line-height: 1.9; font-size: 0.95rem; padding: 4px 2px; }
.m-doc h1, .m-doc h2, .m-doc h3 { color: var(--gold); font-size: 1.08rem; line-height: 1.5; margin: 22px 0 6px; }
.m-doc h2:first-child, .m-doc h1:first-child { margin-top: 4px; }
.m-doc p { color: var(--text-muted); margin-bottom: 8px; }
.m-doc ul, .m-doc ol { padding-inline-start: 20px; color: var(--text-muted); list-style: disc; }
.m-doc-date { font-size: 0.78rem !important; background: var(--m-soft); color: var(--gold) !important; display: inline-block; padding: 4px 12px; border-radius: 999px; }
.m-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--gold); margin: 0 auto 14px; animation: mSpin 0.8s linear infinite; }
@keyframes mSpin { to { transform: rotate(360deg); } }
.m-empty .m-btn { display: flex; }

/* ---------- Notifications ---------- */
.m-row-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--gold); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 22px; text-align: center; }
.m-notifs { display: flex; flex-direction: column; gap: 12px; }
.m-notif { display: flex; gap: 12px; padding: 16px; border-radius: 20px; background: var(--m-card); border: 1px solid var(--border); position: relative; }
.m-notif.unread { border-color: var(--gold); background: linear-gradient(135deg, rgba(73, 34, 26,0.10), var(--m-card) 60%); }
.m-notif.unread::after { content: ''; position: absolute; top: 16px; inset-inline-end: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.m-notif-ic { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--m-soft); color: var(--gold); font-size: 1rem; }
.m-notif-b { flex: 1; min-width: 0; }
.m-notif-b strong { display: block; font-size: 0.95rem; color: var(--text); padding-inline-end: 14px; }
.m-notif-b p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.8; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.m-notif-f { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.m-notif-f small { font-size: 0.72rem; color: var(--text-muted); }
.m-notif-link { font-size: 0.8rem; font-weight: 700; color: var(--gold); text-decoration: none; }
.m-nbanner {
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; z-index: 9000;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px;
  background: color-mix(in srgb, var(--m-card) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  transform: translateY(-140%); transition: transform .5s cubic-bezier(.22,1,.36,1); cursor: pointer;
}
.m-nbanner.show { transform: none; }
.m-nbanner-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.m-nbanner-t { flex: 1; min-width: 0; }
.m-nbanner-t small { display: block; font-size: 0.7rem; color: var(--gold); font-weight: 700; }
.m-nbanner-t strong { display: block; font-size: 0.88rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-nbanner-x { color: var(--text-muted); padding: 6px; }
@media (min-width: 769px) { .m-nbanner { left: auto; right: 24px; width: 380px; } }

[data-theme="dark"] { --m-soft: rgba(73, 34, 26, 0.35); }

/* ---------- Home categories: endless moving strip ---------- */
html.m-app .categories-grid.m-marquee { display: block !important; overflow: hidden !important; padding: 6px 0 22px !important; scroll-snap-type: none; }
html.m-app .m-marquee-track {
  display: flex; width: max-content;
  animation: mMarquee var(--m-marquee-dur, 30s) linear infinite;
  will-change: transform;
}
html.m-app[dir="rtl"] .m-marquee-track { animation-name: mMarqueeRtl; }
html.m-app .categories-grid.m-paused .m-marquee-track { animation-play-state: paused; }
@keyframes mMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes mMarqueeRtl { from { transform: translateX(0); } to { transform: translateX(50%); } }
html.m-app .m-marquee-track .cat-card,
html.m-app .m-marquee-track .cat-card.large {
  flex: 0 0 auto !important; width: 52vw; max-width: 230px; margin-inline-end: 14px;
  box-shadow: 0 14px 28px rgba(20,18,16,0.12) !important;
}
html.m-app .m-marquee-track .cat-card img { clip-path: none !important; }
html.m-app .m-marquee-track .cat-overlay { opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) {
  html.m-app .categories-grid.m-marquee { overflow-x: auto !important; }
  html.m-app .m-marquee-track { animation: none; }
}


/* ===== One font, one weight: Cairo Bold everywhere ===== */
*:not(i):not([class*="fa-"]) { font-weight: 700 !important; }

/* ===== Titles in the brand walnut ===== */
.m-view-head h2, #mAppBar .m-bar-title, .m-acc-guest h3, .m-notif-b strong, .m-doc h1, .m-doc h2, .m-doc h3 { color: var(--gold) !important; }
html.m-app .features-section .section-header h2 { color: #f6f2ec !important; }

/* ===== Brand walnut inside the banner (text colour only, no boxes) ===== */
html.m-app .slide-tag {
  background: none !important; padding: 0 !important; border-radius: 0 !important;
  color: #49221a !important; text-shadow: 0 0 10px rgba(255,255,255,.85), 0 0 2px rgba(255,255,255,.9);
}
html.m-app .slide-content h1 em {
  color: #49221a !important; background: none !important; padding: 0 !important;
  text-shadow: 0 0 14px rgba(255,255,255,.8), 0 0 3px rgba(255,255,255,.9);
}
html.m-app .slide-actions .btn-primary { background: #49221a !important; color: #fff !important; }

/* ===== Category names & counts in walnut, directly on the photo (soft light fade behind) ===== */
.m-cat-card::after {
  display: block; content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(250,247,242,0.96) 0%, rgba(250,247,242,0.75) 28%, rgba(250,247,242,0) 58%);
}
[data-theme="dark"] .m-cat-card::after { background: linear-gradient(to top, rgba(28,24,22,0.95) 0%, rgba(28,24,22,0.7) 28%, rgba(28,24,22,0) 58%); }
.m-cat-info { background: none !important; padding: 0 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.m-cat-info strong { color: var(--gold) !important; }
.m-cat-info span { color: var(--gold) !important; opacity: .8; }
.m-cat-arrow { background: #49221a !important; color: #fff !important; }

html.m-app .cat-overlay {
  background: linear-gradient(to top, rgba(250,247,242,0.96) 0%, rgba(250,247,242,0.7) 26%, rgba(250,247,242,0) 55%) !important;
  padding-bottom: 20px !important;
}
html.m-app[data-theme="dark"] .cat-overlay { background: linear-gradient(to top, rgba(28,24,22,0.95) 0%, rgba(28,24,22,0.65) 26%, rgba(28,24,22,0) 55%) !important; }
html.m-app .cat-card .cat-tag {
  background: none !important; padding: 0 !important; border-radius: 0 !important;
  color: var(--gold) !important; font-size: 1.02rem !important;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* ===== Account: create / log in switch ===== */
.m-mode { margin-bottom: 14px; }
.m-mode button.active { background: var(--gold) !important; color: #fff !important; }
.m-acc-hint { text-align: center; color: var(--text-muted); font-size: .85rem; margin: -2px 0 14px; }
.m-err a { color: var(--gold); text-decoration: underline; }

/* ===== Dashboard offers on the phone home: Flash Deals + Promo banner =====
   They appear only when switched on in the dashboard (the site sets display:block on them) */
html.m-app.m-home-page[data-mtab="home"] main > #flashDeals[style*="block"]:not(.m-off),
html.m-app.m-home-page[data-mtab="home"] main > .promo-section[style*="block"]:not(.m-off) { display: block !important; }
html.m-app.m-home-page[data-mtab="home"] main > .promo-section:not([style]):not(.m-off) { display: block !important; }

html.m-app .flash-deals-section { padding: 40px 0 10px !important; background: transparent !important; }
html.m-app .flash-deals-section .section-header { display: flex !important; flex-direction: column; align-items: center; gap: 14px; }
html.m-app .flash-timer { display: flex !important; gap: 8px !important; justify-content: center; direction: ltr; }
html.m-app .flash-timer .time-box {
  min-width: 62px !important; padding: 10px 6px !important; border-radius: 16px !important;
  background: #49221a !important; color: #fff !important; border: 0 !important; box-shadow: 0 10px 22px rgba(73,34,26,.25) !important;
  display: flex; flex-direction: column; align-items: center;
}
html.m-app .flash-timer .time-box span { font-size: 1.35rem !important; color: #fff !important; line-height: 1.1; }
html.m-app .flash-timer .time-box small { font-size: .62rem !important; color: rgba(255,255,255,.75) !important; }
html.m-app #flashDealsGrid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
html.m-app #flashDealsGrid .product-card { border-radius: 18px !important; overflow: hidden; background: var(--m-card) !important; border: 1px solid var(--border) !important; position: relative; }
html.m-app #flashDealsGrid .prod-img { aspect-ratio: 1 !important; }
html.m-app #flashDealsGrid .prod-body { padding: 10px !important; display: flex; flex-direction: column; gap: 6px; }
html.m-app #flashDealsGrid .prod-name { font-size: .82rem !important; color: var(--text) !important; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.m-app #flashDealsGrid .prod-price { font-size: .85rem !important; color: var(--gold) !important; }
html.m-app #flashDealsGrid .prod-old-price { display: block; font-size: .7rem !important; }
html.m-app #flashDealsGrid .prod-cart-btn { position: absolute; bottom: 10px; inset-inline-end: 10px; width: 34px !important; height: 34px !important; border-radius: 11px !important; background: #49221a !important; }

html.m-app .promo-section { padding: 30px 12px 6px !important; }
html.m-app .promo-section .container { padding: 0 !important; }
html.m-app .promo-inner {
  flex-direction: column !important; gap: 20px !important; padding: 28px 20px !important; border-radius: 28px !important;
  background: linear-gradient(135deg, #5a2c22 0%, #49221a 55%, #2f150f 100%) !important; text-align: center;
}
html.m-app .promo-inner::before, html.m-app .promo-inner::after, html.m-app .promo-inner .floating-orbs { display: none !important; }
html.m-app .promo-tag { background: rgba(255,255,255,.12) !important; color: #f6e9e3 !important; border: 1px solid rgba(255,255,255,.25) !important; font-size: .78rem !important; padding: 6px 16px !important; margin-bottom: 12px !important; box-shadow: none !important; }
html.m-app .promo-text h2 { font-size: 1.45rem !important; color: #fff !important; }
html.m-app .promo-text p { font-size: .88rem !important; }
html.m-app .promo-text strong { color: #f3d9cd !important; }
html.m-app .promo-text .btn-primary { background: #f6f2ec !important; color: #49221a !important; border: 0 !important; }
html.m-app .promo-image { width: 100% !important; flex: none !important; border-radius: 20px !important; }
html.m-app .promo-image img { height: 190px !important; border-radius: 20px !important; animation: none !important; }

/* ===== No text shadows anywhere on the phone ===== */
html.m-app *, html.m-app *::before, html.m-app *::after { text-shadow: none !important; }

/* =============================================
   معرض الأفكار (Ideas gallery) — phone home, under "لماذا قنفة هوم"
   ============================================= */
html.m-app.m-home-page[data-mtab="home"] main > #inspiration:not([style*="none"]):not(.m-off) { display: block !important; }
html.m-app .gallery-section { padding: 44px 0 20px !important; background: transparent !important; }
html.m-app .gallery-grid {
  display: grid !important; grid-template-columns: 1fr 1fr !important;
  grid-auto-rows: 118px !important; grid-template-rows: none !important; grid-auto-flow: dense;
  gap: 10px !important;
}
html.m-app .gal-item {
  grid-row: span 2 !important; grid-column: auto !important; height: auto !important;
  border-radius: 22px !important; overflow: hidden; position: relative; cursor: zoom-in;
  box-shadow: 0 12px 26px rgba(20,18,16,0.10); transform: none !important;
}
html.m-app .gal-item:nth-child(3n+1) { border-radius: 999px 999px 22px 22px !important; }   /* arch accents, same language as the rooms */
html.m-app .gal-item.tall { grid-row: span 3 !important; }
html.m-app .gal-item.wide { grid-column: 1 / -1 !important; grid-row: span 2 !important; border-radius: 22px !important; }
html.m-app .gal-item img { width: 100%; height: 100%; object-fit: cover; transform: none !important; }
html.m-app .gal-item:active { transform: scale(0.98) !important; }
/* caption always visible (phones have no hover) */
html.m-app .gal-overlay {
  opacity: 1 !important; align-items: flex-end !important; justify-content: flex-start !important; padding: 12px 14px !important;
  background: linear-gradient(to top, rgba(250,247,242,0.96) 0%, rgba(250,247,242,0.7) 26%, rgba(250,247,242,0) 52%) !important;
}
html.m-app[data-theme="dark"] .gal-overlay { background: linear-gradient(to top, rgba(28,24,22,0.95) 0%, rgba(28,24,22,0.65) 26%, rgba(28,24,22,0) 52%) !important; }
html.m-app .gal-overlay span {
  background: none !important; padding: 0 !important; border-radius: 0 !important;
  color: var(--gold) !important; font-size: 0.86rem !important; line-height: 1.35;
}
/* small number on each idea */
html.m-app .gal-item::before {
  content: attr(data-num); position: absolute; top: 12px; inset-inline-start: 12px; z-index: 3;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px;
  background: rgba(250,247,242,0.92); color: #49221a; font-size: .72rem; line-height: 30px; text-align: center;
}
html.m-app .gal-item:nth-child(3n+1)::before { inset-inline-start: 50%; transform: translateX(50%); top: 18px; }
html.m-app[dir="ltr"] .gal-item:nth-child(3n+1)::before { transform: translateX(-50%); }
/* curtain reveal, like the rest of the home page */
html.m-app .gal-item[data-reveal] { opacity: 1 !important; transform: none !important; }
html.m-app .gal-item[data-reveal] img { clip-path: inset(100% 0 0 0); transition: clip-path 1.2s cubic-bezier(.65,0,.35,1); }
html.m-app .gal-item[data-reveal].revealed img { clip-path: inset(0 0 0 0); }
html.m-app .gal-item[data-reveal] .gal-overlay { opacity: 0 !important; transition: opacity .7s ease .5s; }
html.m-app .gal-item[data-reveal].revealed .gal-overlay { opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) { html.m-app .gal-item[data-reveal] img { clip-path: none !important; } html.m-app .gal-item[data-reveal] .gal-overlay { opacity: 1 !important; } }

/* Full-screen viewer */
.m-lightbox {
  position: fixed; inset: 0; z-index: 9500; background: rgba(18,14,12,0.96);
  display: flex; flex-direction: column; opacity: 0; transition: opacity .3s ease;
}
.m-lightbox.show { opacity: 1; }
.m-lb-top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px; color: #f6f2ec; }
.m-lb-count { font-size: .85rem; opacity: .8; direction: ltr; }
.m-lb-close { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; }
.m-lb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.m-lb-track::-webkit-scrollbar { display: none; }
.m-lb-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 0 12px; margin: 0; }
.m-lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 18px; }
.m-lb-bottom { padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.m-lb-title { color: #f6f2ec; font-size: 1.05rem; text-align: center; }
.m-lb-wa { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 16px; background: #25D366; color: #fff !important; text-decoration: none; font-size: .95rem; }
.m-lb-wa i { font-size: 1.2rem; }
/* odd number of ideas: the last one spans the full width so the grid never has a hole */
html.m-app .gal-item:last-child:nth-child(odd) { grid-column: 1 / -1 !important; border-radius: 22px !important; }
html.m-app .gal-item:last-child:nth-child(odd)::before { inset-inline-start: 12px; transform: none; top: 12px; }
.m-lightbox { background: #120e0c; }


/* ===== Phone dark mode: walnut stays the main colour, text on top of it is white ===== */
/* warm walnut-tinted dark background instead of plain grey */
html.m-app[data-theme="dark"] {
  --bg: #17110f; --bg-2: #201713; --bg-3: #2a1e19; --m-card: #221814; --border: rgba(255,255,255,0.08);
  --m-soft: rgba(73, 34, 26, 0.55);
}
html.m-app[data-theme="dark"] body { background: var(--bg) !important; }

/* section labels: white text on a walnut pill */
html.m-app[data-theme="dark"] .section-tag {
  color: #fff !important; background: #49221a !important; padding: 6px 16px !important; border-radius: 999px !important;
}
html.m-app[data-theme="dark"] .section-tag::before, html.m-app[data-theme="dark"] .section-tag::after { display: none !important; }
html.m-app[data-theme="dark"] .slide-tag { color: #fff !important; background: #49221a !important; padding: 6px 14px !important; border-radius: 999px !important; }

/* titles white */
html.m-app[data-theme="dark"] .section-header h2,
html.m-app[data-theme="dark"] .about-text h2,
html.m-app[data-theme="dark"] .m-view-head h2,
html.m-app[data-theme="dark"] #mAppBar .m-bar-title,
html.m-app[data-theme="dark"] .m-acc-guest h3,
html.m-app[data-theme="dark"] .m-notif-b strong,
html.m-app[data-theme="dark"] .m-doc h1, html.m-app[data-theme="dark"] .m-doc h2, html.m-app[data-theme="dark"] .m-doc h3,
html.m-app[data-theme="dark"] .slide-content h1 em { color: #fff !important; }

/* stats strip becomes a walnut card */
html.m-app[data-theme="dark"] .stats-section { background: linear-gradient(135deg, #5a2c22, #49221a 55%, #2f150f) !important; border-color: rgba(255,255,255,0.08) !important; }
html.m-app[data-theme="dark"] .stat-num { color: #fff !important; }
html.m-app[data-theme="dark"] .stat-label { color: rgba(246,233,227,0.75) !important; }
html.m-app[data-theme="dark"] .stat-item + .stat-item { border-inline-start-color: rgba(255,255,255,0.15) !important; }

/* category cards & ideas gallery: walnut fade at the bottom, white names */
html.m-app[data-theme="dark"] .cat-overlay,
html.m-app[data-theme="dark"] .gal-overlay { background: linear-gradient(to top, rgba(73,34,26,0.96) 0%, rgba(73,34,26,0.7) 28%, rgba(73,34,26,0) 58%) !important; }
[data-theme="dark"] .m-cat-card::after { background: linear-gradient(to top, rgba(73,34,26,0.96) 0%, rgba(73,34,26,0.7) 28%, rgba(73,34,26,0) 58%) !important; }
html.m-app[data-theme="dark"] .m-cat-info strong, html.m-app[data-theme="dark"] .m-cat-info span,
html.m-app[data-theme="dark"] .cat-card .cat-tag, html.m-app[data-theme="dark"] .gal-overlay span { color: #fff !important; }
html.m-app[data-theme="dark"] .gal-item::before { background: #49221a !important; color: #fff !important; }

/* bottom bar: walnut glass, active tab on a walnut pill */
html.m-app[data-theme="dark"] #mBottomNav {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01)), rgba(73, 34, 26, 0.55) !important;
  border-color: rgba(255,255,255,0.10) !important;
}
html.m-app[data-theme="dark"] .m-nav-item { color: rgba(246,233,227,0.7) !important; }
html.m-app[data-theme="dark"] .m-nav-item.active { color: #fff !important; }
html.m-app[data-theme="dark"] .m-nav-item.active .m-nav-ic {
  background: #49221a; border-radius: 14px; padding: 6px 14px; margin: -6px -14px; box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
html.m-app[data-theme="dark"] .m-nav-dot { background: #fff !important; }

/* settings rows: icons in walnut circles */
html.m-app[data-theme="dark"] .m-row-ic {
  width: 36px !important; height: 36px; border-radius: 12px; background: #49221a; color: #fff !important; font-size: 1rem !important; align-items: center;
}
html.m-app[data-theme="dark"] .m-chev { color: rgba(246,233,227,0.55) !important; }

/* prices: light walnut tint so they read on the dark cards */
html.m-app[data-theme="dark"] .m-prod-price, html.m-app[data-theme="dark"] #flashDealsGrid .prod-price { color: #e6cbbd !important; }
