/* ============================================
   MOUEENE - Main Stylesheet (Modernized)
   ============================================ */

/* CSS Variables - Enhanced Palette */
:root {
  --primary-color: #00c9a7;
  --primary-dark: #00a88c;
  --secondary-color: #ff6b9d;

  --gradient-start: #00c9a7;
  --gradient-end: #ff6b9d;
  --gradient-mesh: linear-gradient(
    135deg,
    rgba(0, 201, 167, 0.1) 0%,
    rgba(255, 107, 157, 0.1) 100%
  );

  --text-dark: #2d3748;
  --text-light: #718096;
  --text-white: #ffffff;

  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.85);

  --border-color: #e2e8f0;

  --shadow-sm: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg:
    0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
  --shadow-hover:
    0 30px 60px -12px rgba(50, 50, 93, 0.25),
    0 18px 36px -18px rgba(0, 0, 0, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50px;

  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy spring transition */
  --transition-smooth: all 0.3s ease-in-out;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

ul {
  list-style: none;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-fluid {
  width: 100%;
  overflow: hidden;
}
.relative {
  position: relative;
}
.z-10 {
  z-index: 10;
}
.text-center {
  text-align: center;
}
.mt-40 {
  margin-top: 40px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-dark);
}
h1 {
  font-size: 3.5rem;
  letter-spacing: -1px;
}
h2 {
  font-size: 2.5rem;
  letter-spacing: -0.5px;
}

/* Buttons & Interactive Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 35px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(0, 201, 167, 0.4);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 201, 167, 0.6);
}

.btn-white {
  background: var(--text-white);
  color: var(--text-dark);
  border: 2px solid white;
}
.btn-white:hover {
  background: transparent;
  color: white;
}

.btn-outline-white {
  border: 2px solid white;
  color: white;
  background: transparent;
}
.btn-outline-white:hover {
  background: white;
  color: var(--primary-color);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--primary-color);
}
.btn-glass:hover {
  background: rgba(0, 201, 167, 0.1);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* Animations & Effects */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 201, 167, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 201, 167, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 201, 167, 0);
  }
}
.pulse-btn {
  animation: pulse-glow 2s infinite;
}

.glow-effect:hover {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}
.hover-slide:hover {
  padding-left: 45px;
  padding-right: 25px;
}

/* ============================================
   HEADER (Glassmorphism)
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition-smooth);
  padding: 15px 0;
  background: transparent;
}
.header.scrolled {
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-color);
  flex-shrink: 0;
  white-space: nowrap;
}

.logo img {
  height: 40px;
}

.nav-menu {
  display: flex;
  gap: 20px;
  flex-shrink: 1;
  min-width: 0;
}
.nav-menu a {
  font-weight: 500;
  position: relative;
  padding: 5px 0;
  color: var(--text-dark);
  white-space: nowrap;
  font-size: 0.9rem;
}
.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}
.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-buttons .btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.hamburger {
  display: none;
  margin-left: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  margin: 5px 0;
  transition: var(--transition-smooth);
}

/* ============================================
   HERO SECTION (Parallax & Modern)
   ============================================ */
.hero-section {
  position: relative;
  padding-top: 140px;
  padding-bottom: 80px;
  overflow: hidden;
}

.hero-banner {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("../images/hero.webp") center/cover no-repeat fixed;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 201, 167, 0.85) 0%,
    rgba(45, 55, 72, 0.8) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  max-width: 800px;
  padding: 40px;
}

.hero-content h1 {
  color: white;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
}

.hero-search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto 3rem;
}
.hero-search-form {
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}
.hero-search-form:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}
.hero-search-form input {
  flex: 1;
  border: none;
  padding: 15px 25px;
  font-size: 1.1rem;
  background: transparent;
  outline: none;
}
.hero-search-form button {
  background: var(--primary-color);
  color: white;
  width: 55px;
  height: 55px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}
.hero-search-form button:hover {
  transform: rotate(15deg);
}

/* Hero search suggestions (autocomplete) */
.hero-suggest {
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 99999;
  max-height: 320px;
  overflow-y: auto;
}

.hero-suggest__heading {
  padding: 10px 14px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.02);
}

.hero-suggest__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.85);
  transition: background 0.15s ease;
}

.hero-suggest__item:hover,
.hero-suggest__item.is-active {
  background: rgba(0, 201, 167, 0.1);
}

.hero-suggest__icon {
  width: 18px;
  min-width: 18px;
  color: rgba(0, 0, 0, 0.45);
}

.hero-suggest__label {
  font-size: 0.98rem;
}

.hero-suggest__match {
  color: var(--primary-color);
  font-weight: 700;
}

.hero-suggest__empty {
  padding: 14px;
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.95rem;
}

.hero-cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* ============================================
   CATEGORIES SECTION (Modern cards)
   ============================================ */
.categories {
  position: relative;
  padding: 50px 0 120px 0;
  /* Light theme: soft warm mesh gradient */
  background:
    radial-gradient(
      1200px 800px at 15% 20%,
      rgba(0, 201, 167, 0.08),
      transparent 60%
    ),
    radial-gradient(
      1100px 900px at 85% 10%,
      rgba(255, 107, 157, 0.06),
      transparent 58%
    ),
    linear-gradient(180deg, #fbfbfd 0%, #f3f6f9 100%);
  overflow: visible;
}

.categories .container-fluid {
  overflow: visible;
}

/* Bottom curve for Categories - seamless wave transition */
.categories-curve {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 10;
  pointer-events: none;
}
.categories-curve svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 100px;
}
.categories-curve .shape-fill {
  fill: #ffffff;
}
.categories .section-header {
  text-align: center;
  margin-bottom: 0;
}
.categories .section-header h2 {
  color: var(--text-dark);
}
.categories .section-header p {
  color: var(--text-light);
  margin: 0;
}

/* Swipeable lanes */
.categories-lanes {
  width: 100%;
  max-width: 1200px;
  margin: 22px auto 0;
}

.lane {
  position: relative;
  margin-top: 24px;
}

.lane-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
}

.lane-header h3 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.lane-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-color);
  opacity: 0.9;
}

.lane-scroller {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 16px 20px 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 20px;
  -webkit-overflow-scrolling: touch;
}

.lane-scroller::-webkit-scrollbar {
  height: 8px;
}

.lane-scroller::-webkit-scrollbar-thumb {
  background: rgba(45, 55, 72, 0.15);
  border-radius: 999px;
}

.lane-scroller::-webkit-scrollbar-track {
  background: transparent;
}

/* Edge fades (Light mode) */
.lane::before,
.lane::after {
  content: "";
  position: absolute;
  top: 50px;
  bottom: 0;
  width: 40px;
  z-index: 2;
  pointer-events: none;
}

.lane::before {
  left: 0;
  background: linear-gradient(to right, #fbfbfd, transparent);
}

.lane::after {
  right: 0;
  background: linear-gradient(to left, #fbfbfd, transparent);
}

.lane-card {
  position: relative;
  flex: 0 0 auto;
  /* Resized for mobile: smaller snap cards */
  width: clamp(160px, 45vw, 220px);
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow:
    0 8px 20px -5px rgba(50, 50, 93, 0.12),
    0 5px 10px -5px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: #ffffff;
  /* Visible by default; animations apply only when JS is enabled */
  transform: none;
  opacity: 1;
  transition:
    transform 650ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 650ms ease,
    box-shadow 380ms ease,
    border-color 380ms ease;
  transition-delay: var(--d, 0ms);
}

html.js .lane-card {
  transform: translateY(14px);
  opacity: 0;
}

html.js .lane.is-visible .lane-card {
  transform: translateY(0);
  opacity: 1;
}

.lane-card:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 4px;
}

.lane-card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  /* Light mode placeholder gradients for non-image cards */
  background: linear-gradient(135deg, #f0f4f8, #e2e8f0);
}

.lane-card__media img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 520ms ease;
}

/* Brand wash (transparent gradient layer) */
.lane-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      700px 320px at 12% 18%,
      rgba(0, 201, 167, 0.22),
      transparent 58%
    ),
    radial-gradient(
      650px 320px at 88% 12%,
      rgba(255, 107, 157, 0.18),
      transparent 55%
    );
  opacity: 0.7;
  pointer-events: none;
}

/* Overlay gradient: crucial for legibility on white/images without going full dark mode */
.lane-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(23, 31, 48, 0.35) 82%,
    rgba(23, 31, 48, 0.55) 100%
  );
}

/* Special gradients for card pillars */
.lane-card__media--elderly {
  background: linear-gradient(135deg, #e6fffa 0%, #e2e8f0 100%);
}

.lane-card__media--petcare {
  background: linear-gradient(135deg, #fff5f7 0%, #fffaf0 100%);
}

.lane-card__media--repairs {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.lane-card__media--cta {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
}
/* CTA: don't darken with the bottom readability overlay */
.lane-card__media--cta::after {
  background: none;
}

.lane-card__overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.lane-card__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  color: #ffffff;
  /* Glass chip that pops on both images and pastel backgrounds */
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lane-card__chip i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  box-shadow: 0 4px 10px rgba(0, 201, 167, 0.3);
  font-size: 0.9em;
}

.lane-card__chip span {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle readability boost */
}

/* CTA Chip specific */
.lane-card__chip--cta {
  background: rgba(255, 255, 255, 0.25);
}
.lane-card__chip--cta i {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  box-shadow: none;
}

.lane-card__meta {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  line-height: 1.3;
  margin-left: 4px;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lane-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 6px;
}

.lane-dot {
  appearance: none;
  border: 0;
  cursor: pointer;
  height: 6px;
  width: 6px;
  border-radius: 999px;
  background: #cbd5e0; /* Neutral gray for inactive */
  transition:
    width 260ms ease,
    background-color 260ms ease;
}

.lane-dot.is-active {
  width: 18px;
  background: var(--primary-color);
}

@media (hover: hover) and (pointer: fine) {
  .lane-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(50, 50, 93, 0.15); /* More refined hover shadow */
    border-color: rgba(0, 201, 167, 0.4);
  }
  .lane-card:hover .lane-card__media img {
    transform: scale(1.06);
  }
}

@media (pointer: coarse) {
  .lane-card:active {
    transform: translateY(0) scale(0.98);
  }
}

@media (min-width: 900px) {
  .lane-scroller {
    gap: 16px;
  }
  .lane-card {
    height: 250px;
    width: clamp(260px, 30vw, 340px);
  }
  .lane::before,
  .lane::after {
    width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lane-card,
  .lane-card__media img,
  .lane-dot {
    transition: none;
  }
  .lane-card {
    transform: none;
    opacity: 1;
  }
}

.categories-ticker {
  position: relative;
  overflow: hidden;
  padding: 20px 0;
}
/* Masking for fade effect on ticker */
.categories-ticker::before,
.categories-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 150px;
  z-index: 2;
  pointer-events: none;
}
.categories-ticker::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-light), transparent);
}
.categories-ticker::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-light), transparent);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.ticker-track {
  display: flex;
  gap: 30px;
  width: max-content;
  animation: scroll 30s linear infinite;
  padding-left: 20px;
}
.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item.glass-card {
  background: var(--bg-white);
  padding: 25px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  transition: var(--transition);
}
.ticker-item.glass-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
  background: white;
}
.ticker-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  color: var(--primary-color);
  transition: transform 0.3s;
}
.ticker-item:hover .ticker-icon {
  transform: scale(1.2) rotate(10deg);
}
.ticker-item h3 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
  color: var(--text-dark);
}

/* ============================================
   CATEGORIES ORBITAL LAYOUT
   ============================================ */
.categories-orbital {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  min-height: 520px;
  --orbit-size: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.categories-orbital::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--orbit-size);
  height: var(--orbit-size);
  border-radius: 50%;
  border: 2px solid rgba(7, 204, 174, 0.35);
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.categories-orbital .categories-image {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 1640 / 924;
  display: flex;
  align-items: center;
  justify-content: center;
}

.categories-orbital .categories-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
}

.orbital-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 120px;
  height: 120px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 3;
  border: 2px solid #07ccae;
}

.orbital-item:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.orbital-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  border-radius: 50%;
  color: white;
  font-size: 1.3rem;
}

.orbital-item span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.2;
}

/* Orbital Positions with floating animations */
.orbital-1 {
  top: 14%;
  left: 12%;
  animation: float1 4s ease-in-out infinite;
}

.orbital-2 {
  top: 14%;
  right: 12%;
  animation: float2 5s ease-in-out infinite;
}

.orbital-3 {
  top: 42%;
  left: 0%;
  animation: float3 4.5s ease-in-out infinite;
}

.orbital-4 {
  top: 42%;
  right: 0%;
  animation: float4 5.5s ease-in-out infinite;
}

.orbital-5 {
  bottom: 14%;
  left: 10%;
  animation: float5 4s ease-in-out infinite;
}

.orbital-6 {
  bottom: 14%;
  right: 10%;
  animation: float6 5s ease-in-out infinite;
}

.orbital-7 {
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  animation: float7 4.5s ease-in-out infinite;
}

/* Floating Animations */
@keyframes float1 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10px, -15px);
  }
}

@keyframes float2 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-10px, 12px);
  }
}

@keyframes float3 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(15px, 10px);
  }
}

@keyframes float4 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-12px, -10px);
  }
}

@keyframes float5 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(8px, -12px);
  }
}

@keyframes float6 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-10px, 8px);
  }
}

@keyframes float7 {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -15px);
  }
}

/* Responsive for orbital layout */
@media (max-width: 768px) {
  .categories-orbital {
    min-height: 420px;
    --orbit-size: 420px;
  }

  .orbital-item {
    width: 100px;
    height: 100px;
    padding: 5px;
  }

  .orbital-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .orbital-item span {
    font-size: 0.8rem;
  }

  .orbital-1 {
    top: 0%;
    left: 0%;
  }
  .orbital-2 {
    top: 0%;
    right: 0%;
  }
  .orbital-3 {
    top: 28%;
    left: -4%;
  }
  .orbital-4 {
    top: 28%;
    right: -4%;
  }
  .orbital-5 {
    bottom: 12%;
    left: 0%;
  }
  .orbital-6 {
    bottom: 12%;
    right: 0%;
  }
  .orbital-7 {
    bottom: -4%;
  }
}

@media (max-width: 480px) {
  .categories-orbital {
    min-height: 360px;
    --orbit-size: 360px;
  }

  .orbital-item {
    width: 90px;
    height: 90px;
    padding: 5px;
  }

  .orbital-icon {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .orbital-item span {
    font-size: 0.7rem;
  }
}

/* Mobile app-shell: place orbital items top/bottom (not around) */
@media (max-width: 768px) {
  body.app-mobile .categories-orbital {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    align-items: center;
    justify-items: center;
    gap: 8px;
    min-height: auto;
    padding: 6px 10px 0;
    overflow: visible;
  }

  body.app-mobile .categories-orbital::before {
    display: none;
  }

  body.app-mobile .categories-orbital .categories-image {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 100%;
  }

  body.app-mobile .orbital-item {
    position: relative;
    width: 82px;
    height: 82px;
    padding: 6px;
    gap: 4px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    transform: translate(var(--tx, 0px), var(--ty, 0px))
      rotate(var(--rot, 0deg));
    animation: app-orbit-float var(--dur, 5.2s) ease-in-out infinite;
    will-change: transform;
  }

  @keyframes app-orbit-float {
    0%,
    100% {
      transform: translate(var(--tx, 0px), var(--ty, 0px))
        rotate(var(--rot, 0deg));
    }
    50% {
      transform: translate(
          var(--tx, 0px),
          calc(var(--ty, 0px) + var(--lift, -8px))
        )
        rotate(var(--rot, 0deg));
    }
  }

  body.app-mobile .orbital-icon {
    width: 32px;
    height: 32px;
    font-size: 0.92rem;
  }

  body.app-mobile .orbital-item span {
    font-size: 0.66rem;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Top: near image top edge (slightly random) */
  body.app-mobile .orbital-1 {
    grid-row: 1;
    grid-column: 1;
    --tx: 10px;
    --ty: 18px;
    --rot: -2deg;
    --dur: 5s;
    --lift: -7px;
  }
  body.app-mobile .orbital-2 {
    grid-row: 1;
    grid-column: 2;
    --tx: -6px;
    --ty: 24px;
    --rot: 1deg;
    --dur: 5.8s;
    --lift: -9px;
  }
  body.app-mobile .orbital-3 {
    grid-row: 1;
    grid-column: 5;
    --tx: 4px;
    --ty: 20px;
    --rot: -1deg;
    --dur: 5.3s;
    --lift: -8px;
  }
  body.app-mobile .orbital-4 {
    grid-row: 1;
    grid-column: 6;
    --tx: -10px;
    --ty: 26px;
    --rot: 2deg;
    --dur: 6.1s;
    --lift: -10px;
  }

  /* Bottom: near image bottom edge (slightly random) */
  body.app-mobile .orbital-5 {
    grid-row: 3;
    grid-column: 2;
    --tx: -8px;
    --ty: -22px;
    --rot: 2deg;
    --dur: 5.4s;
    --lift: -7px;
  }
  body.app-mobile .orbital-6 {
    grid-row: 3;
    grid-column: 4;
    --tx: 6px;
    --ty: -28px;
    --rot: -1deg;
    --dur: 6s;
    --lift: -9px;
  }
  body.app-mobile .orbital-7 {
    grid-row: 3;
    grid-column: 5;
    --tx: 2px;
    --ty: -24px;
    --rot: 1deg;
    --dur: 5.6s;
    --lift: -8px;
  }
}

@media (max-width: 480px) {
  body.app-mobile .categories-orbital {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 8px 0;
    gap: 6px;
  }
  body.app-mobile .orbital-item {
    width: 74px;
    height: 74px;
  }
  body.app-mobile .orbital-icon {
    width: 28px;
    height: 28px;
    font-size: 0.88rem;
  }
  body.app-mobile .orbital-item span {
    font-size: 0.62rem;
  }

  /* Slightly tighter distribution on very small phones */
  body.app-mobile .orbital-1 {
    grid-column: 1;
    --ty: 16px;
  }
  body.app-mobile .orbital-2 {
    grid-column: 2;
    --ty: 20px;
  }
  body.app-mobile .orbital-3 {
    grid-column: 4;
    --ty: 16px;
  }
  body.app-mobile .orbital-4 {
    grid-column: 5;
    --ty: 20px;
  }
  body.app-mobile .orbital-5 {
    grid-column: 2;
    --ty: -20px;
  }
  body.app-mobile .orbital-6 {
    grid-column: 3;
    --ty: -24px;
  }
  body.app-mobile .orbital-7 {
    grid-column: 4;
    --ty: -20px;
  }
}

/* Responsive curve adjustments */
@media (max-width: 768px) {
  .categories {
    padding-bottom: 80px;
  }
  .categories-curve svg {
    height: 60px;
  }
  .how-it-works {
    padding-top: 30px;
  }
}

@media (max-width: 480px) {
  .categories {
    padding-bottom: 60px;
  }
  .categories-curve svg {
    height: 40px;
  }
  .how-it-works {
    padding-top: 20px;
  }
}

/* ============================================
   HOW IT WORKS (Curved & Animated)
   ============================================ */
.how-it-works {
  position: relative;
  padding: 40px 0 200px 0;
  background: #ffffff;
  text-align: center;
}

.custom-shape-divider-bottom-1689366681 {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.custom-shape-divider-bottom-1689366681 svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 150px;
}
.custom-shape-divider-bottom-1689366681 .shape-fill {
  fill: var(--bg-light);
}

/* Steps Layout */
.steps-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  margin-top: 60px;
}

.step {
  flex: 1;
  max-width: 240px;
  padding: 30px 20px;
  background: white;
  z-index: 5;
  position: relative;
  transition: var(--transition);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.step:hover {
  transform: translateY(-15px) !important;
  box-shadow: var(--shadow-lg);
}

.step-down {
  margin-top: 50px;
}
.step-up {
  margin-top: 0;
}

.step-number {
  width: 45px;
  height: 45px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 5px 15px rgba(0, 201, 167, 0.4);
  z-index: 2;
}
.step-icon {
  width: 100px;
  height: 100px;
  margin: 20px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-color);
  transition: var(--transition);
}
.step:hover .step-icon {
  border-color: var(--primary-color);
  border-style: solid;
  background: rgba(0, 201, 167, 0.05);
  transform: rotateY(180deg);
}
.step-icon i {
  font-size: 2.5rem;
  color: var(--text-dark);
  background: -webkit-linear-gradient(
    var(--gradient-start),
    var(--gradient-end)
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.4s;
}
.step:hover .step-icon i {
  transform: rotateY(-180deg);
} /* Counter rotate explicitly for icons if needed, but simplistic approach here */

.step h3 {
  font-size: 1.2rem;
  margin: 15px 0 10px;
}
.step p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.step-connector-curve {
  flex: 1;
  height: 100px;
  background: url("data:image/svg+xml,%3Csvg width='100' height='50' viewBox='0 0 100 50' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,25 C25,25 25,50 50,50 C75,50 75,25 100,25' fill='none' stroke='%23E2E8F0' stroke-width='2' stroke-dasharray='5,5'/%3E%3C/svg%3E")
    no-repeat center center;
  background-size: contain;
  margin-top: 50px;
  opacity: 0.5;
}

/* ============================================
   TOP SERVICES (Masonry-like Grid)
   ============================================ */
.featured-providers {
  padding: 100px 0 120px;
  background: var(--bg-white);
  position: relative;
  z-index: 10;
}
.featured-providers .section-header {
  text-align: center;
}
.featured-providers .section-header h2 {
  margin-bottom: 8px;
}
.featured-providers .section-header p {
  margin-top: 0;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.service-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.03);
  position: relative;
}
.service-card:hover {
  transform: translateY(-15px);
  box-shadow: var(--shadow-hover);
}

.service-image-container {
  height: 220px;
  overflow: hidden;
  position: relative;
}
.service-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.service-card:hover .service-img {
  transform: scale(1.15);
}

.service-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}
.service-card:hover .service-overlay {
  opacity: 1;
}

.service-content {
  padding: 25px;
}
.service-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-color);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}
.service-content h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.service-content p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.service-provider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
}
.service-provider img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}
.service-provider span {
  font-weight: 500;
  font-size: 0.9rem;
}

.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border-color);
  padding-top: 15px;
  margin-top: 10px;
}
.service-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}
.service-rating {
  color: #ffd700;
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
  padding: 100px 0;
  background: var(--bg-white);
}
.cta-content.glass-panel {
  background:
    linear-gradient(135deg, rgba(0, 201, 167, 0.85), rgba(255, 107, 157, 0.85)),
    url("../CTA.webp");
  background-size: cover, cover;
  background-position: center, center;
  padding: 80px 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
/* Animated Background Circles */
.cta-content::before,
.cta-content::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  z-index: -1;
}
.cta-content::before {
  width: 400px;
  height: 400px;
  top: -150px;
  left: -100px;
  animation: float 10s infinite ease-in-out;
}
.cta-content::after {
  width: 300px;
  height: 300px;
  bottom: -100px;
  right: -50px;
  animation: float 8s infinite ease-in-out reverse;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(30px);
  }
}

.cta-content h2 {
  color: white;
  margin-bottom: 1rem;
}
.cta-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
}
.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: white;
  padding-top: 80px;
  border-top: 1px solid var(--border-color);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}
.footer-logo {
  display: block;
  margin-bottom: 20px;
}
.footer-about p {
  color: var(--text-light);
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  gap: 10px;
}
.social-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-dark);
  transition: var(--transition);
}
.social-icon:hover {
  background: var(--primary-color);
  color: white;
  transform: rotate(360deg);
}

.footer-links h4 {
  font-size: 1.1rem;
  margin-bottom: 25px;
}
.footer-links ul li {
  margin-bottom: 12px;
}
.footer-links ul li a {
  color: var(--text-light);
  font-weight: 400;
}
.footer-links ul li a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 991px) {
  h1 {
    font-size: 2.8rem;
  }
  .steps-container {
    flex-direction: column;
    align-items: center;
  }
  .step-connector-curve {
    display: none;
  }
  .step-down,
  .step-up {
    margin: 20px 0;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .categories-ticker::before,
  .categories-ticker::after {
    width: 50px;
  }
}
/* Desktop: Hide hamburger, show everything */
@media (min-width: 1025px) {
  .hamburger {
    display: none !important;
  }
  .nav-menu,
  .nav-buttons {
    display: flex !important;
  }
}

/* Tablet: Compact layout */
@media (max-width: 1024px) and (min-width: 769px) {
  .nav-menu {
    gap: 12px;
  }
  .nav-menu a {
    font-size: 0.85rem;
  }
  .nav-buttons .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .lang-toggle {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* Mobile: Hamburger menu */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  .nav-buttons .btn {
    display: none; /* Hide Login/Signup buttons */
  }
  .nav-buttons {
    display: flex; /* Keep container for language switcher */
  }
  .hamburger {
    display: block;
  }
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    gap: 0;
  }
  .nav-menu.active a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
  }
  /* Add Login/Signup links to mobile menu */
  .nav-menu.active .mobile-auth-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid var(--primary-color);
  }

  /* Language switcher always visible on mobile */
  .lang-switcher {
    margin-right: 5px;
  }
  .lang-toggle {
    padding: 5px 8px;
    font-size: 0.75rem;
    gap: 4px;
  }
  .lang-toggle .fa-globe {
    font-size: 0.9rem;
  }
  .lang-toggle .fa-chevron-down {
    display: none;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  /* Keep header readable over the Hero on mobile (even before scroll) */
  .header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  }
  .header.scrolled {
    background: rgba(255, 255, 255, 0.95);
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }
  .hero-search-form {
    flex-direction: column;
    padding: 15px;
    border-radius: var(--radius-lg);
  }
  .hero-search-form button {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    height: 45px;
  }
  .hero-cta-buttons {
    flex-direction: column;
  }
  .ticker-track {
    gap: 20px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .social-links {
    justify-content: center;
  }
}

/* ============================================
   MOBILE APP SHELL (Mobile-only redesign)
   - App-like header
   - Bottom tab bar
   - Larger touch targets, card surfaces
   Desktop remains unchanged.
   ============================================ */

@media (max-width: 768px) {
  body.app-mobile {
    background: #f6f7fb;
    color: var(--text-dark);
    padding-top: calc(64px + env(safe-area-inset-top));
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior-y: none;
  }

  /* App-style header (keeps desktop untouched) */
  body.app-mobile .header {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    z-index: 1320;
  }
  body.app-mobile .header.scrolled {
    padding: 10px 0;
  }
  body.app-mobile .navbar {
    gap: 10px;
    align-items: center;
  }
  body.app-mobile .logo img {
    height: 30px;
  }
  body.app-mobile .container {
    padding: 0 16px;
  }

  /* Turn hamburger dropdown into a full-screen sheet */
  body.app-mobile .nav-menu.active {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(64px + env(safe-area-inset-top));
    height: calc(100vh - (64px + env(safe-area-inset-top)));
    max-height: calc(100vh - (64px + env(safe-area-inset-top)));
    border-radius: 18px 18px 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 18px calc(130px + env(safe-area-inset-bottom));
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
    z-index: 1200;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
  }

  /* Prefer dynamic viewport height on modern mobile browsers */
  @supports (height: 100dvh) {
    body.app-mobile .nav-menu.active {
      height: calc(100dvh - (64px + env(safe-area-inset-top)));
      max-height: calc(100dvh - (64px + env(safe-area-inset-top)));
    }
  }
  body.app-mobile .nav-menu.active a {
    padding: 14px 0;
    font-size: 0.95rem;
  }

  /* Backdrop overlay for menu */
  body.app-mobile .app-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 1100;
  }
  body.app-mobile.app-menu-open .app-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* App-like surfaces */
  body.app-mobile section {
    scroll-margin-top: 90px;
  }
  body.app-mobile .card,
  body.app-mobile .service-card,
  body.app-mobile .provider-card,
  body.app-mobile .section-card,
  body.app-mobile .auth-card,
  body.app-mobile .dashboard-card {
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
  }

  /* Typography scaling */
  body.app-mobile h1 {
    font-size: 1.8rem;
    letter-spacing: -0.6px;
  }
  body.app-mobile h2 {
    font-size: 1.35rem;
  }
  body.app-mobile h3 {
    font-size: 1.1rem;
  }

  body.app-mobile p {
    font-size: 0.95rem;
  }

  /* Touch-friendly controls */
  body.app-mobile .btn {
    min-height: 44px;
    border-radius: 16px;
    padding: 10px 14px;
  }
  body.app-mobile input,
  body.app-mobile select,
  body.app-mobile textarea {
    min-height: 44px;
    border-radius: 14px;
  }

  /* Bottom tab bar */
  body.app-mobile .app-tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    height: auto;
    min-height: 58px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 6px 6px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
    z-index: 1300;
  }
  body.app-mobile .app-tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 16px;
    padding: 6px 6px;
    color: var(--text-light);
    transition:
      transform 180ms ease,
      background 180ms ease,
      color 180ms ease;
    min-width: 0;
    text-align: center;
  }
  body.app-mobile .app-tabbar__icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-dark);
  }
  body.app-mobile .app-tabbar__label {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.app-mobile .app-tabbar__item.active {
    color: var(--primary-color);
    background: rgba(0, 201, 167, 0.1);
  }
  body.app-mobile .app-tabbar__item.active .app-tabbar__icon {
    background: rgba(0, 201, 167, 0.16);
    color: var(--primary-color);
  }
  body.app-mobile .app-tabbar__item:active {
    transform: scale(0.98);
  }

  /* Guest-only More sheet */
  body.app-mobile .app-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 1350;
  }
  body.app-mobile .app-sheet {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    padding: 10px 10px 12px;
    transform: translateY(18px);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 200ms ease,
      opacity 200ms ease;
    z-index: 1360;
  }
  body.app-mobile.app-sheet-open .app-sheet-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  body.app-mobile.app-sheet-open .app-sheet {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  body.app-mobile .app-sheet__handle {
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.15);
    margin: 2px auto 10px;
  }
  body.app-mobile .app-sheet__title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-dark);
    padding: 0 8px 10px;
  }
  body.app-mobile .app-sheet__list {
    display: grid;
    gap: 8px;
  }
  body.app-mobile .app-sheet__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-dark);
    font-weight: 700;
  }
  body.app-mobile .app-sheet__item:active {
    transform: scale(0.99);
  }

  /* Avoid content being hidden behind fixed UI */
  body.app-mobile .footer {
    /* Keep a small safe area for the tab bar, but don't make the footer huge */
    padding-top: 18px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }
}

/* ============================================
   MOBILE COMPACT DEFAULTS (applies to pages without app shell)
   - Many dashboard-style pages don't load main.js, so they won't get .app-mobile
   - Keep changes safe: reduce spacing/typography only
   ============================================ */

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  /* Footer: compact mobile/app-like */
  .footer {
    padding-top: 26px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }
  .footer-grid .footer-links {
    display: none;
  }
  .footer-about p {
    display: none;
  }
  .social-links {
    justify-content: center;
  }
  .social-icon {
    width: 34px;
    height: 34px;
  }
  .footer-bottom {
    padding: 12px 0;
    font-size: 0.78rem;
  }

  h1 {
    font-size: 1.7rem;
    margin-bottom: 14px;
  }
  h2 {
    font-size: 1.35rem;
    margin-bottom: 12px;
  }
  h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  p {
    font-size: 0.95rem;
  }

  .container {
    padding: 0 14px;
  }

  .btn {
    padding: 10px 16px;
  }

  /* Reduce padding in common panels/cards */
  .content-panel {
    padding: 18px;
    border-radius: 16px;
  }
  .panel-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  .dashboard-container {
    padding: 18px 12px;
  }
  .dashboard-layout {
    gap: 16px;
  }

  /* Compact dashboard header */
  .dashboard-navbar {
    height: 58px;
    gap: 12px;
  }
  .dashboard-logo img {
    height: 32px;
  }
  .dashboard-logo span {
    display: none;
  }
  .dashboard-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .user-menu-trigger {
    padding: 4px 10px 4px 4px;
  }
  .user-menu-avatar {
    width: 32px;
    height: 32px;
  }
  .user-menu-info {
    display: none;
  }

  /* Marketing hero: less vertical space */
  .hero-section {
    padding-top: 18px;
  }
}

/* ============================================
   ADMIN MOBILE DRAWER (works with inline admin styles)
   ============================================ */

@media (max-width: 768px) {
  body.admin-mobile {
    padding-top: calc(env(safe-area-inset-top));
  }

  body.admin-mobile h1 {
    font-size: 1.35rem;
  }

  body.admin-mobile .admin-header {
    padding: 16px 16px !important;
  }

  body.admin-mobile .admin-menu-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 10px;
  }

  body.admin-mobile .admin-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 999;
  }

  /* Ensure the admin sidebar can open even if page inline styles hide it */
  body.admin-menu-open .admin-sidebar {
    transform: translateX(0) !important;
  }

  body.admin-menu-open .admin-mobile-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================
   AUTH PAGES
   ============================================ */
/* ============================================
   AUTHENTICATION PAGES - Professional Design
   ============================================ */

.auth-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.auth-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1000px;
  width: 100%;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 50px 100px -20px rgba(0, 0, 0, 0.25),
    0 30px 60px -30px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.auth-image {
  background: linear-gradient(135deg, #00c9a7 0%, #00a88c 100%);
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-image::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

.auth-image h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: white;
  position: relative;
  z-index: 1;
}

.auth-image p {
  font-size: 1.1rem;
  opacity: 0.95;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.auth-form-container {
  padding: 60px 50px;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo img {
  width: 120px;
  height: auto;
  margin: 0 auto;
}

.auth-form h2 {
  font-size: 2rem;
  color: var(--text-dark);
  margin-bottom: 10px;
  text-align: center;
}

.auth-form p {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 30px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f7fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 4px rgba(0, 201, 167, 0.1);
  transform: translateY(-2px);
}

.form-group input::placeholder {
  color: #a0aec0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Checkbox Styles */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.form-check label {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
  margin: 0;
}

/* Account Type Selection */
.account-type-option {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.account-type-option:hover {
  transform: translateY(-3px);
}

.account-type-option input[type="radio"]:checked + i,
.account-type-option input[type="radio"]:checked ~ span {
  color: var(--primary-color);
}

/* Auth Links */
.auth-links {
  text-align: center;
  margin-top: 25px;
}

.auth-links p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin: 0;
}

.auth-links a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.auth-links a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Social Auth Buttons */
.btn-outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-dark);
  transition: all 0.3s ease;
}

.btn-outline:hover {
  border-color: var(--primary-color);
  background: rgba(0, 201, 167, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Button Enhancements */
.btn-lg {
  padding: 16px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 201, 167, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 201, 167, 0.4);
}

.btn-primary:active {
  transform: translateY(-1px);
}

/* Loading State */
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}
.badge-warning {
  background: #fff3cd;
  color: #856404;
}
.badge-danger {
  background: #f8d7da;
  color: #721c24;
}
.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}
.badge-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

/* Responsive Design for Auth Pages */
@media (max-width: 768px) {
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .auth-image {
    display: none;
  }

  .auth-form-container {
    padding: 40px 30px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .auth-section {
    padding: 80px 15px 40px;
  }
}

@media (max-width: 480px) {
  .auth-form-container {
    padding: 30px 20px;
  }

  .auth-form h2 {
    font-size: 1.6rem;
  }

  .btn-lg {
    padding: 14px 30px;
    font-size: 1rem;
  }
}

/* Animation Effects */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-container {
  animation: fadeInUp 0.6s ease-out;
}

.auth-form-container > * {
  animation: fadeIn 0.8s ease-out;
  animation-fill-mode: backwards;
}

.auth-form-container > *:nth-child(1) {
  animation-delay: 0.1s;
}
.auth-form-container > *:nth-child(2) {
  animation-delay: 0.2s;
}
.auth-form-container > *:nth-child(3) {
  animation-delay: 0.3s;
}

/* Enhanced Focus States */
.form-group input:focus + label,
.form-group select:focus + label {
  color: var(--primary-color);
}

/* Error States */
.form-group input.error,
.form-group select.error {
  border-color: #f56565;
  background: #fff5f5;
}

.form-group input.error:focus {
  box-shadow: 0 0 0 4px rgba(245, 101, 101, 0.1);
}

.error-message {
  color: #f56565;
  font-size: 0.85rem;
  margin-top: 5px;
  display: block;
}

/* Success States */
.form-group input.success,
.form-group select.success {
  border-color: #48bb78;
  background: #f0fff4;
}

/* Floating Labels Effect */
.form-group.floating {
  position: relative;
}

.form-group.floating label {
  position: absolute;
  left: 18px;
  top: 16px;
  pointer-events: none;
  transition: all 0.3s ease;
  background: white;
  padding: 0 5px;
}

.form-group.floating input:focus + label,
.form-group.floating input:not(:placeholder-shown) + label {
  top: -10px;
  font-size: 0.8rem;
  color: var(--primary-color);
}

/* User Type Selection Enhancement */
.user-type-btn,
.account-type-option {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.user-type-btn:hover,
.account-type-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 201, 167, 0.2);
}

/* Spinner Animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}

/* Subtle Gradient Background Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.auth-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

/* ============================================
   MODAL (In-page alerts)
   ============================================ */
.mm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.mm-modal-overlay.is-open {
  display: flex;
}

.mm-modal {
  width: 100%;
  max-width: 520px;
  background: var(--bg-white);
  border-radius: 18px;
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.mm-modal-overlay.is-open .mm-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.mm-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 0;
}

.mm-modal-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 22px;
  line-height: 1;
  padding: 10px;
  cursor: pointer;
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.mm-modal-close:hover {
  background: rgba(113, 128, 150, 0.12);
  color: var(--text-dark);
}

.mm-modal-body {
  padding: 14px 18px 18px;
}

.mm-modal-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-dark);
}

.mm-modal-message {
  margin: 10px 0 0;
  color: var(--text-light);
  line-height: 1.7;
}

.mm-modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mm-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  box-shadow: var(--shadow-sm);
}

.mm-modal-icon--success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.mm-modal-icon--error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.mm-modal-icon--warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.mm-modal-icon--info {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
}

.mm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 18px 18px;
}

.mm-modal-actions .btn {
  min-width: 110px;
}

/* ============================================
   PAGE HEADERS (Sub-pages)
   ============================================ */
.page-header-section {
  padding: 160px 0 80px;
  background: var(--primary-color);
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-color)
  );
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 60px;
}
.page-header-section::after {
  content: "";
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  height: 100px;
  background: white;
  clip-path: ellipse(60% 60% at 50% 60%);
}
.page-header-content h1 {
  color: white;
  margin-bottom: 10px;
}
.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}
.breadcrumb a:hover {
  color: white;
  text-decoration: underline;
}

/* ============================================
   GENERAL CONTENT STYLES
   ============================================ */
.page-content {
  padding-bottom: 80px;
}
.section-title {
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin-top: 10px;
  border-radius: 2px;
}

/* ============================================
   i18n (EN/FR/AR) + Smooth Transition
   ============================================ */

body.i18n-ready {
  transition: opacity 180ms ease;
}

body.i18n-ready.i18n-switching {
  opacity: 0.15;
}

/* I18n Styles */
.i18n-switching {
  opacity: 0;
  transition: opacity 0.18s ease-out;
}
.i18n-ready {
  opacity: 1;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
  font-family: "Tajawal", "Cairo", sans-serif;
  letter-spacing: 0;
}
html[lang="ar"] {
  font-family: "Tajawal", "Cairo", sans-serif;
}

/* Language Switcher - Compact Dropdown Design */
.lang-switcher {
  position: relative;
  display: inline-flex;
  margin-right: 10px;
  z-index: 1001;
  flex-shrink: 0;
}

/* Toggle Button - Compact */
.lang-toggle {
  background: white;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 99px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: var(--transition-smooth);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.glass-header .lang-toggle {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  backdrop-filter: blur(5px);
}

.lang-toggle:hover {
  background: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  border-color: var(--primary-color);
}

.lang-toggle i.fa-globe {
  color: var(--primary-color);
  font-size: 1rem;
}

.lang-toggle i.fa-chevron-down {
  font-size: 0.7rem;
  color: var(--text-light);
  transition: transform 0.3s ease;
}

.lang-switcher.open .lang-toggle i.fa-chevron-down {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
  padding: 6px;
  min-width: 140px;
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
}

.lang-switcher.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Option Buttons */
.lang-option {
  background: transparent;
  border: none;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Space for checkmark if added later */
  width: 100%;
}

.lang-option:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.lang-option.active {
  background: rgba(0, 201, 167, 0.08);
  color: var(--primary-color);
  font-weight: 700;
}

/* Fallback / Fixed Position Mode */
.lang-switcher-fixed {
  position: fixed;
  top: 20px;
  right: 20px;
  margin-right: 0;
  z-index: 9999;
}

/* RTL Support */
html[dir="rtl"] .lang-switcher {
  margin-right: 0;
  margin-left: 15px;
}

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
  transform-origin: top left;
  text-align: right;
}

html[dir="rtl"] .lang-option {
  text-align: right;
  flex-direction: row-reverse;
}

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

html.lang-ar body {
  font-family: "Tajawal", "Cairo", "Arial", sans-serif;
}

html[dir="rtl"] .navbar,
html[dir="rtl"] .dashboard-navbar {
  direction: rtl;
}

html[dir="rtl"] .nav-menu {
  direction: rtl;
}

/* ============================================
   MOBILE OPTIMIZATIONS (Compact Interface)
   ============================================ */
@media (max-width: 768px) {
  body.app-mobile .container {
    padding: 0 14px;
  }

  /* Typography Scaling */
  body.app-mobile {
    font-size: 14px;
  }
  body.app-mobile h1 {
    font-size: 1.6rem !important;
    margin-bottom: 0.4rem;
  }
  body.app-mobile h2 {
    font-size: 1.35rem !important;
    margin-bottom: 0.4rem;
  }
  body.app-mobile h3 {
    font-size: 1rem !important;
    margin-bottom: 0.35rem;
  }
  body.app-mobile p {
    font-size: 0.82rem !important;
    line-height: 1.35;
    color: #718096;
  }

  /* Keep hero text readable (white) */
  body.app-mobile .hero-content p,
  body.app-mobile .hero-banner p,
  body.app-mobile .page-hero p {
    color: rgba(255, 255, 255, 0.92) !important;
  }

  /* Remove overly-long blocks of text on mobile */
  body.app-mobile .review-text {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body.app-mobile .btn {
    min-height: 38px !important;
    padding: 7px 14px !important;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
  }

  body.app-mobile input,
  body.app-mobile select,
  body.app-mobile textarea {
    min-height: 40px !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
  }

  /* Hero Sections */
  body.app-mobile .page-hero {
    padding: 40px 0 30px !important;
    min-height: auto !important;
    border-radius: 0 0 20px 20px !important;
    margin-bottom: 20px !important;
  }
  body.app-mobile .page-hero h1 {
    font-size: 1.45rem !important;
  }
  body.app-mobile .page-hero p {
    max-width: 100%;
    font-size: 0.85rem !important;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 2-Column Grid Adjustments */
  body.app-mobile .services-grid,
  body.app-mobile .services-grid-layout,
  body.app-mobile .providers-grid-layout {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  /* Compact Service Card */
  body.app-mobile .service-card {
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  }
  body.app-mobile .service-card .service-img-wrapper,
  body.app-mobile .service-card .service-image-container {
    height: 92px !important;
  }
  body.app-mobile .service-card .service-content {
    padding: 9px !important;
  }
  body.app-mobile .service-card .service-content h3 {
    font-size: 0.88rem !important;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.app-mobile .service-card .service-content p {
    display: none !important; /* Remove description */
  }
  body.app-mobile .service-category {
    font-size: 0.65rem !important;
    margin-bottom: 2px !important;
  }
  body.app-mobile .service-meta {
    margin-top: 5px !important;
    padding-top: 5px !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  body.app-mobile .service-price {
    font-size: 0.88rem !important;
  }
  body.app-mobile .service-rating {
    font-size: 0.75rem !important;
  }
  body.app-mobile .service-provider {
    display: none !important; /* Hide provider info in grid to save space */
  }

  /* Compact Provider Card */
  body.app-mobile .provider-card {
    border-radius: 12px !important;
    /* ensure height is auto */
    height: auto !important;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
  }
  body.app-mobile .provider-card .card-header-bg {
    height: 44px !important;
    border-radius: 12px 12px 0 0;
  }
  body.app-mobile .provider-card .provider-avatar-wrapper {
    width: 56px !important;
    height: 56px !important;
    margin: -28px auto 5px !important;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }
  body.app-mobile .provider-card h3 {
    font-size: 0.88rem !important;
    margin-bottom: 2px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 5px;
  }
  body.app-mobile .provider-card .provider-category {
    font-size: 0.68rem !important;
    text-align: center;
    margin-bottom: 5px !important;
  }
  body.app-mobile .provider-card .provider-stats {
    justify-content: center;
    gap: 8px;
    font-size: 0.7rem !important;
    margin-bottom: 0 !important;
  }
  body.app-mobile .provider-card .provider-bio,
  body.app-mobile .provider-card .provider-skills {
    display: none !important;
  }
  body.app-mobile .provider-card .card-footer {
    padding: 5px 10px !important;
    margin-top: auto;
  }
  body.app-mobile .provider-card .btn {
    width: 100%;
    padding: 6px 0 !important;
    font-size: 0.74rem !important;
    height: 30px !important;
  }

  /* Layout Resets for Sidebar Pages */
  body.app-mobile .services-container,
  body.app-mobile .providers-container {
    display: block !important;
    grid-template-columns: 1fr !important;
  }
  body.app-mobile .filters-sidebar {
    display: none !important; /* Hide filters to simplify */
  }

  /* General Element Reductions */
  body.app-mobile .section-title h2 {
    font-size: 1.5rem !important;
  }
  body.app-mobile .section-header {
    margin-bottom: 20px !important;
    text-align: center;
  }

  /* App Tab Bar Adjustments */
  body.app-mobile .app-tabbar {
    height: auto;
    min-height: 62px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 2px);
  }
  body.app-mobile .app-tabbar__icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }
  body.app-mobile .app-tabbar__label {
    font-size: 0.62rem;
  }

  /* Ultra-small screens: icon-only labels to avoid overflow */
  @media (max-width: 360px) {
    body.app-mobile .app-tabbar__label {
      display: none;
    }
    body.app-mobile .app-tabbar__item {
      gap: 0;
    }
  }
}

/* ============================================
   ADDITIONAL MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
  /* Index Hero Section */
  body.app-mobile .hero-section {
    padding: 60px 0 40px !important;
    min-height: auto !important;
    text-align: center;
  }
  body.app-mobile .hero-content h1 {
    font-size: 1.8rem !important;
    line-height: 1.2;
    margin-bottom: 10px;
  }
  body.app-mobile .hero-content p {
    font-size: 0.9rem !important;
    margin-bottom: 20px;
    padding: 0 10px;
  }
  body.app-mobile .hero-search-wrapper {
    margin-bottom: 20px;
  }
  body.app-mobile .hero-cta-buttons {
    flex-direction: column;
    gap: 10px;
    padding: 0 20px;
  }
  body.app-mobile .hero-cta-buttons .btn {
    width: 100%;
  }

  /* How It Works - 2x2 Grid */
  body.app-mobile .steps-container {
    flex-direction: row !important; /* Force row to allow wrap */
    flex-wrap: wrap !important;
    gap: 10px;
    margin-top: 20px !important;
    justify-content: center;
  }
  body.app-mobile .step {
    flex: 0 0 calc(50% - 15px) !important; /* 2 per row */
    padding: 15px 10px !important;
    margin: 0 !important; /* Remove custom margins */
    max-width: none !important;
  }
  body.app-mobile .step-down,
  body.app-mobile .step-up {
    margin-top: 0 !important;
  }
  body.app-mobile .step-connector-curve {
    display: none !important;
  }
  body.app-mobile .step-icon {
    width: 50px !important;
    height: 50px !important;
    margin: 10px auto !important;
  }
  body.app-mobile .step-icon i {
    font-size: 1.2rem !important;
  }
  body.app-mobile .step h3 {
    font-size: 0.85rem !important;
    margin: 5px 0 !important;
  }
  body.app-mobile .step p {
    display: none !important; /* Remove text as requested */
  }
  body.app-mobile .step-number {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    top: -10px;
  }

  /* Footer Adjustments */
  body.app-mobile footer {
    padding-bottom: 80px; /* Safe space for tabbar */
  }
}
