/* ==========================================================================
   Suuqa App — Mobile-first CSS (Amazon-inspired)
   ========================================================================== */

:root{
  --sb:#dd9933;      /* brand orange */
  --ink:#111;        /* primary text */
  --muted:#666;      /* secondary text */
  --bg:#f6f6f6;      /* app background */
  --card:#fff;       /* card background */
  --line:#eee;       /* subtle borders */
  --danger:#e11d48;  /* red badge */
}

*{ box-sizing:border-box }
html,body{ height:100% }
img{ max-width:100%; height:auto }
body.sapp-body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}

/* ==========================================================================
   HEADER (compact + logo)
   ========================================================================== */

.sb-header{
  position:sticky; top:0; z-index:1000;
  background:var(--sb); color:#fff;
  padding:10px 10px 8px; /* keep height steady */
  border-bottom:1px solid rgba(0,0,0,.06);
}

/* top row: logo | location | button  */
.sb-row.sb-top{
  display:grid; grid-template-columns:auto 1fr auto;
  align-items:center; gap:8px;
}

/* logo container */
.sb-logo-wrap{ display:flex; align-items:center; gap:8px; text-decoration:none; color:#fff; min-width:32px }

/* clamp ANY image used as logo so header doesn't stretch */
.sb-header .sb-logo,
.sb-header img.custom-logo,
.sb-header .custom-logo-link img,
.sb-header img{
  height:28px; max-height:28px; width:auto; display:block;
}

/* hide stray site title/description some plugins/themes output */
.sb-header .site-title,
.sb-header .site-name,
.sb-header .site-description,
.sb-header .wp-block-site-title{ display:none!important }

.sb-brand{ font-weight:800; letter-spacing:.3px } /* fallback text if no logo */

/* location pill */
.sb-loc{
  font-size:12px; line-height:1;
  background:rgba(255,255,255,.12);
  padding:6px 10px; border-radius:999px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sb-loc-btn{
  background:rgba(255,255,255,.18); color:#fff;
  border:none; border-radius:999px; padding:6px 10px;
}

/* search */
.sb-searchwrap{ margin-top:8px }
.sb-search{ display:flex; gap:6px }
.sb-input{
  flex:1; border:0; border-radius:6px; padding:10px;
  background:#fff; color:#111;
}
.sb-search-btn{
  background:#222; color:#fff; border:none;
  border-radius:6px; padding:10px 12px;
}

/* prevent Gutenberg blocks dropped in header from adding spacing */
.sb-header .wp-block-image,
.sb-header .wp-block-group{ margin:0!important; padding:0!important }

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.sbu-section{ margin:10px }
.sbu-sec-title{ margin:6px 0 8px; font-size:16px; font-weight:700; padding:0 2px }

/* ==========================================================================
   REUSABLE SLIDER
   ========================================================================== */

.sb-slider{ position:relative }
.sb-track{
  display:grid; grid-auto-flow:column; gap:12px;
  overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
  padding:6px; scrollbar-width:none;
}
.sb-track::-webkit-scrollbar{ display:none }

/* columns via data attribute */
.sb-slider[data-cols="3"] .sb-track{ grid-auto-columns:calc((100% - 24px)/3) }
.sb-slider[data-cols="2"] .sb-track{ grid-auto-columns:calc((100% - 12px)/2) }
.sb-slider[data-cols="1"] .sb-track{ grid-auto-columns:100% }

/* card */
.sb-card{
  scroll-snap-align:start;
  border:1px solid var(--line); border-radius:8px;
  background:var(--card); overflow:hidden;
}
.sb-card .thumb{ display:block; position:relative; border-bottom:1px solid #f3f3f3; text-align:center }
.sb-card img{ display:block; width:100%; height:auto }
.sb-badge{ position:absolute; top:8px; left:8px; background:var(--sb); color:#fff; padding:4px 6px; border-radius:6px; font-size:12px }
.sb-card .info{ padding:8px }
.sb-card .title{
  display:block; text-decoration:none; color:var(--ink);
  font-weight:600; line-height:1.2; margin:4px 0; min-height:2.4em;
}
.sb-card .price{ font-weight:700; margin:4px 0 }
.sb-card .row{ display:flex; gap:6px; align-items:center }

/* slider arrows (paginate by viewport width via JS) */
.sb-nav{
  position:absolute; top:50%; transform:translateY(-50%);
  background:var(--sb); color:#fff; border:none; border-radius:999px;
  width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.sb-nav.prev{ left:4px } .sb-nav.next{ right:4px }

/* ==========================================================================
   PROMOS & CATEGORY TILES
   ========================================================================== */

.sb-promo-card{
  border:1px solid var(--line); border-radius:10px;
  background:var(--card); min-height:120px;
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.sb-cat-tiles{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px }
.sb-tile{
  display:flex; align-items:center; justify-content:center;
  min-height:64px; border:1px solid var(--line);
  background:var(--card); border-radius:8px;
  text-decoration:none; color:var(--ink); font-weight:700;
}

/* ==========================================================================
   BOTTOM APP NAV
   ========================================================================== */

.sb-bottomnav{
  position:fixed; left:0; right:0; bottom:0;
  background:#fff; border-top:1px solid #eaeaea;
  display:flex; justify-content:space-around;
  padding:6px 6px 8px; z-index:9999;
}
.sb-bottomnav a{
  flex:1; text-align:center; text-decoration:none; color:var(--ink); font-size:11px;
}
.sb-bottomnav a .ico{ display:block; font-size:20px; line-height:1; margin-bottom:2px }
.sb-main{ padding-bottom:74px } /* keep content above bottom nav */

/* live cart count badge (with Woo fragments) */
.sb-badge-num{
  display:inline-block; min-width:16px; height:16px; line-height:16px;
  padding:0 5px; font-size:11px; border-radius:999px;
  background:var(--danger); color:#fff; margin-left:4px; vertical-align:middle;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.sb-quick-add{
  margin-top:6px; background:var(--sb); color:#fff;
  border:none; border-radius:6px; padding:6px 10px;
}

/* ==========================================================================
   GENERIC FALLBACKS (index/page/single)
   ========================================================================== */

.sb-list{ display:grid; gap:12px }
.sb-article{ border:1px solid var(--line); border-radius:8px; background:var(--card); padding:10px }
.sb-article-title{ margin:0 0 6px; font-size:16px }
.sb-page .sb-page-content{ background:var(--card); border:1px solid var(--line); border-radius:8px; padding:10px }

/* ==========================================================================
   TINY SCREENS
   ========================================================================== */

@media (max-width:420px){
  /* show 2 wider cards on very small phones */
  .sb-slider[data-cols="3"] .sb-track{ grid-auto-columns:calc((100% - 12px)/2) }
}

/* ==========================================================================
   ADMIN BAR SAFETY
   ========================================================================== */

body.admin-bar .sb-header{ top:0 } /* keep our header sticky above content */
/* Location modal (bottom sheet) */
.sb-modal{position:fixed;inset:0;background:rgba(0,0,0,.3);z-index:10000;display:none}
.sb-modal.show{display:block}
.sb-modal-sheet{position:absolute;left:0;right:0;bottom:0;background:#fff;border-top-left-radius:16px;border-top-right-radius:16px;padding:12px 12px 16px;max-height:70vh;overflow:auto}
.sb-loc-useme{display:inline-flex;gap:6px;align-items:center;background:var(--sb);color:#fff;border:none;border-radius:8px;padding:8px 12px;margin:4px 0 8px}
.sb-loc-search{width:100%;padding:10px;border:1px solid #ddd;border-radius:8px;margin:6px 0 10px}
.sb-loc-list{list-style:none;margin:0;padding:0}
.sb-loc-list li{border-bottom:1px solid #eee}
.sb-loc-list button{width:100%;text-align:left;background:#fff;border:0;padding:10px 6px}
.sb-modal-close{display:block;width:100%;margin-top:8px;padding:10px;border:1px solid #ddd;border-radius:8px;background:#fff}