:root {
  --red:#e50914; --red-dark:#b9000a; --ink:#171717; --muted:#737373;
  --bg:#f5f5f6; --card:#fff; --line:#ececef; --green:#149447;
  --shadow:0 12px 36px rgba(30,20,20,.10); --radius:24px;
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;padding-bottom:92px;min-height:100vh}
button,input,textarea,select{font:inherit}.hidden{display:none!important}.topbar{height:72px;position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;padding:0 max(18px,calc((100vw - 1180px)/2));background:rgba(255,255,255,.92);backdrop-filter:blur(18px);border-bottom:1px solid rgba(0,0,0,.05)}
.brand{border:0;background:none;font-size:24px;font-weight:800;letter-spacing:-1.2px;display:flex;align-items:center;cursor:pointer;padding:0}.brand em{font-family:Georgia,serif;color:var(--red);font-weight:700}.brand-k{width:36px;height:36px;border-radius:12px;background:var(--red);color:#fff;display:grid;place-items:center;margin-right:7px;box-shadow:0 7px 16px rgba(229,9,20,.25)}
.header-actions{display:flex;gap:10px;align-items:center}.icon-btn{width:42px;height:42px;border:1px solid var(--line);background:#fff;border-radius:14px;font-size:27px;line-height:1;cursor:pointer}.admin-link{color:#fff;background:var(--ink);padding:11px 16px;border-radius:13px;text-decoration:none;font-size:14px;font-weight:700}
.page{max-width:1180px;margin:auto;padding:26px 18px 40px}.loader,.empty{padding:60px 20px;text-align:center;color:var(--muted)}
.hero{position:relative;overflow:hidden;min-height:310px;border-radius:32px;background:linear-gradient(125deg,#fff 0 56%,#ffe8e9);box-shadow:var(--shadow);display:flex;align-items:center;padding:44px;margin-bottom:34px}.hero:before,.hero:after{content:"";position:absolute;background:var(--red);border-radius:50%}.hero:before{width:290px;height:290px;right:-80px;top:-100px}.hero:after{width:160px;height:160px;right:150px;bottom:-100px;opacity:.12}.hero-copy{position:relative;z-index:2;max-width:590px}.eyebrow{display:inline-flex;background:#fff0f0;color:var(--red);border:1px solid #ffd9db;border-radius:99px;padding:7px 12px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.hero h1{font-size:clamp(34px,6vw,66px);line-height:.98;letter-spacing:-3px;margin:18px 0 16px}.hero h1 em{font-family:Georgia,serif;color:var(--red)}.hero p{font-size:18px;color:#626262;line-height:1.55;max-width:520px;margin:0 0 25px}.primary,.secondary{border:0;border-radius:15px;padding:14px 20px;font-weight:800;cursor:pointer}.primary{color:#fff;background:linear-gradient(135deg,var(--red),var(--red-dark));box-shadow:0 9px 20px rgba(229,9,20,.24)}.secondary{background:#f1f1f3;color:var(--ink)}
.section{margin:32px 0}.section-head{display:flex;align-items:end;justify-content:space-between;margin-bottom:16px;gap:12px}.section-head h1,.section-head h2{margin:0;letter-spacing:-1px}.section-head h1{font-size:30px}.section-head h2{font-size:24px}.section-head p{margin:5px 0 0;color:var(--muted)}.text-btn{border:0;background:none;color:var(--red);font-weight:800;cursor:pointer}
.category-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}.category-card{position:relative;border:0;padding:0;background:#fff;border-radius:22px;overflow:hidden;min-height:180px;cursor:pointer;text-align:left;box-shadow:0 6px 22px rgba(35,20,20,.08);transition:.2s}.category-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.category-card img{width:100%;height:100%;position:absolute;object-fit:cover}.category-card .category-label{position:absolute;left:14px;bottom:14px;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-radius:14px;padding:10px 14px;font-weight:800;box-shadow:0 5px 15px rgba(0,0,0,.1)}
.category-banner{width:100%;aspect-ratio:2.55/1;object-fit:cover;border-radius:25px;box-shadow:var(--shadow);margin-bottom:25px;background:#fff}.back-btn{border:0;background:#fff;border-radius:13px;padding:11px 15px;margin-bottom:14px;font-weight:700;cursor:pointer}
.product-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.product-card{position:relative;background:var(--card);border:1px solid var(--line);border-radius:20px;padding:18px;min-height:190px;display:flex;flex-direction:column;cursor:pointer;transition:.2s;text-align:left}.product-card:hover{transform:translateY(-3px);box-shadow:var(--shadow);border-color:#ffd4d6}.product-icon{width:48px;height:48px;border-radius:16px;background:linear-gradient(145deg,#fff0f0,#ffd9db);color:var(--red);display:grid;place-items:center;font-weight:900;font-size:19px;margin-bottom:20px}.product-card h3{font-size:16px;margin:0 0 8px;line-height:1.25}.stock{font-size:12px;color:var(--green);margin-bottom:auto}.stock.out{color:var(--red)}.price-row{display:flex;align-items:baseline;gap:8px;margin-top:18px}.price{font-size:19px;font-weight:900}.old-price{text-decoration:line-through;color:#aaa;font-size:13px}.sale{position:absolute;top:14px;right:14px;background:var(--red);color:#fff;font-weight:800;font-size:11px;padding:5px 8px;border-radius:8px}
.bottom-nav{position:fixed;z-index:30;bottom:0;left:50%;transform:translateX(-50%);display:flex;width:min(680px,calc(100% - 12px));padding:8px 5px;background:rgba(255,255,255,.94);backdrop-filter:blur(20px);border:1px solid var(--line);border-radius:22px 22px 0 0;box-shadow:0 -8px 30px rgba(0,0,0,.08);padding-bottom:max(8px,env(safe-area-inset-bottom))}.bottom-nav button,.bottom-nav .bottom-link{flex:1 1 0;min-width:0;border:0;background:none;color:#8d8d91;font-size:10px;font-weight:700;padding:5px 1px;cursor:pointer;text-decoration:none;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;white-space:nowrap}.bottom-nav svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.bottom-nav button.active{color:var(--red)}
.sheet{border:0;border-radius:28px;padding:0;width:min(600px,calc(100% - 22px));max-height:90vh;box-shadow:0 24px 80px rgba(0,0,0,.3);overflow:auto}.sheet::backdrop{background:rgba(20,10,10,.55);backdrop-filter:blur(4px)}.product-detail{padding:25px}.detail-top{min-height:180px;border-radius:23px;background:linear-gradient(145deg,#fff3f3,#ffd7d9);display:grid;place-items:center;color:var(--red);font-size:55px;font-weight:900;position:relative}.close{position:absolute;right:14px;top:14px;width:38px;height:38px;border:0;border-radius:50%;background:#fff;font-size:25px;cursor:pointer}.product-detail h2{font-size:28px;margin:22px 0 8px}.product-detail p{line-height:1.6;color:#626262}.detail-meta{display:flex;align-items:center;justify-content:space-between;margin:22px 0}.detail-meta .price{font-size:28px}.buy-btn{width:100%;font-size:16px;padding:16px}.buy-btn:disabled{background:#aaa;box-shadow:none}.payment-box{background:#fff7f7;border:1px solid #ffd5d7;border-radius:17px;padding:16px;margin-top:14px}.payment-box a{display:block;text-align:center;text-decoration:none;margin-bottom:10px}
.search-sheet{padding:23px;min-height:55vh}.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head h2{margin:0}.dialog-head button{border:0;background:#eee;width:38px;height:38px;border-radius:50%;font-size:23px}.search-box{display:flex;align-items:center;background:#f3f3f4;border-radius:15px;padding:0 14px;margin:20px 0}.search-box span{font-size:24px;color:#777}.search-box input{width:100%;padding:14px 10px;border:0;background:transparent;outline:0}.compact{grid-template-columns:repeat(2,1fr)}
.orders-list,.reviews-list{display:grid;gap:13px}.order-card,.review-card{background:#fff;border:1px solid var(--line);border-radius:19px;padding:18px}.order-top{display:flex;justify-content:space-between;gap:10px}.order-card h3,.review-card h3{margin:0 0 7px}.order-card p,.review-card p{margin:6px 0;color:#666;line-height:1.5}.status{font-size:11px;font-weight:800;padding:6px 9px;border-radius:99px;background:#f1f1f2;height:max-content}.status.fulfilled,.status.paid{background:#e7f8ee;color:var(--green)}.status.waiting_payment{background:#fff4dc;color:#9b6500}.review-stars{color:#ffb000;letter-spacing:2px}.review-form{background:#fff;border-radius:20px;padding:20px;margin-bottom:20px}.stars-input{display:flex;gap:5px;margin:14px 0}.stars-input button{border:0;background:none;font-size:29px;color:#ddd;padding:0;cursor:pointer}.stars-input button.on{color:#ffb000}.review-form textarea{width:100%;min-height:90px;border:1px solid var(--line);border-radius:14px;padding:12px;resize:vertical;margin-bottom:10px}.toast{position:fixed;z-index:100;left:50%;bottom:100px;transform:translate(-50%,20px);background:#202020;color:#fff;padding:12px 17px;border-radius:13px;opacity:0;pointer-events:none;transition:.25s;max-width:90%;text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:850px){.product-grid{grid-template-columns:repeat(2,1fr)}.hero{min-height:260px;padding:30px}.hero:before{right:-180px}.category-card{min-height:125px}.category-grid{gap:11px}.category-card .category-label{font-size:12px;padding:8px 10px;left:8px;bottom:8px}}
@media(max-width:520px){.topbar{height:62px;padding:0 14px}.brand{font-size:20px}.brand-k{width:32px;height:32px}.admin-link{display:none!important}.page{padding:16px 12px 35px}.hero{border-radius:23px;padding:25px 20px;min-height:250px}.hero h1{font-size:39px;letter-spacing:-2px}.hero p{font-size:14px}.section{margin:25px 0}.category-grid{grid-template-columns:1fr}.category-card{min-height:155px}.product-grid{gap:10px}.product-card{padding:14px;min-height:175px}.product-icon{margin-bottom:15px}.category-banner{border-radius:18px}.compact{grid-template-columns:1fr}.sheet{margin-top:auto;margin-bottom:0;width:100%;max-width:none;border-radius:26px 26px 0 0;max-height:92vh}}

/* Stable Kinder Store theme across Telegram WebViews (iOS, Android and Desktop). */
:root{color-scheme:light only}
html{background:#f5f5f6;color:#171717;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{background:#f5f5f6!important;color:#171717!important}
button,input,textarea,select{color:#171717;-webkit-appearance:none;appearance:none}
button{-webkit-tap-highlight-color:transparent}
a{color:inherit}
.topbar{background:#fff;border-bottom:1px solid #ececef}
.env-badge{position:fixed;right:72px;top:max(14px,env(safe-area-inset-top));z-index:80;background:#111;color:#fff;border:2px solid #e50914;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;letter-spacing:.08em;box-shadow:0 8px 20px rgba(229,9,20,.18);pointer-events:none}
.brand{width:clamp(170px,24vw,230px);height:52px;overflow:hidden;align-items:center}
.brand-logo{display:block;width:100%;height:auto;clip-path:inset(0 0 8% 0)}
.icon-btn{color:#e50914!important;font-weight:900;background:#fff!important;border-color:#e4e4e7!important}
.hero-logo{display:block;width:min(520px,78%);height:auto;clip-path:inset(0 0 8% 0);margin:18px 0 8px}
.hero-copy{width:100%}
.hero p{color:#5e5e62!important}
.primary{color:#fff!important;background:#e50914!important}
.secondary{color:#171717!important;background:#f1f1f3!important}
.text-btn{color:#e50914!important}

.category-card{position:relative;display:flex;flex-direction:column;min-height:0!important;color:#171717!important;background:#fff!important;border:1px solid #ececef!important}
.category-media{width:100%;aspect-ratio:1200/520;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff;padding:0}
.category-card img{position:static!important;display:block;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important}
.category-card .category-label{position:static!important;display:flex;justify-content:space-between;align-items:center;left:auto!important;bottom:auto!important;color:#171717!important;background:#fff!important;border-radius:0!important;padding:14px 16px!important;box-shadow:none!important;border-top:1px solid #f0f0f2;font-weight:800}
.category-count{color:#e50914;font-size:12px;white-space:nowrap}
.category-banner{display:block;width:100%;height:auto!important;max-height:none;aspect-ratio:16/9!important;object-fit:contain!important;object-position:center!important;background:#fff;padding:12px}

.product-card{color:#171717!important;background:#fff!important}
.product-card h3{color:#171717!important}
.product-card .price{color:#e50914!important}
.product-card .old-price{color:#9b9ba1!important}
.product-card .stock{color:#149447!important}
.product-card .stock.out{color:#e50914!important}
.bottom-nav{background:#fff!important;border-color:#e7e7ea!important}
.bottom-nav button{color:#8d8d91!important}
.bottom-nav button.active{color:#e50914!important}

.search-panel{position:fixed;z-index:70;inset:0;background:#f5f5f6;overflow:auto;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(18px);transition:opacity .18s ease,transform .18s ease,visibility .18s;padding:calc(18px + env(safe-area-inset-top)) 18px calc(110px + env(safe-area-inset-bottom))}
.search-panel.open{opacity:1;visibility:visible;pointer-events:auto;transform:none}
.search-panel-inner{width:min(920px,100%);margin:0 auto}
.search-panel .dialog-head{position:sticky;top:0;z-index:2;background:rgba(245,245,246,.96);backdrop-filter:blur(16px);padding:8px 0 14px}
.search-panel .dialog-head h2{margin:8px 0 0;color:#171717;font-size:28px}
.search-panel .dialog-head button{color:#171717!important;background:#fff!important;border:1px solid #e1e1e4!important}
.search-box{background:#fff!important;border:1px solid #e0e0e3;box-shadow:0 8px 24px rgba(30,20,20,.06)}
.search-box span{color:#e50914!important}
.search-box input{color:#171717!important;font-size:16px}
.search-box input::placeholder{color:#9a9aa0;opacity:1}
.search-hint{color:#737378;text-align:center;margin:36px 0}
body.search-open{overflow:hidden}

@media(max-width:850px){
  .category-grid{gap:14px}
  .category-card .category-label{font-size:14px!important;padding:12px 14px!important}
}
@media(max-width:520px){
  .topbar{background:#fff!important}
  .brand{width:178px;height:45px}
  .hero-logo{width:min(360px,88%);margin-top:14px}
  .category-card{min-height:0!important;border-radius:18px}
  .category-media{aspect-ratio:1200/520;padding:0}
  .category-card .category-label{font-size:14px!important;left:auto!important;bottom:auto!important}
  .category-banner{border-radius:18px}
  .search-panel{padding-left:12px;padding-right:12px}
  .search-panel .compact{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Fluid Mini App layout: Telegram can resize the webview to any width. */
html,body{width:100%;max-width:100%;overflow-x:clip}
body{min-width:0}
img,svg,video,canvas{max-width:100%}
.topbar{width:100%;padding-inline:clamp(12px,3vw,28px)}
.page{width:min(100%,1216px);min-width:0;padding-inline:clamp(12px,3vw,24px)}
.page>*,.section,.section-head,.hero-copy,.header-actions{min-width:0}
.section-head>div{min-width:0}
.section-head h1,.section-head h2,.product-card h3,.order-card,.review-card{overflow-wrap:anywhere}
.category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.category-card,.category-media,.category-label{min-width:0}
.product-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))}
.product-card{min-width:0}
.hero{width:100%;padding:clamp(22px,5vw,44px);min-height:clamp(240px,34vw,310px)}
.hero-logo{max-width:100%}
.bottom-nav{max-width:calc(100% - 12px)}
.bottom-nav button,.bottom-nav .bottom-link{min-width:0}
.sheet{max-width:calc(100vw - 16px);max-height:min(92vh,92dvh)}
.product-detail,.search-sheet{min-width:0;padding:clamp(16px,4vw,25px)}
.detail-meta{gap:12px;flex-wrap:wrap}
.search-panel{width:100%;max-width:100%}
.search-panel-inner,.search-box,.search-results{min-width:0}

@media(max-width:680px){
  .category-grid{grid-template-columns:1fr}
  .section-head{align-items:flex-start;flex-wrap:wrap}
  .section-head .text-btn{margin-left:auto}
}
@media(max-width:520px){
  .product-grid,.search-panel .compact{grid-template-columns:repeat(2,minmax(0,1fr))}
  .product-card{padding:clamp(11px,3.5vw,14px)}
  .product-card h3{font-size:clamp(13px,4vw,16px)}
  .product-icon{width:44px;height:44px;margin-bottom:13px}
  .price-row{gap:5px;flex-wrap:wrap}
  .price{font-size:clamp(16px,5vw,19px)}
  .bottom-nav button,.bottom-nav .bottom-link{font-size:clamp(8px,2.25vw,10px)}
  .bottom-nav svg{width:clamp(18px,5vw,22px);height:clamp(18px,5vw,22px)}
  .hero:before{right:-210px}
}
@media(max-width:330px){
  .product-grid,.search-panel .compact{grid-template-columns:1fr}
  .brand{width:150px}
  .env-badge{right:58px;font-size:9px}
}

.review-form label{display:grid;gap:8px;margin-bottom:14px;font-weight:700}
.review-form select{width:100%;min-width:0;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff;font-size:16px}
.status.open{background:#fff4dc;color:#9b6500}.status.closed{background:#ececef;color:#68686d}

/* End-to-end responsive layout for Telegram mobile, tablet and desktop. */
body{
  padding-bottom:calc(92px + env(safe-area-inset-bottom));
  overflow-wrap:break-word;
}
.topbar{
  min-height:64px;
  height:auto;
  padding-top:max(6px,env(safe-area-inset-top));
  padding-bottom:6px;
}
.page{padding-bottom:clamp(32px,5vw,56px)}
.primary,.secondary,.back-btn,.text-btn,.icon-btn{min-height:44px}
.primary,.secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  max-width:100%;
}
input,textarea,select{min-width:0;max-width:100%}
.hero{isolation:isolate}
.hero-copy{max-width:min(590px,78%)}
.category-label>span:first-child,
.product-card h3,
.order-card h3,
.review-card h3{min-width:0}
.product-card{height:100%}
.product-card-wrap{
  position:relative;
  min-width:0;
  height:100%;
}
.product-card-wrap .product-card{width:100%}
.product-card-wrap .sale{right:52px}
.favorite-btn{
  position:absolute;
  z-index:3;
  top:11px;
  right:11px;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid #ececef;
  border-radius:13px;
  color:#9b9ba1;
  background:rgba(255,255,255,.94);
  box-shadow:0 5px 14px rgba(30,20,20,.08);
  cursor:pointer;
}
.favorite-btn svg{
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
}
.favorite-btn.active{
  color:#fff;
  border-color:var(--red);
  background:var(--red);
}
.favorite-btn.active svg{fill:currentColor}
.favorite-detail{
  width:100%;
  min-height:42px;
  margin-top:9px;
  padding:9px 12px;
  border:0;
  color:#77777d;
  background:transparent!important;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}
.favorite-detail.active{
  color:var(--red)!important;
  background:transparent!important;
}
.product-detail>.buy-btn{
  min-height:54px;
  font-size:18px;
  box-shadow:0 12px 25px rgba(229,9,20,.30);
}
.product-detail>.buy-btn:disabled{
  color:#69696f!important;
  background:#e5e5e8!important;
  box-shadow:none;
  cursor:not-allowed;
}
.detail-sold-out{
  display:grid;
  gap:4px;
  margin:0 0 14px;
  padding:14px 16px;
  border:1px solid #ffcfd2;
  border-radius:15px;
  color:#9e0008;
  background:#fff2f3;
  text-align:center;
}
.detail-sold-out span{color:#6f5f61;font-size:13px;line-height:1.4}
.catalog-empty{
  grid-column:1/-1;
  width:100%;
  min-height:clamp(230px,38vh,360px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:34px 20px;
  border:1px dashed #d9d9de;
  border-radius:22px;
  color:var(--muted);
  background:rgba(255,255,255,.64);
}
.catalog-empty-icon{
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  margin-bottom:5px;
  border-radius:20px;
  color:var(--red);
  background:#fff0f1;
}
.catalog-empty-icon svg{
  width:32px;
  height:32px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.catalog-empty h3{margin:0;color:var(--ink);font-size:21px}
.catalog-empty p{max-width:430px;margin:0;line-height:1.5}
.load-more-wrap{
  display:flex;
  justify-content:center;
  margin-top:20px;
}
.load-more-btn{
  min-width:min(100%,240px);
  border:1px solid #dedee2;
}
.load-more-btn[hidden]{display:none!important}
.support-contact{
  color:var(--red);
  font-weight:900;
  text-decoration:none;
  white-space:nowrap;
}
.support-contact:hover{text-decoration:underline}
.price-row{min-width:0}
.price,.old-price{overflow-wrap:anywhere}
.bottom-nav{
  min-height:68px;
  padding-inline:clamp(3px,1.5vw,8px);
  gap:1px;
}
.bottom-nav button,.bottom-nav .bottom-link{
  min-height:50px;
  overflow:hidden;
}
.bottom-nav span{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sheet{
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.product-detail,.product-detail>*{min-width:0}
.product-detail h2{overflow-wrap:anywhere}
.payment-box{
  min-width:0;
  overflow-wrap:anywhere;
}
.payment-box code{
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.payment-box .primary,.payment-box .secondary{width:100%}
.order-top{align-items:flex-start}
.order-top>div{min-width:0}
.status{
  flex:0 0 auto;
  max-width:100%;
  text-align:center;
}
.review-card blockquote{
  margin:14px 0 0;
  padding:12px;
  border-left:3px solid var(--red);
  border-radius:0 12px 12px 0;
  background:#fff5f5;
  overflow-wrap:anywhere;
}
.review-form input,
.review-form textarea,
.review-form select{font-size:16px}
.review-form .primary{min-width:min(100%,240px)}
.stars-input{flex-wrap:wrap}
.stars-input button{min-width:38px;min-height:44px}

@media(min-width:1280px){
  .page{max-width:1280px}
  .product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:680px){
  .hero-copy{max-width:88%}
  .order-top{flex-wrap:wrap}
  .order-top .status{margin-left:0}
  .review-form{padding:clamp(15px,4vw,20px)}
}
@media(max-width:520px){
  body{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  .page{padding-top:14px}
  .hero{
    min-height:clamp(230px,72vw,280px);
    padding:clamp(20px,6vw,28px);
    margin-bottom:26px;
  }
  .hero-copy{max-width:92%}
  .hero p{max-width:82%;line-height:1.45}
  .section-head h1{font-size:clamp(25px,8vw,30px)}
  .section-head h2{font-size:clamp(22px,7vw,26px)}
  .category-card .category-label{gap:10px;flex-wrap:wrap}
  .category-count{margin-left:auto}
  .detail-top{min-height:clamp(125px,38vw,180px)}
  .product-detail h2{font-size:clamp(23px,7vw,28px)}
  .detail-meta{align-items:flex-start}
  .detail-meta .price{font-size:clamp(23px,7vw,28px)}
  .sheet{
    width:100%;
    max-width:100%;
    max-height:calc(100dvh - env(safe-area-inset-top));
    margin:auto 0 0;
    border-radius:24px 24px 0 0;
  }
  .bottom-nav{
    width:calc(100% - 8px);
    max-width:calc(100% - 8px);
    border-radius:20px 20px 0 0;
  }
}
@media(max-width:380px){
  .topbar{padding-inline:10px}
  .brand{width:145px}
  .icon-btn{width:40px;height:40px}
  .page{padding-inline:10px}
  .product-grid,.search-panel .compact{gap:9px}
  .product-card{min-height:164px}
  .product-icon{width:40px;height:40px;font-size:16px}
  .bottom-nav button,.bottom-nav .bottom-link{
    font-size:7.5px;
    padding-inline:0;
  }
  .bottom-nav svg{width:18px;height:18px}
  .review-form .primary{width:100%}
}
@media(max-width:330px){
  .hero-copy{max-width:100%}
  .hero p{max-width:90%}
  .product-card{min-height:150px}
}
@media(orientation:landscape) and (max-height:520px){
  .sheet{max-height:96dvh}
  .detail-top{min-height:105px}
  .product-detail{padding:16px}
  .product-detail h2{margin-top:14px}
}

/* Unified support chat for Mini App and Telegram messages. */
.support-page,.support-chat-page{max-width:920px;margin-inline:auto}
.page>.section:first-child{margin-top:8px}
.support-new{
  margin-bottom:30px;
  border:1px solid var(--line);
  border-radius:20px;
  background:#fff;
  overflow:hidden;
}
.support-new summary{
  min-height:56px;
  display:flex;
  align-items:center;
  padding:15px 20px;
  color:#fff;
  background:var(--red);
  font-weight:900;
  cursor:pointer;
  list-style:none;
}
.support-new summary::-webkit-details-marker{display:none}
.support-new .review-form{margin:0;border-radius:0}
.support-list-title{margin-top:28px}
.support-ticket-list{display:grid;gap:12px}
.support-ticket-card{
  width:100%;
  min-width:0;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:18px;
  color:var(--ink);
  background:#fff;
  text-align:left;
  cursor:pointer;
  transition:.18s ease;
}
.support-ticket-card:hover{
  transform:translateY(-2px);
  border-color:#ffc9cc;
  box-shadow:var(--shadow);
}
.support-ticket-main{min-width:0;display:grid;gap:7px}
.support-ticket-heading{display:flex;align-items:center;gap:8px;min-width:0}
.support-ticket-preview{
  color:#5f5f64;
  line-height:1.45;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow-wrap:anywhere;
}
.support-ticket-main small{color:#888}
.support-unread{
  min-width:22px;
  height:22px;
  padding:0 6px;
  display:inline-grid;
  place-items:center;
  border-radius:99px;
  color:#fff;
  background:var(--red);
  font-size:11px;
  font-weight:900;
}
.support-chat-card{
  min-width:0;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 8px 28px rgba(25,20,20,.06);
}
body.support-chat-open{
  height:100dvh;
  min-height:0;
  padding-bottom:0;
  overflow:hidden;
}
body.support-chat-open .page{
  height:calc(var(--tg-viewport-height,100dvh) - 64px);
  padding-top:clamp(10px,2.5vh,22px);
  padding-bottom:calc(76px + env(safe-area-inset-bottom));
  overflow:hidden;
}
.support-chat-page{
  height:100%;
  min-height:0;
  margin:0 auto;
  display:flex;
  flex-direction:column;
}
.support-chat-page>.back-btn{
  flex:0 0 auto;
  align-self:flex-start;
  margin-bottom:10px;
}
.support-chat-page .support-chat-card{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.support-chat-head{
  flex:0 0 auto;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:20px;
  border-bottom:1px solid var(--line);
}
.support-chat-head>div{min-width:0}
.support-chat-head h1{
  margin:0;
  font-size:clamp(23px,5vw,30px);
  overflow-wrap:anywhere;
}
.support-chat-head p{margin:6px 0 0;color:var(--muted);line-height:1.45}
.support-user-chat{
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow:auto;
  overscroll-behavior:contain;
  background:#f7f7f8;
}
.support-user-message{
  align-self:flex-start;
  max-width:min(82%,620px);
  padding:11px 13px;
  border-radius:16px 16px 16px 5px;
  background:#fff;
  border:1px solid #e7e7ea;
  box-shadow:0 3px 10px rgba(20,20,20,.04);
}
.support-user-message.user{
  align-self:flex-end;
  border-color:#ffd1d4;
  border-radius:16px 16px 5px 16px;
  background:#fff0f1;
}
.support-user-message.system{
  align-self:center;
  max-width:90%;
  color:#666;
  background:#ededf0;
}
.support-user-message small{color:#888;font-size:11px}
.support-user-message p{
  margin:5px 0 0;
  line-height:1.45;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.support-message-form{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:10px;
  padding:14px;
  border-top:1px solid var(--line);
  background:#fff;
}
.support-message-form textarea{
  width:100%;
  min-width:0;
  min-height:52px;
  height:52px;
  max-height:180px;
  padding:12px 14px;
  border:1px solid #dcdce0;
  border-radius:15px;
  font-size:16px;
  resize:none;
  overflow-y:hidden;
  outline:0;
}
.support-message-form textarea:focus{
  border-color:#ff9ba0;
  box-shadow:0 0 0 3px rgba(229,9,20,.08);
}
.support-message-form .primary{min-height:52px}
.support-close-btn{
  flex:0 0 auto;
  width:100%;
  min-height:44px;
  padding:10px 16px;
  border:0;
  border-top:1px solid var(--line);
  color:#777;
  background:#fff;
  font-weight:800;
  cursor:pointer;
}
.support-close-btn:hover{color:var(--red);background:#fff8f8}
.support-closed{
  flex:0 0 auto;
  padding:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border-top:1px solid var(--line);
}
.support-closed p{margin:0;color:#666;line-height:1.45}

@media(max-width:560px){
  .support-ticket-card{padding:15px;gap:10px}
  .support-ticket-card>.status{font-size:10px}
  .support-chat-head{padding:16px;flex-wrap:wrap}
  .support-user-chat{
    min-height:0;
    max-height:none;
    padding:12px;
  }
  .support-user-message{max-width:92%}
  .support-message-form{
    grid-template-columns:minmax(0,1fr) auto;
    padding:10px;
  }
  .support-message-form .primary{width:auto;padding-inline:14px}
  .support-closed{align-items:stretch;flex-direction:column}
  .support-closed .primary{width:100%}
}
@media(max-height:720px){
  body.support-chat-open .page{
    padding-top:8px;
    padding-bottom:calc(70px + env(safe-area-inset-bottom));
  }
  .support-chat-page>.back-btn{
    min-height:38px;
    margin-bottom:7px;
    padding-block:7px;
  }
  .support-chat-head{padding:12px 14px}
  .support-chat-head h1{font-size:clamp(20px,5vw,25px)}
  .support-chat-head p{margin-top:3px;font-size:13px}
  .support-user-chat{padding:10px}
  .support-message-form{padding:8px}
  .support-message-form textarea,
  .support-message-form .primary{min-height:46px;height:46px}
  .support-close-btn{min-height:38px;padding-block:7px}
}
