.market-topbar-inner{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:12px 16px;
}

.market-header-logo{
  flex:0 1 auto;
  min-width:0;
  max-width:48%;
}

.market-header-actions{
  flex:1 1 auto;
  min-width:0;
  justify-content:flex-end;
}

.market-topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.market-guide-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 10px;
  border-radius:10px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.01em;
  color:#ff3b30 !important;
  background:#fff5f5;
  border:1px solid #ffd1d1;
  white-space:nowrap;
  flex-shrink:0;
  text-decoration:none !important;
}
.market-guide-link:hover{
  background:#ffe8e8;
  color:#e6342a !important;
}

.market-cart-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111827;
  text-decoration:none;
  font-size:14px;
  font-weight:700;
  transition:border-color .18s ease, box-shadow .18s ease;
}

.market-cart-link:hover{
  border-color:#ef3d2f;
  box-shadow:0 0 0 3px rgba(239,61,47,.1);
}

.market-cart-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:#ef3d2f;
  color:#fff;
  font-size:12px;
  font-weight:800;
  line-height:1;
}

.market-cart-badge[hidden]{
  display:none !important;
}

.market-mobile-business-btn{
  display:none;
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111827;
  text-decoration:none;
  font-size:12px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  flex-shrink:0;
  transition:border-color .18s ease, box-shadow .18s ease;
}

.market-mobile-business-btn:hover{
  border-color:#ef3d2f;
  box-shadow:0 0 0 3px rgba(239,61,47,.1);
  color:#111827;
}

.market-mobile-business-icon{
  font-size:14px;
  line-height:1;
}

.market-header-cabinet--desktop{
  display:inline-flex;
}

.product-buy-controls{
  display:grid;
  gap:8px;
  margin-top:8px;
}

.product-qty-row{
  display:grid;
  grid-template-columns:38px 1fr 38px;
  gap:6px;
  align-items:center;
}

.qty-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  color:#111827;
  font-size:18px;
  font-weight:700;
  cursor:pointer;
}

.qty-btn:hover{
  border-color:#ef3d2f;
  color:#ef3d2f;
}

.qty-input{
  width:100%;
  height:38px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  text-align:center;
  font-size:14px;
  font-weight:700;
  color:#111827;
  background:#fafafa;
}

.qty-btn:disabled{
  opacity:.45;
  cursor:default;
}

.product-buy-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  max-width:100%;
  min-height:38px;
  border:none;
  border-radius:10px;
  background:#222;
  color:#fff;
  font-size:14px;
  font-weight:800;
  line-height:1.2;
  cursor:pointer;
  transition:background .18s ease, transform .18s ease;
  box-sizing:border-box;
}

.product-buy-btn:hover{
  background:#111;
}

.product-buy-btn.is-success{
  background:#15803d;
}

.product-buy-btn:disabled{
  opacity:.75;
  cursor:wait;
}

.product-buy-btn-icon{
  font-size:15px;
  line-height:1;
}

.product-buy-actions{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}

.product-buy-actions .product-buy-btn{
  flex:none;
  width:100%;
}

.product-buy-btn--retail{
  background:#222;
  color:#fff;
  border:none;
}

.product-buy-btn--retail:hover{
  background:#111;
  color:#fff;
  border:none;
}

.product-buy-btn--wholesale{
  background:#ef3d2f;
  color:#fff;
  border:none;
}

.product-buy-btn--wholesale:hover{
  background:#d93628;
}

.product-buy-btn--retail.is-success,
.product-buy-btn--wholesale.is-success{
  background:#15803d;
  border:none;
  color:#fff;
}

.product-detail-buy{
  margin-top:12px;
}

.product-detail-buy .product-buy-controls{
  max-width:320px;
}

@media (max-width:767px){
  .market-topbar-inner,
  .market-header-flex,
  .site-header .topbar-inner,
  .site-header .site-container{
    display:grid !important;
    grid-template-columns:minmax(0,1fr);
    align-items:stretch;
    justify-content:stretch;
    gap:8px;
    padding:8px 12px;
    flex-wrap:unset;
    flex-direction:unset !important;
  }

  .market-guide-link{
    min-height:44px;
    padding:0 8px;
    font-size:12px;
  }

  .market-header-logo,
  .market-brand,
  .market-brand-block{
    flex:none;
    min-width:0;
    max-width:100%;
  }

  .market-brand-block .market-header-logo,
  .market-brand-block .market-brand{
    max-width:100%;
  }

  .market-brand img,
  .market-header-logo img{
    height:24px !important;
    width:auto !important;
    max-width:100%;
  }

  .market-header-actions,
  .market-topbar-actions{
    flex:none;
    width:100%;
    min-width:0;
    justify-content:stretch;
    gap:8px;
    flex-wrap:nowrap;
  }

  .market-cart-label,
  .seller-cabinet-label{
    display:none;
  }

  .market-cart-link,
  .market-mobile-business-btn,
  .market-guide-link{
    flex:1 1 0;
    min-height:44px;
    min-width:0;
  }

  .market-cart-link{
    padding:0 8px;
    font-size:12px;
    gap:4px;
    justify-content:center;
  }

  .market-mobile-business-btn{
    display:inline-flex;
    padding:0 8px;
    justify-content:center;
    gap:4px;
  }

  .market-mobile-business-icon{
    font-size:14px;
    line-height:1;
  }

  .market-header-cabinet--desktop{
    display:none !important;
  }

  .seller-cabinet-btn,
  .market-header-cabinet{
    padding:6px 8px !important;
    font-size:12px !important;
    gap:4px !important;
    min-height:44px;
  }

  .topbar-inner{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    align-items:stretch;
    justify-content:stretch;
    gap:8px;
    padding:8px 12px !important;
    flex-wrap:unset;
  }

  .topbar-inner .brand,
  .topbar-inner > .site-logo-link{
    flex:none;
    min-width:0;
    max-width:100%;
  }

  .topbar-inner .brand img{
    width:auto !important;
    max-width:100% !important;
    height:24px !important;
    margin:0 !important;
  }

  .topbar-inner .market-header-actions{
    width:100%;
  }

  .topbar-inner .market-cart-link span:not(.market-cart-badge):not(.market-cart-icon){
    display:none;
  }
}
