/* ═══════════════════════════════════════════
   АгроМаркет КРС — Mobile System v3
   ═══════════════════════════════════════════ */

/* ── BOTTOM NAV ── */
.mob-nav{display:none;position:fixed;bottom:0;left:0;right:0;height:56px;background:#fff;border-top:1px solid #e5e5e5;z-index:900;padding-bottom:env(safe-area-inset-bottom)}
.mob-nav-inner{display:flex;height:100%;max-width:500px;margin:0 auto}
.mob-nav-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;text-decoration:none;color:#999;-webkit-tap-highlight-color:transparent;position:relative}
.mob-nav-item svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.mob-nav-item span{font-size:10px;font-weight:500}
.mob-nav-item.active{color:#1a6b42}
.mob-nav-item.active svg{stroke-width:2}
.mob-nav-create{position:relative}
.mob-nav-create-btn{width:46px;height:46px;background:linear-gradient(135deg,#1a6b42,#27a865);border-radius:50%;display:flex;align-items:center;justify-content:center;margin-top:-18px;box-shadow:0 4px 14px rgba(26,107,66,.35)}
.mob-nav-create-btn svg{width:22px;height:22px;stroke:#fff;stroke-width:2.5}
.mob-nav-badge{position:absolute;top:2px;right:calc(50% - 16px);min-width:16px;height:16px;padding:0 4px;background:#dc2626;color:#fff;font-size:9px;font-weight:700;border-radius:8px;display:flex;align-items:center;justify-content:center}

/* ── MOBILE HEADER ── */
.mob-header{display:none;position:sticky;top:0;z-index:100;background:#fff;border-bottom:1px solid #eee;padding:8px 16px;align-items:center;gap:10px}
.mob-header-logo{display:flex;align-items:center;gap:8px;text-decoration:none}
.mob-header-logo-icon{width:30px;height:30px;background:#0f3d2e;border-radius:7px;display:flex;align-items:center;justify-content:center}
.mob-header-logo-icon svg{width:15px;height:15px;fill:none;stroke:#fff;stroke-width:1.8}
.mob-header-logo-name{font-family:'Geologica',sans-serif;font-weight:700;font-size:13px;color:#111}
.mob-header-actions{display:flex;gap:6px;margin-left:auto}
.mob-header-btn{width:34px;height:34px;border-radius:8px;border:1.5px solid #eee;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
.mob-header-btn svg{width:17px;height:17px;stroke:#555;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ── MOBILE SEARCH BAR ── */
.mob-search{display:none;padding:0 16px 10px;background:#fff}
.mob-search-input{width:100%;height:42px;border:1.5px solid #eee;border-radius:10px;padding:0 14px 0 38px;font-size:14px;font-family:'Inter',sans-serif;background:#f5f5f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat}
.mob-search-input:focus{outline:none;border-color:#1a6b42;background-color:#fff}

/* ── MOBILE CATEGORIES ── */
.mob-categories{display:none;padding:0 16px 14px;overflow-x:auto;-webkit-overflow-scrolling:touch;gap:8px;scrollbar-width:none}
.mob-categories::-webkit-scrollbar{display:none}
.mob-cat{flex-shrink:0;padding:8px 14px;background:#f3f3f3;border-radius:10px;font-size:13px;font-weight:500;color:#555;text-decoration:none;white-space:nowrap}

/* ── STICKY CTA ── */
.mob-sticky-cta{display:none;position:fixed;bottom:56px;left:0;right:0;padding:8px 16px;background:#fff;border-top:1px solid #eee;z-index:800;gap:8px;padding-bottom:env(safe-area-inset-bottom)}
.mob-btn{flex:1;height:46px;border:none;border-radius:10px;font-size:14px;font-weight:600;font-family:'Inter',sans-serif;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px}
.mob-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8}
.mob-btn-primary{background:#0f3d2e;color:#fff}
.mob-btn-secondary{background:#f3f3f3;color:#555}

/* ── BOTTOM SHEET ── */
.mob-sheet-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:950}
.mob-sheet-overlay.open{display:block}
.mob-sheet{position:fixed;bottom:0;left:0;right:0;background:#fff;border-radius:14px 14px 0 0;z-index:960;transform:translateY(100%);transition:transform .3s cubic-bezier(.32,.72,0,1);max-height:85vh;overflow-y:auto;padding-bottom:env(safe-area-inset-bottom)}
.mob-sheet.open{transform:translateY(0)}
.mob-sheet-handle{width:36px;height:4px;background:#ddd;border-radius:2px;margin:10px auto}
.mob-sheet-head{padding:4px 20px 14px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eee}
.mob-sheet-title{font-family:'Geologica',sans-serif;font-size:18px;font-weight:700}
.mob-sheet-close{width:32px;height:32px;border-radius:8px;border:none;background:#f3f3f3;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center}
.mob-sheet-body{padding:16px 20px}
.mob-sheet-group{margin-bottom:18px}
.mob-sheet-label{font-size:11px;font-weight:600;color:#999;text-transform:uppercase;letter-spacing:.4px;margin-bottom:8px}
.mob-sheet-chips{display:flex;flex-wrap:wrap;gap:6px}
.mob-sheet-chip{padding:8px 14px;border:1.5px solid #eee;border-radius:8px;font-size:13px;font-weight:500;color:#555;background:#fff;cursor:pointer;font-family:'Inter',sans-serif}
.mob-sheet-chip.active{border-color:#1a6b42;background:#eaf7f0;color:#1a6b42}
.mob-sheet-range{display:flex;gap:8px;align-items:center}
.mob-sheet-range input{flex:1;height:40px;border:1.5px solid #eee;border-radius:8px;padding:0 12px;font-size:13px;font-family:'Inter',sans-serif}
.mob-sheet-range input:focus{outline:none;border-color:#1a6b42}
.mob-sheet-submit{width:100%;height:48px;border:none;border-radius:12px;background:#0f3d2e;color:#fff;font-size:15px;font-weight:600;font-family:'Inter',sans-serif;cursor:pointer;margin-top:8px}

/* ── AUTH PROMPT MODAL ── */
.mob-auth-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:970;align-items:flex-end;justify-content:center}
.mob-auth-overlay.open{display:flex}
.mob-auth-sheet{background:#fff;border-radius:16px 16px 0 0;padding:32px 24px 24px;width:100%;max-width:500px;text-align:center;padding-bottom:calc(24px + env(safe-area-inset-bottom))}
.mob-auth-icon{width:56px;height:56px;background:#eaf7f0;border-radius:16px;display:flex;align-items:center;justify-content:center;margin:0 auto 16px}
.mob-auth-icon svg{width:28px;height:28px;stroke:#1a6b42;fill:none;stroke-width:1.8}
.mob-auth-title{font-family:'Geologica',sans-serif;font-size:20px;font-weight:800;margin-bottom:8px}
.mob-auth-sub{font-size:14px;color:#888;margin-bottom:20px;line-height:1.5}
.mob-auth-features{display:flex;flex-direction:column;gap:8px;text-align:left;margin-bottom:24px}
.mob-auth-feat{display:flex;align-items:center;gap:10px;font-size:14px;color:#444}
.mob-auth-feat svg{width:18px;height:18px;stroke:#1a6b42;fill:none;stroke-width:2;flex-shrink:0}
.mob-auth-btn{width:100%;height:50px;border:none;border-radius:12px;background:#0f3d2e;color:#fff;font-size:16px;font-weight:600;font-family:'Inter',sans-serif;cursor:pointer;margin-bottom:10px}
.mob-auth-link{font-size:13px;color:#888}
.mob-auth-link a{color:#1a6b42;font-weight:600;text-decoration:none}

/* ══════════════════════════════════════
   BREAKPOINT ≤768px
   ══════════════════════════════════════ */
@media(max-width:768px){
  .mob-nav{display:flex}
  .mob-header{display:flex}
  .mob-search{display:block}
  .mob-categories{display:flex}
  body{padding-bottom:64px!important}

  /* ── FORCE HIDE desktop navbar on ALL pages ── */
  nav.navbar,
  .navbar,
  .topbar,
  nav:not([class]),
  header nav{display:none!important;height:0!important;overflow:hidden!important;visibility:hidden!important}
  
  /* analytics.html has plain <nav> */
  body > nav:first-of-type{display:none!important}

  /* ── HERO ── */
  .hero{height:auto!important;min-height:auto!important;flex-direction:column!important;position:relative!important}
  .hero-bg{position:relative!important;height:180px!important;animation:none!important}
  .hero-overlay{background:linear-gradient(0deg,rgba(10,34,24,.95) 0%,rgba(10,34,24,.3) 60%,transparent)!important}
  .hero-content{position:relative!important;background:#0a2218!important;padding:20px 16px 24px!important}
  .hero-inner{max-width:100%!important}
  .hero-title{font-size:24px!important;line-height:1.15!important;letter-spacing:-.5px!important}
  .hero-subtitle,.hero-sub{font-size:12px!important;margin-bottom:14px!important;opacity:.7!important}
  .hero-badge{display:none!important}
  .hero-search{flex-direction:column!important;gap:8px!important}
  .hero-search input{height:44px!important;font-size:14px!important;width:100%!important;border-radius:10px!important}
  .hero-search select{height:40px!important;width:100%!important;border-radius:8px!important}
  .search-div,.hero-search .divider{display:none!important}
  .search-btn,.hero-search button[type="submit"]{height:44px!important;width:100%!important;border-radius:10px!important}
  .hero-cats{overflow-x:auto!important;flex-wrap:nowrap!important;gap:8px!important;scrollbar-width:none!important}
  .hero-cats::-webkit-scrollbar{display:none}
  .hero-cat{flex-shrink:0!important;font-size:12px!important;padding:6px 12px!important}

  /* ── STATS ── */
  .stats{padding:12px 0!important}
  .stats-inner{display:grid!important;grid-template-columns:1fr 1fr!important;gap:0!important;padding:0!important}
  .stat-item{padding:12px 16px!important;border-right:1px solid rgba(0,0,0,.06)!important;border-bottom:1px solid rgba(0,0,0,.06)!important}
  .stat-item:nth-child(2n){border-right:none!important}
  .stat-num,.stat-item strong,.stat-value{font-size:22px!important}

  /* ── SECTIONS ── */
  section{padding:24px 0!important}
  .section-head{padding:0 16px!important;margin-bottom:14px!important}

  /* ── CATEGORIES GRID → horizontal scroll ── */
  .cat-grid{display:flex!important;overflow-x:auto!important;gap:10px!important;padding:0 16px 8px!important;scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;scroll-snap-type:x mandatory!important}
  .cat-grid::-webkit-scrollbar{display:none}
  .cat-card{flex:0 0 70%!important;min-width:220px!important;height:150px!important;scroll-snap-align:start!important}

  /* ══ LISTINGS — AVITO MOBILE STYLE ══ */
  #listings-grid,
  #catalog-grid,
  .listings-grid{
    display:flex!important;flex-direction:column!important;gap:10px!important;padding:0 16px!important
  }
  .listing-card{
    display:flex!important;flex-direction:row!important;
    border-radius:12px!important;overflow:hidden!important;
    height:auto!important;min-height:auto!important;max-height:none!important;
    box-shadow:0 1px 4px rgba(0,0,0,.06)!important
  }
  .lc-photo{
    width:125px!important;min-width:125px!important;max-width:125px!important;
    height:125px!important;aspect-ratio:unset!important;
    border-radius:0!important;flex-shrink:0!important;overflow:hidden!important
  }
  .lc-photo img{
    width:125px!important;height:125px!important;
    object-fit:cover!important;display:block!important
  }
  .lc-body{
    padding:10px 12px!important;flex:1!important;min-width:0!important;
    display:flex!important;flex-direction:column!important;justify-content:center!important;
    gap:2px!important
  }
  .lc-title{font-size:13px!important;line-height:1.3!important;margin-bottom:0!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
  .lc-price{font-size:16px!important;font-weight:700!important;margin:2px 0!important}
  .lc-price-per{font-size:11px!important}
  .lc-meta{font-size:11px!important;gap:4px!important;margin-top:2px!important;flex-wrap:wrap!important}
  .lc-meta span{font-size:10px!important}
  .lc-footer{padding:4px 0 0!important;border:none!important}
  .lc-footer-seller{font-size:11px!important}
  .lc-badges{top:4px!important;left:4px!important;gap:2px!important}
  .lc-badges span{font-size:8px!important;padding:2px 5px!important;border-radius:3px!important}
  .lc-fav{top:4px!important;right:4px!important;width:26px!important;height:26px!important}
  .lc-fav svg{width:13px!important;height:13px!important}

  /* ── HOW IT WORKS ── */
  .how-flow{display:flex!important;flex-direction:column!important;gap:10px!important;padding:0 16px!important}
  .step-arrow,.how-arrow{display:none!important}

  /* ── ADVANTAGES ── */
  .why-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;padding:0 16px!important}
  .why-card{padding:14px!important}
  .why-num{font-size:26px!important}

  /* ── FARMS → horizontal scroll ── */
  .farms-grid{display:flex!important;overflow-x:auto!important;gap:12px!important;padding:0 16px!important;scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important}
  .farms-grid::-webkit-scrollbar{display:none}
  .farm-card{flex:0 0 260px!important;min-width:260px!important;scroll-snap-align:start!important}

  /* ── REVIEWS → swipe ── */
  .reviews-grid{display:flex!important;overflow-x:auto!important;scroll-snap-type:x mandatory!important;gap:12px!important;padding:0 16px!important;scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important}
  .reviews-grid::-webkit-scrollbar{display:none}
  .review-card{flex:0 0 270px!important;min-width:270px!important;scroll-snap-align:start!important}

  /* ── ANALYTICS (on index) ── */
  .analytics{padding:28px 0!important}
  .analytics-inner{padding:0 16px!important}
  .an-grid{grid-template-columns:1fr!important;gap:10px!important}
  .an-grid-2{grid-template-columns:1fr!important;gap:10px!important}
  .an-header{flex-direction:column!important;align-items:flex-start!important;gap:10px!important}
  .an-title{font-size:20px!important}
  .an-card{padding:16px!important}
  .price-big{font-size:26px!important}
  .an-cta{flex-direction:column!important}
  .an-cta-btn{width:100%!important;justify-content:center!important}

  /* ── FOOTER ── */
  .footer-grid{display:flex!important;flex-direction:column!important;gap:16px!important}

  /* ── CTA SECTIONS ── */
  .cta-section,.big-cta{padding:28px 16px!important}
  .cta-title{font-size:20px!important}

  /* ── CATALOG PAGE ── */
  .catalog-sidebar,.filters-sidebar{display:none!important}
  .catalog-main,.catalog-content{width:100%!important;padding:0!important}
  .mob-filter-btn{display:flex!important}

  /* ── ANIMAL PAGE ── */
  .mob-sticky-cta{display:flex!important}

  /* ── DASHBOARD ── */
  .dash-sidebar,.dashboard-sidebar{display:none!important}
  .dash-content,.dashboard-content{margin-left:0!important;width:100%!important}

  /* ── ANALYTICS PAGE ── */
  .hero-insight{border-radius:0!important;padding:24px 16px!important}
  .hero-title{font-size:22px!important}
  .page{padding:0 16px 48px!important}
  .grid-3{grid-template-columns:1fr!important;gap:10px!important}
  .grid-4{grid-template-columns:1fr 1fr!important;gap:10px!important}
  .grid-2{grid-template-columns:1fr!important;gap:10px!important}
  .grid-main{grid-template-columns:1fr!important;gap:10px!important}
  .index-val{font-size:32px!important}
  .metric-big{font-size:24px!important}
  .chart-area{height:180px!important}
}

@media(max-width:380px){
  .mob-nav{height:52px}
  .mob-nav-create-btn{width:42px;height:42px;margin-top:-14px}
  body{padding-bottom:60px!important}
  .lc-photo,.lc-photo img{width:105px!important;min-width:105px!important;max-width:105px!important;height:105px!important}
}
