/* ══════════════════════════════════════════
   Smart Zugdidi — Library Landing Mobile CSS
   /landing/library/assets/css/mobile.css
   ══════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Hero */
  .hero { min-height: auto; border-radius: 0 0 24px 24px; margin-bottom: 40px; }
  .hero-inner { padding: 52px 18px 44px; }
  .hero-btns { flex-direction: column; gap: 10px; }
  .hbtn { justify-content: center; width: 100%; }

  /* Stats bar */
  .stats-bar {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    border-radius: 12px;
  }
  .stat { border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); padding: 12px 8px; }
  .stat:nth-child(odd)         { border-right: 1px solid rgba(255,255,255,.1); }
  .stat:nth-last-child(-n+2)   { border-bottom: none; }
  .stat-n { font-size: 1.3rem; }
  .stat-l { font-size: .6rem; }

  /* Sections */
  .sec  { margin-bottom: 48px; }
  .wrap { padding: 0 18px; }

  /* About */
  .about-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .about-img img { height: 220px; }
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }

  /* ── BOOKSHELF ──
     მთლიანი .sec overflow hidden ვქნათ,
     shelf-wrap კი scrollable container გახდეს */
  .sec:has(.shelf-wrap) { overflow: hidden; }

  .shelf-wrap {
    padding: 16px 0 0;
    border-radius: 12px;
    overflow: hidden;            /* არ გადის გარეთ */
    position: relative;
  }

  /* თითოეული row — მასშტაბირება რომ ჩაეტიოს */
  .shelf-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0;
    padding: 10px 4px 0;
    transform-origin: bottom center;
    transform: scale(0.62);      /* მასშტაბი — მთლიანი row პატარავდება */
    margin-bottom: -62px;        /* კომპენსაცია scale-ის შემდეგ */
  }

  /* shelf board კომპენსაცია */
  .shelf-row::after {
    left: -60px;
    right: -60px;
  }

  .shelf-spacer { height: 14px; }

  /* bookend */
  .bend { width: 22px; min-height: 140px; }

  /* Filials */
  .filials-grid { grid-template-columns: 1fr !important; gap: 16px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .map-wrap { height: 260px !important; border-radius: 14px; }

  /* News */
  .news-grid { grid-template-columns: 1fr !important; gap: 16px; }

  /* Footer */
  .xlft-i { grid-template-columns: 1fr !important; gap: 24px; padding: 24px 18px !important; }
  .xlft-bot-i { flex-direction: column; text-align: center; padding: 12px 18px; gap: 6px; }
}

@media (max-width: 480px) {
  .hero-inner { padding: 44px 16px 36px; }
  .hero h1 { font-size: 1.75rem; line-height: 1.2; }
  .hero-sub { font-size: .88rem; }
  .badge-pill { font-size: .7rem; padding: 5px 12px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }

  /* პატარა ეკრანზე კიდევ უფრო პატარა */
  .shelf-row {
    transform: scale(0.5);
    margin-bottom: -90px;
  }
}

@media (max-width: 360px) {
  .shelf-row {
    transform: scale(0.42);
    margin-bottom: -110px;
  }
}