/* ================= TOKENS ================= */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --accent:#fc8019;
  --radius:18px;
  --shadow:0 18px 40px rgba(0,0,0,.08);
}
[data-theme="dark"]{
  --bg:#0b0d12;
  --card:#151925;
  --text:#f8fafc;
  --muted:#9ca3af;
}

/* ================= BASE ================= */
*{box-sizing:border-box}
body{
  margin:0;
  font-family:'Poppins',system-ui;
  background:var(--bg);
  color:var(--text);
  padding-bottom:90px;
  transition:.35s ease;
}

/* PAGE BLUR */
.page{
  transition:filter .35s ease, transform .35s ease;
}
.page.blur{
  filter:blur(10px) saturate(1.2);
  transform:scale(.98);
}

/* ================= ICONS ================= */
.material-symbols-rounded{
  font-size:26px;
  line-height:1;
}

/* ================= TOP BAR ================= */
.top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
}
.brand{
  font-weight:700;
  font-size:17px;
}
.icon-btn{
  width:42px;height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:var(--card);
  box-shadow:var(--shadow);
  cursor:pointer;
  transition:.2s ease;
}
.icon-btn:active{transform:scale(.92)}

/* ================= SEARCH ================= */
.search{padding:0 16px 16px}
.search input{
  width:100%;
  padding:15px 16px;
  border-radius:16px;
  border:0;
  background:var(--card);
  box-shadow:var(--shadow);
  outline:none;
}

/* ===== FEATURES ===== */
.features-wrap{
  padding:16px;
  overflow:hidden;
}

.features-track{
  display:flex;
  gap:14px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth;

  /* Performance */
  will-change:scroll-position;
  contain:layout paint;
}

.features-track::-webkit-scrollbar{
  display:none;
}

.feature{
  flex:0 0 230px;
  height:150px;
  border-radius:20px;
  overflow:hidden;
  scroll-snap-align:start;
  position:relative;

  /* cheaper shadow */
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  background:#000;
}

/* Image */
.feature img{
  width:100%;
  height:100%;
  object-fit:cover;
  pointer-events:none;
  user-select:none;
}

/* Overlay */
.feature::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(to bottom,rgba(0,0,0,.05),rgba(0,0,0,.7));
}

/* Tags */
.tags{
  position:absolute;
  top:10px;
  left:10px;
  display:flex;
  gap:6px;
  z-index:2;
}

.tag{
  padding:4px 10px;
  font-size:10px;
  border-radius:999px;
  background:var(--accent);
  color:#fff;
}

/* Text */
.feature-text{
  position:absolute;
  bottom:10px;
  left:12px;
  right:12px;
  color:#fff;
  z-index:2;
}

.feature-text h4{
  margin:0;
  font-size:14px;
  font-weight:600;
}

.feature-text p{
  margin:2px 0 0;
  font-size:11px;
  opacity:.9;
}

/* ===== DOTS ===== */
.feature-dots{
  display:flex;
  justify-content:center;
  gap:6px;
  margin-top:12px;
}

.feature-dots span{
  width:6px;
  height:6px;
  border-radius:999px;
  background:#cbd5e1;
  transition:.3s ease;
}

.feature-dots span.active{
  width:18px;
  background:#fc8019;
}


/* Accent colors */
.feature[data-cat="food"]{--accent:#f97316}
.feature[data-cat="pg"]{--accent:#6366f1}
.feature[data-cat="restaurant"]{--accent:#22c55e}
.feature[data-cat="events"]{--accent:#ec4899}
.feature[data-cat="shopping"]{--accent:#facc15}
.feature[data-cat="gym"]{--accent:#ef4444}
.feature[data-cat="hospital"]{--accent:#38bdf8}
.feature[data-cat="cafe"]{--accent:#a855f7}

/* ================= SECTION ================= */
.section{padding:16px}
.section-title{
  font-weight:700;
  margin-bottom:14px;
  display:flex;
  align-items:center;
  gap:8px;
}

/* ================= CATEGORIES ================= */
.categories{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;

  overflow:hidden;

  /* smooth open / close */
  transition:
    max-height .45s cubic-bezier(.22,.61,.36,1),
    padding .3s ease;
}

/* collapsed = only 2 rows */
.categories.collapsed{
  max-height:180px;
}

/* expanded */
.categories:not(.collapsed){
  max-height:1000px; /* safe large value */
}

/* CARD DESIGN (unchanged look) */
.cat{
  background:var(--card);
  border-radius:18px;
  padding:16px 6px 14px;
  box-shadow:var(--shadow);

  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;

  font-size:12px;
  text-align:center;
  cursor:pointer;

  transition:
    transform .25s ease,
    box-shadow .25s ease,
    opacity .35s ease,
    filter .35s ease;
}

/* default visible state */
.categories:not(.collapsed) .cat{
  opacity:1;
  transform:translateY(0) scale(1);
}

/* fade & slide hidden rows */
.categories.collapsed .cat:nth-child(n+7){
  opacity:0;
  transform:translateY(14px) scale(.96);
  pointer-events:none;
}

/* hover stays crisp */
.cat:hover{
  transform:translateY(-4px) scale(1.04);
}

/* icon */
.cat span{
  color:var(--accent);
  font-size:28px;
}

/* toggle */
.toggle{
  text-align:center;
  margin-top:14px;
  color:var(--accent);
  font-size:13px;
  cursor:pointer;
  user-select:none;
  transition:opacity .2s ease, transform .2s ease;
}

.toggle:active{
  transform:scale(.96);
}

  
/* ================= TRENDING ================= */
.scroll{
  display:flex;
  gap:16px;
  overflow-x:auto;
}
.scroll::-webkit-scrollbar{display:none}
.card{
  min-width:230px;
  background:var(--card);
  border-radius:18px;
  overflow:hidden;
  box-shadow:var(--shadow);
}
.card img{
  width:100%;
  height:140px;
  object-fit:cover;
}
.card-body{
  padding:12px;
  font-size:13px;
}

/* ================= THEME MODAL ================= */
.theme-modal{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(0,0,0,.25);
  backdrop-filter:blur(12px);
  opacity:0;
  pointer-events:none;
  transition:.3s ease;
  z-index:999;
}
.theme-modal.show{
  opacity:1;
  pointer-events:auto;
}
.theme-box{
  background:var(--card);
  padding:22px 28px;
  border-radius:20px;
  display:flex;
  align-items:center;
  gap:14px;
  box-shadow:var(--shadow);
}
.spinner{
  width:22px;height:22px;
  border:3px solid rgba(0,0,0,.15);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin .9s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ================= BOTTOM NAV ================= */
.nav{
  position:fixed;
  bottom:0;left:0;right:0;
  display:flex;
  justify-content

  .nav{
  position:fixed;
  bottom:0;left:0;right:0;
  display:flex;
  justify-content:space-around;
  background:var(--card);
  padding:10px 0;
  box-shadow:0 -12px 30px rgba(0,0,0,.08);
}
.nav-item{
  text-align:center;
  font-size:11px;
  color:var(--muted);
}
.nav-item.active{
  color:var(--accent);
  transform:translateY(-3px) scale(1.1);
}
/* ================= DESKTOP SWIPE FIX ================= */









/* ================= CATEGORIES GRID ================= */

.categories{
  display:grid;
  grid-template-columns:repeat(3, 1fr); /* ALWAYS 3 columns */
  grid-template-rows:repeat(2, auto);    /* ALWAYS 2 rows */
  gap:14px;

  /* Lock height to 2 rows */
  max-height:240px;
  overflow-y:auto;        /* scroll when more items */
  overflow-x:hidden;

  /* Smooth scroll on expand */
  scroll-behavior:smooth;

  /* PC width control */
  margin:0 auto;
  max-width:720px;
}

/* Category card */
.cat{
  background:var(--card);
  border-radius:18px;
  padding:14px 6px 12px;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  font-size:12px;
  text-align:center;
  cursor:pointer;
}

/* Icon */
.cat span{
  font-size:26px;
  color:var(--accent);
  transition:transform .3s ease;
}

/* Micro interaction */
.cat:hover span{
  transform:scale(1.15);
}

/* Hidden items are NOT removed */
.cat.hidden{
  display:flex;
}

/* Scrollbar polish (optional) */
.categories::-webkit-scrollbar{
  width:6px;
}
.categories::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.2);
  border-radius:10px;
}

/* ================= BOTTOM NAV ================= */
/* BOTTOM NAV */
.bottom-nav{
  position:fixed;bottom:0;left:0;right:0;
  background:var(--card);
  display:flex;justify-content:space-around;
  padding:10px 0;
  box-shadow:0 -6px 20px rgba(0,0,0,.15);
}
.bottom-nav a{text-align:center;font-size:.7rem;color:var(--muted)}
.bottom-nav i{font-size:1.3rem;display:block}
.active{color:var(--primary)}
