/* =============================================================
   FezaMarket — Mobile App Shell
   Targets ≤768px viewports.  Builds an app-feel mobile UI on
   top of the existing desktop layout without touching it.
   ============================================================= */

:root {
  --fz-primary:        #E62E04;
  --fz-primary-dark:   #B91D00;
  --fz-accent-orange:  #FF6B00;
  --fz-banner-bg:      linear-gradient(135deg, #FF7A1A 0%, #FF3D00 100%);
  --fz-ink:            #111315;
  --fz-ink-2:          #4B5563;
  --fz-ink-3:          #6B7280;
  --fz-line:           #ECECEC;
  --fz-soft:           #F6F7F9;
  --fz-card:           #FFFFFF;
  --fz-radius:         14px;
  --fz-shadow-1:       0 1px 2px rgba(0,0,0,.05);
  --fz-shadow-2:       0 6px 18px rgba(0,0,0,.10);
}

/* Mobile-only / desktop-only convenience helpers */
.fz-mobile-only { display: none; }
.fz-desktop-only { display: block; }

/* ============================================================
   Mobile chrome activates ≤768px
   ============================================================ */
@media (max-width: 768px) {

  .fz-mobile-only { display: block; }
  .fz-desktop-only { display: none !important; }

  /* hide the legacy eBay-style top bars on mobile (they crowd out the new chrome) */
  .ebay-top-header,
  .ebay-main-header,
  .ebay-nav-bar,
  .ebay-categories-bar,
  .desktop-header,
  .top-header,
  header.site-header > .container > .top-row { display: none !important; }

  body { background: #ffffff; }

  /* --------- Sticky mobile header (search pill + avatar + bell) --------- */
  .fz-mhead {
    position: sticky; top: 0; z-index: 1000;
    background: #ffffff;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--fz-line);
    display: flex; align-items: center; gap: 10px;
  }
  .fz-mhead-search {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: #F1F3F4; border-radius: 999px; padding: 9px 14px;
    color: var(--fz-ink-3); font-size: 14px; min-width: 0;
  }
  .fz-mhead-search i { color: var(--fz-ink-3); font-size: 15px; }
  .fz-mhead-search input {
    border: 0; background: transparent; flex: 1; outline: none;
    color: var(--fz-ink); font-size: 14px; min-width: 0;
  }
  .fz-mhead-search input::placeholder { color: var(--fz-ink-3); }
  .fz-mhead-avatar {
    width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
    background: #DADCE0 url('/uploads/placeholders/default.svg') center/cover no-repeat;
    flex: 0 0 34px;
  }
  .fz-mhead-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .fz-mhead-bell {
    position: relative; flex: 0 0 34px;
    width: 34px; height: 34px; display: grid; place-items: center;
    color: var(--fz-ink);
  }
  .fz-mhead-bell i { font-size: 19px; }
  .fz-mhead-bell .badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 18px; height: 18px; border-radius: 9px;
    background: var(--fz-primary); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px;
    text-align: center; padding: 0 4px;
  }

  /* --------- Horizontal category tab strip --------- */
  .fz-tabs {
    display: flex; gap: 18px; overflow-x: auto;
    padding: 10px 14px 6px; -webkit-overflow-scrolling: touch;
    background: #fff; border-bottom: 1px solid var(--fz-line);
    position: sticky; top: 54px; z-index: 999;
  }
  .fz-tabs::-webkit-scrollbar { display: none; }
  .fz-tab {
    flex: 0 0 auto; font-size: 15px; color: var(--fz-ink-2);
    padding: 6px 0 8px; font-weight: 500; white-space: nowrap;
    border-bottom: 3px solid transparent;
  }
  .fz-tab.active { color: var(--fz-ink); border-bottom-color: var(--fz-primary); font-weight: 700; }
  .fz-tab.hot    { color: var(--fz-primary); }

  /* --------- Promo banner with countdown --------- */
  .fz-promo {
    margin: 12px 12px 0; padding: 14px;
    border-radius: var(--fz-radius);
    background: var(--fz-banner-bg);
    color: #fff; position: relative; overflow: hidden;
  }
  .fz-promo-eyebrow { font-size: 12px; opacity: .95; }
  .fz-promo-title   { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
  .fz-promo-title i { font-size: 14px; opacity: .9; }
  .fz-promo-cards {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px;
  }
  .fz-promo-card {
    background: #fff; color: var(--fz-ink); border-radius: 10px; padding: 10px;
    font-size: 12px; line-height: 1.3;
  }
  .fz-promo-card .amt { color: var(--fz-primary); font-weight: 800; font-size: 14px; display: block; }

  .fz-promo-badge {
    position: absolute; top: 10px; right: 12px;
    background: #18A957; color: #fff; font-size: 11px; font-weight: 700;
    padding: 4px 8px; border-radius: 999px;
  }

  /* --------- Category icon grid --------- */
  .fz-cgrid {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 4px 6px; padding: 14px 8px 6px; background: #fff;
  }
  .fz-cgrid-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    text-align: center; color: var(--fz-ink); font-size: 11px; line-height: 1.2;
    padding: 6px 2px;
  }
  .fz-cgrid-img {
    width: 46px; height: 46px; border-radius: 12px; object-fit: cover;
    background: var(--fz-soft);
  }
  .fz-cgrid-label { font-size: 11px; color: var(--fz-ink); }

  /* --------- "SuperDeals" section header --------- */
  .fz-sec {
    background: #fff; padding: 14px 12px 8px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .fz-sec-title { font-size: 18px; font-weight: 800; color: var(--fz-ink); }
  .fz-sec-link  { font-size: 13px; color: var(--fz-primary); display: flex; align-items: center; gap: 4px; }
  .fz-sec-link i { font-size: 12px; }
  .fz-sec-pill  {
    background: #FFE9E2; color: var(--fz-primary); padding: 4px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
  }

  /* --------- Mobile product masonry --------- */
  .fz-mgrid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
    padding: 4px 8px 16px; background: #fff;
  }
  .fz-mcard {
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: var(--fz-shadow-1); position: relative;
    color: var(--fz-ink);
  }
  .fz-mcard-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--fz-soft); }
  .fz-mcard-body { padding: 8px 10px 12px; }
  .fz-mcard-title { font-size: 13px; line-height: 1.3; color: var(--fz-ink);
                    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                    overflow: hidden; min-height: 33px; }
  .fz-mcard-price { font-size: 16px; font-weight: 800; color: var(--fz-ink); margin-top: 6px; }
  .fz-mcard-price .old { font-size: 12px; font-weight: 500; color: var(--fz-ink-3); text-decoration: line-through; margin-left: 4px; }
  .fz-mcard-off {
    background: var(--fz-primary); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 4px; padding: 2px 6px; display: inline-block; margin-top: 4px;
  }
  .fz-mcard-badge-tl {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,.55); color: #fff; font-size: 11px;
    border-radius: 4px; padding: 1px 6px;
  }

  /* --------- Treat strip (like the "special treat" row in references) --------- */
  .fz-treat {
    margin: 0 12px 12px; padding: 10px 12px;
    background: #FFEFEC; border-radius: 14px;
    display: flex; align-items: center; gap: 10px;
    color: var(--fz-ink); font-size: 13px;
  }
  .fz-treat img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
  .fz-treat-body { flex: 1; line-height: 1.3; }
  .fz-treat-body b { color: var(--fz-primary); }
  .fz-treat-cta {
    background: #111; color: #fff; padding: 7px 14px;
    border-radius: 999px; font-size: 13px; font-weight: 700;
  }
  .fz-treat-x { color: var(--fz-ink-3); padding: 4px; }

  /* --------- Account dashboard ---------- */
  .fz-acct-hd {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: #fff; border-bottom: 1px solid var(--fz-line);
  }
  .fz-acct-hd img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--fz-soft); }
  .fz-acct-hd .name { font-weight: 800; font-size: 17px; color: var(--fz-ink); flex: 1;
                      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fz-acct-hd .gear, .fz-acct-hd .bell {
    width: 32px; height: 32px; display: grid; place-items: center;
    color: var(--fz-ink); position: relative;
  }
  .fz-acct-hd .bell .badge {
    position: absolute; top: -2px; right: -2px; background: var(--fz-primary); color: #fff;
    min-width: 17px; height: 17px; border-radius: 9px; font-size: 10px; line-height: 17px;
    font-weight: 700; padding: 0 4px;
  }

  .fz-orders-card {
    background: #fff; margin: 10px 12px; padding: 14px;
    border-radius: var(--fz-radius); box-shadow: var(--fz-shadow-1);
  }
  .fz-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .fz-card-head .t { font-size: 16px; font-weight: 800; color: var(--fz-ink); }
  .fz-card-head .more { font-size: 13px; color: var(--fz-ink-3); display: flex; align-items: center; gap: 4px; }
  .fz-orders-row {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  }
  .fz-orders-row a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--fz-ink); font-size: 11.5px; position: relative;
  }
  .fz-orders-row .ic {
    width: 28px; height: 28px; display: grid; place-items: center; font-size: 22px;
  }
  .fz-orders-row .pill {
    position: absolute; top: -4px; right: 10px; min-width: 16px; height: 16px;
    background: var(--fz-primary); color: #fff; border-radius: 8px;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; padding: 0 4px;
  }

  .fz-quick-card {
    background: #fff; margin: 0 12px 10px; padding: 14px;
    border-radius: var(--fz-radius); box-shadow: var(--fz-shadow-1);
  }
  .fz-quick-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  }
  .fz-quick-row a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--fz-ink); font-size: 12px;
  }
  .fz-quick-row .ic { font-size: 22px; }

  /* --------- Cart line items (store-grouped) --------- */
  .fz-cart-bar {
    display: flex; align-items: center; padding: 12px 14px; background: #fff;
    border-bottom: 1px solid var(--fz-line); gap: 10px;
  }
  .fz-cart-bar .back { font-size: 18px; color: var(--fz-ink); }
  .fz-cart-bar .title { font-size: 18px; font-weight: 800; flex: 1; }
  .fz-cart-bar .icons { display: flex; gap: 14px; align-items: center; color: var(--fz-ink); }
  .fz-cart-bar .icons i { font-size: 18px; }

  .fz-cart-store {
    background: #fff; margin: 8px 0 0; padding: 12px 14px;
  }
  .fz-cart-store-name { font-weight: 800; font-size: 14px; color: var(--fz-ink); margin-bottom: 8px;
                        display: flex; align-items: center; gap: 8px; }
  .fz-cart-store-name::before {
    content: ""; width: 18px; height: 18px; border-radius: 50%;
    background: var(--fz-primary); color: #fff; display: inline-grid; place-items: center;
    font-size: 11px;
  }
  .fz-cart-line {
    display: grid; grid-template-columns: 22px 88px 1fr; gap: 10px;
    padding: 10px 0; border-top: 1px solid var(--fz-line);
  }
  .fz-cart-line:first-of-type { border-top: 0; }
  .fz-cart-line .check {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--fz-primary); color: #fff;
    display: grid; place-items: center; font-size: 12px;
  }
  .fz-cart-line .check.off { background: #fff; border: 1.5px solid #C7C9CD; color: transparent; }
  .fz-cart-line img { width: 88px; height: 88px; border-radius: 10px; object-fit: cover;
                      background: var(--fz-soft); }
  .fz-cart-line .body { min-width: 0; }
  .fz-cart-line .name { font-size: 13px; color: var(--fz-ink);
                        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                        overflow: hidden; }
  .fz-cart-line .price { font-weight: 800; color: var(--fz-primary); margin-top: 4px; }
  .fz-cart-line .qty {
    margin-top: 6px; display: inline-flex; align-items: center; gap: 0;
    border: 1px solid var(--fz-line); border-radius: 999px; overflow: hidden;
  }
  .fz-cart-line .qty button { width: 28px; height: 24px; background: #fff; border: 0;
                              color: var(--fz-ink); font-size: 14px; }
  .fz-cart-line .qty span { padding: 0 10px; font-size: 13px; }

  /* Sticky checkout bar */
  .fz-cart-foot {
    position: fixed; left: 0; right: 0; bottom: 56px; /* sits above bottom nav */
    background: #fff; border-top: 1px solid var(--fz-line);
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    z-index: 998;
  }
  .fz-cart-foot .all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fz-ink); }
  .fz-cart-foot .all .check {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--fz-primary); color: #fff;
    display: grid; place-items: center; font-size: 12px;
  }
  .fz-cart-foot .total { flex: 1; }
  .fz-cart-foot .total .t { font-size: 16px; font-weight: 800; color: var(--fz-ink); }
  .fz-cart-foot .total .s { font-size: 12px; color: var(--fz-primary); }
  .fz-cart-foot .go {
    background: var(--fz-primary); color: #fff; font-weight: 800;
    padding: 10px 18px; border-radius: 999px; font-size: 14px;
    display: inline-flex; align-items: center; gap: 6px;
  }

  /* --------- Refreshed bottom nav (Home / Shop / Feed+ / Cart / Account) --------- */
  .mobile-bottom-nav {
    background: #fff !important;
    box-shadow: 0 -1px 6px rgba(0,0,0,.06) !important;
    border-top: 1px solid var(--fz-line) !important;
    height: 56px !important;
  }
  .mobile-bottom-nav-item .mobile-bottom-nav-icon { font-size: 19px !important; }
  .mobile-bottom-nav-item .mobile-bottom-nav-label { font-size: 11px !important; }
  .mobile-bottom-nav-item.active,
  .mobile-bottom-nav-item.active .mobile-bottom-nav-icon,
  .mobile-bottom-nav-item.active .mobile-bottom-nav-label { color: var(--fz-primary) !important; }

  /* The center "Feed" item — a big circular + button */
  .mobile-bottom-nav-item.center .mobile-bottom-nav-icon-wrapper {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--fz-primary); color: #fff;
    display: grid; place-items: center; margin-top: -16px;
    box-shadow: 0 6px 14px rgba(230,46,4,.35);
  }
  .mobile-bottom-nav-item.center .mobile-bottom-nav-icon { color: #fff !important; font-size: 22px !important; }
  .mobile-bottom-nav-item.center .mobile-bottom-nav-label { display: none !important; }

  /* Give the page room above the fixed bottom nav */
  body { padding-bottom: 60px; }
}

/* ============================================================
   Larger phones / small tablets fine-tune
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
  .fz-mgrid { grid-template-columns: repeat(2, 1fr); }
  .fz-cgrid { grid-template-columns: repeat(6, 1fr); }
}

/* ============================================================
   Mobile overlay: the .fz-mobile-only wrapper rendered inside
   each redesigned page (home/account/cart) takes over the
   viewport between the sticky header and the bottom nav so the
   underlying desktop layout is hidden on mobile.
   ============================================================ */
@media (max-width: 768px) {
  /* Wrap-level overlay: the FIRST .fz-mobile-only inside a redesigned page is the screen */
  .fz-mobile-only.fz-mobile-screen,
  body > .fz-mobile-only,
  .container > .fz-mobile-only,
  main > .fz-mobile-only,
  #main-content > .fz-mobile-only {
    position: fixed;
    top: 54px; left: 0; right: 0; bottom: 56px;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    z-index: 900;
  }

  /* Belt and braces: hide the legacy desktop containers we know exist on this site */
  .home-content, .home-hero, .feza-section,
  .feza-cat-showcase, .feza-cats, .feza-grid,
  .floating-cart, .site-footer, footer.site-footer,
  .desktop-header, .top-header, .ebay-top-header,
  .ebay-main-header, .ebay-nav-bar, .ebay-categories-bar,
  .container > .row > .col-md-3.sidebar,
  .breadcrumb-bar, .breadcrumbs { display: none !important; }
}
