html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #fff;
}

body {
  padding-top: 0 !important;
}

:root{
  --suuq-font-body:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --suuq-font-heading:"Poppins",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;

  --brand:#2E7D32; --brand-050:#e8f5e9; --brand-600:#256b29;
  --accent:#FF7A00;       /* orange accent */
  --accent-050:#FFF2E6;
  --rail-pad: clamp(12px,3vw,24px);
  --feed-max: 1280px;
  --nav-h: 86px;
}

/* Glass header (copied from reels) */
.feed-nav{
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.76));
  border-bottom: 1px solid rgba(15,23,42,.06);
}


.feed-nav .nav-inner{
  display:flex; align-items:center; gap:12px; flex-wrap:nowrap;
  padding:10px var(--rail-pad);
  width:min(1100px, var(--feed-max)); margin:0 auto;
}
.brand{ font-weight:900; color:var(--brand); text-decoration:none; font-size:1.25rem; white-space:nowrap; }
.search-pill{ display:flex; align-items:center; gap:10px; flex:1 1 auto; height:44px; padding:0 14px;
  border-radius:999px; background:linear-gradient(90deg,#f8fafc,#fff); border:1px solid #e5e7eb; box-shadow:0 6px 18px rgba(2,6,23,.05) inset; min-width:160px; }
.search-pill i{ color:#64748b; font-size:18px; }
.search-pill input{ border:none; outline:none; background:transparent; width:100%; font-size:15px; color:#0f172a; }
.search-pill input::placeholder{ color:#94a3b8; }
.btn-upload{ border-radius:999px; padding:.55rem 1rem; border:1px solid var(--brand); color:var(--brand); background:#fff; text-decoration:none; font-weight:700; white-space:nowrap; }
.btn-upload:hover{ background:var(--brand-050); }

.chips{
  display:flex; gap:8px; padding:6px var(--rail-pad) 10px;
  width:min(1100px, var(--feed-max)); margin:0 auto; overflow:auto; scrollbar-width:none;
}
.chips::-webkit-scrollbar{ display:none; }
.chip{ border:1px solid var(--brand); color:var(--brand-600); background:#fff; border-radius:999px; padding:6px 12px; font-weight:700; font-size:.9rem; }
.chip.is-active{ background:var(--brand-050); color:var(--brand); }

/* Selects styled like chips (Category filters) */
select.chip{ padding-right:34px; }
select.chip:disabled{ opacity:.55; cursor:not-allowed; }

/* Inline filter form inside the chips row */
.chips .chip-form{
  display:flex;
  gap:8px;
  align-items:center;
  margin:0;
  padding:0;
}

/* Grid */
.grid{
  width:min(1100px, var(--feed-max));
  margin:8px auto 28px; padding:0 var(--rail-pad);
  display:grid; gap:12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card{
  background:#fff; border:1px solid #e5e7eb; border-radius:14px; overflow:hidden;
  display:flex; flex-direction:column; min-height:0;
}
.thumb{ position:relative; width:100%; aspect-ratio:9/16; background:#000; }
.thumb video{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.dur{ position:absolute; right:8px; top:8px; background:rgba(0,0,0,.55); color:#fff; font-size:.78rem; padding:2px 6px; border-radius:10px; }
.like-badge{ position:absolute; left:8px; top:8px; display:flex; align-items:center; gap:6px; background:rgba(0,0,0,.45); color:#fff; border:1px solid rgba(255,255,255,.25); border-radius:999px; padding:4px 8px; }
.like-badge.is-liked i{ color:#ff2d55; }

.meta{ display:flex; gap:10px; padding:10px 10px 12px; }
.meta img{ width:34px; height:34px; border-radius:50%; object-fit:cover; }
.meta .text{ min-width:0; }
.meta .handle{ font-weight:800; font-size:.95rem; color:#0f172a; }
.meta .cap{ color:#475569; font-size:.9rem; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; }

.see-reel{
  text-decoration:none; margin-left:auto; align-self:center; font-weight:700; font-size:.9rem;
  border:1px solid var(--brand); color:var(--brand); padding:.25rem .6rem; border-radius:999px;
}
.see-reel:hover{ background:var(--brand-050); }

@media (max-width: 991.98px){
  .feed-nav .nav-inner, .chips{ width:100%; padding-left:var(--rail-pad); padding-right:var(--rail-pad); }
  .feed-nav .nav-inner{ flex-wrap:wrap; }
  .btn-upload{ display:none; }
  .search-pill{ order:3; width:100%; height:42px; }
}

/* 1) Match Reels font (logo + Post inherit) */
body{
  font-family:var(--suuq-font-body);
}
.feed-nav .brand{ font-weight:900; letter-spacing:.2px; }
.feed-nav .btn-upload{ font-weight:700; }

/* 2) Shorter cards everywhere (product-like) */
.thumb{ aspect-ratio: 4 / 5; }

/* 3) MOBILE FIXES */
@media (max-width: 767.98px){
  /* reset container widths that were desktop-only */
  .feed-nav .nav-inner,
  .chips{ width:100%; padding-left:var(--rail-pad); padding-right:var(--rail-pad); }

  .grid{
    width:100%;
    margin:8px 0 24px;
    padding-left:var(--rail-pad);
    padding-right:var(--rail-pad);
    display:grid;
    grid-template-columns: 1fr 1fr;   /* 2 columns */
    gap:10px;
  }
  .grid > *{ min-width:0; }          /* prevent overflow */
  .card{ width:auto; border-radius:12px; }
  .thumb{ aspect-ratio:4 / 5; }
  .meta{ padding:8px 8px 10px; }
  .meta img{ width:30px; height:30px; }
  .meta .handle{ font-size:.9rem; }
  .meta .cap{ font-size:.85rem; -webkit-line-clamp:1; line-clamp:1; }
  .see-reel{ display:none; }         /* declutter small screens */

  /* header behavior on phones */
  .feed-nav .nav-inner{ flex-wrap:wrap; }
  .search-pill{ order:3; width:100%; height:42px; }
  .btn-upload{ display:none; }
}

/* Tablets (still shorter cards) */
@media (min-width:768px) and (max-width:991.98px){
  .grid{ grid-template-columns: repeat(3, 1fr); gap:12px; width:100%; padding:0 var(--rail-pad); }
  .thumb{ aspect-ratio:4 / 5; }
}


/* 0) Make widths include padding to prevent overflow on mobile */
*, *::before, *::after { box-sizing: border-box; }

/* 1) Mobile: remove horizontal scroll in the header + chips + grid */
@media (max-width: 767.98px){
  .feed-nav .nav-inner,
  .chips,
  .grid{
    width: 100%;
    padding-left: var(--rail-pad);
    padding-right: var(--rail-pad);
    box-sizing: border-box; /* important */
  }

  /* Wrap chips instead of horizontal scrolling */
  .chips{
    overflow: visible;      /* no scroll */
    flex-wrap: wrap;        /* wrap to next line */
    row-gap: 8px;           /* nice vertical spacing for wrapped lines */
  }
  .chips::-webkit-scrollbar{ display: none; } /* harmless if still present */
  .chip{ flex: 0 1 auto; }  /* allow wrapping */

  /* (keep your earlier phone tweaks) */
  .feed-nav .nav-inner{ flex-wrap: wrap; }
  .search-pill{ order: 3; width: 100%; height: 42px; }
  .btn-upload{ display: none; }
}

/* 2) As a final guard (optional): stop page-level sideways scroll */
html, body { overflow-x: hidden; }

/* Mobile: show POST opposite SUUQ in the top row */
@media (max-width: 767.98px){
  .feed-nav .nav-inner{
    display:flex; align-items:center; flex-wrap:wrap; gap:10px;
  }
  .feed-nav .brand{ order:1; }

  /* bring the button back and pin it to the right */
  .feed-nav .nav-inner .btn-upload{
    order:2;
    display:inline-flex !important;         /* override any previous display:none */
    margin-left:auto;                       /* pushes it to the far right */
    height:36px; padding:.35rem .75rem;
    border-radius:999px;
    border:1px solid var(--brand);
    color:var(--brand); background:#fff;
    font-weight:700;
  }

  /* search sits on its own line below */
  .search-pill{
    order:3; width:100%; height:42px;
  }
}

/* tiny phones: make POST a touch smaller so it never wraps */
@media (max-width: 360px){
  .feed-nav .nav-inner .btn-upload{
    height:34px; padding:.3rem .6rem; font-size:.85rem;
  }
}
/* Theme (fallbacks if you don't already define these) */

/* Matched tag highlight while typing */
.chip.is-match{
  background: var(--brand-050);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent);
  font-weight: 600;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

/* Desktop ONLY: single, scrollable line */
@media (min-width: 768px){
  .chips{
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: auto;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar{ display: none; }
  .chip{ flex: 0 0 auto; }
}

/* Mobile: wrap rows; show just the first 18 (JS hides the rest with .is-mobile-hidden) */
@media (max-width: 767.98px){
  .chips{
    overflow: visible;      /* no horizontal scroll on phones */
    flex-wrap: wrap;        /* wrap to next line(s) */
    row-gap: 8px;
  }
  .chip{ flex: 0 1 auto; }  /* allow wrapping */
  .chip.is-mobile-hidden{ display:none; }
}

/* kill the blue tap highlight on mobile */
a, button, .action-btn, .chip, .fab, .search-pill, input {
  -webkit-tap-highlight-color: transparent; /* iOS/Safari/Chrome */
}

/* only show a nice focus ring when navigating by keyboard */
html.using-mouse :focus { outline: none !important; box-shadow: none !important; }
:focus { outline: none; } /* fallback */
:focus-visible {
  outline: 2px solid #0ea5e9;   /* subtle, pro ring for keyboard users */
  outline-offset: 2px;
  box-shadow: none !important;
}
.chip:hover{ background:var(--brand-050); }
.chip:active{ background:var(--accent-050); border-color:var(--accent); color:var(--accent); }
/* ==============================
   Mobile polish: chips + filters
============================== */
@media (max-width: 576px){

  /* make the whole chips rail wrap cleanly */
  #trendChips{
    flex-wrap: wrap;
    overflow: visible;
    gap: 8px;
    row-gap: 8px;
  }

  /* Row 1: Reels / Explore */
  #trendChips > a.chip{ order: 1; }

  /* Row 2: dropdown filters (full-width row) */
  #trendChips > form.chip-form{
    order: 2;
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* Row 3: hashtag chips */
  #trendChips > button.chip,
  #trendChips > .chip[data-q]{
    order: 3;
  }

  /* Make the dropdowns look/behave like chips on phones */
  #trendChips .chip-form{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  /* two dropdowns side-by-side */
  #trendChips .chip-form select.chip{
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    height: 34px;
    line-height: 34px;
    padding-top: 0;
    padding-bottom: 0;

    /* prevent long names from breaking layout */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* slightly tighter chips on mobile */
  #trendChips .chip{
    padding: .34rem .70rem;
    font-size: .86rem;
  }
}

/* ---- Flash (Django messages) ---- */
.flash-wrap{
  position: fixed;
  right: 12px;
  top: calc(var(--nav-h) + 10px);
  z-index: 6000;
  display: grid;
  gap: 8px;
}
.flash{
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  color: #0f172a;
  background: #ecfdf5;            /* success bg */
  border: 1px solid #10b981;      /* success border */
  box-shadow: 0 8px 24px rgba(2,6,23,.08);
  max-width: min(86vw, 420px);
}
.flash.is-error{
  background:#fef2f2; border-color:#ef4444;
}
.flash .x{
  margin-left: 10px; cursor: pointer; font-weight: 800; color:#334155;
}
@media (max-width: 991.98px){
  .flash-wrap{ left: 12px; right: 12px; }
}

.flash.is-info{ background:#ecfdf5;; border-color:#10b981; }


.grid,
.feed-grid {
  padding: 8px 10px;
  gap: 12px;
}


/* Explore card links: no underlines anywhere */
a.card,
a.card:hover,
a.card:focus,
a.card:visited,
a.card *{
  text-decoration:none !important;
}

a.card{
  color:inherit;
}

/* Selected/opening reel feedback */
a.card{
  position:relative;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease,
    opacity .16s ease;
}

a.card.is-opening{
  border-color:var(--accent) !important;
  box-shadow:
    0 0 0 3px rgba(255,122,0,.22),
    0 12px 26px rgba(15,23,42,.14);
  transform:translateY(-2px) scale(.985);
  opacity:.96;
}

a.card.is-opening::after{
  content:"Opening reel...";
  position:absolute;
  inset:0;
  z-index:6;
  display:grid;
  place-items:center;
  background:rgba(15,23,42,.24);
  color:#fff;
  font-weight:800;
  font-size:.9rem;
  text-shadow:0 2px 8px rgba(0,0,0,.45);
  pointer-events:none;
}

a.card.is-opening .thumb::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:34px;
  height:34px;
  margin-left:-17px;
  margin-top:-48px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.45);
  border-top-color:#fff;
  z-index:7;
  animation:suuqSpin .7s linear infinite;
}

@keyframes suuqSpin{
  to{ transform:rotate(360deg); }
}

/* Meta area after removing Watch button */
.meta{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.meta img{
  flex:0 0 auto;
}

.meta .text{
  flex:1 1 auto;
  min-width:0;
}

/* Shop handle + package icon */
.handle-line{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  min-width:0;
}

.meta .handle{
  color:#0f172a;
  font-weight:800;
  font-size:.95rem;
  line-height:1.15;
  text-decoration:none !important;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
}

.plan-badge-mini{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;

  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
  margin:0;
  min-width:auto;
  height:auto;
  line-height:1;
}

.plan-badge-mini .plan-icon{
  display:block;
  width:16px;
  height:16px;
  color:#087a55;
  overflow:visible;
}

/* keep all package levels plain */
.plan-badge-mini.is-master,
.plan-badge-mini.is-pro,
.plan-badge-mini.is-ninja,
.plan-badge-mini.is-junior{
  background:transparent;
  border:none;
  box-shadow:none;
  color:inherit;
}

.plan-badge-mini.is-master .plan-icon{
  color:#ff6600;
}

@media (max-width:767.98px){
  .plan-badge-mini .plan-icon{
    width:15px;
    height:15px;
  }
}

.meta .cap{
  margin-top:3px;
  color:#475569;
  text-decoration:none !important;
}

/* Mobile: keep the old Explore layout, just neater */
@media (max-width:767.98px){
  .meta{
    gap:8px;
    padding:8px 8px 10px;
  }

  .meta img{
    width:30px;
    height:30px;
  }

  .meta .handle{
    font-size:.84rem;
  }

  .meta .cap{
    font-size:.78rem;
    -webkit-line-clamp:1; line-clamp:1;
  }

  .plan-badge-mini{
    min-width:24px;
    height:18px;
    padding:1px 6px;
    font-size:.72rem;
  }
}

/* FINAL: prevent top gap flash in mobile app and mobile browser */
@media (max-width: 767.98px){
  html,
  body{
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  .feed-nav{
    top: 0 !important;
    margin-top: 0 !important;
  }

  .feed-nav .nav-inner{
    padding-top: 8px !important;
  }
}

/* ===== Premium mobile Reels navigation =====
   This is a standalone template, so it carries the same mobile-web bottom
   navigation as base.html while keeping its own search and filters visible. */
.suuq-mobile-bottom-nav{
  display:none;
}

.suuq-bottom-nav-icon{
  display:block;
  width:21px;
  height:21px;
  flex:0 0 21px;
  color:inherit;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:color .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}

@media (max-width:767.98px){
  /* Keep the useful Reels search and filter rows; hide only desktop actions. */
  .feed-nav{
    display:block !important;
    top:0 !important;
  }

  .feed-nav .brand,
  .feed-nav .btn-upload{
    display:none !important;
  }

  .feed-nav .nav-inner{
    display:flex !important;
    width:100% !important;
    padding:8px 12px 5px !important;
    flex-wrap:nowrap !important;
    gap:0 !important;
  }

  .search-pill{
    order:1 !important;
    width:100% !important;
    height:42px !important;
    margin:0 !important;
    flex:1 1 100%;
  }

  .chips{
    display:flex !important;
    width:100% !important;
    padding:5px 12px 9px !important;
    flex-wrap:nowrap !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    white-space:nowrap;
  }

  .chips .chip-form{
    flex:0 0 auto;
    flex-wrap:nowrap;
  }

  .chips .chip,
  .chips select.chip{
    flex:0 0 auto;
    white-space:nowrap;
  }

  body:not(.suuq-flutter-app){
    padding-bottom:calc(76px + env(safe-area-inset-bottom)) !important;
  }

  .grid{
    margin-top:10px;
  }

  .suuq-mobile-bottom-nav{
    position:fixed;
    right:0;
    bottom:0;
    left:0;
    z-index:2050;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    min-height:64px;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top:1px solid #e5ebe7;
    background:rgba(255,255,255,.98);
    -webkit-backdrop-filter:blur(16px);
    backdrop-filter:blur(16px);
    box-shadow:0 -8px 28px rgba(15,23,42,.10);
  }

  .suuq-bottom-link{
    position:relative;
    display:flex;
    min-width:0;
    min-height:52px;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    border-radius:12px;
    color:#667085;
    font-size:.68rem;
    font-weight:700;
    line-height:1;
    text-decoration:none;
    -webkit-tap-highlight-color:transparent;
    transition:color .22s ease, background-color .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
  }

  .suuq-bottom-link:link,
  .suuq-bottom-link:visited,
  .suuq-bottom-link:hover,
  .suuq-bottom-link:focus{
    color:#667085;
    text-decoration:none;
  }

  .suuq-bottom-link:focus-visible{
    outline:2px solid rgba(255,102,0,.28);
    outline-offset:-2px;
  }

  .suuq-bottom-link i{
    font-size:1.2rem;
    line-height:1;
    transition:color .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
  }

  .suuq-bottom-link:active{
    background:#f4faf6;
    transform:translateY(1px);
  }

  .suuq-bottom-link.is-active{
    color:#12C25B;
    background:transparent;
  }

  .suuq-bottom-link.is-active:link,
  .suuq-bottom-link.is-active:visited,
  .suuq-bottom-link.is-active:hover,
  .suuq-bottom-link.is-active:focus{
    color:#12C25B;
  }

  .suuq-bottom-link.is-active i,
  .suuq-bottom-link.is-active .suuq-bottom-nav-icon{
    color:#FF6600;
    transform:translateY(-1px) scale(1.08);
  }

  .suuq-bottom-link.is-live{
    color:#667085;
  }

  .suuq-bottom-link.is-live.is-active{
    color:#12C25B;
    background:transparent;
  }

  .suuq-bottom-badge{
    position:absolute;
    top:4px;
    left:calc(50% + 7px);
    display:flex;
    min-width:17px;
    height:17px;
    align-items:center;
    justify-content:center;
    padding:0 4px;
    border:2px solid #fff;
    border-radius:999px;
    background:#ef4444;
    color:#fff;
    font-size:.57rem;
    font-weight:800;
  }
}

@media (min-width:768px){
  .suuq-mobile-bottom-nav{
    display:none !important;
  }
}


/* ==========================================================
   SUUQ typography alignment
   Same family used by Product List / Product Detail / Live:
   Inter for interface/content, Poppins for deliberate headings.
   ========================================================== */
body,
button,
input,
select,
textarea,
.chip,
.search-pill,
.btn-upload,
.handle,
.caption,
.product-name,
.product-price,
.product-handle,
.account,
.meta,
.see-reel {
  font-family:var(--suuq-font-body);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand,
.rail-title {
  font-family:var(--suuq-font-heading);
}
