/* Mobile homepage redesign (concept B, approved 28.10.2026).
   Everything visual is inside @media (max-width: 720px): tablet and desktop are untouched.
   Loaded after the existing stylesheets; !important only where older mobile rules use it. */
.m-home, .m-strip { display: none; }

@media (max-width: 720px) {
  :root { --m-red: #e30613; --m-red-dark: #bd0711; --m-ink: #171717; --m-ink2: #3a3632; --m-muted: #6d675f; --m-line: #e8e3dc; --m-soft: #f7f4ef; --m-plaster: #efe9e0; --m-g: 16px; }

  /* replace the old mobile hero, delivery banner, idea and works strips with the new blocks */
  .home-header ~ .delivery-advantage,
  .home-header ~ main .home-hero,
  .home-header ~ main .creation-strip,
  .home-header ~ main .customer-works { display: none !important; }
  .home-header ~ main .market-card__delivery { display: none !important; }
  .m-home, .m-strip { display: block; }

  /* quick order */
  .m-home { background: #fff; }
  .m-home__photo { display: block; background: var(--m-plaster); }
  /* the whole approved scene (pour, bowl, full box, candles) at every screen height — never cropped by viewport */
  .m-home__photo img { display: block; width: 100%; height: auto; aspect-ratio: 780 / 650; object-fit: cover; }
  .m-bar { position: fixed; z-index: 210; left: 8px; right: 8px; bottom: calc(var(--mobile-nav-height, 64px) + env(safe-area-inset-bottom) + 8px); display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 14px; border: 1px solid var(--m-line); border-radius: 10px; background: rgba(255, 255, 255, .97); box-shadow: 0 10px 28px rgba(36, 28, 22, .16); }
  .m-bar[hidden] { display: none; }
  .m-bar__info { display: grid; flex: 1; min-width: 0; line-height: 1.2; }
  .m-bar__info b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .m-bar__info span { font-size: 15px; font-weight: 850; font-variant-numeric: tabular-nums; }
  .m-bar .m-bar__cta { flex: 0 0 auto; min-height: 44px !important; height: 44px !important; padding: 0 16px !important; border-radius: 6px !important; font-size: 14px !important; box-shadow: none !important; }
  .m-bar__cta.is-in-cart { background: var(--m-ink) !important; }
  body.is-locked .m-bar { display: none; }
  body:has(.m-bar:not([hidden])) .toast { bottom: calc(var(--mobile-nav-height, 64px) + env(safe-area-inset-bottom) + 76px) !important; z-index: 215 !important; }
  /* catalogue tabs in grade order, as in the quick-order block */
  .home-header ~ main .catalog-tabs { display: flex !important; }
  .home-header ~ main .catalog-tabs [data-line-filter="all"] { order: 0; }
  .home-header ~ main .catalog-tabs [data-line-filter="g-5"] { order: 1; }
  .home-header ~ main .catalog-tabs [data-line-filter="g-16"] { order: 2; }
  .home-header ~ main .catalog-tabs [data-line-filter="g-22"] { order: 3; }
  .m-buy { padding: 14px var(--m-g) 22px; color: var(--m-ink); }
  .m-buy__title { margin: 0; font-size: 22px; line-height: 1.08; font-weight: 850; letter-spacing: -0.03em; }
  .m-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 12px; padding: 3px; border-radius: 8px; background: var(--m-soft); }
  .m-seg button { height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--m-ink); font: inherit; font-size: 17px; font-weight: 850; letter-spacing: -0.02em; cursor: pointer; }
  .m-seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 0 var(--m-line), 0 2px 8px rgba(58, 39, 22, .10); }
  .m-buy__note { min-height: 40px; margin: 10px 0 0; color: var(--m-ink2); font-size: 13px; line-height: 1.45; }
  .m-buy__note b { color: var(--m-ink); }
  .m-buy__label { display: flex; justify-content: space-between; margin: 10px 0 8px; color: var(--m-muted); font-size: 12px; font-weight: 750; }
  .m-chips { display: flex; gap: 8px; margin: 0 calc(-1 * var(--m-g)); padding: 0 var(--m-g) 2px; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: var(--m-g); }
  .m-chips::-webkit-scrollbar { display: none; }
  .m-chip { flex: 0 0 auto; min-width: 56px; height: 40px; padding: 0 14px; border: 1px solid var(--m-line); border-radius: 999px; background: #fff; color: var(--m-ink); font: inherit; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; cursor: pointer; }
  .m-chip[aria-pressed="true"] { background: var(--m-ink); border-color: var(--m-ink); color: #fff; }
  .m-buy__price { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 12px; font-variant-numeric: tabular-nums; }
  .m-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  .m-price strong { font-size: 26px; font-weight: 850; letter-spacing: -0.02em; }
  .m-price del { color: var(--m-muted); font-size: 13px; }
  .m-off { display: inline-block; padding: 2px 5px; border-radius: 4px; background: var(--m-red); color: #fff; font-size: 11px; font-weight: 800; }
  .m-rating { margin: 0; color: var(--m-muted); font-size: 12px; font-weight: 600; text-align: right; line-height: 1.3; }
  .m-rating b { color: var(--m-ink); }
  .m-ship { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--m-soft); font-size: 12px; line-height: 1.3; color: var(--m-muted); font-weight: 600; }
  .m-ship svg { flex: 0 0 auto; width: 22px; height: 22px; fill: none; stroke: var(--m-red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .m-ship b { display: block; color: var(--m-ink); font-size: 15px; font-weight: 800; }
  .m-buy .m-buy__cta { display: flex !important; width: 100% !important; min-height: 50px !important; margin-top: 10px; border-radius: 6px !important; font-size: 15px !important; box-shadow: none !important; }
  .m-buy__cta.is-in-cart { background: var(--m-ink) !important; }
  .m-buy__more { display: block; margin-top: 10px; color: var(--m-muted); font-size: 13px; font-weight: 700; text-align: center; text-decoration: underline; text-underline-offset: 3px; }

  /* ideas and customer works */
  .m-strip { padding-top: 28px; background: #fff; }
  .m-strip:last-of-type { padding-bottom: 8px; }
  .m-strip__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 var(--m-g); }
  .m-strip__head h2 { margin: 0; font-size: 20px; line-height: 1.1; font-weight: 850; letter-spacing: -0.03em; color: var(--m-ink); }
  .m-strip__head a { padding: 10px 0; color: var(--m-muted); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
  .m-ideas, .m-works { display: flex; gap: 10px; padding: 12px var(--m-g) 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .m-ideas::-webkit-scrollbar, .m-works::-webkit-scrollbar { display: none; }
  .m-ideas { scroll-snap-type: x mandatory; scroll-padding-inline: var(--m-g); }
  .m-idea { flex: 0 0 148px; display: grid; gap: 6px; align-content: start; scroll-snap-align: start; color: var(--m-ink); text-decoration: none; }
  .m-idea img { width: 148px; height: 148px; object-fit: cover; border-radius: 10px; background: var(--m-plaster); }
  .m-idea b { font-size: 13px; line-height: 1.2; }
  .m-idea span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--m-muted); font-size: 12px; line-height: 1.3; }
  .m-work { flex: 0 0 auto; }
  .m-work img { width: 168px; height: 210px; object-fit: cover; border-radius: 10px; background: var(--m-plaster); }

  /* catalogue cards: readable type, whole product photo (3:4), no repeated delivery line */
  .home-header ~ main .catalog { padding-top: 30px !important; }
  .home-header ~ main .catalog-heading h2 { font-size: 22px !important; }
  .home-header ~ main .catalog-tabs button { min-height: 40px !important; padding: 0 14px !important; font-size: 13px !important; }
  .home-header ~ main .product-grid { gap: 10px !important; }
  .home-header ~ main .market-card { background: #fff; border-radius: 10px; overflow: hidden; }
  .home-header ~ main .market-card__media { aspect-ratio: 3 / 4 !important; border-radius: 0 !important; background: var(--m-plaster) !important; }
  .home-header ~ main .market-card .product-card__image { padding: 0 !important; }
  .home-header ~ main .market-card .product-card__image img { object-fit: contain !important; }
  .home-header ~ main .market-card__body { padding: 10px 10px 12px !important; }
  .home-header ~ main .market-card__name { min-height: 0 !important; font-size: 13px !important; line-height: 1.3 !important; font-weight: 750 !important; }
  .home-header ~ main .market-card__rating { font-size: 12px !important; margin-top: 4px !important; }
  .home-header ~ main .market-card__price-row strong { font-size: 18px !important; }
  .home-header ~ main .market-card__price-row del { font-size: 12px !important; }
  .home-header ~ main .market-card__perkg { font-size: 12px !important; }
  .home-header ~ main .market-card__actions .add-to-cart { height: 40px !important; min-height: 40px !important; font-size: 13px !important; border-radius: 6px !important; }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .m-works { scroll-behavior: auto; }
}
