/* Phone shell — header, drawer, floating bottom nav, search sheet, compact footer.
   Measurements follow the 393px mobile-app artboards (24px side padding). */

:root {
  --be-m-pad: 24px;
  --be-m-col: 480px;
  --be-m-nav-clearance: calc(120px + env(safe-area-inset-bottom, 0px));
}

body.be-m {
  padding-bottom: var(--be-m-nav-clearance);
}

.be-m-wrap {
  width: 100%;
  max-width: var(--be-m-col);
  margin: 0 auto;
  padding: 0 var(--be-m-pad);
}

/* ---------- Header ---------- */
.be-mh {
  position: relative;
  z-index: 20;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 28px;
}

.be-mh::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/ui/mobile-header-curve.svg") center bottom / 100% 100% no-repeat;
  z-index: -1;
}

.be-mh__promo {
  margin: calc(-12px - env(safe-area-inset-top, 0px)) 0 12px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 6px;
  background: var(--be-maroon);
  color: var(--be-canvas);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}

.be-mh__row {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.be-mh__avatar {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.be-mh__photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  -webkit-mask: url("../img/ui/frame-mask.png") center / 100% 100% no-repeat;
  mask: url("../img/ui/frame-mask.png") center / 100% 100% no-repeat;
  background: #f6d9cf;
  font-family: var(--be-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--be-ink);
}

.be-mh__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.be-mh__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.be-mh__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.be-mh__greet {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--be-ink-60);
}

.be-mh__name {
  overflow: hidden;
  font-family: var(--be-font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--be-ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.be-mh__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.be-mh__icon {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #793444;
}

.be-mh__icon svg {
  width: 24px;
  height: 24px;
}

.be-mh__icon--cart {
  background: var(--be-white);
  outline: 1.5px solid #ffe5e0;
  color: var(--be-maroon);
}

/* Inner-page variant: back button + title instead of greeting */
.be-mh__back {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--be-blush);
  border-radius: 16px;
  background: var(--be-white);
  color: var(--be-ink);
}

.be-mh__back svg {
  width: 20px;
  height: 20px;
}

.be-mh__title {
  overflow: hidden;
  font-family: var(--be-font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.be-mh__subtitle {
  font-size: 12px;
  line-height: 16px;
  color: var(--be-ink-60);
}

/* ---------- Floating bottom nav ---------- */
.be-mnav {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  width: calc(100% - 2 * var(--be-m-pad));
  max-width: 432px;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.be-mnav__pill {
  flex: 1;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 8px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.be-mnav__item {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--be-muted);
}

.be-mnav__item svg {
  width: 24px;
  height: 24px;
}

.be-mnav__item span {
  display: none;
  font-size: 14px;
  font-weight: 600;
}

.be-mnav__item.is-active {
  width: auto;
  padding: 0 16px;
  background: var(--be-blush);
  color: var(--be-coral);
}

.be-mnav__item.is-active span {
  display: inline;
}

.be-mnav__item .be-badge {
  top: 6px;
  right: 6px;
}

.be-mnav__circle {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  color: #a48c85;
}

.be-mnav__circle.is-active {
  color: var(--be-coral);
}

/* ---------- Drawer ---------- */
.be-drawer {
  position: fixed;
  inset: 0;
  z-index: 999;
  visibility: hidden;
  pointer-events: none;
}

.be-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.be-drawer__dim {
  position: absolute;
  inset: 0;
  background: rgba(26, 10, 15, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.be-drawer.is-open .be-drawer__dim {
  opacity: 1;
}

.be-drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 96%;
  max-width: 377px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0 40px 40px 0;
  background: var(--be-canvas);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.be-drawer.is-open .be-drawer__panel {
  transform: translateX(0);
}

.be-drawer__top {
  position: relative;
  padding: calc(32px + env(safe-area-inset-top, 0px)) 20px 8px;
  text-align: center;
}

.be-drawer__close {
  position: absolute;
  left: 24px;
  top: calc(24px + env(safe-area-inset-top, 0px));
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--be-blush);
  border-radius: 50%;
  background: #fff5f3;
  color: var(--be-coral);
}

.be-drawer__logo {
  width: 140px;
  height: auto;
  margin: 4px auto 0;
}

.be-drawer__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 24px 40px;
}

.be-drawer__arch {
  margin: 24px -24px 0;
  padding: 40px 20px 24px;
  border-radius: 160px 160px 0 0;
  background: var(--be-white);
  text-align: center;
}

.be-drawer__avatar {
  width: 104px;
  height: 104px;
  margin: 0 auto 12px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7ce68 0%, #fbab7e 100%);
}

.be-drawer__avatar > * {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  background: #f6d9cf;
  font-family: var(--be-font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--be-ink);
}

.be-drawer__name {
  margin-bottom: 4px;
  font-family: var(--be-font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

.be-drawer__profile-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: var(--be-coral);
}

.be-drawer__stats {
  display: flex;
  justify-content: space-between;
  margin: 0 16px 8px;
}

.be-drawer__stat span {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--be-muted);
}

.be-drawer__stat strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  color: var(--be-ink-60);
}

.be-drawer__auth {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.be-drawer__wavy {
  height: 12px;
  margin: 24px 0;
  opacity: 0.6;
  background-image:
    radial-gradient(circle at 10px -5px, transparent 12px, #f4e8df 13px, #f4e8df 14px, transparent 15px),
    radial-gradient(circle at 10px 17px, #f4e8df 12px, transparent 13px);
  background-size: 20px 24px;
  background-repeat: repeat-x;
}

.be-drawer__section {
  margin: 24px 0 12px;
  font-size: 12px;
  line-height: 16px;
  color: var(--be-ink-soft);
}

.be-drawer__card {
  padding: 0 20px;
  border-radius: 24px;
  background: var(--be-white);
}

.be-drawer__link,
.be-drawer__acc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dotted #eaeaea;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  color: var(--be-ink);
  cursor: pointer;
  list-style: none;
}

.be-drawer__acc > summary::-webkit-details-marker {
  display: none;
}

.be-drawer__acc > summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.be-drawer__acc[open] > summary svg {
  transform: rotate(180deg);
}

.be-drawer__sub {
  padding: 0 0 8px 8px;
  border-bottom: 1px dotted #eaeaea;
}

.be-drawer__sub a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--be-ink-soft);
}

.be-drawer__sub a svg {
  width: 12px;
  height: 12px;
  color: var(--be-coral);
}

.be-drawer__card > :last-child,
.be-drawer__card > .be-drawer__acc:last-child > summary {
  border-bottom: 0;
}

.be-drawer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dotted #eaeaea;
}

.be-drawer__row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.be-drawer__row-left > svg {
  width: 20px;
  height: 20px;
  color: #4a1f2c;
  flex-shrink: 0;
}

.be-drawer__row strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
}

.be-drawer__row small {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--be-muted);
}

.be-drawer__go {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff5f3;
  color: var(--be-coral);
}

.be-drawer__go svg {
  width: 14px;
  height: 14px;
}

.be-drawer__logout {
  width: 100%;
  margin: 24px 0 16px;
  padding: 8px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  color: var(--be-coral);
}

.be-drawer__goose {
  width: 120px;
  margin: 8px auto 0;
  opacity: 0.9;
}

/* ---------- Search sheet ---------- */
.be-msearch {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--be-canvas);
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.be-msearch.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.be-msearch__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--be-m-pad) 12px;
}

.be-msearch__bar .be-field {
  min-height: 52px;
}

.be-msearch__bar .be-field svg {
  width: 20px;
  height: 20px;
  color: var(--be-muted);
  flex-shrink: 0;
}

.be-msearch__body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--be-m-pad) 24px;
}

.be-msearch__body .be-suggest {
  position: static;
  max-height: none;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.be-msearch__hint {
  padding: 8px 4px;
  font-size: 13px;
  color: var(--be-muted);
}

.be-msearch__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- Compact footer ---------- */
.be-mf {
  position: relative;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px dotted var(--be-blush-line);
}

.be-mf__logo {
  width: 180px;
  height: auto;
}

.be-mf__contact {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.be-mf__contact a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.be-mf__contact svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.be-mf__groups {
  margin-top: 20px;
}

.be-mf__group {
  border-bottom: 1px dotted var(--be-blush-line);
}

.be-mf__group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.be-mf__group > summary::-webkit-details-marker {
  display: none;
}

.be-mf__group > summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.be-mf__group[open] > summary svg {
  transform: rotate(180deg);
}

.be-mf__group ul {
  display: grid;
  gap: 10px;
  padding: 0 0 16px;
}

.be-mf__group a {
  font-size: 13px;
  color: var(--be-ink-soft);
}

.be-mf__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  line-height: 18px;
  color: var(--be-muted);
}

.be-mf__meta a {
  text-decoration: underline;
}

.be-mf__landscape {
  height: 96px;
  margin: 16px calc(-1 * var(--be-m-pad)) 0;
  background: url("../img/ui/footer-art.webp") left bottom / cover no-repeat;
}
