/* NIHOL final interface polish: one quiet, responsive layer shared by every surface. */
:root{
  --qomar-control-height:44px;
  --qomar-radius-sm:10px;
  --qomar-radius-md:16px;
  --qomar-radius-lg:22px;
  --qomar-shadow-soft:0 10px 28px rgb(7 45 31 / .09);
}

html,body{max-width:100%;overflow-x:clip}
:is(button,a,input,select,textarea){box-sizing:border-box}
:is(button,a,[role="button"]){-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid rgb(29 185 132 / .32)!important;
  outline-offset:2px;
}

/* Public catalogue: keep cards readable instead of squeezing a fifth partial card. */
.nh-store .product-grid{
  grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr))!important;
  gap:16px!important;
  align-items:stretch;
}
.nh-store .product-card{display:flex;min-width:0;flex-direction:column;border-radius:var(--qomar-radius-md)!important;overflow:hidden}
.nh-store .product-card .product-info{display:flex;min-width:0;flex:1;flex-direction:column;padding:14px!important}
.nh-store .product-info h3{
  min-height:2.7em!important;margin:4px 0 7px!important;font-size:15px!important;line-height:1.35!important;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;
}
.nh-store .product-code{font-size:10px!important;letter-spacing:.05em}
.nh-store .product-sales-meta{min-height:26px!important;overflow:visible!important;flex-wrap:wrap!important}
.nh-store :is(.product-stock,.product-rewards){font-size:9px!important;line-height:1.35!important;white-space:normal!important}
.nh-store .product-purchase{margin-top:auto!important;padding-top:12px!important}
.nh-store .product-price-list small{font-size:9px!important}
.nh-store .product-price-list strong{font-size:13px!important;line-height:1.3}
.nh-store .product-unit-choice button{min-height:38px!important;font-size:11px!important}
.nh-store .add-request{min-height:42px!important;font-size:11px!important;border-radius:10px!important}
.nh-store .marketplace-factories{overflow:hidden;border-radius:var(--qomar-radius-md)!important}
.nh-store .factory-pills{align-items:flex-start;justify-content:flex-start!important;gap:16px!important;overflow:visible!important}
.nh-store .factory-pills button{min-width:0!important}
.nh-store .factory-pills i{isolation:isolate}
.nh-store .factory-pills i img{filter:contrast(1.08) saturate(1.04)}

/* Shop app: consistent touch sizes and calmer product-detail rhythm. */
body.nh-store .app-shell{width:min(100%,540px);min-height:100dvh;box-shadow:0 0 45px rgb(1 29 20 / .18)}
body.nh-store .app-header{min-height:58px}
body.nh-store :is(.app-icon-button,.app-back-button,.app-bottom-nav button){min-width:42px;min-height:42px}
body.nh-store .app-product-detail :is(button,[role="button"]){touch-action:manipulation}
body.nh-store .app-product-detail .app-product-hero img{max-height:430px;object-fit:contain}
body.nh-store .app-product-detail .app-product-unit-toggle button{min-height:48px}

/* Factory profile banner copy stays inside the photograph on wide screens. */
body.factory-page .factory-headline{
  right:14%!important;width:min(320px,30%)!important;max-width:30%!important;
  font-size:clamp(20px,2vw,28px)!important;line-height:1.16!important;overflow-wrap:anywhere;
}

/* Admin header: the wordmark and panel name must both remain visible. */
html body .admin-header{min-width:0}
html body .admin-header :is(.seller-header-tools,.admin-header-tools){min-width:0}
html body .admin-header .seller-account-switch{
  width:214px!important;height:52px!important;flex:0 0 214px!important;min-width:0!important;
  gap:7px!important;padding:4px 6px!important;overflow:hidden!important;border:1px solid #d9bf99!important;
  border-radius:10px!important;background:#fbf7ef!important;color:#173f32!important;
}
html body .admin-header .seller-account-switch>img.qomar-account-wordmark{
  width:136px!important;height:42px!important;max-width:136px!important;flex:0 0 136px!important;
  object-fit:cover!important;border-radius:7px!important;background:#fbf7ef!important;
}
html body .admin-header .seller-account-switch>span{display:grid!important;min-width:0!important;max-width:58px!important}
html body .admin-header .seller-account-switch>span small{
  display:block!important;max-width:58px!important;color:#173f32!important;font-size:9px!important;font-weight:800!important;
  line-height:1.2!important;white-space:normal!important;overflow-wrap:anywhere;
}
html body .admin-header .seller-account-switch>span strong,
html body .admin-header .seller-account-switch>b{display:none!important}

/* Admin content: clearer cards, balanced controls and no clipped tab rows. */
body[data-reference-role]:not([data-admin-section="dashboard"]) .admin-content :is(.admin-panel,.settings-form,.settings-state,.settings-subpage,.customer-detail){
  border-radius:var(--qomar-radius-md)!important;
}
body[data-reference-role]:not([data-admin-section="dashboard"]) .admin-content :is(button,input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  min-height:var(--qomar-control-height);
}
body[data-reference-role] .settings-panel .settings-tabs{
  grid-template-columns:repeat(5,minmax(120px,1fr))!important;overflow:visible!important;
}
body[data-reference-role] .settings-panel .settings-tabs>button{
  min-width:0!important;min-height:50px!important;padding:10px!important;border-radius:10px!important;
}
body[data-reference-role] .settings-panel :is(.settings-form,.settings-state,.settings-subpage){min-width:0}
body[data-reference-role] .settings-panel .settings-state>label{min-width:0}
body[data-reference-role] .settings-panel .settings-state strong{min-width:0;overflow-wrap:anywhere}

/* Uploaded image controls: Uzbek, large and obvious; native OS text stays visually hidden. */
.admin-content .qomar-file-picker{
  position:relative;display:flex!important;min-width:0;min-height:154px;align-content:center;align-items:flex-start;
  flex-direction:column;justify-content:center;gap:9px!important;padding:18px!important;cursor:pointer;
  border:1px dashed var(--panel-line)!important;border-radius:14px;background:var(--panel-card)!important;
  transition:border-color .18s ease,background .18s ease,transform .18s ease;
}
.admin-content .qomar-file-picker:hover{border-color:var(--panel-accent)!important;background:var(--panel-paper)!important;transform:translateY(-1px)}
.admin-content .qomar-file-picker input[type="file"]{
  position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;margin:0!important;padding:0!important;
  overflow:hidden!important;opacity:0!important;pointer-events:none!important;
}
.admin-content .qomar-file-title{color:var(--panel-ink);font-size:14px;font-weight:850}
.admin-content .qomar-file-button{
  display:inline-flex;min-height:42px;align-items:center;justify-content:center;padding:10px 16px;border-radius:10px;
  background:var(--panel-accent);color:#fff;font-size:12px;font-weight:850;box-shadow:0 8px 18px rgb(0 112 77 / .18);
}
.admin-content .qomar-file-picker small{color:var(--panel-muted);font-size:11px;font-weight:500;line-height:1.45}

body[data-reference-role] .factory-branding-form{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  gap:16px 20px!important;align-items:start!important;padding:20px!important;min-width:0;max-width:100%;box-sizing:border-box;
}
body[data-reference-role] .factory-branding-form>*{min-width:0;max-width:100%;box-sizing:border-box;grid-column:1/-1!important}
body[data-reference-role] .factory-branding-form>label{width:100%;line-height:1.5}
body[data-reference-role] .factory-branding-form :is(input:not([type="file"]),textarea){min-width:0;max-width:100%;width:100%;box-sizing:border-box}
body[data-reference-role] .factory-branding-form textarea{resize:vertical}
body[data-reference-role] .factory-branding-form>.qomar-file-picker{grid-column:1!important;grid-row:auto!important}
body[data-reference-role] .factory-branding-form .qomar-file-picker :is(.qomar-file-title,.qomar-file-button,small){max-width:100%;white-space:normal;overflow-wrap:break-word}
body[data-reference-role] .factory-branding-form .qomar-file-picker:focus-within{outline:3px solid rgb(29 185 132 / .32);outline-offset:2px}
body[data-reference-role] .factory-branding-form>.factory-branding-preview{
  grid-column:1!important;grid-row:auto!important;min-height:150px!important;aspect-ratio:16/7;height:auto;overflow:hidden;padding:16px;text-align:center;
  border-radius:16px!important;background-size:contain!important;background-repeat:no-repeat;background-position:center!important;box-shadow:inset 0 0 0 1px rgb(255 255 255 / .08);
}
body[data-reference-role] .factory-branding-form>label:nth-of-type(2),
body[data-reference-role] .factory-branding-form>label:nth-of-type(3),
body[data-reference-role] .factory-branding-form>label:nth-of-type(4){grid-column:1!important;grid-row:auto!important}
body[data-reference-role] .factory-branding-form>button{grid-column:1!important;grid-row:auto!important;width:100%;min-height:48px!important;white-space:normal}
body[data-reference-role] .factory-branding-form>.status{grid-column:1/-1!important;grid-row:auto!important;overflow-wrap:anywhere}
body[data-reference-role] .factory-branding-panel>.panel-heading{flex-wrap:wrap}
body[data-reference-role] .factory-branding-panel>.panel-heading>*{min-width:0;max-width:100%}
body[data-reference-role] .factory-page-preview{min-height:42px;display:inline-flex;align-items:center;padding:9px 13px;border-radius:10px;white-space:normal}

/* Keep explicit desktop tracks out of the phone cascade: otherwise the preview
   creates an implicit second column despite a one-column mobile template. */
@media(min-width:1100px){
  body[data-reference-role] .factory-branding-form{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important}
  body[data-reference-role] .factory-branding-form>.qomar-file-picker{grid-row:1!important}
  body[data-reference-role] .factory-branding-form>.factory-branding-preview{grid-column:2!important;grid-row:1/span 4!important;min-height:320px!important;aspect-ratio:auto;height:100%}
  body[data-reference-role] .factory-branding-form>label:nth-of-type(2){grid-row:2!important}
  body[data-reference-role] .factory-branding-form>label:nth-of-type(3){grid-row:3!important}
  body[data-reference-role] .factory-branding-form>label:nth-of-type(4){grid-row:4!important}
  body[data-reference-role] .factory-branding-form>button{grid-row:5!important}
  body[data-reference-role] .factory-branding-form>.status{grid-row:6!important}
}

body[data-reference-role] .factory-logo-panel form{
  display:grid!important;max-width:900px!important;grid-template-columns:minmax(260px,.9fr) minmax(220px,1.1fr)!important;
  gap:16px 20px!important;align-items:stretch;
}
body[data-reference-role] .factory-logo-panel .factory-logo-preview{min-height:154px!important;border-radius:14px!important}
body[data-reference-role] .factory-logo-panel form>button,
body[data-reference-role] .factory-logo-panel form>.status{grid-column:1/-1;width:100%}

/* Dark theme: keep secondary copy and price blocks visibly lighter than their cards. */
html[data-theme="dark"] body[data-reference-role]{--reference-card:#173329;--reference-surface:#203f33;--reference-ink:#f1faf5;--reference-muted:#b9cec2;--reference-line:#3d5e4f}
html[data-theme="dark"] body[data-reference-role] .admin-content :is(.reference-product-prices strong,.sales-row-heading span,.admin-order-compact strong){color:#f4fbf7!important}
html[data-theme="dark"] body[data-reference-role][data-admin-section="promotions"] .admin-header .seller-account-switch>span :is(strong,small){color:var(--reference-ink,#f1faf5)!important}

@media(max-width:1180px){
  .nh-store .product-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body[data-reference-role] .settings-panel .settings-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body[data-reference-role] .settings-panel .settings-tabs>button:nth-last-child(-n+2){grid-column:auto!important}
}

@media(max-width:820px){
  .nh-store .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  .nh-store .product-card .product-info{padding:9px!important}
  .nh-store .product-info h3{min-height:2.6em!important;font-size:11px!important}
  .nh-store .product-code{font-size:8px!important}
  .nh-store :is(.product-stock,.product-rewards){font-size:7.5px!important}
  .nh-store .product-price-list small{font-size:8px!important}
  .nh-store .product-price-list strong{font-size:11px!important}
  .nh-store .product-unit-choice button{min-height:35px!important;font-size:9px!important}
  .nh-store .add-request{min-height:38px!important;font-size:10px!important}
}

@media(max-width:700px){
  body.factory-page .factory-headline{display:none!important}
  html body .admin-header .seller-account-switch{
    width:min(198px,calc(100vw - 118px))!important;height:50px!important;flex:1 1 auto!important;max-width:198px!important;
    padding:4px 5px!important;gap:5px!important;
  }
  html body .admin-header .seller-account-switch>img.qomar-account-wordmark{
    width:124px!important;height:40px!important;max-width:124px!important;flex-basis:124px!important;
  }
  html body .admin-header .seller-account-switch>span{max-width:54px!important}
  html body .admin-header .seller-account-switch>span small{max-width:54px!important;font-size:8px!important;color:#173f32!important}
  body[data-reference-role] .settings-panel .settings-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-reference-role] .settings-panel .settings-tabs>button:last-child{grid-column:1/-1!important}
  body[data-reference-role] .factory-branding-form{grid-template-columns:minmax(0,1fr)!important;padding:14px!important}
  body[data-reference-role] .factory-branding-form>*{grid-column:1!important;grid-row:auto!important}
  body[data-reference-role] .factory-branding-form>.factory-branding-preview{min-height:150px!important;height:auto}
  body[data-reference-role] .factory-logo-panel form{grid-template-columns:minmax(0,1fr)!important}
  body[data-reference-role] .factory-logo-panel form>*{grid-column:1!important}
  .admin-content .qomar-file-picker{min-height:132px;padding:14px!important}
}

@media(max-width:420px){
  .nh-store .factory-pills{gap:6px!important}
  .nh-store .factory-pills button{flex:0 0 calc(25% - 5px)!important;min-height:86px!important;font-size:9px!important}
  .nh-store .factory-pills i{width:54px!important;height:54px!important}
  .nh-store .product-grid{gap:7px!important}
  html body .admin-header .seller-account-switch{width:min(184px,calc(100vw - 116px))!important;max-width:184px!important}
  html body .admin-header .seller-account-switch>img.qomar-account-wordmark{width:116px!important;max-width:116px!important;flex-basis:116px!important}
}

/* Savat belgisi telefon va kompyuterda aniq ko'rinsin va oson bosilsin. */
body.nh-store .app-header-actions .app-header-cart{
  position:relative!important;
  width:46px!important;
  min-width:46px!important;
  height:46px!important;
  min-height:46px!important;
  padding:8px!important;
}
body.nh-store .app-header-actions .app-header-cart svg{
  width:29px!important;
  height:29px!important;
  stroke-width:2.15!important;
}
body.nh-store .app-header-actions .app-header-cart> b{
  top:1px!important;
  right:1px!important;
  min-width:17px!important;
  height:17px!important;
  font-size:9px!important;
}
body.nh-store .header-controls .request-button,
body.nh-store .nihol-header-actions>a[aria-label="Savat"],
body.nh-store .favorites-cart-link{
  min-width:44px!important;
  min-height:44px!important;
}
body.nh-store .header-controls .request-button svg,
body.nh-store .nihol-header-actions>a[aria-label="Savat"] .nihol-header-icon{
  width:27px!important;
  height:27px!important;
}

/* Mahsulotda faqat bitta qop turi bo'lsa, tugma bo'sh yarim katak qoldirmasin. */
body.nh-store :is(.app-product-units,.app-detail-unit-toggle,.app-cart-unit-toggle,.product-unit-choice,.nh-unit-choice,.cart-unit-toggle):has(>button:only-child){
  grid-template-columns:minmax(0,1fr)!important;
}
body.nh-store :is(.app-product-units,.app-detail-unit-toggle,.app-cart-unit-toggle,.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button:only-child{
  width:100%!important;
  max-width:none!important;
  justify-self:stretch!important;
}

/* Cart card actions: keep favorite and remove controls readable and easy to tap. */
body.nh-store .app-cart-product-actions{
  display:grid!important;
  grid-template-columns:repeat(2,42px);
  align-items:start;
  justify-content:end;
  gap:7px!important;
}
body.nh-store .app-cart-product-actions>button{
  display:grid!important;
  width:42px!important;
  min-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  place-items:center;
  padding:0!important;
  border:1px solid var(--nh-line)!important;
  border-radius:11px!important;
  background:var(--nh-soft)!important;
  color:var(--nh-green)!important;
  box-shadow:none!important;
  cursor:pointer;
}
body.nh-store .app-cart-product-actions>button svg{
  display:block;
  width:20px!important;
  height:20px!important;
  stroke:currentColor;
  stroke-width:1.9;
  fill:none;
}
body.nh-store .app-cart-product-actions>button[aria-pressed="true"]{
  border-color:#efb9b3!important;
  background:#fff1ef!important;
  color:#c83f37!important;
}
body.nh-store .app-cart-product-actions>button[aria-pressed="true"] svg{
  fill:currentColor;
}
body.nh-store .app-cart-product-actions>button[aria-label="Savatdan olib tashlash"]{
  border-color:#efc8c3!important;
  background:#fff5f3!important;
  color:#a83f37!important;
}
body.nh-store .app-cart-product-actions>button:focus-visible{
  outline:3px solid #0b7a5538;
  outline-offset:2px;
}
html[data-theme="dark"] body.nh-store .app-cart-product-actions>button{
  border-color:#476252!important;
  background:#203229!important;
  color:#dff1e3!important;
}
html[data-theme="dark"] body.nh-store .app-cart-product-actions>button[aria-label="Savatdan olib tashlash"]{
  border-color:#7f4b47!important;
  background:#3a2523!important;
  color:#ffb8b0!important;
}
@media(max-width:380px){
  body.nh-store .app-cart-product-actions{
    grid-template-columns:repeat(2,40px);
    gap:5px!important;
  }
  body.nh-store .app-cart-product-actions>button{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    min-height:40px!important;
  }
}

/* Public shop safety: hide any stale cached admin link. */
body.nh-store a[href="/admin-app/"],
body.nh-store a[href^="/admin-app/?"],
body.nh-store a[href*="/admin-app/#"]{
  display:none!important;
}

/* Premium star belongs to the large sack only. */
body.nh-store :is(.app-product-units,.app-detail-unit-toggle,.app-cart-unit-toggle,.product-unit-choice,.nh-unit-choice,.cart-unit-toggle) .app-unit-small-sack::before,
body.nh-store :is(.app-product-units,.app-detail-unit-toggle,.app-cart-unit-toggle,.product-unit-choice,.nh-unit-choice,.cart-unit-toggle) .app-unit-small-sack::after,
body.nh-store :is(.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button[data-order-unit="small_sack"]::before,
body.nh-store :is(.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button[data-order-unit="small_sack"]::after,
body.nh-store :is(.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button[data-detail-unit="small_sack"]::before,
body.nh-store :is(.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button[data-detail-unit="small_sack"]::after,
body.nh-store :is(.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button[data-unit="small_sack"]::before,
body.nh-store :is(.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button[data-unit="small_sack"]::after{
  content:none!important;
  display:none!important;
}
body.nh-store :is(.app-product-units,.app-detail-unit-toggle,.app-cart-unit-toggle) .app-unit-small-sack.is-active{
  border-color:var(--nh-green)!important;
  background:var(--nh-green)!important;
  color:#fff!important;
  box-shadow:none!important;
  text-shadow:none!important;
}

@media(max-width:560px){
  body.nh-store :is(.app-product-units,.app-detail-unit-toggle,.app-cart-unit-toggle,.product-unit-choice,.nh-unit-choice,.cart-unit-toggle)>button{
    min-width:0!important;
    padding:6px 3px!important;
    font-size:10px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:visible!important;
  }
}

/* Mehmon buyurtmasida ham sotib olingan mahsulot aniq ko'rinsin. */
body.nh-store .app-guest-receipt-items{
  display:grid;gap:8px;width:100%;margin:14px 0 10px;text-align:left;
}
body.nh-store .app-guest-receipt-items article{
  display:grid;grid-template-columns:76px minmax(0,1fr) auto;align-items:center;gap:10px;
  padding:9px;border:1px solid var(--line);border-radius:12px;background:var(--soft);
}
body.nh-store .app-guest-receipt-items img{
  width:76px;height:76px;padding:4px;border-radius:10px;background:#fff;object-fit:contain;
}
body.nh-store .app-guest-receipt-items article>div{display:grid;gap:5px;min-width:0}
body.nh-store .app-guest-receipt-items strong{font-size:12px;line-height:1.3;overflow-wrap:anywhere}
body.nh-store .app-guest-receipt-items small{color:var(--muted);font-size:9px;font-weight:750}
body.nh-store .app-guest-receipt-items b{font-size:11px;white-space:nowrap}
body.nh-store .app-clear-demo-order{
  width:100%;min-height:42px;margin-top:8px;border:1px solid #cf7064;border-radius:10px;background:#fff5f3;color:#8f342c;font-size:11px;font-weight:850;
}
body.nh-store .app-clear-demo-order:disabled{opacity:.65}
html[data-theme="dark"] body.nh-store .app-guest-receipt-items article{border-color:#3a5142;background:#203229}
html[data-theme="dark"] body.nh-store .app-clear-demo-order{border-color:#8e4c45;background:#34221f;color:#ffd7d2}

@media(max-width:390px){
  body.nh-store .app-guest-receipt-items article{grid-template-columns:68px minmax(0,1fr)}
  body.nh-store .app-guest-receipt-items img{width:68px;height:68px}
  body.nh-store .app-guest-receipt-items b{grid-column:2;justify-self:start}
}
