/* ============================================================
   LAYOUT — Header, Footer, Main Grid, Sidebar, Responsive
   ============================================================ */


/* --- App Shell --- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Lock viewport when chat mode is active */
html.chat-mode-active,
body.chat-mode-active {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.chat-mode-active .app {
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.chat-mode-active {
  padding-bottom: 0 !important;
}

body.chat-mode-active .mobile-cart-bar {
  display: none !important;
}

body.chat-mode-active .mobile-search {
  display: none !important;
}


/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-header);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(10, 29, 102, 0.3);
}

.header__top {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-8);
  height: var(--header-height);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  cursor: pointer;
}

.header__logo {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xl);
  font-weight: 800;
  color: var(--primary);
}

.header__brand-text h1 {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-inverse);
  line-height: 1.2;
}
.header__brand-text span {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 4px;
}
.header__brand-text .dot-online {
  width: 7px;
  height: 7px;
  background: var(--accent-green);
  border-radius: var(--radius-full);
  display: inline-block;
}

.header__search {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
}

.header__action-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255,255,255,0.85);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
  position: relative;
}
.header__action-item:hover {
  color: white;
}
.header__action-item svg {
  width: 22px;
  height: 22px;
}

.header__cart {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: white;
  font-weight: 700;
  font-size: var(--font-md);
  position: relative;
  cursor: pointer;
}
.header__cart svg {
  width: 26px;
  height: 26px;
}

.header__mobile-menu {
  display: none;
  color: white;
  cursor: pointer;
}
.header__mobile-menu svg {
  width: 28px;
  height: 28px;
}


/* --- Categories Bar --- */
.categories-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-8);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.categories-bar__right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-shrink: 0;
}


/* --- Main Content --- */
.main-content {
  flex: 1;
  display: flex;
  gap: 0;
}

.main-content__catalog {
  flex: 1;
  padding: var(--space-6) var(--space-8);
  min-width: 0;
}

.main-content__cart-sidebar {
  width: var(--cart-width);
  flex-shrink: 0;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}


/* --- Footer --- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

.footer__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  padding: var(--space-5) var(--space-8);
  border-bottom: 1px solid var(--border-light);
}
.footer__trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer__trust-item svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
}
.footer__trust-item strong {
  font-size: var(--font-sm);
  font-weight: 600;
  display: block;
}
.footer__trust-item span {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  display: block;
}


/* --- Chat View Layout (Desktop) --- */
.chat-layout {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.chat-layout.active {
  display: flex;
}

.chat-layout__sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
}

.chat-layout__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-chat);
}

.chat-layout__order {
  width: var(--cart-width);
  flex-shrink: 0;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
}


/* --- Catalog View (wrapper for show/hide) --- */
.catalog-layout {
  display: flex;
  flex: 1;
}
.catalog-layout.hidden-layout {
  display: none;
}





/* --- Mobile Bottom Navigation --- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  height: var(--mobile-nav-height);
  padding: 0 var(--space-4);
}

.mobile-nav__items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  position: relative;
  padding: var(--space-1) var(--space-2);
}
.mobile-nav__item.active {
  color: var(--primary);
}
.mobile-nav__item svg {
  width: 22px;
  height: 22px;
}


/* --- Mobile Cart Bar (bottom sticky) --- */
.mobile-cart-bar {
  display: none;
  position: fixed;
  bottom: var(--mobile-nav-height);
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  transition: all var(--transition-fast);
}

/* --- Continue Shopping Button (Mobile Only) --- */
#btnCartContinue {
  display: none !important;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet landscape and smaller */
@media (max-width: 1024px) {
  .header__top {
    padding: 0 var(--space-4);
  }
  .categories-bar {
    padding: var(--space-3) var(--space-4);
  }
  .main-content__catalog {
    padding: var(--space-4);
  }
  .footer__trust {
    gap: var(--space-6);
    padding: var(--space-4);
  }
  .main-content__cart-sidebar {
    width: 300px;
  }
}

/* Tablet portrait and smaller */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  body.chat-mode-active .categories-bar {
    display: none !important;
  }
  body.chat-mode-active .header {
    display: none !important;
  }
  body.chat-mode-active .mobile-nav {
    display: none !important;
  }

  .header__mobile-menu {
    display: block;
  }
  .header__search {
    display: none;
  }
  .header__actions {
    display: none !important;
  }

  .main-content__cart-sidebar {
    display: none;
  }
  #btnCartContinue {
    display: inline-flex !important;
  }
  .main-content__cart-sidebar.active-mobile,
  #chatOrderSidebar.active-mobile {
    display: flex !important;
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    z-index: var(--z-modal);
    background: var(--bg-card);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    animation: slideInRight 0.25s ease-out forwards;
  }
  .main-content__cart-sidebar.active-mobile .cart-sidebar__toggle svg,
  #chatOrderSidebar.active-mobile .cart-sidebar__toggle svg {
    transform: rotate(-90deg);
  }

  .footer__trust {
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: flex-start;
  }
  .footer__trust-item {
    flex: 1 1 45%;
  }

  .floating-chat-btn {
    bottom: calc(var(--mobile-nav-height) + 16px);
    right: 16px;
  }
  .floating-chat-btn span {
    display: none;
  }
  .floating-chat-btn {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-full);
  }

  /* Mobile navigation shows */
  .mobile-nav {
    display: block;
  }
  body {
    padding-bottom: var(--mobile-nav-height);
  }

  /* Chat layout stacks */
  .chat-layout__sidebar {
    display: none;
  }
  .chat-layout__order {
    display: none;
  }
  .chat-layout {
    flex-direction: column;
    height: 100% !important;
    max-height: 100% !important;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .chat-layout__main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Show mobile cart bar */
  .mobile-cart-bar.has-items {
    display: block;
  }
}

/* Phone */
@media (max-width: 480px) {
  .header__top {
    padding: 0 var(--space-3);
    gap: var(--space-3);
  }
  .header__logo {
    width: 36px;
    height: 36px;
    font-size: var(--font-lg);
  }
  .header__brand-text h1 {
    font-size: var(--font-md);
  }
  .main-content__catalog {
    padding: var(--space-3);
  }
  .categories-bar {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }
  .footer__trust-item {
    flex: 1 1 100%;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ============================================================
   QUERYFULL LANDING PAGE & UTILITIES
   ============================================================ */

.blur-app {
  filter: blur(20px) brightness(30%) grayscale(40%);
  pointer-events: none;
  user-select: none;
}

.qf-landing {
  min-height: 100vh;
  background: linear-gradient(135deg, #07090e 0%, #0f172a 50%, #1e1b4b 100%);
  color: #f1f5f9;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.qf-landing__glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
  z-index: 1;
}

.qf-landing__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8%;
  z-index: 10;
  position: relative;
}

.qf-landing__logo-wrapper {
  display: flex;
  align-items: center;
}

.qf-landing__logo-img {
  height: 135px;
  object-fit: contain;
}

.qf-landing__logo-text {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qf-landing__logo-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
}

.qf-landing__btn-header {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  text-decoration: none;
  transition: all 0.2s ease;
}

.qf-landing__btn-header:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.qf-landing__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  text-align: center;
  width: 100%;
  z-index: 2;
}

.qf-landing__hero {
  max-width: 820px;
  margin-bottom: 50px;
  animation: qfScaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.qf-landing__title {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 24px;
}

.qf-landing__gradient-text {
  background: linear-gradient(90deg, #818cf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.qf-landing__subtitle {
  font-size: 18px;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 35px;
}

.qf-landing__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.qf-landing__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.qf-landing__btn--primary {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.qf-landing__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.45);
}

.qf-landing__btn--primary svg {
  transition: transform 0.2s ease;
}

.qf-landing__btn--primary:hover svg {
  transform: translateX(3px);
}

.qf-landing__btn--secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.qf-landing__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.qf-landing__preview {
  width: 100%;
  max-width: 540px;
  margin-bottom: 70px;
  perspective: 1000px;
  animation: qfFadeIn 0.8s ease-out;
}

.qf-preview-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: left;
  overflow: hidden;
  transform: rotateX(6deg) translateY(0);
  transition: transform 0.3s ease;
}

.qf-preview-card:hover {
  transform: rotateX(2deg) translateY(-4px);
}

.qf-preview-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.qf-preview-card__status {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

.qf-preview-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qf-preview-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.qf-preview-bubble--user {
  background: #3730a3;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.qf-preview-bubble--bot {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.qf-preview-bubble--system {
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.2);
  color: #34d399;
  align-self: center;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  max-width: 100%;
  text-align: center;
}

.qf-landing__features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
  text-align: left;
}

.qf-feature-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.qf-feature-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.09);
  transform: translateY(-4px);
}

.qf-feature-card__icon {
  width: 44px;
  height: 44px;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.qf-feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.qf-feature-card p {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

.qf-landing__plans {
  width: 100%;
  max-width: 820px;
  margin: 50px auto 20px;
  animation: qfFadeIn 0.8s ease-out;
}

.qf-plans-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(192, 132, 252, 0.04) 100%);
  border: 1px solid rgba(129, 140, 248, 0.15);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.qf-plans-card h3 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.qf-plans-card p {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
}

.qf-plans-card .qf-landing__btn {
  padding: 12px 36px;
}

.qf-landing__footer {
  margin-top: auto;
  padding: 30px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.qf-landing__footer p {
  margin: 0;
}

.qf-landing__footer-tagline {
  margin-top: 4px;
  color: #475569;
  font-size: 11px;
}

/* Animations */
@keyframes qfScaleIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes qfFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Landing Page */
@media (max-width: 900px) {
  .qf-landing__features {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .qf-landing__title {
    font-size: 36px;
  }
  .qf-landing__subtitle {
    font-size: 16px;
  }
  .qf-landing__header {
    padding: 20px 24px;
  }
  .qf-landing__main {
    padding: 20px 16px 60px;
  }
}

