@font-face {
    font-family: "AppFont";
    src: url("fonts/Montserrat-Bold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "AppFont";
    src: url("fonts/Montserrat-Light.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
}

* {  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "AppFont", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-color: transparent !important;
}

body {
    background: #ffffff;
    color: #000000;
    font-family: "AppFont", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html, body {  height: 100%;
  margin: 0;
  background: var(--bw-bg) !important;
  color: var(--bw-text) !important;
}

/* Скролл гасим только когда реально надо (например, при открытой модалке) */
body.no-scroll,
html.no-scroll {
    overflow: hidden;
}


/* ВАЖНО:
   100lvh = "large viewport height" (не уменьшается при клавиатуре),
   fallback на 100vh для старых движков */
#app{  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
@supports (height: 100lvh){
    #app{ height: 100lvh; }
}

/* скролл только внутри контента */
#mainContent{  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  padding: 10px 10px calc(72px + env(safe-area-inset-bottom, 0px));
}



.top-header {
    position: relative;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    border-bottom: none;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
}

.logo{
    width: 100%;
    display: flex;
    justify-content: center;
}



.logo img {
    height: 45px;
    display: block;
    object-fit: contain;
}



.search-wrapper {
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #f5f5f5;
    color: #000000;
}

.search-wrapper input::placeholder {
    color: rgba(0,0,0,0.4);
}



.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.products-list {  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}




.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
    border-radius: 12px;
    overflow: hidden;
}

/* Блок с названием + низом */
.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 8px;
    min-width: 0;
}

.product-image-wrapper {  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #fff !important;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-controls {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    border-radius: 1px;
    padding: 4px 6px;
    font-size: 12px;
    background: rgba(0,0,0,0.4);
    color: #ffffff;
    backdrop-filter: blur(2px);
}

.image-nav-btn-left { left: 6px; }
.image-nav-btn-right { right: 6px; }

/* Название ВСЕГДА сверху */
.product-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Низ ВСЕГДА прижат вниз */
.product-bottom,
.product-card-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
}

.product-card-action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.product-bottom .product-price {
    flex: 0 0 auto;
}

.product-price {
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
}

.bim-money,
.price.money,
.money {
    white-space: nowrap !important;
    word-break: keep-all;
}

.product-add-btn,
.product-buy-btn {
    flex: 0 0 auto;
    border: none;
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1;
    color: #ffffff;
    min-width: 64px;
    max-width: 88px;
    white-space: nowrap;
    box-sizing: border-box;
}

/* === CART === */

/* Измените отступ для основного контента корзины */
#cartItems {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
    padding-bottom: 0;
    min-width: 0;
}


.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    background: #f2f2f2;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 14px;
    color: #000000;
}

.cart-item-price {
    font-size: 13px;
    opacity: 0.8;
    color: #444444;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-qty-btn {
    border: none;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 16px;
    background: #e6e6e6;
    color: #000000;
}

.cart-qty {
    min-width: 20px;
    text-align: center;
}

.cart-remove-btn {
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    background: #ffdddd;
    color: #cc0000;
    font-size: 12px;
}

.cart-summary {
    padding: 0;
    background: transparent;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: static;
    min-width: 0;
}

.cart-bonus-section {
    display: flex;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-bonus-left{
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-bonus-top-row{
    display: flex;
    align-items: center;
    justify-content: space-between; /* тумблер справа на той же строке, что "Списать" */
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-bonus-writeoff-label{
    font-size: 14px;
    font-weight: 500;
    color: #000;
}

/* цифры бонусов жирным */
.cart-bonus-info b{
    font-weight: 700;
}

.cart-bonus-info {
    font-size: 14px;
    color: #000000;
    font-weight: 500;
}

/* Правая верхняя */
.cart-total {
    text-align: left;
    font-weight: 600;
    font-size: 16px;
    color: #000;
}

.cart-total-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-total-section .primary-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.cart-bonus-row {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    opacity: 0.9;
    grid-area: bonus;
}

/* Уберите старые стили */
.cart-bonus-row,
.cart-total { grid-area: unset; }


/* === CART NOTES (comment + card) === */
.cart-notes{
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;              /* ← ВАЖНО */
    padding-top: 8px;       /* лёгкое визуальное разделение */
}


.cart-notes label{
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #000000;
}

.cart-notes input,
.cart-notes textarea{
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 8px;
    background: #f5f5f5;
    color: #000000;
}


.bonus-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bonus-switch-label {
    font-size: 13px;
    color: #666;
}

.bonus-switch {
    display: inline-flex;
    align-items: center;
}

.bonus-switch input {
    display: none;
}

.switch-slider {
    width: 44px;
    height: 26px;
    background-color: #d1d5db;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.switch-slider:after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.bonus-switch input:checked + .switch-slider {
    background-color: #111827;
}

.bonus-switch input:checked + .switch-slider:after {
    transform: translateX(18px);
}



.primary-btn,
.secondary-btn {
    border-radius: 999px;
    padding: 8px 16px;
    border: none;
    font-size: 14px;
}

.primary-btn {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    font-weight: 500;
}

.secondary-btn {
    background: #eaeaea;
    color: #000000;
}

/* === MODAL === */

.modal {  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 99999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
}





/* iOS 16+ / современные движки */
@supports (height: 100dvh){
    .modal{ height: 100dvh; }
}


.modal.hidden { display: none; }
.hidden {  display: none !important;
}

.modal-content {  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 0;
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
  color: #000000;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}



.modal-content h2 { margin-bottom: 10px; }

.modal-content label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #000000;
}

.modal-content input,
.modal-content textarea {
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 8px;
    background: #f5f5f5;
    color: #000000;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.address-block h3 { margin: 10px 0 6px; }

/* === PROFILE === */

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #000000;
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    overflow: hidden;
}

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

.profile-name {
    font-weight: 600;
    font-size: 16px;
    color: #000000;
}

.profile-username {
    font-size: 13px;
    opacity: 0.7;
    color: #444444;
}

.profile-bonuses {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    opacity: 0.85;
}

.loyalty-profile-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #fff;
}

.loyalty-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.loyalty-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.loyalty-progress-wrap {
    margin-top: 8px;
}

.loyalty-progress-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.loyalty-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.loyalty-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #111827;
    width: 0;
}

.loyalty-phone-status,
.loyalty-phone-form {
    margin-top: 10px;
    font-size: 13px;
}

.loyalty-phone-confirmed {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.7;
}

.loyalty-phone-form .secondary-btn {
    margin-top: 8px;
    width: 100%;
}

.cart-bonus-suffix {
    margin-left: 4px;
    font-size: 12px;
    opacity: 0.75;
}

#adminPanelOverlay.admin-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#adminPanelOverlay .admin-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#adminPanelLoyaltySection,
.loyalty-admin {
    width: 100%;
    min-width: 0;
}

.loyalty-admin-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px !important;
    padding: 16px;
    background: #fff;
    width: 100%;
    min-width: 0;
}

.loyalty-admin-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 12px;
    color: #111827;
}

.loyalty-admin-search-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.loyalty-admin-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    display: block;
}

.loyalty-admin-search-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.loyalty-admin-phone-input,
.loyalty-admin-amount-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(0, 0, 0, 0.14) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #111827 !important;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.2;
    -webkit-appearance: none;
    appearance: none;
}

.loyalty-admin-phone-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.loyalty-admin-phone-input:focus,
.loyalty-admin-amount-input:focus {
    outline: 2px solid rgba(17, 24, 39, 0.2);
    outline-offset: 1px;
    border-color: rgba(17, 24, 39, 0.45) !important;
}

#adminPanelOverlay button.loyalty-admin-search-btn {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 44px;
    padding: 10px 16px;
    white-space: nowrap;
    border-radius: 10px !important;
    border: 1px solid #111827 !important;
    background: #111827 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

#adminPanelOverlay button.loyalty-admin-search-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.loyalty-admin-field-error {
    font-size: 13px;
    line-height: 1.4;
    color: #b42318;
    min-height: 18px;
}

.loyalty-admin-field-error.hidden {
    display: none;
}

.loyalty-admin-status {
    font-size: 14px;
    color: #5f6b7a;
    margin-top: 12px;
}

.loyalty-admin-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    width: 100%;
    min-width: 0;
}

.loyalty-admin-row .profile-address-input {
    flex: 1 1 auto;
    min-width: 0;
}

.loyalty-admin-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loyalty-admin-info {
    font-size: 14px;
    line-height: 1.5;
}

.loyalty-admin-history {
    margin-top: 14px;
}

.loyalty-admin-history-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.loyalty-admin-history-item {
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.loyalty-admin-error {
    color: #b42318;
}

.loyalty-admin-subtitle {
    font-size: 13px;
    color: #5f6b7a;
    margin: 0 0 12px;
    line-height: 1.45;
}

.loyalty-admin-empty {
    font-size: 13px;
    color: #5f6b7a;
    margin: 0;
}

.loyalty-admin-preview {
    font-size: 13px;
    line-height: 1.45;
    color: #374151;
}

@media (max-width: 420px) {
    .loyalty-admin-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    #adminPanelOverlay button.loyalty-admin-search-btn {
        width: 100%;
    }
}

.loyalty-admin-not-found {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: #fafafa;
}

.loyalty-admin-not-found-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}

.loyalty-admin-not-found-message,
.loyalty-admin-not-found-hint,
.loyalty-admin-not-found-note {
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 8px;
}

.loyalty-admin-retry-btn {
    margin-top: 8px;
    width: 100%;
}

.loyalty-admin-confirm.hidden {
    display: none;
}

.profile-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.profile-tab-btn {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 6px 4px;
    font-size: 13px;
    background: #e5e5e5;
    color: #000000;
}

.profile-tab-btn.active {
    color: #ffffff;
}

.profile-content {
    font-size: 14px;
    color: #000000;
}

.address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f2f2f2;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.address-text {
    font-size: 14px;
    color: #000000;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.address-delete-btn {
    padding: 4px 10px;
    font-size: 13px;
    background: #ffdddd;
    border: none;
    border-radius: 6px;
    color: #cc0000;
    margin-left: 12px;
}



/* === ORDERS === */

.order-item {
    padding: 8px;
    border-radius: 10px;
    background: #f2f2f2;
    margin-bottom: 6px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #000000;
}

.order-id { font-size: 13px; }
.order-status { font-size: 13px; opacity: 0.8; }
.order-total { font-size: 14px; font-weight: 600; }
.order-date { font-size: 12px; opacity: 0.7; }

/* === INFO === */

.info-content {
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #000000;
}

/* === BOTTOM NAVIGATION === */

.bottom-nav{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;

    height: auto;
    min-height: 56px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;

    background: #ffffff;
    display: flex;
    z-index: 1000;
}


.nav-btn {  flex: 1;
  border: 2px solid transparent;
  background: #ffffff;
  color: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
    align-self: stretch;
  justify-content: center;
  font-size: 11px;
  gap: 2px;
  border-radius: 12px;
  margin: 10px 6px;
  padding: 8px 6px;
}

.nav-btn.active {  color: #ffffff;
  background: #ffffff;
  border-color: #000000;
}





.cart-sum-badge {  position: fixed;
  right: 12px;
  bottom: calc(var(--bim-bottom-nav-h, 72px) + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  color: #000 !important;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #fff !important;
  border: 1px solid #000 !important;
}


.product-qty-controls,
.product-qty-control {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    max-width: 96px;
}

.product-qty-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    flex: 0 0 28px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.product-qty-value {
    min-width: 16px;
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: transparent;
    color: #000000;
    font-size: 24px;
}

.nav-icon {  width: 22px;
  height: 22px;
  filter: grayscale(1) contrast(2) !important;
  opacity: 1 !important;
}



.cart-sum-icon {
    width: 18px;
    height: 18px;
    display: block;
}



.cart-sum-badge:hover {
    filter: brightness(1.05);
}


.categories-bar {
    display: flex;
    gap: 8px;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 6px;     /* отступ от шапки */
    margin-bottom: 12px;  /* отступ до товаров */
    min-width: 0;
    max-width: 100%;
}
.categories-bar::-webkit-scrollbar { display: none; }

.category-chip {
    flex: 0 0 auto;
    background: transparent;
    color: #000;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
}

.category-chip.active {
    color: #fff;
}

.address-add-form {  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.address-add-label {  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.text {
    text-indent: 2em;
    text-align: justify;
}

.input-error {
    outline: 1px solid #e74c3c;
    outline-offset: 1px;
}

.profile-address-input {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);   /* <-- добавили видимую границу */
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);         /* <-- лёгкий серый фон под белую тему */
    color: #111;
    font-size: 14px;
}

.profile-address-input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.profile-address-input:focus {
    outline: 2px solid rgba(87, 112, 79, 0.35);  /* акцент 57704F */
    outline-offset: 1px;
    border-color: rgba(87, 112, 79, 0.55);
}

/* Чтобы подпись "Адрес" выглядела как в модалке */


/* Чтобы кнопка всегда была под строкой */


.big-weight {
    font-weight: 600;
}

/* ===== Delivery options grid (2x2) ===== */
.delivery-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.delivery-option{  border: none !important;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.delivery-option-title{
    font-size: 14px;
    line-height: 1.25;
}

.delivery-option-price{
    font-size: 12px;
    opacity: 0.75;
}

.delivery-option.active{
    border-color: rgba(0,0,0,0.08);
}

.delivery-option.active,
.delivery-option.active .delivery-option-title,
.delivery-option.active .delivery-option-price{
    color: #fff;
}

.delivery-hours-notice{
    margin-top: 8px;
    font-size: 13px;
    opacity: 0.9;
}

.free-delivery-note{
    font-size: 13px;
    opacity: 0.85;
    margin: 0; /* без лишних отступов */
}

.cart-bonus-rows{
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-bonus-line{
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #000;
}

.cart-bonus-line b{
    font-weight: 700;
}


.cart-bonus-section.no-divider{
    border-bottom: none;
    padding-bottom: 0;
}




.keyboard-open .bottom-nav,
.keyboard-open .cart-summary,
.keyboard-open .cart-sum-badge {
    display: none !important;
}

/* iOS: чтобы не увеличивал экран при фокусе */
input, textarea, select {  font-size: 16px;
  background: #fff !important;
  border: none !important;
  outline: none !important;
  color: #000 !important;
}


.image-dots{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 8px;
    display: flex;
    gap: 5px;
    z-index: 3;
    padding: 4px 6px;
    border-radius: 1px;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(2px);
}

.image-dot{
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: rgba(255,255,255,0.55);
    transition: transform 0.15s, background 0.15s;
    cursor: pointer;
}

.image-dot.active{
    background: rgba(255,255,255,0.95);
    transform: scale(1.25);
}

.cart-card-toggle-row{
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f2f2f2;
}

.cart-card-toggle-label{
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.cart-item-note{
    cursor: pointer;
    position: relative;
}

.cart-item-note .cart-item-info{
    width: 100%;
}

.cart-item-note-text{
    margin-top: 6px;
    font-size: 13px;
    color: rgba(0,0,0,0.78);
    line-height: 1.25;
    white-space: pre-wrap;
}

.cart-item-note-hint{
    font-size: 12px;
    opacity: 0.7;
    padding-left: 10px;
}

.cart-note-btn{
    width: 100%;
    margin-top: 10px;
    border: none;
    text-align: left;
    border-radius: 10px;
    padding: 12px;
    background: #f2f2f2;
    color: #000;
}

.cart-note-btn-title{
    font-size: 14px;
    font-weight: 600;
}

.cart-note-btn-text{
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.25;
    white-space: pre-wrap;
}

/* Перенос длинного текста (без вылета за границы) */
.cart-item-note-text,
.cart-note-btn-text{
    white-space: pre-wrap;
    overflow-wrap: anywhere;   /* современный вариант */
    word-break: break-word;    /* fallback */
}

.note-counter{
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.65;
    text-align: right;
}

:root{
  --bim-dark: #111827;
  --bim-text: #090909;
  --bim-muted: #777777;
  --bim-border: #e5e5e5;
  --bim-soft: #f7f7f7;
  --bim-radius-lg: 24px;
  --bim-radius-md: 18px;
  --bim-shadow-card: 0 8px 28px rgba(0, 0, 0, 0.06);
  --bim-bottom-nav-h: 72px;
  --bw-bg: #ffffff;
  --bw-text: #090909;
  --bw-muted: rgba(0,0,0,0.55);
  --bw-line: rgba(0,0,0,0.0);
  --bw-active-line: #111827;
}



/* Remove shadows everywhere in UI */


/* 90-degree corners by default */


/* Keep rounding ONLY where requested */
.switch-slider,
.switch-slider:after,
.bonus-switch{
  border-radius: 999px !important;
}

/* Global: no default borders/outlines */


/* Inputs: keep clean white; show state only on focus */

input:focus, textarea:focus, select:focus{
  outline: 2px solid #000 !important;
  outline-offset: 0 !important;
}

/* Main cards/blocks: white surfaces */
.product-card,
.cart-item,
.modal,
.address-item,
.cart-bonus-section,
.cart-card-toggle-row,
.profile-card,
.delivery-option,
.cart-summary,
.categories-row{
  background: #fff !important;
  border: none !important;
}

/* Product image wrapper stays clean */


/* Product add button: outlined primary */
.product-add-btn,
.checkout-btn,
.cart-checkout-btn,
.save-address-btn,
.add-address-btn,
.login-btn,
.logout-btn,
.btn,
button.primary{
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  font-weight: 500 !important;
}

/* Secondary buttons: no border by default; active will show border */
button:not(.image-nav-btn),
.profile-tab-btn,
.category-chip,
.delivery-option,
.nav-btn,
.product-qty-btn{
    background: #fff !important;
    color: #000 !important;
    border: none !important;
    font-weight: 500 !important;
}


/* Active state: thick clean black outline, NO bold text */
.nav-btn.active,
.profile-tab-btn.active,
.category-chip.active,
.delivery-option.active{
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  font-weight: 500 !important; /* keep same as inactive */
}

/* Ensure no inherited bolding on nested text inside active items */
.nav-btn.active *,
.profile-tab-btn.active *,
.category-chip.active *,
.delivery-option.active *{
  font-weight: inherit !important;
  color: inherit !important;
}

/* Bottom navigation: white buttons, active outlined */


.nav-btn span{
  color: #000 !important;
}


/* Remove green separators/top borders from header, etc. */
.header,
.top-bar,
.app-header,
.navbar{
  background: #fff !important;
  border-bottom: none !important;
}

/* If any leftover "divider" borders exist */
hr,
.divider,
.section-divider{
  display: none !important;
}

/* Errors: minimal, rare accent (almost unused) */
.input-error,
.error,
.invalid{
  outline: 2px solid rgba(128,0,0,0.35) !important;
}






/* === Delivery zones admin panel === */

.admin-panel-btn{
  position: absolute;
  right: 12px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.9);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-header{ position: relative; }

.fullscreen-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.fullscreen-header{
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.fullscreen-title{ font-weight: 700; }
.fullscreen-close{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}
.fullscreen-body{
  flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* важно: убирает общий горизонтальный скролл всей админки */
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 12px;
}

@media (max-width: 430px) {
  #adminPanelOverlay .fullscreen-body {
    padding: 10px 10px calc(14px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
}

.fullscreen-body > *{ min-width: 0; }


/* Лента категорий в админке: скролл только внутри ленты */
#adminPanelOverlay .categories-bar{
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* Таблица/блок зон: скролл только внутри зоны */
#adminPanelOverlay .admin-zones-table-scroll{
    max-width: 100%;
    overflow-x: auto;
}

.admin-zones-table-wrap{ }
.admin-zones-table-title{ font-weight: 700; margin-bottom: 8px; }
.admin-zones-table-scroll{ overflow: auto; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; }
.admin-zones-table{ width: 100%; border-collapse: collapse; min-width: 820px; }
.admin-zones-table th, .admin-zones-table td{ padding: 10px 10px; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 13px; text-align: left; }
.admin-zones-table thead th{ position: sticky; top: 0; background: #fff; z-index: 1; }
.zone-color-chip{ width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.2); }
.admin-add-zone-btn{ margin-top: 10px; }

.admin-zones-map{ width: 100%; height: 320px; border-radius: 14px; border: 1px solid rgba(0,0,0,.08); overflow: hidden; }
.map-hint{ margin-top: 8px; font-size: 12px; opacity: .8; }

.zone-editor-body{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.zone-editor-form{ display: grid; gap: 10px; }
.zone-editor-row{ display: flex; gap: 10px; align-items: center; }
.zone-color-input{ width: 44px; height: 38px; border-radius: 12px; border: 1px solid rgba(0,0,0,.12); background: #fff; }
.zone-editor-actions{ display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.danger-btn{
  border: 1px solid rgba(220,0,0,.3);
  background: rgba(220,0,0,.08);
  color: #b00000;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}
.zone-editor-map{ width: 100%; height: 360px; border-radius: 14px; border: 1px solid rgba(0,0,0,.08); overflow: hidden; }
.zone-editor-map-actions{ display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* === Address suggestions in cart === */
.address-suggest{
  margin-top: 6px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.address-suggest-item{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 13px;
}
.address-suggest-item:last-child{ border-bottom: 0; }
.address-suggest-item:hover{ background: rgba(0,0,0,.03); cursor: pointer; }
.address-suggest-sub{
  margin-top: 4px;
  font-size: 12px;
  opacity: .8;
}

/* === Checkout pickup embedded map === */
.pickup-map{
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #f2f2f2;
}

.pickup-map-link{
  display: inline-block;
  margin-top: 8px;
  text-decoration: underline;
  font-size: 14px;
}

button.product-add-btn{
    border: 2px solid #000 !important;
    box-sizing: border-box;
}


/* === Header: кнопка "Каталог" (верхний правый угол, видна везде кроме каталога) === */
.go-to-catalog-btn{
  position: absolute;
  left: 12px;
  top: 10px;
    right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: #000;
  width: 48px;
  height: 48px;
  z-index: 60;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.go-to-catalog-btn svg{ display:block; }

/* === Кнопки оформления: жирный текст + обводка как у "Купить" === */
#checkoutBtn.primary-btn,
#checkoutConfirm.primary-btn{
  font-weight: 700 !important;
  border: 2px solid #000 !important;
  box-sizing: border-box !important;
}
.pickup-address.copied{ opacity: .75; }



/* Admin: active categories selector */
.admin-active-cats-wrap {
  margin-bottom: 16px;
}
.admin-active-cats-wrap .categories-bar {
  margin-top: 8px;
}

/* === Fullscreen product image viewer (catalog) === */
body.image-viewer-open{
    overflow: hidden !important;
}

.product-image-viewer{
    position: fixed;
    inset: 0;
    z-index: 10050;
}

.product-image-viewer.hidden{ display: none !important; }

.product-image-viewer-backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(2px);
}

.product-image-viewer-content{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-viewer-stage{
    position: relative;
    width: 100%;
    height: 100%;
    /*
      Хотим: фото+стрелки ближе к верху, точки остаются внизу,
      а между ними — short_description.
    */
    padding: 56px 12px 180px; /* space for close + description + dots */
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.product-image-viewer-img{
    max-width: 92vw;
    /* оставляем воздух под short_description */
    max-height: 48vh;
    object-fit: contain;
    transform: translate3d(0,0,0) scale(1);
    transform-origin: center center;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* short_description внутри fullscreen viewer */
.product-image-viewer-desc{
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(56px + 48vh + 10px);
    bottom: 56px;

    /* центрируем содержимое по вертикали */
    display: flex;
    flex-direction: column;
    justify-content: center;

    /* чтобы длинный текст не ломал экран */
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    color: #fff;
    font-size: 14px;
    line-height: 1.35;
    padding: 0;
    z-index: 2;
}


.product-image-viewer-desc p{ margin: 0 0 10px; }
.product-image-viewer-desc p:last-child{ margin-bottom: 0; }
.product-image-viewer-desc strong{ color: inherit; }


.product-image-viewer-close{
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 2px;                 /* круг как у точек */
    background: rgba(120,120,120,0.45);   /* серый полупрозрачный фон */
    color: #fff;                          /* белый крестик */
    font-size: 22px;
    line-height: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.product-image-viewer-nav{
    position: absolute;
    top: calc(56px + 24vh);
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 2px;                 /* круг как у точек */
    background: rgba(120,120,120,0.45);   /* серый полупрозрачный фон */
    color: #fff;                          /* белые стрелки */
    font-size: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.product-image-viewer-nav-left{ left: 10px; }
.product-image-viewer-nav-right{ right: 10px; }

.product-image-viewer-dots{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 12px;
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.product-image-viewer-dot{
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: rgba(255,255,255,0.55);
    transition: transform 0.15s, background 0.15s;
}

.product-image-viewer-dot.active{
    background: rgba(255,255,255,0.95);
    transform: scale(1.2);
}

/* viewer controls FORCE (в конец файла) */
.product-image-viewer .product-image-viewer-close,
.product-image-viewer .product-image-viewer-nav{
    background: rgba(120,120,120,0.45) !important;
    border-radius: 2px !important;
    color: #fff !important;
}

/* если внутри SVG — тоже выбелим */
.product-image-viewer .product-image-viewer-close svg,
.product-image-viewer .product-image-viewer-nav svg{
    stroke: #fff !important;
    fill: #fff !important;
}

/* ===== Admin panel design system (scoped) ===== */
.admin-shell {
  font-family: "Gilroy", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111827;
  background: #ffffff;
}

.admin-shell,
.admin-shell * {
  box-sizing: border-box;
}

.admin-shell .fullscreen-body,
.admin-shell .admin-panel-body {
  padding: 8px 12px calc(64px + env(safe-area-inset-bottom, 0px));
  gap: 8px;
  background: #ffffff;
}

.admin-header {
  background: #ffffff;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  min-height: 56px;
  padding: 8px 12px !important;
  flex-shrink: 0;
}

.admin-title {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.admin-close {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
  border-radius: 10px;
  min-width: 38px;
  min-height: 38px;
  width: 38px;
  height: 38px;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.admin-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: flex;
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  max-width: 100%;
}

.admin-bottom-nav__btn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-bottom-nav__btn.active {
  color: #111827;
  background: #f7f7f7;
  border-color: #e5e7eb;
}

.admin-bottom-nav__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.admin-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px !important;
  padding: 12px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.admin-card-title--compact {
  font-size: 14px;
  margin-bottom: 4px;
}

.admin-active-cats-desc {
  font-size: 12px;
  margin: 0 0 8px;
  line-height: 1.35;
}

.admin-cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #ffffff;
  cursor: pointer;
  min-height: 40px;
}

.admin-cat-row--active {
  background: #f7f7f7 !important;
  border-color: #111827 !important;
}

.admin-cat-row__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.admin-cat-row__name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.admin-cat-row__check {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  border: 1px solid #d1d5db !important;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  background: #fff;
}

.admin-cat-row--active .admin-cat-row__check {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #fff !important;
}

.admin-cat-toggle {
  margin-top: 8px;
  width: 100%;
  min-height: 36px;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
}

.admin-cat-toggle.hidden {
  display: none !important;
}

#adminPanelOverlay .loyalty-admin-money-input {
  font-size: 16px !important;
  min-height: 44px;
}

#adminPanelOverlay .admin-metric-card {
  padding: 10px 12px !important;
}

#adminPanelOverlay .admin-metric-value {
  font-size: 18px !important;
}

#adminPanelOverlay .admin-metric-title {
  font-size: 12px !important;
}

.admin-tab.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-card-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.admin-muted {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.45;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.admin-form-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.admin-label {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.admin-input,
.admin-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  line-height: 1.2;
}

.admin-input:focus,
.admin-select:focus {
  outline: 2px solid rgba(17, 24, 39, 0.15);
  border-color: #111827;
}

.admin-button {
  appearance: none;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  touch-action: manipulation;
}

.admin-button--compact {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
}

.admin-button-primary {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.admin-button-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-button-secondary {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}

.admin-button-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-button-danger {
  background: #ffffff;
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.35);
}

.admin-grid {
  display: grid;
  gap: 12px;
}

.admin-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  text-align: left;
  color: #111827;
}

.admin-table thead th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  z-index: 1;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  background: #fafafa;
  font-size: 14px;
  min-width: 0;
}

.admin-empty {
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed #d1d5db;
  background: #fafafa;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
}

.admin-error {
  color: #b42318;
  font-size: 14px;
  line-height: 1.4;
}

.admin-success {
  color: #166534;
  font-size: 14px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(17, 24, 39, 0.08);
  color: #111827;
}

.admin-badge--ok {
  background: rgba(22, 101, 52, 0.12);
  color: #166534;
}

.admin-badge--muted {
  background: #f3f4f6;
  color: #6b7280;
}

.admin-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-shell .admin-chip,
.admin-shell #adminActiveCategoriesBar .admin-chip {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-shell .admin-chip.active,
.admin-shell #adminActiveCategoriesBar .admin-chip.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.admin-zones-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-zone-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
}

.admin-zone-card__title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.admin-zone-card__meta {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #111827;
}

.admin-zone-card__meta .admin-muted {
  display: inline-block;
  min-width: 110px;
  margin-right: 6px;
}

.admin-zone-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.admin-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-segment.admin-segment--active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.admin-shell .admin-add-zone-btn {
  margin-top: 12px;
  width: 100%;
}

.admin-shell .admin-zones-map {
  width: 100%;
  height: 300px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

#adminPanelOverlay .admin-bottom-nav__btn {
  font-family: "Gilroy", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#adminPanelOverlay #adminPanelTabs .profile-tab-btn {
  flex: 0 0 auto !important;
  width: auto !important;
}

@media (max-width: 640px) {
  .admin-title {
    font-size: 20px;
  }

  .admin-tab {
    min-height: 38px;
    height: 38px;
    padding: 6px 12px;
    font-size: 14px;
  }

  .admin-form-row {
    flex-direction: column;
  }

  .admin-zones-table-scroll {
    display: none;
  }

  .admin-zones-cards {
    display: flex;
  }
}

@media (min-width: 641px) {
  .admin-zones-cards {
    display: none;
  }
}

/* Admin users card inside stats dashboard */
.bb-admin .admin-users-card {
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #e1ded6;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
  padding: 10px 12px;
}

.bb-admin .admin-users-desc {
  display: none;
}

.bb-admin .admin-users-list {
  margin-top: 12px;
}

.bb-admin .admin-users-row {
  align-items: center;
}

.bb-admin .admin-users-row__main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.bb-admin .admin-users-row__id {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  word-break: break-all;
}

.bb-admin .admin-users-form .admin-form-row {
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
}

.bb-admin .admin-users-form .admin-input {
  flex: 1 1 auto;
  min-width: 0;
}

.bb-admin .admin-users-form .admin-button-primary {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (min-width: 480px) {
  .bb-admin .admin-users-form .admin-form-row {
    flex-direction: row;
    align-items: stretch;
  }

  .bb-admin .admin-users-form .admin-input {
    flex: 1 1 auto;
  }

  .bb-admin .admin-users-form .admin-button-primary {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* =============================================================================
   BIM Mini App — scoped under #app (client Telegram). Does not affect #adminPanelOverlay.
   ============================================================================= */

#app {
  background: #ffffff !important;
  color: var(--bim-text, #090909) !important;
}

#app #mainContent {
  padding: 8px 12px calc(var(--bim-bottom-nav-h, 72px) + env(safe-area-inset-bottom, 0px)) !important;
  background: #ffffff !important;
  overflow-x: hidden;
  min-width: 0;
}

#app .tab-content {
  min-width: 0;
  max-width: 100%;
}

/* --- Compact top bar --- */
#app .bim-topbar {
  padding: 8px 12px calc(6px + env(safe-area-inset-top, 0px)) !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--bim-border, #e5e5e5) !important;
  flex-shrink: 0;
}

#app .bim-topbar__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

#app .bim-topbar__back {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  padding: 0 !important;
}

#app .bim-topbar__logo {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app .bim-topbar__logo img {
  width: 44px !important;
  height: 44px !important;
  object-fit: contain !important;
  border-radius: 10px !important;
}

#app .bim-topbar__search {
  flex: 1 1 auto;
  min-width: 0;
}

#app .bim-topbar__search.hidden {
  display: none !important;
}

#app .bim-topbar__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--bim-text, #090909);
  margin: 0;
  line-height: 1.2;
}

#app .bim-topbar__title.hidden {
  display: none !important;
}

#app.bim-tab-profile .bim-topbar__logo,
#app.bim-tab-cart .bim-topbar__logo,
#app.bim-tab-info .bim-topbar__logo {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

#app.bim-tab-profile .bim-topbar__logo img,
#app.bim-tab-cart .bim-topbar__logo img,
#app.bim-tab-info .bim-topbar__logo img {
  width: 36px !important;
  height: 36px !important;
}

#app .search-wrapper input,
#app .bim-topbar__search input {
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: 12px !important;
  background: var(--bim-soft, #f7f7f7) !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  color: var(--bim-text, #090909) !important;
  width: 100%;
  min-height: 40px;
}

/* --- Cards --- */
#app .bim-card {
  background: #ffffff !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: var(--bim-radius-md, 18px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  padding: 14px !important;
  margin-bottom: 10px !important;
}

#app .bim-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#app .bim-card__title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--bim-text, #090909) !important;
  line-height: 1.25;
}

#app .bim-muted {
  color: var(--bim-muted, #777) !important;
  font-size: 13px;
  line-height: 1.45;
}

#app .bim-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  background: var(--bim-soft, #f7f7f7) !important;
  color: var(--bim-text, #090909) !important;
}

#app .bim-badge--dark {
  background: var(--bim-dark, #111827) !important;
  border-color: var(--bim-dark, #111827) !important;
  color: #ffffff !important;
  font-size: 14px;
  padding: 6px 12px;
}

#app .bim-badge--ok {
  background: #ecfdf3 !important;
  border-color: #abefc6 !important;
  color: #067647 !important;
}

/* --- Key-value rows --- */
#app .bim-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--bim-text, #090909);
  border-bottom: 1px solid var(--bim-border, #e5e5e5) !important;
}

#app .bim-kv-row:last-child {
  border-bottom: none !important;
  padding-bottom: 0;
}

#app .bim-kv-row:first-of-type {
  padding-top: 0;
}

#app .bim-kv-label {
  color: var(--bim-muted, #777);
  font-size: 14px;
}

#app .bim-kv-value,
#app .bim-kv-row b,
#app .bim-kv-row strong {
  font-weight: 700 !important;
  color: var(--bim-text, #090909) !important;
  text-align: right;
}

#app .bim-kv-row--emph {
  font-size: 15px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--bim-border, #e5e5e5) !important;
}

/* --- Profile hero --- */
#app .bim-profile-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#app .bim-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0 10px;
  background: transparent !important;
}

#app .bim-avatar {
  flex: 0 0 auto;
  width: 72px !important;
  height: 72px !important;
  min-width: 72px;
  min-height: 72px;
  border-radius: 50% !important;
  background: var(--bim-soft, #f7f7f7) !important;
  border: 2px solid var(--bim-border, #e5e5e5) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: var(--bim-text, #090909);
  overflow: hidden;
}

#app .bim-avatar.bim-avatar--photo {
  background: #ffffff !important;
}

#app .bim-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50% !important;
}

#app .bim-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

#app .bim-profile-name {
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.2;
  color: var(--bim-text, #090909) !important;
}

#app .bim-profile-username {
  font-size: 13px !important;
  color: var(--bim-muted, #777) !important;
}

#app .bim-profile-bonuses {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--bim-text, #090909) !important;
  line-height: 1.35;
  margin-top: 2px;
}

#app .loyalty-profile-card,
#app .bim-contacts-card,
#app .bim-phone-link-panel {
  padding: 12px !important;
  margin-bottom: 8px !important;
}

#app .loyalty-profile-card .bim-card__head {
  margin-bottom: 10px;
}

#app .loyalty-profile-card .bim-kv-row {
  padding: 6px 0;
}

#app .loyalty-profile-card .bim-badge--dark {
  font-size: 13px !important;
  padding: 4px 10px !important;
}

#app .bim-progress__label {
  font-size: 12px;
  margin-bottom: 8px;
}

#app .bim-progress__track {
  height: 6px;
}

/* --- Contacts card --- */
#app .bim-contacts-card__title {
  margin-bottom: 10px !important;
  font-size: 15px !important;
}

#app .bim-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bim-border, #e5e5e5);
  min-width: 0;
}

#app .bim-contact-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#app .bim-contact-row:first-of-type {
  padding-top: 0;
}

#app .bim-contact-row__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#app .bim-contact-row__label {
  font-size: 12px;
  color: var(--bim-muted, #777);
  line-height: 1.2;
}

#app .bim-contact-row__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--bim-text, #090909);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#app .bim-contact-row__value--ok {
  letter-spacing: 0.02em;
}

#app .bim-contact-row__side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#app .bim-contact-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bim-dark, #111827);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

#app .bim-contact-action {
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  background: #ffffff !important;
  color: var(--bim-text, #090909) !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap;
  min-height: 0;
}

#app .bim-contact-action--subtle {
  color: var(--bim-muted, #777) !important;
}

#app .bim-contact-action:disabled {
  opacity: 0.55;
}

#app .bim-phone-link-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#app .bim-phone-link-panel.hidden {
  display: none !important;
}

/* --- Progress --- */
#app .bim-progress {
  margin-top: 4px;
}

#app .bim-progress__label {
  font-size: 13px;
  color: var(--bim-muted, #777);
  margin-bottom: 10px;
  line-height: 1.4;
}

#app .bim-progress__track {
  height: 8px;
  background: var(--bim-soft, #f7f7f7) !important;
  border-radius: 999px !important;
  overflow: hidden;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
}

#app .bim-progress__fill {
  height: 100%;
  background: var(--bim-dark, #111827) !important;
  border-radius: 999px !important;
  transition: width 0.25s ease;
}

/* --- Sync card --- */
#app .bim-sync-card .bim-card__title {
  margin-bottom: 12px;
}

#app .bim-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bim-border, #e5e5e5) !important;
  font-size: 14px;
  font-weight: 600;
}

#app .bim-sync-row:last-of-type {
  border-bottom: none !important;
}

#app .bim-sync-row__icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  background: var(--bim-soft, #f7f7f7) !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  font-size: 13px;
  color: var(--bim-muted, #777);
}

#app .bim-sync-row--ok .bim-sync-row__icon {
  background: var(--bim-dark, #111827) !important;
  border-color: var(--bim-dark, #111827) !important;
  color: #ffffff !important;
}

#app .bim-sync-hint {
  margin-top: 12px;
}

/* --- Phone card --- */
#app .bim-phone-linked__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

#app .bim-phone-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

#app .bim-field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bim-text, #090909);
}

/* --- Segment tabs (profile) --- */
#app .bim-segment-tabs {
  display: flex;
  gap: 8px;
  margin: 2px 0 12px;
  padding: 0;
}

#app .bim-segment-tab {
  flex: 1;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: var(--bim-text, #090909) !important;
}

#app .bim-segment-tab.active {
  background: var(--bim-dark, #111827) !important;
  border-color: var(--bim-dark, #111827) !important;
  color: #ffffff !important;
}

#app .bim-profile-content {
  padding-bottom: 12px;
}

#app .bim-profile-stack .bim-card {
  margin-bottom: 8px !important;
}

/* --- Catalog (small screens) --- */
#app .products-list {
  min-width: 0;
  max-width: 100%;
}

#app .product-card {
  min-width: 0;
  max-width: 100%;
}

#app .product-info {
  padding: 8px !important;
}

#app .product-bottom,
#app .product-card-bottom {
  min-width: 0;
  gap: 6px;
}

#app .product-price {
  font-size: 13px;
}

#app .product-add-btn,
#app .product-buy-btn {
  flex: 0 0 auto;
  min-width: 64px;
  max-width: 84px;
  padding: 7px 8px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap;
}

#app .product-qty-controls,
#app .product-qty-control {
  gap: 3px;
  max-width: 92px;
}

#app .product-qty-btn {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  flex: 0 0 26px !important;
  font-size: 15px !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: 8px !important;
  padding: 0 !important;
}

#app .product-qty-value {
  width: 18px;
  min-width: 18px;
  flex: 0 0 18px;
  font-size: 13px !important;
}

@media (max-width: 390px) {
  #app .product-price {
    font-size: 12px;
  }

  #app .product-add-btn,
  #app .product-buy-btn {
    min-width: 58px;
    max-width: 76px;
    padding: 6px 6px !important;
    font-size: 11px !important;
  }

  #app .product-qty-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    flex: 0 0 24px !important;
    font-size: 14px !important;
  }

  #app .product-qty-value {
    width: 16px;
    min-width: 16px;
    flex: 0 0 16px;
    font-size: 12px !important;
  }
}

#app .categories-bar {
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}

/* --- Cart --- */
#app .cart-summary,
#app .bim-cart-summary {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  max-height: none !important;
  box-shadow: none !important;
  z-index: auto !important;
  border-top: none !important;
  background: transparent !important;
}

#app .bim-cart-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

#app .bim-cart-bonus {
  position: static !important;
}

#app .bim-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: var(--bim-radius-md, 18px) !important;
  box-shadow: var(--bim-shadow-card, 0 8px 28px rgba(0, 0, 0, 0.06)) !important;
  padding: 14px !important;
  margin-bottom: 12px !important;
}

#app .bim-cart-item__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 14px !important;
  overflow: hidden;
  background: var(--bim-soft, #f7f7f7) !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
}

#app .bim-cart-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px !important;
}

#app .bim-cart-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#app .bim-cart-item__body .cart-item-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--bim-text, #090909);
}

#app .bim-cart-item__body .cart-item-price {
  font-size: 15px;
  font-weight: 700;
}

#app .bim-cart-item__controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#app .bim-qty-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: var(--bim-text, #090909) !important;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

#app .bim-link-btn {
  background: transparent !important;
  border: none !important;
  color: var(--bim-muted, #777) !important;
  font-size: 13px;
  text-decoration: underline;
  padding: 4px 0 !important;
  margin-left: auto;
}

#app .bim-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px !important;
  margin-bottom: 14px !important;
}

#app .bim-cart-bonus {
  border-bottom: none !important;
  padding-bottom: 16px !important;
}

#app .bim-cart-bonus__head {
  border-bottom: 1px solid var(--bim-border, #e5e5e5) !important;
  padding-bottom: 14px !important;
  margin-bottom: 4px;
}

#app .bim-cart-bonus__rows .bim-kv-row {
  font-size: 14px;
}

#app .bim-cart-checkout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#app .bim-cart-payable {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#app .bim-cart-payable__label {
  font-size: 16px;
  font-weight: 600;
  color: var(--bim-text, #090909);
}

#app .bim-cart-payable__value {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--bim-text, #090909) !important;
}

/* --- Switch --- */
#app .bonus-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

#app .bonus-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

#app .switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db !important;
  border-radius: 999px !important;
  transition: background 0.2s;
}

#app .switch-slider:after {
  width: 22px;
  height: 22px;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

#app .bonus-switch input:checked + .switch-slider {
  background: var(--bim-dark, #111827) !important;
}

#app .bonus-switch input:checked + .switch-slider:after {
  transform: translateX(18px);
}

/* --- Buttons & inputs --- */
#app .bim-btn-primary,
#app .primary-btn.bim-btn-primary {
  background: var(--bim-dark, #111827) !important;
  border: 1px solid var(--bim-dark, #111827) !important;
  color: #ffffff !important;
  border-radius: 14px !important;
  min-height: 48px;
  padding: 12px 16px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

#app .bim-btn-block {
  width: 100%;
}

#app .bim-input,
#app .profile-address-input.bim-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px !important;
  font-size: 16px !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: var(--bim-text, #090909) !important;
}

/* --- Bottom nav --- */
#app .bottom-nav {
  height: auto !important;
  min-height: 56px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  background: #ffffff !important;
  border-top: 1px solid var(--bim-border, #e5e5e5) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04) !important;
  gap: 4px;
}

#app .nav-btn {
  flex: 1;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--bim-muted, #777) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  gap: 3px !important;
  margin: 0 !important;
  padding: 6px 2px !important;
  min-height: 46px;
}

#app .nav-btn.active {
  color: var(--bim-text, #090909) !important;
  background: var(--bim-soft, #f7f7f7) !important;
  border-color: var(--bim-border, #e5e5e5) !important;
}

#app .nav-btn .nav-icon {
  width: 22px !important;
  height: 22px !important;
  opacity: 0.75 !important;
}

#app .nav-btn.active .nav-icon {
  opacity: 1 !important;
  filter: none !important;
}

#app .cart-sum-badge {
  bottom: calc(var(--bim-bottom-nav-h, 72px) + env(safe-area-inset-bottom, 0px)) !important;
  border: 1px solid var(--bim-border, #e5e5e5) !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

#app .bim-cart-empty {
  text-align: center;
  padding: 20px 12px;
}

#app .cart-empty__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

@media (min-width: 390px) {
  #app .bim-avatar {
    width: 76px !important;
    height: 76px !important;
    min-width: 76px;
    min-height: 76px;
  }

  #app .bim-profile-name {
    font-size: 19px !important;
  }
}

@media (max-width: 359px) {
  #app .bim-avatar {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px;
    min-height: 64px;
    font-size: 26px;
  }

  #app .bim-contact-action {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }
}

/* --- Manager loyalty admin (inside admin overlay) --- */
#adminPanelOverlay .loyalty-admin-intro {
  margin-bottom: 16px;
}

#adminPanelOverlay .loyalty-admin-intro__title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
}

#adminPanelOverlay .loyalty-admin-intro__subtitle {
  font-size: 14px;
  color: #5f6b7a;
  line-height: 1.45;
  margin: 0;
}

#adminPanelOverlay .loyalty-admin-howto {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 18px !important;
  background: #f7f7f7 !important;
}

#adminPanelOverlay .loyalty-admin-howto__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #111827;
}

#adminPanelOverlay .loyalty-admin-howto__list {
  margin: 0;
  padding-left: 18px;
  color: #5f6b7a;
  font-size: 14px;
  line-height: 1.5;
}

#adminPanelOverlay .loyalty-admin-customer-card {
  margin-top: 16px;
}

#adminPanelOverlay .loyalty-admin-customer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#adminPanelOverlay .loyalty-admin-customer-bonus {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}

#adminPanelOverlay .loyalty-admin-customer-discount {
  font-size: 14px;
  font-weight: 600;
  color: #5f6b7a;
  margin-top: 4px;
}

#adminPanelOverlay .loyalty-admin-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 14px;
}

#adminPanelOverlay .loyalty-admin-calc-row:last-child {
  border-bottom: none;
}

#adminPanelOverlay .loyalty-admin-calc-row strong {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

#adminPanelOverlay .loyalty-admin-segment-wrap {
  margin: 12px 0;
}

#adminPanelOverlay .loyalty-admin-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

#adminPanelOverlay .loyalty-admin-info-note {
  font-size: 13px;
  color: #5f6b7a;
  line-height: 1.45;
  padding: 10px 12px;
  background: #f7f7f7;
  border-radius: 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  margin-bottom: 12px;
}

