  :root {
    --bg: #ffffff;
    --surface: #f7f8fb;
    --ink: #14171f;
    --muted: #6b7280;
    --border: #e8e9ee;
    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --accent-soft: #eef0ff;
    --price: #0f9d63;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --max: 1180px;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  img { max-width: 100%; display: block; }
  a { color: inherit; text-decoration: none; }
  .wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
  button { font-family: inherit; cursor: pointer; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* ==========================================================================
     PROMO WRAP (holds notice card + slider — same width as the search box)
     ========================================================================== */
  .promo-wrap {
    max-width: 720px; margin: 24px auto 0; padding: 0 20px;
    display: flex; flex-direction: column; gap: 16px;
  }

  /* ---------- Notice (boxed/table style card) ---------- */
  .notice-card {
    position: relative; display: flex; align-items: stretch; background: #fff; border-radius: 16px;
    box-shadow: 0 8px 24px rgba(20,23,31,.09); border: 1px solid var(--border); overflow: hidden;
  }
  .notice-label {
    flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 18px; color: #fff; font-weight: 800;
    font-size: 13.5px; letter-spacing: .04em; text-transform: uppercase;
    background: linear-gradient(135deg,#22d3f5,#1447e6);
  }
  .notice-label .dot {
    width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.28);
    animation: noticeDotPulse 1.6s ease-in-out infinite;
  }
  @keyframes noticeDotPulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: .55; transform: scale(.72); }
  }
  .notice-scroll {
    flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; padding: 0 18px;
    -webkit-mask-image: linear-gradient(90deg,transparent,#000 18px,#000 calc(100% - 8px),transparent);
            mask-image: linear-gradient(90deg,transparent,#000 18px,#000 calc(100% - 8px),transparent);
  }
  .notice-track { display: flex; align-items: center; width: max-content; white-space: nowrap; animation: noticeScroll 18s linear infinite; }
  /* Paused only via JS-added class (see script below) — plain CSS :hover
     gets "stuck" on mobile after a tap because touch simulates hover
     without a matching mouseleave, which is what froze the ticker. */
  .notice-card.paused .notice-track { animation-play-state: paused; }
  .notice-set { display: flex; align-items: center; }
  .notice-pill {
    display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink);
    text-decoration: none; padding: 0 8px;
  }
  a.notice-pill:hover { color: var(--accent); }
  .notice-sep { color: #1447e6; font-weight: 700; padding: 0 4px; opacity: .6; }
  @keyframes noticeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  @media (prefers-reduced-motion: reduce) {
    .notice-track { animation: none; }
  }

  /* ---------- Slider — fixed 6:2.5 ratio box, plain auto-advance ---------- */
  .hslider {
    position: relative; width: 100%; overflow: hidden;
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 10px 28px rgba(20,23,31,.10);
    border: 1px solid var(--border);
  }
  .hslider::before { content: ""; display: block; padding-top: 41.6667%; } /* 6 : 2.5 ratio */
  .hslider-track {
    position: absolute; inset: 0; display: flex; width: 100%; height: 100%;
    transition: transform .55s cubic-bezier(.65,0,.35,1);
  }
  .hslider-slide { position: relative; flex: 0 0 100%; width: 100%; height: 100%; }
  .hslider-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .hslider-slide a.hslider-link { position: absolute; inset: 0; z-index: 2; }
  .hslider-dots {
    position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 7px; z-index: 3;
  }
  .hslider-dots button {
    width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.55); border: none; cursor: pointer;
    padding: 0; transition: background .2s ease, transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  }
  .hslider-dots button.active { background: #fff; transform: scale(1.25); }
  .hslider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 36px; height: 36px; border-radius: 50%;
    background: rgba(20,23,31,.4); border: none; color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .15s ease; backdrop-filter: blur(2px);
  }
  .hslider-arrow:hover { background: rgba(20,23,31,.62); }
  .hslider-arrow svg { width: 18px; height: 18px; }
  .hslider-arrow.prev { left: 12px; }
  .hslider-arrow.next { right: 12px; }

  /* ---------- Search box (overlaps slider) ---------- */
  .search-float {
    max-width: 720px;
    margin: 16px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 3;
  }
  .search-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px rgba(20,23,31,.10);
    height: 54px;
    cursor: pointer;
    transition: box-shadow .3s ease, border-color .3s ease;
  }
  .search-card:focus-within,
  .search-card.active {
    border-color: var(--accent);
    box-shadow: 0 16px 36px rgba(20,23,31,.14);
  }
  .search-card input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    padding: 0 44px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
  }
  .search-card.active input { cursor: text; }
  .search-card input::placeholder { color: #9ca0ab; }
  .search-card .search-icon {
    position: absolute;
    top: 50%;
    left: calc(100% - 40px);
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    transition: left .3s ease, color .3s ease;
  }
  .search-card.active .search-icon {
    left: 16px;
    color: var(--accent);
  }
  .search-clear {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #f1f2f5;
    color: var(--muted);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
  }
  .search-clear:hover { background: #e5e7eb; color: var(--ink); }
  .search-card.has-text .search-clear { display: flex; }
  .no-results {
    display: none;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    padding: 30px 0 50px;
  }

  /* ---------- Sections ---------- */
  section.block { padding: 56px 0 8px; }
  .block-head {
    text-align: center;
    max-width: 520px;
    margin: 0 auto 36px;
  }
  .block-head h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
  }
  .block-head p {
    color: var(--muted);
    font-size: 14.5px;
    margin: 0;
  }

  /* ---------- Results wrapper (search regroup/reorder) ---------- */
  .results-flex { display: flex; flex-direction: column; }
  .results-flex #posts { order: 1; }
  .results-flex #products { order: 2; }

  /* While actively searching: show products first, then posts, as one
     continuous list — no section titles, no separate "group" styling. */
  .results-flex.is-searching #posts { order: 2; }
  .results-flex.is-searching #products { order: 1; }
  .results-flex.is-searching .block-head { display: none; }
  .results-flex.is-searching section.block { padding: 8px 0 8px; }
  .results-flex.is-searching .products-section {
    background: transparent;
    margin-top: 0;
    padding: 8px 0 8px;
  }

  /* ---------- Posts ---------- */
  .posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    padding-bottom: 56px;
  }
  .post-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s ease, transform .2s ease;
  }
  .post-card:hover {
    box-shadow: 0 16px 32px rgba(20,23,31,.08);
    transform: translateY(-3px);
  }
  .post-thumb { height: 170px; overflow: hidden; }
  .post-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .post-body { padding: 18px 20px 22px; }
  .post-category {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    display: block;
  }
  .post-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.35;
  }
  .post-excerpt {
    font-size: 13.8px;
    color: var(--muted);
    margin: 0 0 14px;
  }
  .post-date { font-size: 12.5px; color: #9ca0ab; }

  /* ---------- Products ---------- */
  .products-section { background: var(--surface); padding: 56px 0 60px; margin-top: 20px; }
  .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    align-items: stretch;
  }
  .product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow .2s ease, transform .2s ease;
  }
  .product-card:hover {
    box-shadow: 0 16px 32px rgba(20,23,31,.08);
    transform: translateY(-3px);
  }
  /* Whole-card link, sits under the badge/button so both stay clickable */
  .product-link { position: absolute; inset: 0; z-index: 1; }
  .product-thumb { aspect-ratio: 3 / 4; background: var(--surface); overflow: hidden; flex-shrink: 0; }
  .product-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .product-thumb .no-image {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 13px;
  }
  .product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
  }
  .product-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
  .product-name {
    font-size: 14.5px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.35;
    min-height: 2.7em; /* reserves space for 2 lines so 1-line names don't shift the button row up */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
  .price-now { font-size: 16px; font-weight: 800; color: var(--price); }
  .price-old { font-size: 13px; color: #9ca0ab; text-decoration: line-through; }
  .product-actions {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 8px;
    margin-top: auto;
  }
  .view-btn {
    flex: 1;
    background: var(--accent-soft);
    color: var(--accent);
    border: none;
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
  }
  .view-btn:hover { background: var(--accent); color: #fff; }
  .share-btn {
    flex-shrink: 0;
    width: 40px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
  }
  .share-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
  .share-btn.copied { color: var(--price); border-color: var(--price); }

  /* ---------- Share toast ---------- */
  .toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(20,23,31,.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 999;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ---------- Responsive ---------- */
  @media (max-width: 980px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 860px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 640px) {
    .promo-wrap { margin-top: 14px; padding: 0 14px; gap: 12px; }
    .notice-card { border-radius: 13px; }
    .notice-label { padding: 0 12px; font-size: 11px; gap: 6px; }
    .notice-scroll { padding: 0 12px; }
    .notice-pill { font-size: 12.5px; }
    .hslider { border-radius: 13px; }
    .hslider-arrow { width: 30px; height: 30px; }
    .hslider-arrow svg { width: 15px; height: 15px; }
    .hslider-arrow.prev { left: 8px; }
    .hslider-arrow.next { right: 8px; }
    .search-float { margin-top: 14px; padding: 0 14px; }
    .posts-grid { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    section.block { padding: 44px 0 8px; }
    .products-section { padding: 44px 0 44px; }
  }
