:root{
  --bg: #ffffff;
  --text: #0b0b0c;
  --muted: #6b7280;

  --header: #0b0b0c;
  --header-text: #ffffff;

  --card: #ffffff;
  --card-border: rgba(0,0,0,.08);
  --shadow: 2px 2px 6px 2px rgba(0, 0, 0, 0.2);
  --shadow-small: 1px 1px 6px 1px rgba(0, 0, 0, 0.1);

  --pill-active: #f7c928;
  --pill-active-text: #111111;

  --danger: #dc3545;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-m: 14px;
  --radius-s: 12px;
  --radius-xs: 8px;

  --nav-h: 84px;
  --cartbar-h: 42px;
}

html { background: var(--header); min-height: 100vh; }
body { background: var(--bg); color: var(--text); min-height: 100vh; }
body { overflow-x: hidden; }

/* Prevent iOS zoom-on-focus for form controls */
input,
textarea,
select{
  font-size: 16px;
}

/* ---------- TOP NAVBAR ---------- */
.app-navbar{
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--header);
  color: var(--header-text);
  padding: 102px 0 6px;
}
body.no-tg .app-navbar{ padding: 12px 0; }
.brand-logo{ height: 36px; width: auto; display:block; }
.navbar-actions{ display:flex; align-items:center; gap:10px; }


/* ===== HEADER SWITCHER (DO NOT RENAME) ===== */
.segmented{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px;
  background: var(--bs-gray-900);
  border-radius: 999px;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.segmented .seg-pill{
  position: absolute;
  width: 50%;
  top: 0px;
  bottom: 0px;
  left: 0px;
  background: var(--bs-gray-dark);
  border-radius: 999px;
  transform: translateX(0%);
  transition: transform .22s ease;
  will-change: transform;
}
.segmented button{
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: #111;
  font-weight: 600;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.segmented button.active{ color: var(--bs-gray-dark); }
.segmented.is-disabled{
  background: var(--bs-gray-700);
  opacity: .9;
}
.segmented.is-disabled .seg-pill{
  background: var(--bs-gray-600);
}
.segmented.is-disabled button{
  color: #7a818a;
  cursor: default;
  pointer-events: none;
  opacity: .9;
}
.segmented.is-disabled button.active{
  color: #5f6670;
}
.segmented.is-disabled img{
  filter: grayscale(1);
}

.flag-emoji{ height: 22px; width: 22px; }
.flag-emoji-img{ height:100%; width:auto; display:block; }

.support-btn{
  color: grey;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: var(--bs-gray-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, background .12s ease;
}
.support-btn:active{ transform: scale(.98); }

/* ---------- Bottom nav (same as homepage) ---------- */
.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0,0,0,.08);
  padding-bottom: 20px;
}
body.no-tg .bottom-nav{ padding-bottom: 0; height: 64px; }
body.no-tg .bottom-nav .nav-inner{ height: 64px; align-items: center; }
body.keyboard-open .bottom-nav{
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}
.bottom-nav .nav-inner{
  height: var(--nav-h);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  max-width: 560px;
  margin: 0 auto;
}
.bn-item{
  position: relative;
  width: 64px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,.55);
  text-decoration: none;
  transition: background .15s ease, transform .12s ease, color .15s ease;
}
.bn-item i{ font-size: 1.5rem; }
.bn-item .bn-cart-icon{
  display: inline-block;
  margin-bottom: .16rem;
  width: 1.6rem;
  height: 1.6rem;
  background-color: currentColor;
  -webkit-mask: url('/static/images/icons/cart.svg') no-repeat center / contain;
  mask: url('/static/images/icons/cart.svg') no-repeat center / contain;
}
.bn-item.active{ color: #111; }
.bn-item:active{ transform: scale(.98); }
.bn-badge{
  position: absolute;
  top: 6px;
  right: 12px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pill-active);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.container-narrow{ max-width: 100%; }

/* ===== NARROW PAGE LAYOUT (profile, order, cart, etc.) ===== */
.page-wrap-narrow{
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.mt-2r{
  margin-top: 2rem !important;
}

.mb-2r{
  margin-bottom: 2rem !important;
}

.mt-23{
  margin-top: .75rem !important;
}

.mb-23{
  margin-bottom: .75rem !important;
}

/* ===== AUTH MODAL ===== */
.auth-overlay{
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.auth-overlay.is-open{
  opacity: 1;
  pointer-events: all;
}
.auth-sheet{
  background: #fff;
  border-radius: 28px;
  width: 100%;
  max-width: 400px;
  min-height: 420px;
  padding: 24px 24px 32px;
  display: flex;
  flex-direction: column;
  transform: scale(.95) translateY(12px);
  transition: transform .25s cubic-bezier(.25,.8,.25,1);
}
.auth-overlay.is-open .auth-sheet{
  transform: scale(1) translateY(0);
}
.auth-sheet-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.auth-title{
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.auth-state{ flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.auth-state--hidden{ display: none; }
.auth-methods{
  display: flex;
  gap: 28px;
  justify-content: center;
  padding: 12px 0 8px;
}
.auth-method-btn{
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.auth-method-icon{
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.auth-method-icon--email{ background: #fff7d6; color: #f7c928; }
.auth-method-icon--tg{ background: #29a9eb; }
.auth-method-label{
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  color: #333;
  line-height: 1.35;
  text-transform: lowercase;
}
.auth-input{
  width: 100%;
  border: 1.5px solid #e0e0e0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.auth-input:focus{ border-color: #f7c928; }
.auth-hint{
  font-size: .9rem;
  color: #444;
  line-height: 1.5;
  margin: 0;
}
.auth-error{
  color: var(--danger);
  font-size: .82rem;
  min-height: 18px;
}
/* ===== SHARED PRIMARY BUTTON ===== */
.btn-primary-big{
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  background: var(--pill-active);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary-big:active{ transform: scale(.995); }
.btn-primary-big[disabled],
.btn-primary-big:disabled{ opacity: .65; pointer-events: none; }

/* ===== SHARED CLOSE BUTTON ===== */
.close-btn{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  background: #fff;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  text-decoration: none;
  cursor: pointer;
  flex: 0 0 auto;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.close-btn:active{ transform: scale(.99); }
.close-btn i{ font-size: 1.45rem; font-weight: 700; }
