/*
Theme Name: VegeCrimea Mobile-First PWA (Вегемаркет)
Theme URI: https://vegecrimea.ru
Author: VegeCrimea Team
Description: Современная адаптивная Mobile-First тема в стиле Eco/Fresh App-Like (ВкусВилл / Самокат) для магазина вегетарианских и эко-продуктов «Вегемаркет» (Крым). Включает нижний мобильный таб-бар, выдвижную AJAX-шторку корзины, быстрые чипсы количества (+2/+3/+5/+10 шт.), покупку ингредиентов рецепта в 1 клик, 1-шаговый заказ без онлайн-оплаты и поддержку чистого браузерного PWA + Telegram Mini App.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: vege-pwa
*/

:root {
  --vege-primary: #2E7D32;
  --vege-primary-dark: #1B5E20;
  --vege-primary-light: #E8F5E9;
  --vege-accent: #F57C00;
  --vege-accent-light: #FFF3E0;
  --vege-bg: #F7F9F7;
  --vege-surface: #FFFFFF;
  --vege-text: #1C251E;
  --vege-text-muted: #5C6B5E;
  --vege-border: #E2EAE3;
  --vege-danger: #D32F2F;
  --vege-radius-lg: 16px;
  --vege-radius-md: 12px;
  --vege-radius-sm: 8px;
  --vege-shadow: 0 4px 20px rgba(28, 37, 30, 0.06);
  --vege-shadow-lg: 0 12px 32px rgba(28, 37, 30, 0.14);
  --vege-bottom-nav-h: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background-color: var(--vege-bg);
  color: var(--vege-text);
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--vege-bg);
  color: var(--vege-text);
  line-height: 1.5;
  padding-bottom: calc(var(--vege-bottom-nav-h) + env(safe-area-inset-bottom, 16px));
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--vege-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--vege-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent legacy attachment images lacking dimensions metadata from collapsing to 1px */
img[width="1"][height="1"] {
  width: auto !important;
  height: auto !important;
}

.vege-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 14px;
}

@media (min-width: 768px) {
  .vege-container {
    padding: 0 24px;
  }
}

/* ==========================================================================
   1. Sticky App-Like Header & Live Search
   ========================================================================== */
.vege-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--vege-border);
}

.vege-topbar {
  background: var(--vege-primary-light);
  color: var(--vege-primary-dark);
  font-size: 12px;
  padding: 6px 0;
}

.vege-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vege-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.vege-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--vege-primary-dark);
  flex-shrink: 0;
}

.vege-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--vege-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.vege-search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
}

.vege-search-input {
  width: 100%;
  padding: 10px 38px 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--vege-border);
  background: var(--vege-bg);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.vege-search-input:focus {
  border-color: var(--vege-primary);
  background: #fff;
}

.vege-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--vege-radius-md);
  box-shadow: var(--vege-shadow-lg);
  border: 1px solid var(--vege-border);
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 150;
}

.vege-search-results.is-open {
  display: block;
}

.vege-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--vege-border);
  color: var(--vege-text);
  font-size: 14px;
}

.vege-search-item:hover {
  background: var(--vege-primary-light);
}

.vege-header-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--vege-primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.vege-desktop-nav {
  display: none;
  border-top: 1px solid var(--vege-border);
  padding: 8px 0;
}

@media (min-width: 1024px) {
  .vege-desktop-nav {
    display: block;
  }
}

.vege-desktop-nav-list {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

/* ==========================================================================
   2. Quick Filter Pills & Category Grid
   ========================================================================== */
.vege-pills-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

.vege-pills-scroll::-webkit-scrollbar {
  display: none;
}

.vege-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--vege-surface);
  border: 1px solid var(--vege-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--vege-text);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.vege-pill:hover, .vege-pill.is-active {
  background: var(--vege-primary);
  color: #fff;
  border-color: var(--vege-primary);
}

.vege-section {
  margin: 22px 0;
}

.vege-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.vege-section-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

@media (min-width: 768px) {
  .vege-section-title {
    font-size: 24px;
  }
}

.vege-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 640px) {
  .vege-cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .vege-cat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
  }
}

.vege-cat-card {
  background: var(--vege-surface);
  border-radius: var(--vege-radius-md);
  padding: 10px;
  text-align: center;
  border: 1px solid var(--vege-border);
  box-shadow: var(--vege-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--vege-text);
  font-weight: 600;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
}

.vege-cat-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
}

/* ==========================================================================
   3. App-Like Product Card (`vege_render_product_card`)
   ========================================================================== */
.vege-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 640px) {
  .vege-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .vege-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}

.vege-product-card {
  background: var(--vege-surface);
  border-radius: var(--vege-radius-lg);
  border: 1px solid var(--vege-border);
  box-shadow: var(--vege-shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vege-product-card > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vege-product-thumb-wrap {
  display: block;
  width: 100%;
  height: 175px;
  position: relative;
  border-radius: var(--vege-radius-md);
  overflow: hidden;
  background: #f4f7f4;
  margin-bottom: 10px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .vege-product-thumb-wrap {
    height: 205px;
  }
}

.vege-product-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.vege-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.vege-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.vege-badge--action {
  background: var(--vege-accent);
  color: #fff;
}

.vege-badge--new {
  background: var(--vege-primary);
  color: #fff;
}

.vege-packing-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(28, 37, 30, 0.72);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 2;
  pointer-events: none;
}

.vege-product-brand {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--vege-text-muted);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vege-product-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  min-height: 38px;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.vege-product-title a {
  color: var(--vege-text);
}

.vege-product-kbzhu-hint {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 11px;
  color: var(--vege-text-muted);
  background: var(--vege-bg);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vege-product-footer {
  margin-top: auto;
  padding-top: 4px;
  min-width: 0;
}

.vege-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.vege-price-current {
  font-size: 17px;
  font-weight: 800;
  color: var(--vege-text);
}

.vege-price-old {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
}

/* Add to Cart Button & Stepper `- 1 +` + Quick Chips `+2 / +3 / +5 / +10 шт.` */
.vege-btn-add {
  width: 100%;
  background: var(--vege-primary-light);
  color: var(--vege-primary-dark);
  border: 1px solid #c8e6c9;
  border-radius: var(--vege-radius-md);
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.vege-btn-add:hover {
  background: var(--vege-primary);
  color: #fff;
}

.vege-stepper-box {
  display: none;
  flex-direction: column;
  gap: 6px;
}

.vege-product-card.in-cart .vege-btn-add {
  display: none;
}

.vege-product-card.in-cart .vege-stepper-box {
  display: flex;
}

.vege-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--vege-primary);
  color: #fff;
  border-radius: var(--vege-radius-md);
  overflow: hidden;
}

.vege-stepper-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  width: 38px;
  height: 36px;
  cursor: pointer;
}

.vege-stepper-val {
  font-size: 14px;
  font-weight: 700;
}

.vege-quick-chips {
  display: flex;
  gap: 4px;
  justify-content: space-between;
}

.vege-chip-qty {
  flex: 1;
  background: var(--vege-bg);
  border: 1px solid var(--vege-border);
  border-radius: 6px;
  padding: 4px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--vege-primary-dark);
  cursor: pointer;
  text-align: center;
}

.vege-chip-qty:hover {
  background: var(--vege-primary-light);
  border-color: var(--vege-primary);
}

/* ==========================================================================
   4. Recipe Cards & "Buy Recipe Ingredients in 1 Click"
   ========================================================================== */
.vege-recipe-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@media (min-width: 640px) {
  .vege-recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .vege-recipe-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

.vege-recipe-card {
  background: var(--vege-surface);
  border-radius: var(--vege-radius-lg);
  overflow: hidden;
  border: 1px solid var(--vege-border);
  box-shadow: var(--vege-shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vege-recipe-card-thumb {
  display: block;
  width: 100%;
  height: 195px;
  overflow: hidden;
  position: relative;
  background: #eef3ee;
  flex-shrink: 0;
}

.vege-recipe-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.vege-recipe-card:hover .vege-recipe-card-thumb img {
  transform: scale(1.03);
}

.vege-recipe-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vege-recipe-buy-box {
  background: var(--vege-primary-light);
  border: 1.5px solid #a5d6a7;
  border-radius: var(--vege-radius-lg);
  padding: 16px;
  margin: 0 0 18px 0;
}

.vege-recipe-buy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  padding: 10px 12px;
  border-radius: var(--vege-radius-md);
  margin-bottom: 8px;
  border: 1px solid var(--vege-border);
}

/* Two-column layout for Single Recipe (Left: Photo + Ingredients, Right: 1-Click Buy + Steps) */
.vege-recipe-single-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

@media (min-width: 860px) {
  .vege-recipe-single-grid {
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 28px;
  }
}

.vege-recipe-photo-box {
  border-radius: var(--vege-radius-md);
  overflow: hidden;
  background: #f4f7f4;
  margin-bottom: 16px;
  border: 1px solid var(--vege-border);
}

.vege-recipe-photo-box img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
}

/* Two-column layout for Single Product (Left: Compact Square Image Box, Right: Details, Price, Stepper & KBZHU) */
.vege-product-single-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 820px) {
  .vege-product-single-grid {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }
}

.vege-single-product-thumb-box {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  background: #f4f7f4;
  border-radius: var(--vege-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  align-self: start;
  border: 1px solid var(--vege-border);
  box-sizing: border-box;
  margin: 0 auto;
}

@media (min-width: 820px) {
  .vege-single-product-thumb-box {
    max-width: 280px;
    margin: 0;
  }
}

.vege-single-product-thumb-box img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: calc(var(--vege-radius-md) - 4px);
  display: block;
}

/* ==========================================================================
   5. Delivery & Payment Information Cards (No Online Payment Required)
   ========================================================================== */
.vege-info-banner {
  background: linear-gradient(135deg, #E8F5E9 0%, #FFF8E1 100%);
  border: 1px solid #C8E6C9;
  border-radius: var(--vege-radius-lg);
  padding: 18px;
  margin: 20px 0;
}

.vege-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .vege-info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.vege-info-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--vege-radius-md);
  padding: 14px;
  border: 1px solid var(--vege-border);
}

/* ==========================================================================
   6. Sticky Mobile Bottom Tab Bar (`< 1024px`)
   ========================================================================== */
.vege-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--vege-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--vege-border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 200;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
  .vege-bottom-nav {
    display: none;
  }
}

.vege-bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--vege-text-muted);
  font-size: 11px;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  padding: 4px 2px;
}

.vege-bottom-tab.is-active, .vege-bottom-tab:hover {
  color: var(--vege-primary);
}

.vege-bottom-tab-icon {
  font-size: 20px;
  line-height: 1;
}

.vege-cart-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  background: var(--vege-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

/* ==========================================================================
   7. Slide-Out / Bottom-Sheet AJAX Cart Drawer & 1-Step Order Form
   ========================================================================== */
.vege-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 17, 0.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.vege-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.vege-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--vege-surface);
  z-index: 310;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--vege-shadow-lg);
}

.vege-cart-drawer.is-open {
  transform: translateX(0);
}

.vege-drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--vege-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vege-shipping-bar {
  background: var(--vege-primary-light);
  padding: 10px 18px;
  font-size: 12px;
  color: var(--vege-primary-dark);
}

.vege-shipping-progress {
  height: 6px;
  background: #c8e6c9;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.vege-shipping-progress-bar {
  height: 100%;
  background: var(--vege-primary);
  width: 0%;
  transition: width 0.3s ease;
}

.vege-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}

.vege-drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--vege-border);
}

.vege-quick-order-box {
  background: var(--vege-bg);
  border: 1px solid var(--vege-border);
  border-radius: var(--vege-radius-md);
  padding: 14px;
  margin-top: 14px;
}

.vege-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--vege-radius-sm);
  border: 1px solid var(--vege-border);
  font-size: 14px;
  margin-bottom: 8px;
}

.vege-btn-primary {
  width: 100%;
  background: var(--vege-primary);
  color: #fff;
  border: none;
  border-radius: var(--vege-radius-md);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.vege-btn-primary:hover {
  background: var(--vege-primary-dark);
}

/* ==========================================================================
   8. Pure Browser PWA Install Banner (No APK) & Telegram Mini App (`is-tma`)
   ========================================================================== */
.vege-pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--vege-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  max-width: 480px;
  margin: 0 auto;
  background: #ffffff;
  border: 1.5px solid #a5d6a7;
  border-radius: var(--vege-radius-lg);
  padding: 12px 14px;
  box-shadow: var(--vege-shadow-lg);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (min-width: 1024px) {
  .vege-pwa-banner {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 390px;
  }
}

.vege-pwa-banner.is-visible {
  display: flex;
}

.vege-pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--vege-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.vege-pwa-install-btn {
  background: var(--vege-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.vege-pwa-install-btn:hover {
  background: var(--vege-primary-dark);
}

.vege-pwa-close-btn {
  background: transparent;
  border: none;
  color: var(--vege-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* iOS / Manual PWA Install Instructions Modal */
.vege-pwa-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 17, 0.55);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.vege-pwa-modal.is-open {
  display: flex;
}

.vege-pwa-modal-card {
  background: #fff;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  padding: 22px 20px;
  box-shadow: var(--vege-shadow-lg);
  border: 1px solid var(--vege-border);
}

/* Telegram Mini App (`body.is-tma`) adjustments */
body.is-tma .vege-pwa-banner {
  display: none !important;
}

.vege-tma-bar {
  display: none;
  background: linear-gradient(90deg, #1E88E5 0%, #2AABEE 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
}

body.is-tma .vege-tma-bar {
  display: block;
}

/* ==========================================================================
   9. Autonomous AI Consultant Chat Widget (`.vege-ai-drawer` & `.vege-ai-fab`)
   ========================================================================== */
.vege-ai-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 240;
  background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 26px rgba(27, 94, 32, 0.35);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vege-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(27, 94, 32, 0.45);
}

@media (min-width: 1024px) {
  .vege-ai-fab {
    display: inline-flex;
  }
}

.vege-ai-drawer {
  position: fixed;
  right: 0;
  bottom: 0;
  top: 0;
  width: 100%;
  max-width: 440px;
  background: var(--vege-surface);
  z-index: 320;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--vege-shadow-lg);
}

.vege-ai-drawer.is-open {
  transform: translateX(0);
}

.vege-ai-header {
  background: linear-gradient(125deg, #1B5E20 0%, #2E7D32 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vege-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #F4F7F4;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vege-ai-msg {
  max-width: 90%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.48;
  word-break: break-word;
}

.vege-ai-msg--bot {
  align-self: flex-start;
  background: #ffffff;
  color: var(--vege-text);
  border: 1px solid var(--vege-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.vege-ai-msg--user {
  align-self: flex-end;
  background: var(--vege-primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.vege-ai-prod-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.vege-ai-prod-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--vege-bg);
  border: 1px solid var(--vege-border);
  border-radius: 12px;
  padding: 8px 10px;
}

.vege-ai-prod-card img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}

.vege-ai-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px;
  background: #fff;
  border-top: 1px solid var(--vege-border);
  scrollbar-width: none;
}

.vege-ai-chips::-webkit-scrollbar {
  display: none;
}

.vege-ai-chip {
  white-space: nowrap;
  background: var(--vege-primary-light);
  color: var(--vege-primary-dark);
  border: 1px solid #c8e6c9;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.vege-ai-chip:hover {
  background: var(--vege-primary);
  color: #fff;
}

.vege-ai-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--vege-border);
}

/* ==========================================================================
   Test Mode Banner (T11 / prod-deploy-ops)
   ========================================================================== */
.vege-test-mode-banner {
  background: #FFF3CD;
  color: #856404;
  border-bottom: 1px solid #FFEBAA;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  z-index: 99999;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.vege-test-mode-banner a {
  color: #2E7D32;
  font-weight: 700;
  text-decoration: underline;
  margin-left: 4px;
}



