:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --hairline: #d2d2d7;
  --blue: #007aff;
  --blue-dark: #0066d6;
  --shadow: 0 24px 70px rgba(0, 0, 0, .18);
  --layout-footer-margin-top: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.footer-column h6 {
  margin-top: 0;
}

button,
input {
  font: inherit;
}

.store-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 245, 247, .82);
  border-bottom: 1px solid rgba(210, 210, 215, .7);
  backdrop-filter: blur(22px);
}

.store-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #00a5ff, #0057ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.search {
  width: min(430px, 46vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 12px;
  background: rgba(118, 118, 128, .12);
}

.search-box {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
  border-radius: 999px;
  overflow: visible;
}

.search-box::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.22) 48%, rgba(255,255,255,0.14)),
    linear-gradient(180deg, rgba(255,255,255,0.22), transparent 22%);
  box-shadow:
    0 14px 28px rgba(120, 128, 140, 0.16),
    0 3px 8px rgba(120, 128, 140, 0.12),
    inset 0 -8px 14px rgba(136, 143, 155, 0.08),
    inset 0 1px 10px rgba(255,255,255,0.26);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  pointer-events: none;
}

.search-submit {
  position: absolute;
  top: 50%;
  right: 13px;
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  background: transparent;
  color: rgba(29, 29, 31, 0.72);
  cursor: pointer;
  transition:
    background-color .18s ease,
    color .18s ease,
    transform .18s ease;
}

.search-submit svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-submit:hover,
.search-submit.is-active {
  background: rgba(0, 122, 255, .12);
  color: var(--blue);
}

.search-submit:active {
  transform: translateY(-50%) scale(.94);
}

.search-submit:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .22);
  outline-offset: 2px;
}

.search-box input {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 18px 64px 18px 24px;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}

.search-box input::placeholder {
  color: rgba(29, 29, 31, 0.52);
}

.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: var(--muted);
  stroke-width: 2;
  fill: none;
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 0;
}

.hero {
  position: relative;
  height: clamp(220px, 32vw, 360px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 26px;
  padding: 34px;
  border-radius: 22px;
  color: #fff;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("https://ngaphukhang.vn/wp-content/uploads/hinh-nen-4k-anh-lien-quan-cuc-net-6.jpg") center/cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 58%;
  z-index: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .52) 0%, rgba(0, 0, 0, .36) 62%, rgba(0, 0, 0, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mask-image: linear-gradient(90deg, #000 0%, #000 68%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 68%, transparent 100%);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: .98;
  letter-spacing: 0;
}

.subtitle {
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: 18px;
  line-height: 1.45;
}

.search-section {
  margin: 18px 0 8px;
  scroll-margin-top: 96px;
}

.floating-search {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)),
    linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.01));
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 9998;
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  color: rgba(29, 29, 31, 0.88);
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255,255,255,0.45);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  cursor: pointer;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity .28s ease,
    transform .34s ease,
    box-shadow .24s ease;
}

.floating-search[hidden] {
  display: grid;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px) scale(.92);
}

.floating-search svg {
  position: relative;
  z-index: 1;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: rgba(29, 29, 31, 0.88);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-search:hover {
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.52),
    inset 0 -12px 22px rgba(255,255,255,0.08);
  transform: translateY(-1px) scale(1.02);
}

.floating-search:active {
  transform: translateY(0) scale(.97);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 34px 0 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.ghost-button,
.load-more {
  border: 0;
  border-radius: 999px;
  background: rgba(0, 122, 255, .1);
  color: var(--blue);
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button:hover,
.load-more:hover {
  background: rgba(0, 122, 255, .16);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 28px;
  border-top: 1px solid var(--hairline);
}

.app-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}

.appstore-suggestions {
  grid-column: 1 / -1;
  padding: 20px 0 6px;
}

.suggestion-head {
  display: flex;
  align-items: center;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--hairline);
}

.suggestion-head h3 {
  width: 100%;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 24px;
  letter-spacing: 0;
}

.suggestion-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-head p {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.suggestion-count {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(52, 199, 89, .12);
  color: #1d7f3b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.suggestion-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 28px;
}

.appstore-suggestion .app-meta {
  color: #1d7f3b;
}

.app-open {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.app-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 14px;
  object-fit: cover;
  background: #e8e8ed;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 6px 16px rgba(0, 0, 0, .08);
}

.app-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-title,
.app-subtitle,
.app-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-title {
  font-size: 16px;
  font-weight: 650;
}

.app-subtitle,
.app-meta {
  color: var(--muted);
  font-size: 13px;
}

.get-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 32px;
  border-radius: 999px;
  background: rgba(0, 122, 255, .12);
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  transform: translateY(0) scale(1);
  transition:
    background-color .28s cubic-bezier(.2, .8, .2, 1),
    color .24s cubic-bezier(.2, .8, .2, 1),
    transform .22s cubic-bezier(.2, .8, .2, 1),
    box-shadow .28s cubic-bezier(.2, .8, .2, 1);
}

.get-button:hover {
  background: var(--blue-dark);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 102, 214, .18);
  transform: translateY(-1px) scale(1.015);
}

.get-button:active {
  background: rgba(0, 122, 255, .24);
  box-shadow: 0 3px 8px rgba(0, 122, 255, .1);
  transform: translateY(0) scale(.985);
}

.get-button:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .24);
  outline-offset: 3px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .24);
  opacity: 0;
  transition: opacity .28s ease;
}

.sheet-backdrop.show {
  opacity: 1;
}

.app-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10001;
  width: min(900px, 100vw);
  height: 80vh;
  background: var(--panel);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow);
  transform: translate(-50%, 105%);
  transition: transform .36s cubic-bezier(.2, .85, .2, 1);
  overflow: hidden;
}

.app-sheet.open {
  transform: translate(-50%, 0);
}

.app-sheet.is-dragging {
  transition: none;
}

.sheet-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 2;
  width: 54px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  transform: translateX(-50%);
  background: #c7c7cc;
  cursor: pointer;
}

.sheet-content {
  height: 100%;
  overflow: auto;
  padding: 34px 30px 42px;
  overflow-wrap: break-word;
}

.detail-top {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--hairline);
}

.detail-icon {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  object-fit: cover;
  background: #e8e8ed;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 12px 28px rgba(0, 0, 0, .12);
}

.detail-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.detail-copy {
  min-width: 0;
  padding-top: 1px;
}

.detail-artist {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 19px;
  overflow-wrap: anywhere;
}

.download-main {
  margin-top: 13px;
  min-width: 100px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  transform: translateY(0) scale(1);
  transition:
    background-color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.download-main:hover {
  background: var(--blue-dark);
  box-shadow: 0 10px 24px rgba(0, 122, 255, .22);
  transform: translateY(-1px) scale(1.012);
}

.download-main:active {
  box-shadow: 0 5px 14px rgba(0, 122, 255, .16);
  transform: translateY(0) scale(.985);
}

.download-main:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .24);
  outline-offset: 3px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}

.metric {
  min-width: 0;
  padding: 0 14px;
  text-align: center;
  border-right: 1px solid var(--hairline);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  color: #a1a1a6;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 7px;
  color: #5f5f65;
  font-size: 18px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.rating-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.rating-inline svg {
  width: calc(1em + 2px);
  height: calc(1em + 2px);
  flex: 0 0 auto;
  fill: #f5a623;
  transform: translateY(calc(0.08em - 2px));
}

.screenshots {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 24px 0;
  scroll-snap-type: x mandatory;
}

.screenshots img {
  width: min(260px, 72vw);
  max-height: 520px;
  border-radius: 22px;
  object-fit: cover;
  scroll-snap-align: start;
}

.detail-section {
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.description {
  margin: 0;
  color: #363638;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: normal;
}

.version-list {
  display: grid;
}

.version-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--hairline);
}

.version-row:first-child {
  border-top: 0;
}

.version-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.version-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 44px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .suggestion-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .store-header-inner {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .page {
    padding: 18px 16px 0;
  }

  .hero {
    height: clamp(170px, 48vw, 240px);
    align-items: end;
    padding: 24px;
    border-radius: 18px;
  }

  .section-head {
    align-items: center;
  }

  .search-section {
    margin-top: 14px;
  }

  .search-box input {
    padding: 16px 58px 16px 20px;
    font-size: 16px;
  }

  .floating-search {
    width: 56px;
    height: 56px;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .suggestion-head {
    align-items: center;
    gap: 10px;
  }

  .suggestion-head h3 {
    font-size: 18px;
    gap: 8px;
  }

  .suggestion-count {
    margin-left: 0;
  }

  .suggestion-list {
    grid-template-columns: 1fr;
  }

  .app-sheet {
    width: 100vw;
    height: 80vh;
    border-radius: 24px 24px 0 0;
  }

  .sheet-content {
    padding: 30px 18px 36px;
  }

  .detail-top {
    grid-template-columns: 100px 1fr;
    gap: 14px;
  }

  .detail-icon {
    width: 100px;
    height: 100px;
    border-radius: 22px;
  }

  .download-main {
    margin-top: 10px;
    width: 92px;
    height: 38px;
  }

  .detail-title {
    font-size: 28px;
  }

  .detail-artist {
    margin-top: 3px;
    font-size: 17px;
  }

  .metric-row {
    grid-template-columns: repeat(4, 46vw);
    overflow-x: auto;
  }
}

@media (max-width: 430px) {
  .page {
    padding: 16px 14px 0;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero::after {
    width: 78%;
    background: linear-gradient(90deg, rgba(0, 0, 0, .56) 0%, rgba(0, 0, 0, .4) 64%, rgba(0, 0, 0, 0) 100%);
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(27px, 7.8vw, 32px);
    line-height: 1.04;
    overflow-wrap: anywhere;
  }

  .subtitle {
    max-width: 92%;
    margin-top: 12px;
    font-size: 14.5px;
    line-height: 1.38;
  }

  .eyebrow {
    margin-bottom: 7px;
    font-size: 11px;
  }
}
