/* ============================================================
   RANKHOSTZONE STORE - MOBILE / APP EXPERIENCE CSS
   Loaded only on screens < 768px. Gives the store a native
   mobile-app feel: bottom app bar, full-bleed hero, bottom
   purchase sheet, touch-friendly targets.
   ============================================================ */

@media (max-width: 768px) {

  body { font-size: 15px; }
  .container { width: 100%; padding: 0 16px; }
  html, body { max-width: 100%; overflow-x: hidden; }
  img, video, canvas, iframe { max-width: 100%; }

  /* ---------- App bottom bar ---------- */
  .app-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
    height: 62px; padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    box-shadow: 0 -8px 28px rgba(2, 132, 199, .12);
  }
  :root[data-theme='dark'] .app-bar { background: rgba(13, 27, 51, .94); }
  .app-bar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 600; color: var(--text-3); padding: 5px 6px;
    border-radius: 14px; transition: .3s; flex: 1; min-width: 0; max-width: 84px;
    text-decoration: none; white-space: nowrap;
  }
  .app-bar a .ab-icon { font-size: 20px; position: relative; }
  .app-bar a .ab-dot {
    position: absolute; top: -3px; right: -8px; min-width: 16px; height: 16px; padding: 0 3px;
    background: linear-gradient(135deg, #f43f5e, #ef4444); color: #fff;
    font-size: 9px; font-weight: 800; border-radius: 999px;
    display: grid; place-items: center; border: 1.5px solid #fff;
  }
  .app-bar a.active { color: var(--sky-600); }
  .app-bar a.active .ab-icon { transform: translateY(-2px) scale(1.12); }
  .app-bar .ab-home {
    margin-top: -26px; background: var(--grad); color: #fff !important;
    width: 56px; height: 56px; border-radius: 50% !important; padding: 0 !important;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(14, 165, 233, .45); flex: none;
  }
  .app-bar .ab-home .ab-icon { font-size: 23px; }
  .app-bar .ab-home span { display: none; }
  :root[data-theme='dark'] .app-bar a .ab-dot { border-color: #0d1b33; }

  body { padding-bottom: 74px; }

  /* ---------- Announcement ---------- */
  .announce { font-size: 12px; padding: 7px 34px 7px 12px; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .announce .close-announce { right: 8px; top: 50%; transform: translateY(-50%); }

  /* ---------- Navbar (mobile) ---------- */
  .navbar { height: 60px; }
  .nav-inner { height: 60px; }
  .brand img { height: 34px; }
  .brand { font-size: 16px; }
  .brand small { font-size: 8.5px; letter-spacing: 1.6px; }
  .hamburger { display: block; }
  .nav-links {
    position: fixed; top: 0; right: -100%; bottom: 0; z-index: 110;
    width: min(320px, 84vw); background: var(--surface);
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 84px 22px 30px; transition: right .45s cubic-bezier(.2,.9,.3,1);
    box-shadow: -20px 0 60px rgba(2, 132, 199, .18);
    overflow-y: auto;
  }
  :root[data-theme='dark'] .nav-links { box-shadow: -20px 0 60px rgba(0,0,0,.6); }
  .nav-links { right: -100%; }
  .nav-links.open { right: 0; }
  .hide-desktop { display: block; }
  .nav-links a {
    padding: 14px 16px; border-radius: 12px; font-size: 16px;
    display: flex; align-items: center; gap: 12px;
  }
  .nav-links a::after { display: none; }
  .nav-links a:hover, .nav-links a.active { background: var(--sky-100); color: var(--sky-700); }
  :root[data-theme='dark'] .nav-links a:hover, :root[data-theme='dark'] .nav-links a.active { background: #12304f; color: #7dd3fc; }
  .nav-links a i { width: 24px; text-align: center; }
  .nav-drawer-close {
    position: absolute; top: 18px; right: 18px; width: 38px; height: 38px;
    border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 16px; color: var(--text-2);
  }
  .drawer-backdrop {
    position: fixed; inset: 0; z-index: 105; background: rgba(4, 12, 30, .5);
    backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: .4s;
  }
  .drawer-backdrop.show { opacity: 1; visibility: visible; }
  .nav-actions { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; font-size: 16px; }
  .theme-toggle .track { width: 52px; height: 28px; }
  .theme-toggle .thumb { width: 22px; height: 22px; top: 3px; left: 3px; font-size: 12px; }
  .theme-toggle input:checked + .track .thumb { left: 27px; }
  .hide-mob { display: none !important; }

  /* ---------- Hero ---------- */
  .hero { min-height: auto; padding: 0; }
  .hero-inner { padding: 40px 0 52px; gap: 26px; }
  .hero h1 { font-size: 28px; letter-spacing: -.5px; }
  .hero p.lead { font-size: 15px; }
  .hero-badge { font-size: 11px; padding: 6px 12px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; max-width: 340px; margin: 0 auto; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 10px; width: 100%; justify-items: center; }
  .stat { align-items: center; }
  .stat .num { font-size: 21px; }
  .stat .lbl { font-size: 11px; text-align: center; }

  /* 3D code visual */
  .hero-visual { height: auto; min-height: 330px; padding: 10px 0; perspective: 900px; }
  .code-3d { max-width: 340px; }
  .code-3d-inner { transform: rotateX(10deg) rotateY(-12deg) rotateZ(1deg); }
  .cw-body { font-size: 11px; line-height: 1.85; padding: 12px 12px 16px; }
  .cw-title { font-size: 11px; }
  .code-float { padding: 9px 12px; gap: 8px; }
  .code-float .cf-icon { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
  .code-float b { font-size: 12px; }
  .code-float small { font-size: 10px; }
  .code-float.f-1 { left: 0; top: 22px; }
  .code-float.f-2 { right: 0; bottom: 38px; }
  .code-float.f-3 { bottom: -6px; left: 4%; }

  /* drawer account section */
  .drawer-divider { border-top: 1px dashed var(--border); margin: 10px 16px 6px; }

  /* ---------- Sections ---------- */
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 32px; }
  .section-head h2 { font-size: 24px; }
  .section-head p { font-size: 14px; }

  /* ---------- Cards ---------- */
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-card img { height: 96px; }
  .cat-card .cc-body { padding: 12px; }
  .cat-card h3 { font-size: 13.5px; }
  .cat-card p { display: none; }
  .cat-card .cc-arrow { display: none; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .prod-card .pc-body { padding: 12px; }
  .prod-card .pc-cat { font-size: 10px; }
  .prod-card h3 { font-size: 13.5px; margin-bottom: 4px; line-height: 1.3; }
  .prod-card .pc-desc { display: none; }
  .prod-card .price .now { font-size: 17px; }
  .prod-card .price .was { font-size: 11.5px; }
  .prod-card .btn-sm { padding: 8px 13px; font-size: 12px; }
  .wish-btn { width: 32px; height: 32px; font-size: 14px; }
  .badge { font-size: 9.5px; padding: 4px 9px; }

  /* ---------- Features / steps ---------- */
  .feat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .feat-card { padding: 22px 14px; }
  .feat-icon { width: 48px; height: 48px; font-size: 20px; border-radius: 13px; margin-bottom: 12px; }
  .feat-card h3 { font-size: 14px; }
  .feat-card p { font-size: 12px; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .testi-grid { grid-template-columns: 1fr; }

  /* ---------- CTA / newsletter ---------- */
  .cta-banner { padding: 38px 22px; }
  .newsletter { padding: 26px 20px; text-align: center; justify-content: center; }
  .news-form { flex-direction: column; max-width: 100%; }
  .news-form .btn { width: 100%; }

  /* ---------- Shop ---------- */
  .page-hero { padding: 44px 0 36px; }
  .page-hero h1 { font-size: 26px; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .chip-row { gap: 8px; }
  .chip { padding: 8px 14px; font-size: 12.5px; }
  .pagination a, .pagination span { min-width: 38px; height: 38px; }

  /* ---------- Product page ---------- */
  .pd-wrap { gap: 24px; padding-top: 22px; }
  .gallery-thumbs img { width: 62px; height: 48px; }
  .pd-info h1 { font-size: 21px; }
  .pd-desc { font-size: 14px; }
  .period-grid { grid-template-columns: repeat(2, 1fr); }
  .price-tabs { width: 100%; }
  .price-tab { flex: 1; padding: 10px 8px; font-size: 13px; }
  .pd-features { grid-template-columns: 1fr; }
  .pd-cta { flex-direction: column; }
  .pd-cta .btn { min-width: 0; }

  /* ---------- Sticky buy bar (product page) ---------- */
  .sticky-buy {
    position: fixed; bottom: 62px; left: 0; right: 0; z-index: 100;
    background: rgba(255, 255, 255, .95); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
    display: flex; align-items: center; gap: 12px;
    transform: translateY(100%); transition: transform .4s cubic-bezier(.2,.9,.3,1);
    box-shadow: 0 -10px 30px rgba(2, 132, 199, .15);
  }
  :root[data-theme='dark'] .sticky-buy { background: rgba(13, 27, 51, .96); }
  .sticky-buy.show { transform: none; }
  .sticky-buy .sb-price { display: flex; flex-direction: column; line-height: 1.2; }
  .sticky-buy .sb-price .now { font-size: 20px; font-weight: 800; color: var(--sky-700); }
  .sticky-buy .sb-price .per { font-size: 11px; color: var(--text-3); }
  .sticky-buy .btn { flex: 1; padding: 13px; }
  body.has-sticky-buy { padding-bottom: 148px; }

  /* ---------- Checkout ---------- */
  .form-row { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; border-radius: 16px; }
  .checkout-grid { gap: 18px; }

  /* ---------- Verify page ---------- */
  .verify-form { padding: 24px 18px; }
  .verify-form .btn { width: 100%; }

  /* ---------- Footer ---------- */
  .footer-top { grid-template-columns: 1fr; gap: 28px; padding: 44px 0 30px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-payments { justify-content: center; }

  /* ---------- Floats ---------- */
  .whatsapp-float { bottom: 84px; right: 16px; width: 46px; height: 46px; font-size: 22px; }
  #back-top { bottom: 82px; right: 16px; width: 42px; height: 42px; font-size: 16px; }

  /* ---------- Toasts ---------- */
  #toast-wrap { top: 70px; right: 12px; left: 12px; }
  .toast { min-width: 0; max-width: 100%; font-size: 13.5px; }

  /* ---------- Tables scroll on mobile ---------- */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }

  /* ---------- App-like micro-interactions ---------- */
  .prod-card:active, .cat-card:active, .feat-card:active { transform: scale(.97); }
  .btn:active { transform: scale(.95); }

  /* ---------- Landscape phones: restore 3-col products ---------- */
  @media (min-width: 500px) {
    .prod-grid { grid-template-columns: repeat(3, 1fr); }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
  }

  /* ---------- Very small screens (<= 400px) ---------- */
  @media (max-width: 400px) {
    .brand small { display: none; }
    .brand { font-size: 14.5px; }
    .user-menu { right: -40px; min-width: 200px; }
    .stat .num { font-size: 18px; }
    .pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 9px; }
  }
}
