/* Telegram Marketplace — independent storefront rebuild.
   Styles are intentionally formatted and not minified. */
:root {
  --canvas: #f4f6fb;
  --paper: #ffffff;
  --ink: #17223b;
  --body-text: #526179;
  --muted: #8491a8;
  --line: #e4e9f2;
  --brand: #5b46ea;
  --brand-dark: #3825b2;
  --brand-pale: #f0edff;
  --accent: #12b5a5;
  --warning: #ef6475;
  --shadow: 0 14px 44px rgba(32, 48, 90, .07);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { text-decoration: none; color: inherit; }
a:hover { color: var(--brand); }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #ac9fff; outline-offset: 3px; }
.wrap, .market-container { width: min(1260px, calc(100% - 48px)); margin-inline: auto; }
.market-ribbon { background: #151b3c; color: #dfe5ff; font-size: 12px; }
.ribbon-inner { min-height: 32px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ribbon-inner span { color: #a3f3e5; }
.market-header { background: #fff; position: relative; z-index: 20; box-shadow: 0 2px 18px rgba(25,35,64,.04); }
.market-head-main { min-height: 94px; display: flex; align-items: center; gap: 38px; }
.market-brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.market-brand-icon { display: grid; place-items: center; width: 48px; height: 48px; font-size: 29px; color: white; background: linear-gradient(135deg,#755df5,#4030bf); border-radius: 15px; box-shadow: 0 10px 20px #6753d631; }
.market-brand-wordmark { display: grid; line-height: 1.35; }
.market-brand-wordmark strong { font-size: 18px; letter-spacing: -.4px; }
.market-brand-wordmark small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.market-search-trigger { flex: 1; text-align: left; border-radius: 15px; border: 1px solid #e1e4f1; background: #f7f8fd; color: #8590aa; height: 48px; padding: 0 22px; min-width: 120px; }
.market-search-trigger:hover { border-color: #bdb2f4; background: white; }
.market-head-actions { display: flex; gap: 18px; align-items: center; font-weight: 600; font-size: 13px; white-space: nowrap; }
.market-head-actions a:last-child { background: var(--brand-pale); color: var(--brand-dark); border-radius: 11px; padding: 9px 13px; }
.market-categories { border-top: 1px solid #edf0f6; }
.market-categories-inner { display: flex; gap: 34px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.market-categories a { padding: 14px 1px; position: relative; font-weight: 650; color: #4e5a76; font-size: 14px; }
.market-categories a:hover, .market-categories a.current { color: var(--brand); }
.market-categories a.current:after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--brand); }
.market-content { min-height: 64vh; }
.content-space { padding-block: 29px 64px; }
.market-hero { margin: 5px 0 30px; background: linear-gradient(115deg,#17173d 0%,#3d36a7 62%,#6952e4 100%); color: white; border-radius: 28px; min-height: 340px; padding: 48px 55px; display: flex; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; position: relative; }
.market-hero:after { content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%; right: -110px; top: -200px; background: #ffffff0a; pointer-events: none; }
.market-hero-copy { max-width: 640px; position: relative; z-index: 1; }
.market-eyebrow { color: #b8f7ed; font-weight: 750; font-size: 12px; letter-spacing: .14em; }
.market-hero h1 { margin: 15px 0 15px; font-size: clamp(30px,3.5vw,48px); letter-spacing: -1px; line-height: 1.25; }
.market-hero p { font-size: 15px; line-height: 1.9; color: #e2e0ff; }
.market-hero-actions { display: flex; gap: 12px; margin-top: 27px; flex-wrap: wrap; }
.market-hero-actions a { border-radius: 12px; padding: 11px 22px; font-weight: 700; }
.market-primary-link { background: #fff; color: #32259b; }
.market-secondary-link { border: 1px solid #ffffff66; color: white; }
.market-hero-visual { width: 230px; flex: 0 0 230px; display: grid; gap: 12px; transform: rotate(-6deg); }
.market-hero-stat { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; align-items: center; background: #fff; color: #68758f; box-shadow: 0 10px 30px #11112a40; padding: 12px 18px; border-radius: 14px; font-size: 11px; }
.market-hero-stat b { grid-row: span 2; background: #ece9ff; color: var(--brand); width: 30px; height: 30px; text-align: center; border-radius: 9px; font-size: 20px; }
.market-hero-stat strong { color: var(--ink); font-size: 14px; }
.market-intro-note { background: white; border: 1px solid var(--line); padding: 23px 28px; border-radius: var(--radius); margin-bottom: 32px; }
.market-intro-note h2 { font-size: 18px; margin: 0 0 10px; }
.market-intro-note p { margin: 5px 0; color: var(--body-text); }
.market-section, .block, .home-columns { margin-bottom: 32px; }
.block-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 16px; }
.block-title h2 { margin: 0; font-size: 23px; letter-spacing: -.6px; }
.block-title > a { color: var(--brand); font-weight: 650; }
.product-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.product-card { display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .22s,box-shadow .22s,border-color .22s; min-width: 0; }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: #d3caff; color: inherit; }
.product-image { background: linear-gradient(145deg,#f0f2fa,#e9edfb); height: 194px; display: grid; place-items: center; overflow: hidden; }
.product-image img { height: 100%; width: 100%; object-fit: contain; padding: 12px; transition: transform .25s; }
.product-card:hover .product-image img { transform: scale(1.04); }
.product-info { padding: 17px 18px 19px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.auto-tag { font-size: 11px; font-weight: 750; color: #0b857b; background: #e4f8f3; display: inline-block; border-radius: 7px; padding: 2px 8px; }
.product-title { font-weight: 750; font-size: 15px; line-height: 1.6; margin: 12px 0 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-bottom { margin-top: auto; display: flex; width: 100%; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: end; }
.stock { color: var(--muted); font-size: 12px; }
.price, .big-price { font-weight: 850; color: #eb5367; }
.price { font-size: 23px; letter-spacing: -.5px; }
.home-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.side-box { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; }
.side-box h2,.side-box h3 { margin-top: 0; }
.mini-item, .cat-line { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.article-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.article-card { background: white; border: 1px solid var(--line); border-radius: 17px; padding: 22px; }
.article-card h3 { margin: 4px 0 12px; line-height: 1.5; }
.article-meta-small { color: var(--muted); font-size: 12px; }
.list-layout { display: grid; grid-template-columns: 225px minmax(0,1fr); gap: 26px; align-items: start; }
.filter-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: sticky; top: 20px; }
.market-filter-heading { padding: 10px 13px 15px; font-weight: 800; font-size: 18px; }
.filter-item { display: flex; justify-content: space-between; gap: 8px; padding: 12px 13px; border-radius: 10px; color: var(--body-text); font-weight: 600; }
.filter-item:hover, .filter-item.active { color: var(--brand); background: var(--brand-pale); }
.filter-item span:last-child { color: #9299b4; font-size: 12px; }
.market-list-heading { padding: 5px 0 20px; }
.market-list-heading h1 { font-size: 31px; margin: 0 0 4px; }
.market-list-heading p { margin: 0; color: var(--muted); }
.sort-box { display: flex; background: white; gap: 20px; flex-wrap: wrap; padding: 14px 19px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 13px; font-size: 13px; }
.sort-box a:first-child { color: var(--brand); font-weight: 700; }
.blog-list { display: grid; gap: 13px; }
.blog-row { display: block; border: 1px solid var(--line); background: white; border-radius: 15px; padding: 22px 24px; }
.blog-row:hover { border-color: #baadf4; box-shadow: var(--shadow); }
.blog-row h3 { margin: 0 0 7px; font-size: 17px; line-height: 1.55; }
.blog-row p { margin: 0; font-size: 12px; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.pagination a,.pagination span { background: white; border: 1px solid var(--line); padding: 7px 13px; border-radius: 8px; }
.detail-wrap { padding-top: 24px; padding-bottom: 60px; }
.market-breadcrumb { color: #8892ab; margin: 3px 0 20px; font-size: 13px; }
.market-breadcrumb a { color: #626c87; }
.detail-box { display: grid; grid-template-columns: minmax(220px,42%) 1fr; gap: 35px; background: white; border: 1px solid var(--line); border-radius: 24px; padding: 30px; margin-bottom: 24px; }
.detail-image { background: #f3f4fa; min-height: 310px; display: grid; place-items: center; border-radius: 17px; overflow: hidden; }
.detail-image img { width: 100%; max-height: 350px; object-fit: contain; padding: 16px; }
.detail-main { min-width: 0; }
.detail-main h1 { font-size: clamp(22px,2.5vw,31px); line-height: 1.48; margin: 0 0 15px; }
.big-price { margin: 14px 0 24px; font-size: 40px; letter-spacing: -1px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-row { display: flex; gap: 15px; align-items: flex-start; margin: 14px 0; }
.detail-row > .label { flex: 0 0 85px; color: var(--muted); padding-top: 7px; }
.detail-row > :not(.label) { min-width: 0; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { background: #f5f6fc; border: 0; padding: 5px 15px; font-size: 18px; }
.qty input { border: 0; width: 56px; text-align: center; background: white; }
.contact, .field input, .auth-card input, .order-card input { max-width: 100%; border: 1px solid #dfe5f0; border-radius: 11px; background: #fff; padding: 11px 13px; }
.contact { flex: 1; }
.pay-list { display: flex; flex-wrap: wrap; gap: 9px; }
.pay-item { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fafbff; font-size: 12px; }
.pay-item img { width: 22px; height: 22px; object-fit: contain; }
.buy-button,.primary { background: linear-gradient(120deg,#6850f0,#4930d7); color: #fff; border: 0; border-radius: 12px; padding: 12px 30px; font-weight: 800; box-shadow: 0 8px 23px #543be433; }
.buy-button { width: 100%; margin-top: 13px; font-size: 16px; }
.buy-button:hover,.primary:hover { filter: brightness(1.07); }
.desc-box { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 29px 34px; overflow-wrap: anywhere; color: var(--body-text); }
.desc-box > h2:first-child:not(.tg-detail-label) { color: var(--ink); margin-top: 0; }
.desc-box p { line-height: 1.95; margin: 10px 0; }
.desc-box a { color: #1889ba; text-decoration: underline; }
/* Restore blue/red product information labels as in source screenshots. */
.desc-box .tg-detail-label { display: table; width: auto; border: 1px solid #bfd2ff; background: #eff5ff; color: #2563eb; border-radius: 99px; padding: 6px 13px; font-size: 15px; font-weight: 800; line-height: 1.45; margin: 22px 0 11px; }
.desc-box .tg-detail-label.tg-alert { border-color: #ffb8c1; background: #fff2f3; color: #e84558; }
.article-box { background: white; border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px,4vw,50px); margin: 20px 0 45px; max-width: 920px; }
.article-box h1 { margin-top: 0; font-size: clamp(26px,3.3vw,38px); line-height: 1.35; }
.article-meta { color: var(--muted); font-size: 13px; padding: 14px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.article-content { font-size: 16px; line-height: 2; color: #43516a; overflow-wrap: anywhere; }
.article-content h2 { margin-top: 35px; font-size: 23px; color: var(--ink); }
.article-content h3 { margin-top: 27px; color: var(--ink); }
.article-content p { margin: 15px 0; }
.article-content img { border-radius: 14px; margin: 20px 0; }
.article-content a,.prev-next a { color: var(--brand); }
.prev-next { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 22px; }
.auth-wrap,.order-page { display: grid; place-items: center; padding: 60px 0; }
.auth-card,.order-shell,.order-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.auth-card { width: min(480px,100%); }
.field { display: grid; gap: 8px; margin: 14px 0; }
.order-shell { width: min(800px,100%); }
.order-tabs,.auth-switch { display: flex; gap: 12px; padding-bottom: 14px; }
.market-footer { background: #171c3e; color: #c6cbe5; margin-top: 40px; padding: 44px 0 0; }
.market-footer-layout { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.market-footer-layout strong { color: white; font-size: 19px; }
.market-footer-layout p { margin-top: 5px; font-size: 13px; }
.market-footer-links { display: flex; gap: 23px; flex-wrap: wrap; align-items: start; font-size: 13px; }
.market-copyright { color: #8f96ba; margin-top: 33px; padding: 17px 0; border-top: 1px solid #ffffff17; font-size: 12px; }
.search-overlay { display: none; position: fixed; z-index: 100; inset: 0; background: #151936ae; padding: 15vh 16px 16px; }
.search-overlay.active,.search-overlay.show,.search-overlay.open { display: block; }
.search-modal { width: min(620px,100%); background: white; border-radius: 20px; margin: auto; padding: 28px; box-shadow: 0 30px 100px #161a3d50; }
.search-tabs { display: flex; gap: 14px; margin-bottom: 18px; }
.search-tabs button { border: 0; border-radius: 8px; padding: 7px 12px; background: #f0f1f9; }
.search-tabs button.active { background: var(--brand); color: white; }
.search-modal input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px; }
.search-hint { text-align: right; color: var(--muted); font-size: 12px; margin-top: 12px; }
@media (max-width:1050px) {
  .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .market-head-main { gap: 18px; }
  .market-hero-visual { flex-basis: 190px; width: 190px; }
}
@media (max-width:760px) {
  .wrap,.market-container { width: min(100% - 28px,1260px); }
  .ribbon-inner { font-size: 10px; }
  .ribbon-inner span { display:none; }
  .market-head-main { flex-wrap: wrap; gap: 12px; padding: 14px 0; }
  .market-brand { flex: 1; }
  .market-brand-icon { width: 42px; height: 42px; }
  .market-brand-wordmark strong { font-size: 15px; }
  .market-head-actions { font-size: 12px; gap: 12px; }
  .market-search-trigger { order: 3; flex: 0 0 100%; height: 40px; }
  .market-categories-inner { gap: 19px; }
  .market-categories a { font-size: 12px; }
  .market-hero { padding: 33px 26px; min-height: auto; }
  .market-hero-visual { display: none; }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .product-image { height: 165px; }
  .product-info { padding: 12px; }
  .product-title { font-size: 13px; }
  .price { font-size: 20px; }
  .list-layout { display: block; }
  .filter-box { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 18px; position: static; }
  .market-filter-heading { white-space: nowrap; font-size: 14px; padding: 9px; }
  .filter-item { flex: 0 0 auto; padding: 8px; font-size: 12px; }
  .detail-box { grid-template-columns: 1fr; gap: 20px; padding: 18px; }
  .detail-image { min-height: 220px; }
  .detail-image img { max-height: 270px; }
  .detail-row { flex-wrap: wrap; }
  .detail-row > .label { flex: 0 0 100%; padding-top: 0; }
  .desc-box { padding: 20px; }
  .home-columns,.article-grid { grid-template-columns: 1fr; }
}
@media (max-width:430px) {
  .market-head-actions a:first-child { display:none; }
  .market-hero h1 { font-size: 29px; }
  .product-image { height: 125px; }
  .product-bottom { align-items: start; }
  .price { font-size: 19px; }
  .detail-main h1 { font-size: 22px; }
  .market-footer-links { gap: 12px; }
}
