/* ==========================================================================
   App shell & layout
   On wide viewports the app renders as a centered "device" card so the
   demo reads like a real POS terminal even when previewed on desktop.
   ========================================================================== */

.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 640px) {
  body {
    display: flex;
    justify-content: center;
    padding: var(--space-7) var(--space-4);
    background: linear-gradient(160deg, var(--bg-secondary), var(--bg-app));
  }

  .app-shell {
    min-height: min(860px, calc(100vh - var(--space-7) * 2));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: calc(var(--header-height) + var(--safe-top));
  padding: var(--safe-top) var(--space-5) 0;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.app-header__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-md);
  min-width: 0;
}

.app-header__title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
}

.screen.is-active {
  display: flex;
  animation: screen-enter var(--duration-slow) var(--ease-decel);
}

.screen-body {
  flex: 1;
  padding: var(--space-5);
  padding-bottom: var(--space-9);
}

.screen-body--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) calc(var(--space-4) + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
}

.bottom-bar > * {
  flex: 1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--sm {
  gap: var(--space-2);
}

.stack--lg {
  gap: var(--space-6);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.row--between {
  justify-content: space-between;
}

.grid-products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

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

@media (min-width: 900px) {
  .grid-products {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}

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