.pcomas-widget {
  --pcomas-red: var(--pcom-red, #bb0000);
  --pcomas-red-dark: var(--pcom-red-core, #93000c);
  --pcomas-navy: var(--pcom-navy-deep, #0b1e36);
  --pcomas-ink: var(--pcom-ink, #17202d);
  --pcomas-muted: var(--pcom-muted, #5b6572);
  --pcomas-line: var(--pcom-line, #d7dce2);
  --pcomas-soft: var(--pcom-soft, #f2f3f5);
  --pcomas-white: var(--pcom-white, #fff);
  --pcomas-success: var(--pcom-success, #087a45);
  --pcomas-display: var(--pcom-display, 'Arial Narrow', sans-serif);
  --pcomas-body: var(--pcom-body, 'Segoe UI', sans-serif);
  position: relative;
  width: 100%;
  min-width: 0;
  color: var(--pcomas-ink);
  font-family: var(--pcomas-body);
  container-type: inline-size;
}

.pcomas-widget[data-pcomas-pending] { display: none !important; }

.pcomas-widget *, .pcomas-widget *::before, .pcomas-widget *::after { box-sizing: border-box; }
.pcomas-form { position: relative; width: 100%; margin: 0; }
.pcomas-field { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 58px; height: 48px; overflow: hidden; background: var(--pcomas-white); border: 3px solid var(--pcomas-red); }
.pcomas-field:focus-within { box-shadow: 0 0 0 3px rgba(187, 0, 0, .14); }
.pcomas-input { min-width: 0; width: 100%; height: 100%; padding: 0 48px 0 18px; color: var(--pcomas-ink); background: transparent; border: 0; outline: 0; font: 500 14px/1 var(--pcomas-body); appearance: none; }
.pcomas-input::-webkit-search-cancel-button { cursor: pointer; }
.pcomas-input::placeholder { color: #697586; opacity: 1; }
.pcomas-submit { display: grid; place-items: center; padding: 0; color: var(--pcomas-white); background: var(--pcomas-red); border: 0; cursor: pointer; transition: background-color .18s ease; }
.pcomas-submit:hover, .pcomas-submit:focus-visible { background: var(--pcomas-red-dark); }
.pcomas-submit svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pcomas-progress { position: absolute; top: 50%; right: 72px; width: 17px; height: 17px; margin-top: -8.5px; opacity: 0; border: 2px solid #d7dce2; border-top-color: var(--pcomas-red); border-radius: 50%; pointer-events: none; }
.pcomas-widget.is-loading .pcomas-progress { opacity: 1; animation: pcomas-spin .7s linear infinite; }

.pcomas-panel { position: absolute; z-index: 1080; top: calc(100% + 7px); left: 0; width: 100%; overflow: hidden; background: var(--pcomas-white); border: 1px solid #cbd3dd; border-top: 4px solid var(--pcomas-navy); box-shadow: 0 18px 42px rgba(11, 30, 54, .2); }
.pcomas-panel[hidden] { display: none; }
.pcomas-panel-head { min-height: 35px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--pcomas-navy); background: #f4f6f8; border-bottom: 1px solid var(--pcomas-line); font: 800 11px/1 var(--pcomas-display); letter-spacing: .08em; text-transform: uppercase; }
.pcomas-powered { color: var(--pcomas-muted); font-family: var(--pcomas-body); font-size: 9px; letter-spacing: .04em; }
.pcomas-results { max-height: min(474px, calc(100vh - 190px)); overflow-y: auto; overscroll-behavior: contain; }
.pcomas-hit { position: relative; min-height: 78px; display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 8px 15px 8px 11px; color: var(--pcomas-ink); background: var(--pcomas-white); border-bottom: 1px solid #e3e7ec; text-decoration: none; transition: background-color .14s ease, color .14s ease; }
.pcomas-hit::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--pcomas-red); opacity: 0; transform: scaleY(.35); transition: opacity .14s ease, transform .14s ease; }
.pcomas-hit:hover, .pcomas-hit.is-active { color: var(--pcomas-ink); background: #f8f1f2; text-decoration: none; }
.pcomas-hit:hover::before, .pcomas-hit.is-active::before { opacity: 1; transform: scaleY(1); }
.pcomas-hit:focus-visible { z-index: 1; outline: 3px solid var(--pcomas-red); outline-offset: -3px; }
.pcomas-thumb { width: 66px; height: 62px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, #fff, #eef1f4); border: 1px solid var(--pcomas-line); }
.pcomas-thumb img { width: 100%; height: 100%; display: block; object-fit: contain; mix-blend-mode: multiply; }
.pcomas-thumb.is-placeholder::after { content: 'PCOM'; color: #8a96a4; font: 900 17px/1 var(--pcomas-display); letter-spacing: .04em; }
.pcomas-hit-main { min-width: 0; }
.pcomas-hit-name { display: -webkit-box; overflow: hidden; color: var(--pcomas-navy); font-size: 13px; font-weight: 750; line-height: 1.32; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pcomas-hit mark { padding: 0; color: var(--pcomas-red-dark); background: #ffe1e4; font-weight: 800; }
.pcomas-hit-meta { margin-top: 5px; display: flex; align-items: center; gap: 7px; overflow: hidden; color: var(--pcomas-muted); font-size: 10px; line-height: 1.2; white-space: nowrap; }
.pcomas-hit-meta span { overflow: hidden; text-overflow: ellipsis; }
.pcomas-hit-meta span + span::before { content: ''; width: 3px; height: 3px; margin: 0 7px 2px 0; display: inline-block; background: var(--pcomas-red); }
.pcomas-hit-side { min-width: 95px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; text-align: right; }
.pcomas-hit-price { color: var(--pcomas-navy); font: 900 19px/1 var(--pcomas-display); white-space: nowrap; }
.pcomas-stock { display: inline-flex; align-items: center; gap: 5px; color: var(--pcomas-success); font-size: 9px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.pcomas-stock::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.pcomas-stock.is-out { color: #8a4650; }
.pcomas-status { min-height: 84px; margin: 0; padding: 26px 20px; display: grid; place-items: center; color: var(--pcomas-muted); background: var(--pcomas-white); border-bottom: 1px solid var(--pcomas-line); text-align: center; font-size: 13px; line-height: 1.5; }
.pcomas-status:empty { display: none; }
.pcomas-status::before { content: ''; width: 28px; height: 3px; margin-bottom: 8px; display: block; background: var(--pcomas-red); }
.pcomas-all { width: 100%; min-height: 48px; padding: 11px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--pcomas-white); background: var(--pcomas-navy); border: 0; border-left: 5px solid var(--pcomas-red); cursor: pointer; text-align: left; font-size: 12px; transition: background-color .18s ease; }
.pcomas-all[hidden] { display: none; }
.pcomas-all:hover, .pcomas-all.is-active, .pcomas-all:focus-visible { background: var(--pcomas-red-dark); }
.pcomas-all strong { color: inherit; font-weight: 800; }
.pcomas-all svg { flex: 0 0 auto; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pcomas-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@keyframes pcomas-spin { to { transform: rotate(360deg); } }

@container (max-width: 520px) {
  .pcomas-hit { grid-template-columns: 58px minmax(0, 1fr); }
  .pcomas-hit-side { grid-column: 2; min-width: 0; margin-top: -3px; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  .pcomas-thumb { width: 58px; height: 58px; grid-row: 1 / span 2; }
}

@media (max-width: 640px) {
  .pcomas-field { grid-template-columns: minmax(0, 1fr) 52px; height: 46px; }
  .pcomas-input { padding-right: 39px; padding-left: 13px; font-size: 13px; }
  .pcomas-progress { right: 62px; }
  .pcomas-panel { position: fixed; top: var(--pcomas-panel-top, 64px); right: 8px; bottom: auto; left: 8px; width: auto; max-height: var(--pcomas-panel-max-height, calc(100dvh - 74px)); display: flex; flex-direction: column; }
  .pcomas-panel[hidden] { display: none; }
  .pcomas-panel-head { flex: 0 0 auto; }
  .pcomas-results { min-height: 0; max-height: none; flex: 1 1 auto; }
  .pcomas-hit { min-height: 76px; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px 8px 8px; }
  .pcomas-thumb { width: 58px; height: 58px; }
  .pcomas-hit-name { font-size: 12px; }
  .pcomas-hit-meta { max-width: 100%; }
  .pcomas-hit-side { min-width: 76px; gap: 6px; }
  .pcomas-hit-price { font-size: 17px; }
  .pcomas-stock { font-size: 8px; }
  .pcomas-powered { display: none; }
  .pcomas-status { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
  .pcomas-all { flex: 0 0 auto; }
}

@media (max-width: 390px) {
  .pcomas-hit { grid-template-columns: 56px minmax(0, 1fr); }
  .pcomas-hit-side { grid-column: 2; min-width: 0; margin-top: -3px; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  .pcomas-thumb { width: 56px; height: 56px; grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
  .pcomas-widget *, .pcomas-widget *::before, .pcomas-widget *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
