/* =========================================================================
   W05. Интернет-магазин: каталог с фильтрами и цепочка заказа, схема интеграций,
   модули цены, дерево каталога.
   ========================================================================= */

/* ---------- первый экран: каталог, корзина, цепочка заказа ---------- */
.shop { position: relative; display: grid; gap: 18px; }
.shop-browser { background: #f4f6fa; }
.shop-body { display: grid; gap: 10px; padding: 12px 14px 14px; }
.shop-bar { display: flex; align-items: center; gap: 10px; }
.shop-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 9px; background: #fff; border: 1px solid #e3e8f1; color: #5f6b88; font-size: 0.76rem; }
.shop-search svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.shop-cart { position: relative; display: grid; place-items: center; width: 38px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff; }
.shop-cart svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shop-cart b { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--signal); color: var(--ink); font-size: 0.66rem; font-weight: 800; }
.shop-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sf { padding: 4px 10px; border-radius: 999px; border: 1px solid #d5dbe7; background: #fff; color: #4a5470; font-size: 0.72rem; font-weight: 600; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.sf.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.shop-filters small { margin-left: auto; color: #4a5470; font-size: 0.72rem; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 136px; gap: 8px; min-height: 280px; align-content: start; }
.pc { display: grid; grid-template-rows: 58px auto 1fr auto; gap: 4px; padding: 8px; border-radius: 10px; background: #fff; border: 1px solid #e3e8f1; }
.pc.is-off { display: none; }
.pc-img { display: grid; place-items: center; border-radius: 7px; background: #dfe6f3; }
.pc-img--a { background: #ffe2b0; }
.pc-img--b { background: #cfdcff; }
.pc-img--c { background: #d9eee5; }
.pc-img--d { background: #ead7ff; }
.pc-img--e { background: #ffd2cc; }
.pc-img--f { background: #d4ecff; }
.pc-img svg { width: 50px; height: 38px; overflow: visible; }
.pc-img .b { fill: rgba(18, 26, 43, 0.72); }
.pc-img .h { fill: rgba(255, 255, 255, 0.7); }
.pc-img .l { fill: none; stroke: rgba(18, 26, 43, 0.72); stroke-width: 2.4; stroke-linecap: round; }
.pc b { color: var(--ink); font-size: 0.74rem; font-weight: 650; line-height: 1.25; }
.pc-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pc-price { color: var(--ink); font-size: 0.76rem; font-weight: 750; white-space: nowrap; }
.pc-btn { position: relative; flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--signal); transition: transform 0.2s, box-shadow 0.3s; }
.pc-btn::before, .pc-btn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; background: var(--ink); border-radius: 1px; }
.pc-btn::after { transform: rotate(90deg); }
.pc-btn.is-press { transform: scale(0.82); box-shadow: 0 0 0 6px rgba(255, 176, 32, 0.32); }
.pc-st { color: #1d7d59; font-size: 0.64rem; }
.pc-st--wait { color: #9a6214; }
.shop-ghost { position: absolute; z-index: 20; left: 0; top: 0; border-radius: 8px; pointer-events: none; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.6); }

.conv-wrap { position: relative; }
.conv-track { position: absolute; left: 10%; right: 10%; top: 10px; height: 2px; background: var(--night-line); }
.conv-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--flow), var(--signal)); transform-origin: left center; }
.conv-pkt { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 4px; background: var(--signal); box-shadow: 0 0 16px rgba(255, 176, 32, 0.85); opacity: 0; }
.conv { list-style: none; position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.conv li { display: grid; justify-items: center; gap: 3px; text-align: center; }
.cv-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--night); border: 2px solid var(--night-line); transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s; }
.conv li.is-on .cv-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 5px rgba(47, 191, 138, 0.2); }
.conv b { color: #eef2fb; font-size: 0.78rem; font-weight: 600; line-height: 1.2; transition: color 0.3s; }
.conv small { color: var(--fog-dim); font-size: 0.68rem; line-height: 1.25; }
.conv li:not(.is-on) b { color: var(--fog-dim); }

/* ---------- схема интеграций ---------- */
.integr-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 22px; }
.integr-stage { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto auto; gap: 44px 12%; padding: 6px 0; }
.integr-lines { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; }
.integr-lines .ln { fill: none; stroke: rgba(142, 171, 255, 0.4); stroke-width: 2; transition: stroke 0.4s; }
.integr-lines .pk { fill: var(--signal); }
.integr-lines .pk.back { fill: var(--flow-light); }
.integr[data-mode="0"] .integr-lines .ln-sync { stroke: rgba(255, 107, 91, 0.75); stroke-dasharray: 5 9; }
.integr[data-mode="0"] .integr-lines .pk-sync { display: none; }
.in-node { position: relative; z-index: 1; display: grid; gap: 2px; align-content: center; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: border-color 0.4s; }
.in-node b { font-weight: 650; line-height: 1.25; }
.in-node small { color: var(--fog); font-size: 0.85rem; line-height: 1.35; }
.in-node[data-in="erp"] { grid-area: 1 / 1; }
.in-node[data-in="pay"] { grid-area: 3 / 1; }
.in-node[data-in="site"] { grid-area: 2 / 2; }
.in-node[data-in="ship"] { grid-area: 1 / 3; }
.in-node[data-in="crm"] { grid-area: 3 / 3; }
.in-node[data-in="metrika"] { grid-area: 3 / 2; }
.in-node--site { justify-items: center; padding: 22px 16px; text-align: center; background: linear-gradient(135deg, #1f3266, #2f5be0); border-color: var(--flow-light); }
.in-node--site b { font-family: var(--font-display); font-size: var(--step-1); }
.in-node--site small { color: #dfe6f6; }
.integr[data-mode="0"] .in-node[data-link="sync"] { border-color: rgba(255, 107, 91, 0.6); }
.in-manual { grid-area: 2 / 1; z-index: 1; display: none; align-items: center; gap: 10px; align-self: center; padding: 10px 14px; border-radius: 12px; background: rgba(255, 107, 91, 0.12); border: 1px solid rgba(255, 107, 91, 0.45); color: #ffd1cb; font-size: 0.85rem; line-height: 1.35; }
.in-manual svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.integr[data-mode="0"] .in-manual { display: flex; }

.resp { width: 100%; margin-top: clamp(36px, 5vw, 56px); border-collapse: collapse; font-size: 0.95rem; }
.resp caption { padding-bottom: 14px; text-align: left; font-size: var(--step-1); font-weight: 650; color: var(--fg); }
.resp th, .resp td { padding: 14px 18px 14px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--line); line-height: 1.5; }
.resp thead th { padding-top: 0; border-top: 0; color: var(--fg-dim); font-size: 0.85rem; font-weight: 600; }
.resp tbody th { width: 24%; font-weight: 600; }
.resp td { color: var(--fg-soft); }
.resp-note { margin: 18px 0 0; color: #7fe0bb; font-weight: 600; }

/* ---------- что входит и что отдельно ---------- */
.modules { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 20px; align-items: start; }
.mod-col { padding: clamp(18px, 2.4vw, 26px); border-radius: var(--radius-lg); }
.mod-col--in { background: var(--night); color: #eef2fb; }
.mod-col--out { border: 1.5px dashed var(--fg-dim); }
.mod-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; margin-bottom: 16px; }
.mod-head b { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; letter-spacing: -0.02em; }
.mod-head small { color: var(--fg-dim); font-size: 0.85rem; }
.mod-col--in .mod-head small { color: var(--fog); }
.mod-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mod-grid .mod { display: grid; gap: 4px; align-content: start; padding: 14px 14px 14px 16px; border-radius: 12px; background: var(--night-2); border-left: 3px solid var(--flow); }
.mod-grid .mod:nth-child(4n + 2) { border-left-color: var(--signal); }
.mod-grid .mod:nth-child(4n + 3) { border-left-color: var(--ok); }
.mod b { font-weight: 600; line-height: 1.3; }
.mod-grid .mod span { color: var(--fog); font-size: 0.88rem; line-height: 1.4; }
.mod-list { list-style: none; display: grid; gap: 8px; }
.mod-list .mod { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line); }
.mod-list .mod span { color: var(--fg-soft); font-size: 0.88rem; line-height: 1.4; }
.modules + .roles { margin-top: 20px; }

/* ---------- дерево каталога ---------- */
.seo-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.ctree { padding: clamp(18px, 2.4vw, 26px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.ctree-cap { margin: 0 0 12px; color: var(--fg-dim); font-size: var(--step--1); }
.ct, .ct ul { list-style: none; margin: 0; padding: 0; }
.ct ul { margin-left: 12px; padding-left: 22px; border-left: 1.5px solid var(--line); }
.ct li { position: relative; padding: 6px 0; }
.ct ul > li::before { content: ""; position: absolute; left: -22px; top: 22px; width: 16px; height: 1.5px; background: var(--line); }
.ct-node { display: inline-flex; max-width: 100%; padding: 6px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 0.92rem; font-weight: 600; line-height: 1.3; }
.ct-root { background: var(--ink); border-color: var(--ink); color: #fff; }
.ct-filter { background: rgba(255, 176, 32, 0.12); border-color: var(--signal); }
.ct small { display: block; margin: 3px 0 0 2px; color: var(--fg-dim); font-size: 0.8rem; }
.ctree-legend { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--fg-soft); font-size: 0.88rem; }
.ct-filter-key { width: 14px; height: 14px; border-radius: 4px; background: rgba(255, 176, 32, 0.12); border: 1px solid var(--signal); }
.cc-notes--tight { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.cc-notes--tight li { padding: 12px 14px; }

@media (max-width: 1080px) {
  .modules, .seo-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 112px; min-height: 352px; }
  .pc { grid-template-rows: 40px auto 1fr auto; }
  .pc-img svg { width: 38px; height: 29px; }
  .conv b { font-size: 0.68rem; }
  .conv small { font-size: 0.6rem; }
  .integr-stage { grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 26px 14px; }
  .in-node[data-in="site"] { grid-area: 1 / 1 / 2 / 3; }
  .in-manual { grid-area: 2 / 1 / 3 / 3; }
  .in-node[data-in="erp"] { grid-area: 3 / 1; }
  .in-node[data-in="crm"] { grid-area: 3 / 2; }
  .in-node[data-in="pay"] { grid-area: 4 / 1; }
  .in-node[data-in="ship"] { grid-area: 4 / 2; }
  .in-node[data-in="metrika"] { grid-area: 5 / 1 / 6 / 3; }
  .in-node { padding: 12px; }
  .in-node small { font-size: 0.78rem; }
  .resp thead { display: none; }
  .resp tr { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
  .resp th, .resp td { width: auto !important; padding: 0; border: 0; }
  .resp td:nth-of-type(1)::before { content: "Делаю я: "; color: var(--fg); font-weight: 600; }
  .resp td:nth-of-type(2)::before { content: "На вашей стороне: "; color: var(--fg); font-weight: 600; }
  .mod-grid, .cc-notes--tight { grid-template-columns: 1fr; }
}
