/**
 * WEMAN homepage — Mobile search-first layout (≤768px)
 * Desktop keeps styles.css. Mobile IA: Search → VIN → Categories → Products → Brand.
 */
.hm-hero-kicker,
.hm-categories,
.hm-featured,
.hm-sticky-search,
.hm-bottom-nav,
.hm-search-modes,
.hm-search-row {
  display: none;
}

@media (max-width: 768px) {
  body.page-home {
    --hm-pad: 12px;
    --hm-gap: 12px;
    --hm-green: #1b7a3d;
    --hm-ink: #0f172a;
    --hm-muted: #64748b;
    --hm-line: #e2e8f0;
  }

  body.page-home .container {
    padding-left: var(--hm-pad);
    padding-right: var(--hm-pad);
  }

  /* ——— Header compact ——— */
  body.page-home .navbar {
    min-height: 52px;
  }

  body.page-home .navbar .nav-container {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body.page-home .logo h1 {
    font-size: 1.05rem;
  }

  body.page-home .nav-quick-search {
    display: none !important;
  }

  /* ——— Sticky search ——— */
  body.page-home .hm-sticky-search {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: #fff;
    border-bottom: 1px solid var(--hm-line);
    padding: 8px var(--hm-pad);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  }

  body.page-home .hm-sticky-search.is-visible {
    display: block;
  }

  body.page-home .hm-sticky-search[hidden] {
    display: none !important;
  }

  body.page-home .hm-sticky-search__inner {
    display: flex;
    gap: 8px;
    align-items: stretch;
  }

  body.page-home .hm-sticky-search__inner input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 16px;
  }

  body.page-home .hm-sticky-search__inner button {
    min-width: 44px;
    border: none;
    border-radius: 8px;
    background: var(--hm-green);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
  }

  /* ——— Hero: full image + title + transparent search + slow zoom ——— */
  body.page-home .hero-slider {
    min-height: 300px !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
  }

  body.page-home .hero-carousel {
    opacity: 1;
  }

  /* Keep slow zoom (scale in while active) — premium look */
  body.page-home .hero-carousel-slide {
    transform: scale(1) !important;
    transition: opacity 1.1s ease, transform 14s ease-out !important;
  }

  body.page-home .hero-carousel-slide.is-active {
    opacity: 1 !important;
    transform: scale(1.1) !important;
  }

  body.page-home .hero-carousel-shade {
    opacity: 0.32;
    background: linear-gradient(180deg, rgba(8, 18, 40, 0.35) 0%, rgba(8, 18, 40, 0.15) 45%, rgba(8, 18, 40, 0.45) 100%);
  }

  body.page-home .hero-carousel-dots,
  body.page-home .hero-carousel-arrow {
    display: none !important;
  }

  body.page-home .hero-carousel-content {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 300px !important;
    padding: 24px var(--hm-pad) 18px !important;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
  }

  body.page-home .hero-tag {
    display: none !important;
  }

  body.page-home .hero-title,
  body.page-home .hero-simple-text .hero-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 1.45rem !important;
    margin: 0 0 4px !important;
    line-height: 1.2 !important;
    color: #fff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  }

  body.page-home .hm-hero-kicker {
    display: block !important;
    visibility: visible !important;
    margin: 0 0 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }

  body.page-home .hm-desktop-only {
    display: none !important;
  }

  /* Mobile: hide hero quick-link buttons (user: 影响美观) */
  body.page-home .hero-mobile-quicklinks {
    display: none !important;
  }

  body.page-home .hero-mobile-search {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    width: 100%;
  }

  body.page-home .hm-search-row {
    display: flex !important;
    align-items: stretch;
    gap: 8px;
  }

  body.page-home .hero-mobile-search-input {
    flex: 1;
    min-width: 0;
    min-height: 48px !important;
    height: 48px;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    background: rgba(255, 255, 255, 0.28) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #0f172a !important;
    font-size: 16px !important;
    padding: 0 14px !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
  }

  body.page-home .hero-mobile-search-input::placeholder {
    color: rgba(15, 23, 42, 0.55) !important;
  }

  body.page-home .hero-mobile-search-btn {
    width: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    height: 48px;
    border-radius: 10px !important;
    background: rgba(27, 122, 61, 0.88) !important;
    color: #fff !important;
    font-size: 1.1rem !important;
    padding: 0 !important;
    box-shadow: 0 2px 10px rgba(27, 122, 61, 0.28);
  }

  body.page-home .hm-search-modes {
    display: none !important;
  }

  /* Trust promo removed on mobile */
  body.page-home .hm-trust {
    display: none !important;
  }

  /* ——— Categories 2×4 ——— */
  body.page-home .hm-categories,
  body.page-home .hm-featured {
    display: block;
    padding: 14px var(--hm-pad) 0;
  }

  body.page-home .hm-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }

  body.page-home .hm-section-head h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--hm-ink);
  }

  body.page-home .hm-section-head a {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e3c72;
    text-decoration: none;
    white-space: nowrap;
  }

  body.page-home .hm-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  body.page-home .hm-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 68px;
    padding: 8px 4px;
    border-radius: 10px;
    border: 1px solid var(--hm-line);
    background: #fff;
    text-decoration: none;
    color: var(--hm-ink);
    text-align: center;
  }

  body.page-home .hm-cat__ico {
    font-size: 1.15rem;
    line-height: 1;
  }

  body.page-home .hm-cat span:last-child {
    font-size: 0.65rem;
    font-weight: 650;
    line-height: 1.2;
  }

  body.page-home .hm-cat--more {
    background: #f8fafc;
  }

  /* ——— Featured horizontal ——— */
  body.page-home .hm-featured-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  body.page-home .hm-featured-empty {
    color: var(--hm-muted);
    font-size: 0.85rem;
    padding: 12px 0;
  }

  body.page-home .hm-prod-card {
    flex: 0 0 148px;
    width: 148px;
    border: 1px solid var(--hm-line);
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: var(--hm-ink);
    overflow: hidden;
  }

  body.page-home .hm-prod-card__img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    background: #f8fafc;
    display: block;
  }

  body.page-home .hm-prod-card__img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.7rem;
  }

  body.page-home .hm-prod-card__body {
    padding: 8px 10px 10px;
  }

  body.page-home .hm-prod-card__name {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2em;
  }

  body.page-home .hm-prod-card__code {
    margin: 4px 0 0;
    font-size: 0.68rem;
    color: var(--hm-muted);
  }

  body.page-home .hm-prod-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 6px;
  }

  body.page-home .hm-stock {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--hm-green);
    background: #ecfdf3;
    padding: 2px 6px;
    border-radius: 999px;
    white-space: nowrap;
  }

  body.page-home .hm-stock.is-out {
    color: #b45309;
    background: #fff7ed;
  }

  body.page-home .hm-price {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--hm-ink);
  }

  /* ——— Trust: compact 2×2 after products ——— */
  body.page-home .brand-trust {
    margin: 16px 0 0;
    padding: 12px var(--hm-pad);
  }

  body.page-home .trust-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  body.page-home .trust-grid > div {
    padding: 10px !important;
    border-radius: 10px;
    border: 1px solid var(--hm-line);
    background: #fff;
    text-align: left !important;
  }

  body.page-home .trust-grid p {
    margin: 0 !important;
    font-size: 0.65rem !important;
    color: var(--hm-muted) !important;
  }

  body.page-home .trust-grid h3 {
    margin: 4px 0 0 !important;
    font-size: 0.85rem !important;
    line-height: 1.25 !important;
  }

  /* ——— Solutions: hide heavy showcase on mobile ——— */
  body.page-home .solutions-section {
    display: none !important;
  }

  /* Mobile: hide trust blocks (user: 不好看) */
  body.page-home .brand-trust,
  body.page-home .trust-section {
    display: none !important;
  }

  /* ——— Innovation: compact ——— */
  body.page-home .innovation-section {
    padding: 16px 0 8px !important;
  }

  body.page-home .innovation-section .section-head {
    margin-bottom: 10px !important;
  }

  body.page-home .innovation-section .section-head h2 {
    font-size: 1rem !important;
  }

  body.page-home .innovation-section .section-head p {
    font-size: 0.78rem !important;
  }

  body.page-home .innovation-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.page-home .innovation-card {
    padding: 12px !important;
    border-radius: 10px !important;
  }

  body.page-home .innovation-card ul {
    margin: 6px 0 0 !important;
    padding-left: 1.1rem !important;
  }

  body.page-home .innovation-card li {
    font-size: 0.78rem !important;
  }

  /* ——— Global: list only, no huge map ——— */
  body.page-home .global-section {
    padding: 14px 0 !important;
  }

  body.page-home .global-grid {
    display: block !important;
  }

  body.page-home .global-map {
    display: none !important;
  }

  body.page-home .global-list {
    margin: 8px 0 !important;
  }

  body.page-home .global-list li {
    font-size: 0.82rem !important;
    padding: 4px 0 !important;
  }

  /* ——— VN agent compact ——— */
  body.page-home .agent-section {
    padding: 14px 0 !important;
  }

  body.page-home .agent-card {
    padding: 12px !important;
    border-radius: 10px !important;
  }

  body.page-home .agent-info p {
    font-size: 0.78rem !important;
    margin: 4px 0 !important;
  }

  body.page-home .contact-btn {
    min-height: 42px;
    width: 100%;
    margin-top: 8px;
  }

  /* ——— News compact ——— */
  body.page-home .news-section {
    padding: 12px 0 8px !important;
  }

  body.page-home .news-placeholder {
    padding: 1rem !important;
    font-size: 0.85rem;
  }

  body.page-home .footer {
    padding: 14px 0 8px !important;
    font-size: 0.72rem;
  }
}

@media (min-width: 769px) {
  .hm-categories,
  .hm-featured,
  .hm-sticky-search,
  .hm-bottom-nav,
  .hm-hero-kicker,
  .hm-search-modes,
  .hm-trust {
    display: none !important;
  }

  .hm-desktop-only {
    display: revert;
  }

  /* Desktop: never show mobile hero quicklinks */
  .hero-mobile-quicklinks {
    display: none !important;
  }
}
