/* N8 desktop layout. The existing Vue routes, API calls and account flows stay shared. */
@media (min-width: 1024px) {
  :root {
    color-scheme: light;
    --n8-desktop-width: 1240px;
    --n8-desktop-gutter: 32px;
    --n8-desktop-bg: #f6f7f8;
    --n8-desktop-card: #fff;
    --n8-desktop-line: #eceef0;
    --n8-desktop-ink: #202124;
  }

  html,
  body,
  #app {
    min-height: 100%;
  }

  body {
    margin: 0;
    background: var(--n8-desktop-bg);
    color: var(--n8-desktop-ink);
  }

  #app > .container {
    position: relative !important;
    inset: auto !important;
    display: flex;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    height: auto !important;
    overflow: visible !important;
    flex-direction: column;
    background: var(--n8-desktop-bg);
  }

  #app > .container > .content {
    box-sizing: border-box;
    width: min(var(--n8-desktop-width), calc(100% - 2 * var(--n8-desktop-gutter))) !important;
    max-width: var(--n8-desktop-width);
    min-height: 0;
    height: auto !important;
    margin: 0 auto;
    overflow: visible !important;
    flex: 1 0 auto;
    padding-bottom: 48px;
  }

  .van-tabbar--fixed {
    z-index: 1000;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    box-sizing: border-box;
    display: flex;
    width: 100%;
    height: 64px !important;
    justify-content: flex-end;
    padding: 0 max(var(--n8-desktop-gutter), calc((100vw - var(--n8-desktop-width)) / 2)) 0 0 !important;
    border-bottom: 1px solid var(--n8-desktop-line);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 2px 10px rgba(25, 30, 35, .04);
  }

  .van-tabbar-item {
    display: flex;
    width: auto !important;
    min-width: 88px;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px !important;
    color: #656a70;
    font-size: 14px;
  }

  .van-tabbar-item__icon {
    margin: 0 !important;
    font-size: 18px;
  }

  .van-tabbar-item__text {
    font-size: 14px;
  }

  .home-header {
    box-sizing: border-box;
    width: min(var(--n8-desktop-width), calc(100% - 2 * var(--n8-desktop-gutter)));
    height: 84px;
    margin: 64px auto 0;
    padding: 12px 0;
    align-items: center;
  }

  .home-header .tiktok-img {
    box-sizing: border-box;
    width: min(260px, 28vw) !important;
    min-width: 0 !important;
    max-width: 260px !important;
    flex: 0 0 min(260px, 28vw) !important;
    height: auto !important;
    max-height: 60px;
    object-fit: contain;
    object-position: left center;
  }

  .home-header .header-imgs {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
  }

  .custom-nav-container {
    position: relative !important;
    z-index: 20;
    top: auto !important;
    box-sizing: border-box;
    width: min(var(--n8-desktop-width), calc(100% - 2 * var(--n8-desktop-gutter)));
    min-height: 60px;
    margin: 0 auto !important;
    padding: 0 18px;
    border-bottom: 1px solid var(--n8-desktop-line);
    background: var(--n8-desktop-card);
  }

  body:has(.van-tabbar--fixed) .custom-nav-container {
    position: sticky !important;
    top: 64px !important;
    margin-top: 64px !important;
  }

  .custom-nav-title {
    font-size: 18px;
    font-weight: 650;
  }

  .home-content {
    box-sizing: border-box;
    width: min(var(--n8-desktop-width), calc(100% - 2 * var(--n8-desktop-gutter))) !important;
    margin: 0 auto;
    padding: 0 0 64px;
    overflow: visible;
  }

  .home-content > .input-container,
  #app > .container > .content > .input-container {
    width: min(760px, 100%);
    margin: 12px auto 20px;
  }

  .input-container,
  .input-field {
    box-sizing: border-box;
  }

  .swipe-board {
    width: 100%;
    max-height: 360px;
    margin: 12px 0 22px;
    overflow: hidden;
    border-radius: 14px;
  }

  .swipe-board .van-swipe,
  .swipe-board .van-image,
  .swipe-board .van-image__img {
    max-height: 360px;
  }

  .classes-container,
  .tag-row {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
  }

  .class-item,
  .tag {
    flex: 0 0 auto;
    border-radius: 999px;
  }

  .hot-product {
    display: block;
    width: 100%;
    margin: 20px 0 28px;
  }

  .hot-product-title,
  .hot-product-title .title-words {
    font-size: 19px;
    font-weight: 650;
  }

  .hot-product-items,
  .popular-items,
  .recommend-items,
  .recommend-products {
    box-sizing: border-box;
    display: grid !important;
    grid-auto-flow: row;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    overflow: visible;
    padding: 14px 0 8px;
  }

  .hot-product-container,
  .popular-item,
  .horiz-popular-item,
  .horiz-product-container {
    box-sizing: border-box;
    display: flex !important;
    width: 100% !important;
    min-width: 0;
    height: auto;
    min-height: 0;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid var(--n8-desktop-line);
    border-radius: 12px;
    background: var(--n8-desktop-card);
    box-shadow: 0 2px 8px rgba(20, 25, 30, .04);
  }

  .popular-items,
  .recommend-items {
    overflow: visible !important;
  }

  .popular-items > .van-space,
  .recommend-items > .van-space {
    display: contents !important;
  }

  .popular-items > .van-space > .van-space-item,
  .recommend-items > .van-space > .van-space-item {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .popular-items > .popular-item,
  .recommend-items > .horiz-popular-item {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch;
  }

  .popular-items > .popular-item > .product-img,
  .recommend-items > .horiz-popular-item > .van-image {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .hot-product-container .product-img,
  .popular-item .product-img,
  .horiz-popular-item .product-img,
  .horiz-product-container > .van-image {
    box-sizing: border-box;
    width: 100% !important;
    height: 210px !important;
    flex: 0 0 210px;
    padding: 12px;
    background: #fff;
  }

  .hot-product-container .product-img .van-image__img,
  .popular-item .product-img .van-image__img,
  .horiz-popular-item .product-img .van-image__img,
  .horiz-product-container > .van-image .van-image__img {
    object-fit: contain;
  }

  .hot-product-container .product-info,
  .popular-item .product-info,
  .horiz-popular-item .product-info,
  .horiz-product-container .product-info {
    box-sizing: border-box;
    width: 100%;
    min-height: 132px;
    flex: 1 1 auto;
    padding: 12px 14px 14px;
  }

  .hot-product-container .product-info,
  .popular-item .product-info,
  .horiz-popular-item .product-info,
  .horiz-product-container .product-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .product-name {
    display: -webkit-box !important;
    overflow: hidden !important;
    white-space: normal !important;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.45;
  }

  .product-info .product-name {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
  }

  .product-popular {
    overflow: hidden;
    line-height: 1.5;
  }

  .product-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.45;
  }

  .product-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .popular-row,
  .recommend-row {
    box-sizing: border-box;
    width: 100%;
    margin: 18px auto;
  }

  .row-title,
  .sub-title {
    font-size: 19px;
    font-weight: 650;
  }

  .product {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
    margin: 20px auto 30px !important;
  }

  .product > .van-swipe.product-img {
    box-sizing: border-box;
    width: 100%;
    height: clamp(360px, 38vw, 520px) !important;
    border: 1px solid var(--n8-desktop-line);
    border-radius: 14px;
    background: #fff;
  }

  .product > .van-swipe.product-img .van-image,
  .product > .van-swipe.product-img .van-image__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .product > .product-info {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    border: 1px solid var(--n8-desktop-line);
    border-radius: 14px;
    background: #fff;
  }

  .hot-shop-container,
  .hot-shop-container * {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .comment,
  .detail {
    box-sizing: border-box;
    width: 100%;
    margin: 20px auto;
  }

  .product-desc {
    overflow-wrap: anywhere;
  }

  .product-desc img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }

  #app > .container > .bottom {
    position: sticky;
    z-index: 30;
    bottom: 0;
    box-sizing: border-box;
    display: flex;
    width: min(var(--n8-desktop-width), calc(100% - 2 * var(--n8-desktop-gutter)));
    min-height: 72px;
    margin: auto auto 0;
    padding: 10px 0;
    border-top: 1px solid var(--n8-desktop-line);
    background: rgba(255, 255, 255, .97);
  }

  .login-container {
    box-sizing: border-box;
    width: min(480px, calc(100% - 40px)) !important;
    height: auto !important;
    min-height: 0;
    margin: 14px auto !important;
    padding: 28px 32px 32px;
    border: 1px solid var(--n8-desktop-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 34px rgba(20, 25, 30, .07);
  }

  .login-container .welcome,
  .login-container .login-type,
  .login-container .login-forms,
  .login-container .login-button,
  .login-container .go-register {
    width: 100% !important;
  }

  .login-container .form-input {
    width: 100% !important;
  }

  .login-container .van-cell--center.van-field {
    box-sizing: border-box;
    width: 100%;
  }

  .products,
  .content-products,
  .order-container,
  .container-scroll {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
  }

  .product-list > .van-space {
    display: contents !important;
  }

  .product-list > .van-space > .van-space-item {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .product-list .hot-product-container,
  .product-list .horiz-product-container {
    width: 100% !important;
    min-width: 0 !important;
  }

  .content-address,
  .content-products,
  .products-total,
  .choose-address,
  .info.content-item,
  .promotion.content-item,
  .profile-forms {
    box-sizing: border-box;
    border-radius: 12px;
    background: #fff;
  }

  .cart-item-container {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 16px;
  }

  .cart-item-container .van-image,
  .cart-item-container .van-image__img {
    max-width: 100%;
    object-fit: contain;
  }

  .cart-item-del {
    justify-self: end;
  }

  .products-total,
  .checkout-right,
  .container-bottom {
    box-sizing: border-box;
    background: #fff;
  }

  .products-total {
    margin-top: 16px;
    padding: 18px 22px;
    border: 1px solid var(--n8-desktop-line);
    border-radius: 12px;
  }

  .container-bottom {
    position: sticky;
    z-index: 20;
    bottom: 0;
    width: 100%;
    padding: 12px max(var(--n8-desktop-gutter), calc((100vw - var(--n8-desktop-width)) / 2));
    border-top: 1px solid var(--n8-desktop-line);
  }

  .order-container {
    margin: 12px auto;
  }

  .order-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 18px;
  }

  .profile-avatar {
    width: 100%;
    margin: 12px auto 20px;
  }

  .profile-forms {
    width: min(760px, 100%);
    margin: 0 auto 24px;
    padding: 12px 20px;
  }

  .cart-item-container,
  .order-item {
    box-sizing: border-box;
    width: 100%;
    margin: 12px 0;
    border: 1px solid var(--n8-desktop-line);
    border-radius: 12px;
    background: #fff;
  }

  .checkout-left,
  .checkout-right {
    box-sizing: border-box;
  }

  .content-address,
  .content-products,
  .product-list,
  .profile-forms {
    max-width: 100%;
  }

  .profile-avatar,
  .profile-forms,
  .container-scroll {
    box-sizing: border-box;
  }

  .van-popup {
    max-width: min(720px, calc(100vw - 48px));
  }
}
