/**
 * public/assets/css/mobile.css v3
 * Mobile styles — bottom nav, bottom sheet, responsive resets
 */

:root {
  --mob-bar-h:   56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

/* ══ Global Mobile Resets ════════════════════════ */
@media (max-width: 860px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  body {
    margin-inline-start: 0 !important;
    margin-left: 0 !important;
    padding-bottom: calc(var(--mob-bar-h) + var(--safe-bottom) + 4px) !important;
  }
  img, video, iframe { max-width: 100%; height: auto; }
  table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  input, select, textarea { font-size: max(16px, 1em) !important; }
  a, button { -webkit-tap-highlight-color: rgba(13,148,136,.12); }
  body.sb-body-lock { overflow: hidden; position: fixed; width: 100%; }
}

/* ══ Bottom Nav Bar ══════════════════════════════ */
.mob-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  inset-inline-start: 0; inset-inline-end: 0;
  z-index: 900;
  height: calc(var(--mob-bar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--card-solid, #fff);
  border-top: 1px solid var(--border, #e5e7eb);
  align-items: stretch;
  justify-content: space-around;
  box-shadow: 0 -2px 20px rgba(0,0,0,.06);
}
/* Chrome Android: ensure minimum bottom padding even when safe-area is 0 */
@supports (padding: max(0px)) {
  .mob-bar {
    padding-bottom: max(var(--safe-bottom), 6px);
    height: calc(var(--mob-bar-h) + max(var(--safe-bottom), 6px));
  }
}
@media (max-width: 860px) {
  @supports (padding: max(0px)) {
    body { padding-bottom: calc(var(--mob-bar-h) + max(var(--safe-bottom), 6px) + 4px) !important; }
  }
}

.mob-bar-i {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  gap: 2px; text-decoration: none;
  color: var(--text3, #94a3b8);
  font-size: 10px; font-weight: 600; letter-spacing: .2px;
  padding: 6px 4px; flex: 1;
  border: none; cursor: pointer; font-family: inherit;
  background: none; position: relative;
  transition: color .15s;
}
.mob-bar-i span:first-child {
  font-size: 20px; line-height: 1;
  transition: transform .2s;
  display: flex; align-items: center; justify-content: center;
}
.mob-bar-i span:first-child svg {
  width: 22px; height: 22px;
  stroke: currentColor;
  transition: transform .2s;
}
.mob-bar-i.act {
  color: var(--accent, #0d9488);
}
.mob-bar-i.act::after {
  content: '';
  position: absolute; top: 0; left: 25%; right: 25%;
  height: 2.5px; border-radius: 0 0 2px 2px;
  background: var(--accent, #0d9488);
}
.mob-bar-i.act span:first-child {
  transform: scale(1.1);
}
.mob-bar-i:active {
  color: var(--accent, #0d9488);
}
.mob-bar-i:active span:first-child {
  transform: scale(.92);
}

/* ══ Bottom Sheet ════════════════════════════════ */
.mob-bar-sheet {
  display: none;
  position: fixed;
  bottom: calc(var(--mob-bar-h) + var(--safe-bottom));
  left: 0; right: 0;
  inset-inline-start: 0; inset-inline-end: 0;
  background: var(--card-solid, #fff);
  border-top: 1px solid var(--border, #e5e7eb);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 16px;
  z-index: 901;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s linear .28s;
  box-shadow: 0 -4px 30px rgba(0,0,0,.08);
}
.mob-bar-sheet.open {
  display: block;
  transform: translateY(0);
  visibility: visible;
  transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s;
}

.mob-sheet-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.mob-sheet-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 6px; border-radius: 12px;
  border: 1.5px solid var(--border, #e5e7eb);
  text-decoration: none;
  color: var(--text2, #64748b);
  font-size: 11px; font-weight: 600;
  text-align: center;
  background: var(--bg2, #f8fafc);
  transition: all .15s;
}
.mob-sheet-item:hover,
.mob-sheet-item.act {
  border-color: var(--accent, #0d9488);
  color: var(--accent, #0d9488);
  background: var(--accent-bg, rgba(13,148,136,.06));
}
.mob-sheet-item span:first-child { font-size: 20px; }

.mob-overlay {
  display: none; position: fixed; inset: 0; z-index: 899;
  background: rgba(0,0,0,.3);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mob-overlay.open { display: block; }

/* ══ Show/Hide ══════════════════════════════════ */
@media (max-width: 860px) {
  .mob-bar { display: flex !important; }
}
@media (min-width: 861px) {
  .mob-bar, .mob-bar-sheet, .mob-overlay { display: none !important; }
}

/* ══ Grids ══════════════════════════════════════ */
@media (max-width: 768px) {
  .feat-grid, .places-grid { grid-template-columns: 1fr 1fr !important; }
  .sbar-in { grid-template-columns: repeat(2,1fr); }
  .si::after { display: none; }
  .nav-r .nl { display: none; }
}
@media (max-width: 480px) {
  .feat-grid, .places-grid { grid-template-columns: 1fr !important; }
}

/* ══ Utilities ══════════════════════════════════ */
@media (max-width: 860px) {
  .hide-mob { display: none !important; }
  .show-mob { display: block !important; }
}
@media (min-width: 861px) {
  .hide-desk { display: none !important; }
  .show-desk { display: block !important; }
}
