/*
 * The website's own CSS (public/index.html links it; the server adds ?v=<hash> and caches it a year).
 * 1. React Native Web's page reset (was inline in Expo's default index.html — no inline style here).
 * 2. Hind Siliguri, subset WOFF2 (tools/subset-fonts.py): Bangla and Latin parts, only the part a page
 *    uses is downloaded, text shows at once in the phone's font and swaps when the font arrives.
 *    Family names = the app's (tailwind.config.js fontFamily), so the app uses these files on the web.
 * 3. The server's first view (#ssr, server/views.ts) — colours only from the theme variables the
 *    server writes (/web/theme-<hash>.css, made by src/theme/palette.ts).
 * 4. The hand-over: while the first view is up the app draws hidden underneath; when its screen is
 *    ready it adds html.app-ready (src/lib/web/handoff.ts) and the first view goes — no jump.
 */

/* 1 */
html,
body {
  height: 100%;
}
body {
  overflow: hidden;
  margin: 0;
}
#root {
  display: flex;
  height: 100%;
  flex: 1;
}

/* 2 */
@font-face {
  font-family: 'HindSiliguri_400Regular';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-400-bn.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'HindSiliguri_400Regular';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'HindSiliguri_500Medium';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-500-bn.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'HindSiliguri_500Medium';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'HindSiliguri_600SemiBold';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-600-bn.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'HindSiliguri_600SemiBold';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'HindSiliguri_700Bold';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-700-bn.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'HindSiliguri_700Bold';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/hind-siliguri-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * The first view's own family: the SAME files, but font-display: optional — if the font is not there
 * at first paint (it is preloaded, so usually it is) the phone's font stays for this view: text never
 * jumps (layout shift) while the shopper reads. The app's families above swap as usual.
 */
@font-face {
  font-family: 'ShopFirstView';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url(/fonts/hind-siliguri-400-bn.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'ShopFirstView';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url(/fonts/hind-siliguri-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'ShopFirstView';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url(/fonts/hind-siliguri-700-bn.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'ShopFirstView';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url(/fonts/hind-siliguri-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 4 */
html.ssr:not(.app-ready) #root {
  visibility: hidden;
}
html.app-ready #ssr {
  display: none;
}

/* 3 */
.ssr {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgb(var(--bg));
  color: rgb(var(--text));
  font-family: 'ShopFirstView', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.ssr a {
  color: inherit;
  text-decoration: none;
}
.ssr h1,
.ssr h2,
.ssr b {
  font-weight: 700;
}
.ssr h1 {
  font-size: 20px;
  line-height: 1.35;
  margin: 8px 0 6px;
}
.ssr h2 {
  font-size: 17px;
  margin: 20px 0 10px;
}
.ssr-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px 0 16px;
  background: rgb(var(--brand));
  color: rgb(var(--on-brand));
}
.ssr-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}
.ssr-logo {
  height: 28px;
  width: auto;
}
.ssr-name {
  font-weight: 700;
  font-size: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ssr-actions {
  display: flex;
  gap: 4px;
}
.ssr-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}
.ssr-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px 24px;
}
.ssr-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0 2px;
  font-size: 13px;
  color: rgb(var(--muted));
}
.ssr-crumbs i {
  font-style: normal;
}
.ssr-product {
  display: block;
}
.ssr-gallery {
  margin: 4px -16px 0;
  aspect-ratio: 1 / 1;
  background: rgb(var(--surface-2));
  overflow: hidden;
}
.ssr-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ssr-price {
  margin: 6px 0;
  font-size: 15px;
}
.ssr-price b {
  font-size: 22px;
  color: rgb(var(--price));
}
.ssr-price s {
  color: rgb(var(--muted));
  margin-left: 6px;
}
.ssr-off {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgb(var(--deal) / 0.15);
  color: rgb(var(--deal));
  font-size: 13px;
}
.ssr-stock,
.ssr-cod,
.ssr-muted {
  margin: 4px 0;
  color: rgb(var(--muted));
  font-size: 14px;
}
.ssr-stock {
  color: rgb(var(--success));
}
.ssr-options {
  margin: 8px 0;
  padding: 0;
  list-style: none;
}
.ssr-short,
.ssr-desc,
.ssr-text {
  overflow-wrap: anywhere;
}
.ssr-desc {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgb(var(--border));
}
.ssr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
}
.ssr-card {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
}
.ssr-card img,
.ssr-noimg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgb(var(--surface-2));
}
.ssr-card-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 8px 0;
  font-size: 14px;
  line-height: 1.4;
  min-height: 2.8em;
}
.ssr-card .ssr-price {
  margin: 2px 8px 8px;
}
.ssr-card .ssr-off {
  display: none;
}
.ssr-card .ssr-price b {
  font-size: 16px;
}
.ssr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.ssr-chips a {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  font-size: 14px;
}
.ssr-banner {
  display: block;
  margin: 12px 0 4px;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 720 / 300;
  background: rgb(var(--surface-2));
}
.ssr-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ssr-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
}
.ssr-pager a {
  padding: 8px 14px;
  border-radius: 10px;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  color: rgb(var(--link));
}
.ssr-cats {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ssr-cats li {
  padding: 10px 0;
  border-bottom: 1px solid rgb(var(--border));
}
.ssr-cats li a {
  margin-right: 10px;
}
.ssr-404 {
  padding: 40px 0;
  text-align: center;
}
.ssr-search {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 18px auto;
}
.ssr-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  color: rgb(var(--text));
  font: inherit;
}
.ssr-search button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: rgb(var(--buy));
  color: rgb(var(--on-buy));
  font: inherit;
}
.ssr-foot {
  max-width: 1240px;
  margin: 24px auto 0;
  padding: 16px 16px 32px;
  border-top: 1px solid rgb(var(--border));
  color: rgb(var(--muted));
  font-size: 13px;
}
.ssr-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ssr-hide {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
@media (min-width: 640px) {
  .ssr-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .ssr-product {
    display: grid;
    grid-template-columns: 520px minmax(0, 1fr);
    gap: 32px;
    margin-top: 12px;
  }
  .ssr-gallery {
    margin: 0;
    border-radius: 16px;
  }
  .ssr-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
