:root {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  color: #1c1c1e;
  background: #f2f2f7;
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-subtle: #f8f8fa;
  --line: rgba(60, 60, 67, 0.11);
  --line-strong: rgba(60, 60, 67, 0.2);
  --ink: #1c1c1e;
  --secondary: #636366;
  --tertiary: #8e8e93;
  --accent: #dd5a32;
  --accent-dark: #c04620;
  --accent-tint: #fff1ec;
  --green: #16793b;
  --green-tint: #e8f7ed;
  --amber: #9e5814;
  --amber-tint: #fff5e5;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.sheet-locked {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* App Store Sticky Glass Header (1-Row + Menu) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(242, 242, 247, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 10px max(14px, calc((100vw - 1280px) / 2)) 8px;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.header-row .search-field {
  flex: 1;
  min-width: 0;
}

.header-row .search-field input {
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
}

.header-menu-wrap {
  position: relative;
  flex: none;
}

.menu-toggle-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--ink);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.menu-toggle-btn:hover {
  background: rgba(118, 118, 128, 0.2);
}

.header-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 6px;
  display: grid;
  gap: 3px;
  z-index: 40;
}

.menu-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-tint);
  border-radius: 9px;
  margin-bottom: 2px;
}

.menu-status.preview {
  color: var(--amber);
  background: var(--amber-tint);
}

.menu-item {
  border: 0;
  background: transparent;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  width: 100%;
  transition: background 0.12s ease;
}

.menu-item:hover {
  background: var(--card-subtle);
}

.menu-item.primary {
  background: var(--accent-tint);
  color: var(--accent);
}

.brand {
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.06em;
  font-size: 19px;
  color: var(--ink);
  flex: none;
}

.brand span {
  font-weight: 400;
}

.brand i {
  color: var(--accent);
  font-style: normal;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.action-chip {
  border: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.action-chip:hover {
  background: rgba(118, 118, 128, 0.18);
}

.action-chip .chip-icon {
  flex: none;
}

.action-chip.primary {
  background: var(--accent-tint);
  color: var(--accent);
}

/* Search & Segmented Category Bar */
.header-controls {
  display: grid;
  gap: 8px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  color: var(--tertiary);
  font-size: 15px;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.12);
  padding: 0 14px 0 34px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.search-field input:focus-visible {
  background: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.search-field input::placeholder {
  color: var(--tertiary);
}

.segmented-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.category-tab {
  border: 0;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-tab.active {
  background: var(--ink);
  color: #fff;
}

/* Main Store Shell */
.store-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 14px 28px;
}

.shop-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 14px;
  align-items: start;
}

.catalog-column {
  min-width: 0;
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 2px 8px;
}

.section-bar-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.section-bar h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.catalog-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tertiary);
}

.quick-filters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.filter-chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Active Order Floating Bar */
.resume-order {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(22, 121, 59, 0.25);
  background: var(--green-tint);
  color: var(--green);
  border-radius: 14px;
  padding: 11px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

/* Full App Icon Grid (Mẫu C) */
.app-icon-grid-card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid rgba(60, 60, 67, 0.08);
  padding: 12px 10px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 6px;
}

@media (min-width: 640px) {
  .app-icon-grid-card {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 10px;
    padding: 14px;
  }
}

@media (min-width: 1024px) {
  .app-icon-grid-card {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.app-icon-tile {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 3px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  color: inherit;
  min-width: 0;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.app-icon-tile:hover {
  background: var(--card-subtle);
}

.app-icon-tile:active {
  transform: scale(0.97);
}

.app-icon-tile.selected {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.app-icon-tile.out-of-stock {
  opacity: 0.55;
}

.app-icon-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

.app-icon-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.app-icon-count {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--tertiary);
  line-height: 1.1;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 12px;
  font-weight: 800;
}

.brand-logo.sm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
}

.brand-logo.lg,
.brand-logo.large-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 16px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Buy Sheet Package List (Mẫu C) */
.sheet-pkg-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}

.sheet-pkg-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-subtle);
  text-align: left;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
}

.sheet-pkg-item:hover {
  border-color: rgba(221, 90, 50, 0.35);
}

.sheet-pkg-item:active {
  transform: scale(0.985);
}

.sheet-pkg-item.active {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: 0 2px 10px rgba(221, 90, 50, 0.1);
}

.sheet-pkg-item.out-of-stock {
  opacity: 0.65;
}

.sheet-pkg-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-pkg-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sheet-pkg-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  letter-spacing: 0.01em;
}

.sheet-pkg-sub {
  font-size: 10.5px;
  color: var(--secondary);
}

.sheet-pkg-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  flex: none;
}

.primary-action.zalo-action {
  background: #0068ff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-title-col {
  min-width: 0;
}

.app-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.app-title-line h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
  word-break: break-word;
}

.app-cat-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
  flex: none;
}

.app-subtitle {
  font-size: 11.5px;
  color: var(--secondary);
  margin: 1px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-desc-snippet {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.38;
  color: var(--secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-info-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--card-subtle);
  color: var(--secondary);
  border: 1px solid rgba(60, 60, 67, 0.08);
  white-space: nowrap;
}

.info-chip.stock-ok {
  background: var(--green-tint);
  color: var(--green);
  border-color: rgba(22, 121, 59, 0.16);
}

.info-chip.stock-out {
  background: rgba(118, 118, 128, 0.1);
  color: var(--tertiary);
}

.info-chip.warranty {
  background: #eef4ff;
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.14);
}

.info-chip.manual {
  background: var(--amber-tint);
  color: var(--amber);
  border-color: rgba(158, 88, 20, 0.16);
}

.app-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.app-note-line {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--amber);
}

.app-get-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
}

.app-get-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.get-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.1;
  transition: background 0.15s ease, color 0.15s ease;
}

.quick-qr-btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.quick-qr-btn:hover {
  background: var(--accent-dark);
}

.app-group-card.selected .get-pill {
  background: var(--ink);
  color: #fff;
}

.get-subprice {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* Package Pills Strip inside App Card */
.app-variants-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.variant-pill {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card-subtle);
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 8px;
  padding: 5px 9px;
  text-align: left;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.variant-pill:hover {
  border-color: var(--line-strong);
}

.variant-pill.active {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.variant-pill.out-of-stock {
  opacity: 0.62;
}

.variant-pill-name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  min-width: 0;
  word-break: break-word;
}

.variant-pill-price {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.variants-more-btn {
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--secondary);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  min-height: 28px;
}

.variants-more-btn:hover {
  background: var(--card-subtle);
  color: var(--ink);
}

/* Empty State */
.rail-empty {
  grid-column: 1 / -1;
  background: var(--card);
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  color: var(--secondary);
}

.rail-empty strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}

.rail-empty p {
  margin: 0;
  font-size: 13px;
}

/* Inspector Panel (Desktop) & iOS Bottom Sheet (Mobile) */
.flow-panel {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 18px;
  position: sticky;
  top: 112px;
  overflow-wrap: anywhere;
}

.sheet-handle {
  display: none;
  width: 36px;
  height: 5px;
  background: rgba(60, 60, 67, 0.25);
  border-radius: 999px;
  margin: 0 auto 10px;
}

.sheet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sheet-close {
  border: 0;
  background: rgba(118, 118, 128, 0.14);
  color: var(--secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flow-product-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.flow-panel h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.22;
  margin: 2px 0 0;
}

/* In-Sheet Variant Switcher */
.sheet-variants {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 12px 0 4px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.sheet-variants::-webkit-scrollbar {
  display: none;
}

.sheet-variant-btn {
  border: 1px solid var(--line-strong);
  background: var(--card-subtle);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}

.sheet-variant-btn.active {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* App Store 3-Column Spec Strip */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 12px 0;
  padding: 9px 0;
  text-align: center;
}

.spec-cell {
  padding: 0 6px;
}

.spec-cell + .spec-cell {
  border-left: 1px solid var(--line);
}

.spec-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-value {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin: 2px 0 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-sub {
  display: block;
  font-size: 10.5px;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Concise Terms Card */
.notice-box {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 12px;
  display: grid;
  gap: 9px;
}

.notice-box h3 {
  font-size: 12.5px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.notice-group {
  background: #fff;
  border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 10px;
  padding: 9px 11px;
}

.notice-group-warranty {
  background: #f5f9ff;
  border-color: rgba(0, 102, 204, 0.16);
}

.notice-group-guide {
  background: #fff8f2;
  border-color: rgba(221, 90, 50, 0.24);
}

.notice-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 5px;
}

.notice-group-icon {
  font-size: 12px;
  line-height: 1;
}

.notice-group-list {
  padding-left: 16px;
  margin: 0;
  color: var(--secondary);
  line-height: 1.5;
  font-size: 12px;
}

.notice-group-list li + li {
  margin-top: 4px;
}

/* Acknowledge Row */
.acknowledge-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--accent-tint);
  border: 1px solid rgba(221, 90, 50, 0.25);
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  margin-bottom: 10px;
}

.acknowledge-row input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
  flex: none;
}

/* Side-by-Side Stepper + Buy Button Dock */
.purchase-dock {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-subtle);
  flex: none;
}

.quantity-control button {
  width: 34px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.quantity-control input {
  width: 34px;
  height: 44px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.primary-action,
.secondary-action {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.primary-action {
  background: var(--accent);
  color: #fff;
  flex: 1;
}

.primary-action:disabled {
  background: #d1d1d6;
  color: #8e8e93;
  cursor: not-allowed;
}

.secondary-action {
  background: rgba(118, 118, 128, 0.12);
  color: var(--ink);
  margin-top: 8px;
  font-size: 13px;
  padding: 10px 14px;
}

.flow-intro {
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: 6px 0 12px;
}

.flow-overview {
  border-top: 1px solid var(--line);
}

.overview-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 2px 8px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.overview-row b {
  color: var(--accent);
  font-size: 11px;
}

.overview-row strong {
  font-size: 13px;
}

.overview-row p {
  grid-column: 2;
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
}

.form-error {
  color: #c9341c;
  font-size: 12px;
  font-weight: 600;
  margin: 8px 0 0;
}

/* Checkout QR Sheet */
.checkout-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 13px;
}

.checkout-amount strong {
  font-size: 19px;
  font-weight: 800;
  color: var(--accent);
}

.status-banner {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
}

.status-banner strong {
  display: block;
  font-size: 13px;
}

.status-banner p {
  margin: 3px 0 0;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.4;
}

.status-banner.success {
  background: var(--green-tint);
  border-color: rgba(22, 121, 59, 0.25);
}

.status-banner.success strong {
  color: var(--green);
}

.status-banner.warning {
  background: var(--amber-tint);
  border-color: rgba(158, 88, 20, 0.25);
}

.status-banner.warning strong {
  color: var(--amber);
}

.payment-timer {
  font-weight: 800;
  font-size: 12.5px;
  color: var(--accent);
  margin: 6px 0;
  text-align: center;
}

.preview-payment {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 16px;
  color: var(--secondary);
  text-align: center;
  background: var(--card-subtle);
  font-size: 12.5px;
  margin: 8px 0;
}

.qr-wrap {
  max-width: 190px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  margin: 8px auto;
  background: #fff;
}

.qr-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.payment-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  margin: 8px 0;
}

.payment-code {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.03em;
  margin: 0;
}

.copy-btn {
  border: 0;
  background: var(--accent-tint);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.delivery-box {
  margin: 10px 0;
}

.delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.delivery {
  padding: 11px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 60px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* Buyer Contact, Recovery Pin & Warranty Center */
.contact-field {
  display: block;
  margin-bottom: 10px;
}

.contact-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.contact-label-row .contact-label {
  margin-bottom: 0;
}

.contact-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-tint);
  border: 1px solid rgba(221, 90, 50, 0.2);
  white-space: nowrap;
}

.contact-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 5px;
}

.contact-field input,
.lookup-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card-subtle);
  padding: 0 11px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.contact-field input:focus,
.lookup-input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(221, 90, 50, 0.12);
}

.contact-field input.is-invalid {
  border-color: #d93025;
  background: #fff8f7;
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.12);
}

.email-warning-note {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #fff6ed;
  border: 1px solid rgba(221, 90, 50, 0.22);
  font-size: 11.5px;
  line-height: 1.42;
  color: #7c3a1d;
}

.email-warning-icon {
  flex: none;
  line-height: 1.3;
}

.email-admin-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.recovery-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card-subtle);
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  padding: 9px 11px;
  margin: 8px 0;
}

.recovery-box strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.recovery-box span {
  display: block;
  font-size: 11px;
  color: var(--secondary);
  margin-top: 2px;
}

.warranty-badge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--green-tint);
  color: var(--green);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  margin: 8px 0;
}

.warranty-card {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  margin: 10px 0;
}

.passbook-card {
  background: linear-gradient(180deg, rgba(221, 90, 50, 0.05) 0%, var(--card-subtle) 100%);
  border-color: rgba(221, 90, 50, 0.22);
}

.passbook-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 11px;
  margin: 8px 0 10px;
}

.passbook-top-line,
.passbook-balance-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.passbook-top-line strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.passbook-balance-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--secondary);
}

.passbook-balance-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--green);
}

.passbook-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sub-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.sub-pill.ok,
.sub-pill.active {
  background: var(--green-tint);
  color: var(--green);
}

.sub-pill.warn,
.sub-pill.warning {
  background: var(--amber-tint);
  color: var(--amber);
}

.sub-pill.expired {
  background: rgba(201, 52, 28, 0.12);
  color: #c9341c;
}

.passbook-topup-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--secondary);
  line-height: 1.4;
}

.passbook-email-box {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.passbook-email-status {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.passbook-email-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.passbook-email-row .lookup-input {
  flex: 1;
  height: 34px;
  font-size: 12.5px;
}

.subscriptions-list {
  display: grid;
  gap: 8px;
}

.subscription-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 11px;
}

.subscription-item.sub-warn {
  border-color: rgba(158, 88, 20, 0.35);
  background: rgba(255, 248, 238, 0.85);
}

.subscription-item.sub-expired {
  border-color: rgba(201, 52, 28, 0.28);
  opacity: 0.9;
}

.subscription-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.subscription-title strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.subscription-title span {
  display: block;
  font-size: 11px;
  color: var(--secondary);
  margin-top: 2px;
}

.sub-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.sub-badge.sub-ok {
  background: var(--green-tint);
  color: var(--green);
}

.sub-badge.sub-warn {
  background: var(--amber-tint);
  color: var(--amber);
}

.sub-badge.sub-expired {
  background: rgba(201, 52, 28, 0.12);
  color: #c9341c;
}

.sub-delivery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 8px;
}

.sub-delivery-row code {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sub-action-btn {
  border: 1px solid var(--line-strong);
  background: var(--card-subtle);
  color: var(--ink);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.sub-action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.balance-pay-btn {
  margin-top: 8px;
  background: var(--green-tint);
  color: var(--green);
  border: 1px solid rgba(22, 121, 59, 0.25);
  font-weight: 800;
}

.warranty-card h3 {
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 6px;
}

.warranty-sub {
  font-size: 12px;
  color: var(--secondary);
  margin: 0 0 10px;
  line-height: 1.4;
}

.saved-orders-list {
  display: grid;
  gap: 6px;
}

.saved-order-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
}

.saved-order-left strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.saved-order-left span {
  display: block;
  font-size: 11px;
  color: var(--secondary);
  margin-top: 1px;
}

.saved-order-action {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.lookup-grid {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 7px;
  margin-bottom: 7px;
}

.lookup-input.full {
  margin-bottom: 8px;
}

.lookup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lookup-actions .secondary-action {
  margin-top: 0;
}

.policy-sec-title {
  display: block;
  font-size: 12px;
  color: var(--ink);
  margin: 8px 0 4px;
}

.form-success {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  margin: 8px 0 0;
}

/* Footer */
.store-footer {
  border-top: 1px solid var(--line);
  padding: 16px max(14px, calc((100vw - 1140px) / 2)) 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--tertiary);
  font-size: 11.5px;
  flex-wrap: wrap;
}

.store-footer strong {
  color: var(--ink);
}

.footer-links {
  display: flex;
  gap: 14px;
}

/* Mobile-First Responsive (90% Phone Usage) */
@media (max-width: 840px) {
  .shop-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 35;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }

  .sheet-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .flow-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 40;
    max-height: 88dvh;
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    border: 0;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(104%) scale(0.985);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, visibility 0.34s ease;
    will-change: transform, opacity;
    pointer-events: none;
  }

  .flow-panel.sheet-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sheet-handle {
    display: block;
  }
}

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

.flow-panel.flow-animate > * {
  animation: flowFadeUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.flow-panel.flow-animate > *:nth-child(2) { animation-delay: 20ms; }
.flow-panel.flow-animate > *:nth-child(3) { animation-delay: 40ms; }
.flow-panel.flow-animate > *:nth-child(4) { animation-delay: 60ms; }
.flow-panel.flow-animate > *:nth-child(5) { animation-delay: 80ms; }
.flow-panel.flow-animate > *:nth-child(6) { animation-delay: 100ms; }

@media (prefers-reduced-motion: reduce) {
  .flow-panel,
  .sheet-backdrop,
  .sheet-pkg-item,
  .app-icon-tile {
    transition: none !important;
  }
  .flow-panel.flow-animate > * {
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 10px 14px;
  }

  .header-main {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .header-brand {
    justify-content: space-between;
    width: 100%;
  }

  .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .action-chip {
    flex: 1 1 auto;
  }

  .app-list {
    gap: 10px;
  }

  .app-group-card {
    padding: 14px;
  }
}

.action-chip:focus-visible,
.category-tab:focus-visible,
.variant-pill:focus-visible,
.app-row-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.name-lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.name-lookup-row .primary-action {
  width: auto;
  padding: 0 16px;
  min-height: 40px;
  white-space: nowrap;
}

.name-results-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.name-claim-wrap {
  margin-top: 8px;
}

.name-claim-wrap .secondary-action {
  margin-top: 0;
  min-height: 36px;
  padding: 6px 12px;
}

.advanced-lookup {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-subtle);
  padding: 10px 12px;
}

.advanced-lookup-summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--secondary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.advanced-lookup-summary::after {
  content: '+';
  font-size: 16px;
  font-weight: 700;
  color: var(--tertiary);
}

.advanced-lookup[open] .advanced-lookup-summary {
  margin-bottom: 10px;
}

.advanced-lookup[open] .advanced-lookup-summary::after {
  content: '−';
}

.totp-result-box {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.totp-highlight-row {
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--accent-tint);
  border: 1px solid rgba(221, 90, 50, 0.25);
  border-radius: 12px;
}

.totp-big-code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
}

.totp-timer-pill {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--secondary);
  background: #fff;
  padding: 4px 8px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
