/* ==========================================================================
   app-kit · web/store.css — phần web DÙNG CHUNG (kit 1.2.0): nút tải app có icon cửa hàng + khối "iPhone và Android".
   Mọi phần khác của web là thiết kế riêng của từng app.
   Lấy từ horoscope (trang-chu.css .lp-play, .lp-pf*) và fyri (#platforms), chủ dự án chốt 16/10/2026.

   Nạp sau token của app và design/kit.css (thẻ dùng kính chung k-glass-card):
     <link rel="stylesheet" href="kit/kit-tokens.sample.css">   giá trị mặc định
     <link rel="stylesheet" href="<token của app → --k-*>">
     <link rel="stylesheet" href="kit/kit.css">
     <link rel="stylesheet" href="kit/store.css">
     <script src="kit/store.js" defer></script>
   Trạng thái cửa hàng: <html data-play="soon|live" data-appstore="soon|live"> (WEB_KIT §4).

   Màu: chỉ var(--k-*). Ngoại lệ duy nhất: hình icon cửa hàng/hệ điều hành trong url("data:image/svg+xml…")
   giữ màu thương hiệu của chúng (không theo theme), kiểm bằng scripts/check_kit_css.py.
   ========================================================================== */

/* ---------------------------------------------------------------- nút tải */
/*
 * <a class="k-store" data-store="android" href="https://play.google.com/store/apps/details?id=…">
 *   <span class="k-store__icon k-store__icon--play"></span>
 *   <span class="k-store__text"><small><span class="k-store__live">Tải trên</span><span class="k-store__soon">Sắp có trên</span></small><b>Google Play</b></span>
 * </a>
 * <a class="k-store" data-store="ios" href="https://apps.apple.com/app/id…">
 *   <span class="k-store__icon k-store__icon--appstore"></span>
 *   <span class="k-store__text"><small><span class="k-store__live">Tải trên</span><span class="k-store__soon">Sắp có trên</span></small><b>App Store</b></span>
 * </a>
 */
.k-store-row { display: flex; flex-wrap: wrap; gap: var(--k-space-md); }
.k-store {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-md);
  height: 60px;
  padding: 0 var(--k-space-xl) 0 18px;
  border-radius: 18px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--k-store-content);
  background: color-mix(in srgb, var(--k-store-fill) 92%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--k-store-content) 22%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--k-store-content) 14%, transparent), 0 14px 30px -16px var(--k-glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  transition: transform var(--k-dur-quick) var(--k-ease-out);
}
.k-store[href]:hover { transform: translateY(-2px); }
.k-store[href]:focus-visible { outline: 3px solid var(--k-accent); outline-offset: 3px; }
.k-store[aria-disabled="true"] { cursor: default; }
.k-store__text { display: flex; flex-direction: column; }
.k-store small { display: block; font: 600 11px/1 var(--k-font-body); letter-spacing: .5px; text-transform: uppercase; opacity: .75; }
.k-store b { display: block; margin-top: 2px; font: var(--k-display-weight) 19px/1.15 var(--k-font-display); }
/* Chữ nhỏ theo trạng thái cửa hàng: mặc định "Sắp có trên"; tổ tiên có data-play / data-appstore="live" thì "Tải trên". */
.k-store__live { display: none; }
[data-play="live"] .k-store[data-store="android"] .k-store__live,
[data-appstore="live"] .k-store[data-store="ios"] .k-store__live { display: inline; }
[data-play="live"] .k-store[data-store="android"] .k-store__soon,
[data-appstore="live"] .k-store[data-store="ios"] .k-store__soon { display: none; }

/* ---------------------------------------------------------------- icon (màu thương hiệu, không theo theme) */
.k-store__icon, .k-os { flex: none; display: inline-block; background: center / contain no-repeat; }
.k-store__icon { width: 28px; height: 28px; }
.k-store__icon--play {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 28'><path d='M4 2.2 16.4 14 4 25.8c-.6-.3-1-1-1-1.8V4c0-.8.4-1.5 1-1.8z' fill='%232FA8F5'/><path d='M4 2.2c.6-.3 1.3-.3 2 .1l14.3 8.1-3.9 3.6z' fill='%2334D07B'/><path d='M4 25.8l12.4-11.8 3.9 3.6L6 25.7c-.7.4-1.4.4-2 .1z' fill='%23F0503F'/><path d='m20.3 10.4 3.4 1.9c1.3.8 1.3 2.6 0 3.4l-3.4 1.9-3.9-3.6z' fill='%23F7C948'/></svg>");
}
.k-store__icon--appstore {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%231FC2FB'/><stop offset='1' stop-color='%231E6CF2'/></linearGradient></defs><rect width='28' height='28' rx='7' fill='url(%23g)'/><g transform='translate(3 3) scale(.9167)' fill='none' stroke='%23fff' stroke-width='2.1' stroke-linecap='round'><path d='M9.3 16.4 13.6 8.9M14.7 16.4 12.6 12.8M6.6 14.2h7.1M15.6 14.2h1.8M6.9 17.6l.7-1.2'/></g></svg>");
}
/* Icon hệ điều hành: Android (xanh thương hiệu), Apple (theo màu chữ, vẽ bằng mask). */
.k-os { width: 16px; height: 16px; }
.k-os--android {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%233DDC84' d='M2.5 18.5a9.5 9.5 0 0 1 19 0z'/><path d='M7.2 10.6 5 6.8M16.8 10.6 19 6.8' stroke='%233DDC84' stroke-width='1.6' stroke-linecap='round'/><circle cx='8.2' cy='14.6' r='1.25' fill='%23fff'/><circle cx='15.8' cy='14.6' r='1.25' fill='%23fff'/></svg>");
}
.k-os--apple {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'/></svg>") center / contain no-repeat;
}

/* ---------------------------------------------------------------- khối "iPhone và Android" */
/*
 * Máy mini luôn dáng iPhone (Dynamic Island, bo như máy thật) cho cả hai thẻ: chủ dự án chốt 16/10/2026 ("lấy iPhone tất cả",
 * máy Android trong ảnh nhìn xấu). Hệ điều hành nhận ra qua icon cạnh tiêu đề.
 * <div class="k-platforms">
 *   <article class="k-platform k-glass-card">
 *     <div class="k-device" aria-hidden="true"><div class="k-device__screen"><img class="k-device__shot" src="screens/home.webp" alt=""></div></div>
 *     <div class="k-platform__body">
 *       <h3 class="k-platform__title"><span class="k-os k-os--android"></span>Android <span class="k-when">Tháng 12/2026</span></h3>
 *       <ul class="k-checks"><li>…</li></ul>
 *       <a class="k-store" data-store="android" …>…</a>
 *     </div>
 *   </article>
 *   … (iPhone: k-os--apple, data-store="ios")
 * </div>
 * <p class="k-platforms__note">Ngày ra mắt là kế hoạch, chưa phải lời hứa…</p>
 * Trong máy: ảnh màn hình (k-device__shot, phủ kín, căn đỉnh) hoặc icon/linh vật (k-device__art, giữa màn, bo như icon app).
 */
.k-platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.k-platform {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 26px;
  border-radius: var(--k-radius-sheet);
  color: var(--k-content);
}
/* iPhone 17 Pro thu nhỏ: viền đen 2,6 % bề rộng, vành kim loại 1,5 px; màn bo 13,7 % bề rộng như máy thật,
   góc ngoài = góc màn + viền (15,6 % / 7,3 %) để hai đường cong song song. Dynamic Island 31 % × 4,2 %. */
.k-device {
  position: relative;
  --kx-device-w: 116px;
  width: var(--kx-device-w);
  aspect-ratio: 600 / 1324;
  padding: calc(var(--kx-device-w) * .026); /* % của padding tính theo khối cha, nên tính từ bề rộng máy */
  box-sizing: content-box;
  border-radius: 15.6% / 7.3%;
  background: var(--k-device-frame);
  box-shadow: 0 0 0 1.5px var(--k-device-edge), 0 24px 40px -24px var(--k-glass-shadow);
}
.k-device__screen {
  position: relative;
  height: 100%;
  border-radius: 13.7% / 6.2%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(170deg, var(--k-surface), color-mix(in srgb, var(--k-accent) 22%, var(--k-surface)));
}
.k-device__screen::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 1.3%;
  left: 50%;
  width: 31.3%;
  height: 4.2%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--k-device-frame);
}
.k-platform__body { min-width: 0; }
.k-device__shot { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.k-device__art { width: 50%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 22.5%; box-shadow: 0 8px 18px -8px var(--k-glass-shadow); }
/* Cách cũ (icon hệ điều hành trên màn máy mini): vẫn chạy, nên chuyển icon lên tiêu đề. */
.k-device__os { position: absolute; z-index: 2; top: 9%; left: 50%; transform: translateX(-50%); color: var(--k-content); }
.k-platform__title .k-os { width: 22px; height: 22px; }
.k-platform__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  font: var(--k-display-weight) 28px/1.2 var(--k-font-display);
}
.k-when {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--k-radius-pill);
  display: inline-flex;
  align-items: center;
  font: 700 13px/1 var(--k-font-body);
  color: var(--k-accent);
  background: var(--k-accent-soft);
}
.k-checks { list-style: none; margin: 14px 0 20px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.k-checks li { display: flex; gap: 10px; align-items: flex-start; font: 400 15px/1.45 var(--k-font-body); }
.k-checks li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: var(--k-accent);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12l5 5 9-10'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12l5 5 9-10'/></svg>") center / contain no-repeat;
}
.k-platforms__note { margin: 18px 0 0; text-align: center; font: 400 13.5px/1.5 var(--k-font-body); color: var(--k-content-muted); }

@media (max-width: 860px) {
  .k-platforms { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .k-platform { grid-template-columns: 88px minmax(0, 1fr); gap: 18px; padding: 20px; }
  .k-device { --kx-device-w: 88px; }
  .k-platform__title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .k-store { transition: none; }
  .k-store[href]:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .k-store { background: var(--k-store-fill); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
