/* ---- Floating WhatsApp chat button (all screens) ---- */
.float-whatsapp {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s var(--ease);
}

.float-whatsapp:hover {
  transform: scale(1.08);
}

/* ---- Bottom app-style navigation (phones/tablets only) ---- */
.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  body {
    padding-bottom: 64px;
  }

  .mobile-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 16px rgba(11, 60, 120, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-nav a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
  }

  .mobile-nav a.is-active {
    color: var(--color-brand);
  }

  .mobile-nav__badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    min-width: 17px;
    height: 17px;
    padding-inline: 4px;
    border-radius: var(--radius-pill);
    background: var(--color-coral);
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .float-whatsapp {
    bottom: 76px;
    right: 12px;
    width: 48px;
    height: 48px;
  }

  /* product page has its own sticky add-to-cart bar instead */
  body.page-product .mobile-nav {
    display: none;
  }

  body.page-product {
    padding-bottom: 76px;
  }

  body.page-product .float-whatsapp {
    bottom: 88px;
  }
}

/* ---- Sticky buy bar on product pages (phones) ---- */
.buy-bar {
  display: none;
}

@media (max-width: 900px) {
  .buy-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--gutter);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 16px rgba(11, 60, 120, 0.1);
  }

  .buy-bar__price {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }

  .buy-bar__price small {
    font-size: 11px;
    color: var(--color-text-muted);
  }

  .buy-bar__price strong {
    font-family: var(--font-display);
    font-size: var(--font-size-md);
    color: var(--color-brand-dark);
  }

  .buy-bar .btn {
    flex: 1;
    max-width: 200px;
    padding-inline: var(--space-3);
  }
}

/* ---- Safety net: nothing may cause sideways scrolling on small screens ---- */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
svg,
video {
  max-width: 100%;
}

@media (max-width: 640px) {
  h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.6rem);
  }

  .section {
    padding-block: var(--space-5);
  }

  .data-table-wrap,
  .admin-table-wrap {
    overflow-x: auto;
  }
}
