/* === BE.GE NATIVE MOBILE APP SHELL & CENTRAL AI STUDIO (v1) === */
body.is-bege-native-app {
  padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  -webkit-tap-highlight-color: transparent;
}

/* Replace legacy web mobile bottom bar cleanly when running inside BeGeNativeApp */
body.is-bege-native-app app-header .responsive-fixed-menu-wrapper {
  display: none !important;
}

#bege-native-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(66px + env(safe-area-inset-bottom, 0px));
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(22, 23, 24, 0.08);
  box-shadow: 0 -8px 28px rgba(17, 17, 17, 0.06);
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  z-index: 9990;
  box-sizing: border-box;
}

body.is-bege-native-app #bege-native-tabbar {
  display: grid;
}

.bna-tab {
  appearance: none;
  background: none;
  border: none;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #70767b;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  min-width: 0;
}

.bna-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  transition: transform 0.16s ease, stroke 0.16s ease;
}

.bna-tab span.bna-lbl {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bna-tab.is-active {
  color: #161718;
  font-weight: 600;
}

/* Center Elevated AI Button ("en el medio de la app") */
.bna-ai-center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: -24px;
}

.bna-ai-orb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: linear-gradient(140deg, #161718 0%, #272a30 62%, #161718 100%);
  color: #FFB800;
  box-shadow: 0 10px 24px rgba(22, 23, 24, 0.28), 0 0 0 1px rgba(255, 184, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.2,.8,.2,1), box-shadow 0.18s ease;
}

.bna-ai-orb:active {
  transform: scale(0.93);
}

.bna-ai-orb svg {
  width: 24px;
  height: 24px;
}

.bna-ai-lbl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #161718;
  margin-top: 3px;
}

.bna-cart-badge {
  position: absolute;
  top: 0;
  right: calc(50% - 19px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #FFB800;
  color: #161718;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

/* === CENTRAL AI INTERIOR STUDIO SHEET === */
#bege-ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.54);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 10020;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
#bege-ai-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

#bege-ai-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 680px;
  margin: 0 auto;
  height: min(86vh, 760px);
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.22);
  z-index: 10025;
  display: flex;
  flex-direction: column;
  transform: translateY(104%);
  transition: transform 0.28s cubic-bezier(.22,1,.36,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}
#bege-ai-sheet.is-open {
  transform: translateY(0);
}

.bai-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 13px;
  border-bottom: 1px solid #f0f0f2;
  background: #161718;
  color: #ffffff;
}
.bai-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bai-spark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 184, 0, 0.16);
  color: #FFB800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bai-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.bai-sub {
  font-size: 11.5px;
  color: #a1a1aa;
}
.bai-hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bai-icon-btn {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
}

.bai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f9fafb;
}
.bai-msg {
  max-width: 92%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.48;
  word-wrap: break-word;
}
.bai-msg--bot {
  align-self: flex-start;
  background: #ffffff;
  color: #161718;
  border: 1px solid #ececef;
  border-bottom-left-radius: 4px;
}
.bai-msg--user {
  align-self: flex-end;
  background: #161718;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.bai-msg-img {
  max-width: 170px;
  border-radius: 10px;
  margin-bottom: 6px;
  display: block;
}

.bai-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 18px 4px;
  background: #f9fafb;
  scrollbar-width: none;
}
.bai-chips::-webkit-scrollbar { display: none; }
.bai-chip {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 99px;
  padding: 7px 13px;
  font-size: 12px;
  color: #27272a;
  cursor: pointer;
  white-space: nowrap;
}

.bai-prod-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 4px;
  margin-top: 8px;
}
.bai-pcard {
  flex: 0 0 156px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  text-decoration: none !important;
  color: #161718 !important;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bai-pcard img {
  width: 100%;
  height: 112px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.bai-pprice {
  font-size: 14px;
  font-weight: 700;
  color: #161718;
}
.bai-pbadge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  width: fit-content;
}
.bai-pbadge--stock { background: #dcfce7; color: #15803d; }
.bai-pbadge--po { background: #fef3c7; color: #b45309; }
.bai-ptitle {
  font-size: 11.5px;
  line-height: 1.3;
  color: #3f3f46;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bai-photo-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  font-size: 12px;
}
.bai-photo-preview img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}

.bai-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  background: #ffffff;
  border-top: 1px solid #ececef;
}
.bai-cam-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #f4f4f5;
  color: #161718;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.bai-input {
  flex: 1;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 14px;
  outline: none;
  color: #161718;
  background: #f9fafb;
}
.bai-input:focus {
  border-color: #161718;
  background: #ffffff;
}
.bai-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: #FFB800;
  color: #161718;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
