/* =========================================================
   products-cart.css – виджет «Заявка» (мультитоварная заявка)
   Тёмный премиальный стиль, голубые акценты, стеклянные панели.
   ========================================================= */

.ycart {
  --yc-accent: var(--accent, #3aa0ff);
  --yc-accent-2: var(--accent-2, #6bd5ff);
  --yc-surface: rgba(13, 22, 44, 0.92);
  --yc-surface-2: rgba(255, 255, 255, 0.05);
  --yc-line: rgba(255, 255, 255, 0.12);
  --yc-text: rgba(255, 255, 255, 0.94);
  --yc-muted: rgba(255, 255, 255, 0.6);
  font-family: inherit;
}
:root[data-theme="light"] .ycart {
  --yc-surface: rgba(255, 255, 255, 0.96);
  --yc-surface-2: rgba(10, 30, 60, 0.04);
  --yc-line: rgba(10, 30, 60, 0.12);
  --yc-text: #0b1a2e;
  --yc-muted: rgba(11, 26, 46, 0.62);
}
.ycart *, .ycart *::before, .ycart *::after { box-sizing: border-box; }
:root.ycart-lock { overflow: hidden; }

/* ===== LAUNCHER (плавающая кнопка, слева снизу – не мешает чат-боту) ===== */
.ycart-launcher {
  position: fixed;
  left: 18px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 2300;
  display: none;
  align-items: center;
  gap: 9px;
  padding: 12px 18px 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 40px;
  background: linear-gradient(150deg, var(--yc-accent), #1f6fd0);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(11, 30, 70, 0.45), 0 0 0 6px rgba(58, 160, 255, 0.1);
  transition: transform 0.18s ease, box-shadow 0.22s ease;
}
.ycart-launcher.is-visible { display: inline-flex; animation: yc-launch-in 0.4s cubic-bezier(0.18, 0.9, 0.24, 1.2) both; }
.ycart-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(11, 30, 70, 0.55), 0 0 0 8px rgba(58, 160, 255, 0.16); }
.ycart-launcher:focus-visible { outline: 3px solid var(--yc-accent-2); outline-offset: 3px; }
.ycart-launcher__ico { font-size: 16px; }
.ycart-launcher__badge {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 12px; background: #fff; color: #1f6fd0;
  font-size: 12.5px; font-weight: 800; display: grid; place-items: center;
}
.ycart-launcher__badge.is-bump { animation: yc-bump 0.42s cubic-bezier(0.18, 0.9, 0.24, 1.4); }

/* ===== DRAWER ===== */
.ycart-modal { position: fixed; inset: 0; z-index: 10040; }
.ycart-modal[hidden] { display: none; }
.ycart-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 7, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.3s ease;
}
.ycart-modal.is-open .ycart-backdrop { opacity: 1; }

.ycart-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--yc-surface);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-left: 1px solid var(--yc-line);
  box-shadow: -24px 0 60px rgba(6, 14, 36, 0.5);
  color: var(--yc-text);
  transform: translateX(102%);
  touch-action: pan-y;
  transition: transform 0.42s cubic-bezier(0.22, 0.86, 0.28, 1.06);
}
.ycart-modal.is-open .ycart-drawer { transform: translateX(0); }

.ycart-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 18px 14px;
  border-bottom: 1px solid var(--yc-line);
  background: linear-gradient(135deg, rgba(58, 160, 255, 0.16), rgba(31, 111, 208, 0.06));
}
.ycart-head__t { display: flex; align-items: baseline; gap: 9px; }
.ycart-head__title { font-size: 17px; font-weight: 800; }
.ycart-head__count { font-size: 12.5px; color: var(--yc-accent-2); font-weight: 700; }
.ycart-x {
  width: 34px; height: 34px; border: none; border-radius: 10px;
  background: var(--yc-surface-2); color: var(--yc-muted);
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.ycart-x:hover { background: rgba(255, 255, 255, 0.1); color: var(--yc-text); }
.ycart-x:focus-visible { outline: 2px solid var(--yc-accent-2); outline-offset: 1px; }

.ycart-body {
  flex: 1; overflow-y: auto; padding: 14px 16px 6px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.ycart-body::-webkit-scrollbar { width: 6px; }
.ycart-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 4px; }

.ycart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ycart-item {
  display: flex; gap: 10px; justify-content: space-between;
  padding: 13px; border-radius: 14px;
  background: var(--yc-surface-2);
  border: 1px solid var(--yc-line);
  animation: yc-item-in 0.32s cubic-bezier(0.18, 0.9, 0.24, 1.04) both;
  transition: opacity 0.22s ease, transform 0.22s ease, margin 0.22s ease, padding 0.22s ease, max-height 0.22s ease;
}
.ycart-item.is-removing { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -10px; }
.ycart-item__main { min-width: 0; flex: 1; }
.ycart-item__kind {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(58, 160, 255, 0.13);
  border: 1px solid rgba(107, 213, 255, 0.18);
  color: var(--yc-accent-2);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ycart-item__title { font-size: 14.5px; font-weight: 800; color: var(--yc-text); line-height: 1.25; }
.ycart-item__sub { font-size: 12.5px; color: var(--yc-muted); font-weight: 650; margin-top: 3px; line-height: 1.35; }
.ycart-item__params { font-size: 12.5px; color: var(--yc-muted); margin-top: 4px; }
.ycart-item__price { margin-top: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ycart-item__unit { font-size: 12px; color: var(--yc-muted); }
.ycart-item__sum { font-size: 15px; font-weight: 800; color: var(--yc-accent-2); }
.ycart-item__req { font-size: 13px; font-weight: 700; color: var(--yc-accent-2); }

.ycart-item__side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ycart-del {
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: transparent; color: var(--yc-muted); cursor: pointer; font-size: 13px;
  transition: background 0.2s ease, color 0.2s ease;
}
.ycart-del:hover { background: rgba(255, 90, 122, 0.16); color: #ff8298; }
.ycart-del:focus-visible { outline: 2px solid var(--yc-accent-2); outline-offset: 1px; }
.ycart-qty { display: inline-flex; align-items: center; border: 1px solid var(--yc-line); border-radius: 10px; overflow: hidden; }
.ycart-qty__btn {
  width: 30px; height: 30px; border: none; background: var(--yc-surface-2);
  color: var(--yc-text); font-size: 16px; cursor: pointer; line-height: 1;
  transition: background 0.15s ease;
}
.ycart-qty__btn:hover { background: rgba(58, 160, 255, 0.2); }
.ycart-qty__in {
  width: 42px; height: 30px; border: none; background: transparent; color: var(--yc-text);
  text-align: center; font: inherit; font-size: 14px; -moz-appearance: textfield;
}
.ycart-qty__in::-webkit-outer-spin-button, .ycart-qty__in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ycart-totals { margin: 14px 2px 6px; }
.ycart-totals__row { display: flex; align-items: baseline; justify-content: space-between; font-size: 14px; }
.ycart-totals__row b { font-size: 18px; font-weight: 800; color: var(--yc-accent-2); }
.ycart-totals__note { margin-top: 8px; font-size: 11.5px; color: var(--yc-muted); line-height: 1.45; }

.ycart-empty, .ycart-success { text-align: center; padding: 48px 18px; color: var(--yc-muted); }
.ycart-empty__ico, .ycart-success__ico { font-size: 34px; margin-bottom: 10px; }
.ycart-empty__t, .ycart-success__t { font-size: 16px; font-weight: 800; color: var(--yc-text); }
.ycart-empty__p, .ycart-success__p { font-size: 13px; margin-top: 6px; line-height: 1.5; }
.ycart-success__ico {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 26px;
  background: linear-gradient(150deg, #34d27b, #18a85e);
  box-shadow: 0 0 0 6px rgba(52, 210, 123, 0.16);
}

/* ===== FOOTER FORM ===== */
.ycart-foot { flex: 0 0 auto; padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 16px); border-top: 1px solid var(--yc-line); }
.ycart-form { display: flex; flex-direction: column; gap: 9px; }
.ycart-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ycart-in, .ycart-ta {
  width: 100%; background: var(--yc-surface-2); border: 1px solid var(--yc-line);
  border-radius: 11px; color: var(--yc-text); font: inherit; font-size: 14px; padding: 11px 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ycart-ta { resize: vertical; min-height: 46px; }
.ycart-in::placeholder, .ycart-ta::placeholder { color: var(--yc-muted); }
.ycart-in:focus, .ycart-ta:focus { outline: none; border-color: var(--yc-accent); box-shadow: 0 0 0 3px rgba(58, 160, 255, 0.18); }
.ycart-in.is-invalid { border-color: #ff6b81; box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.18); }
.ycart-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--yc-muted); line-height: 1.4; cursor: pointer; }
.ycart-consent input { margin-top: 2px; accent-color: var(--yc-accent); flex: 0 0 auto; }
.ycart-consent a { color: var(--yc-accent-2); }
.ycart-err { font-size: 12.5px; color: #ff8298; min-height: 0; }
.ycart-submit {
  width: 100%; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--yc-accent), #2f86e0); color: #fff;
  font: inherit; font-weight: 800; font-size: 14px; padding: 13px 14px; cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}
.ycart-submit:hover { filter: brightness(1.07); }
.ycart-submit:active { transform: translateY(1px); }
.ycart-submit:disabled { opacity: 0.7; cursor: default; }
.ycart-submit--ghost { background: transparent; border: 1px solid var(--yc-line); color: var(--yc-muted); }
.ycart-spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; border-radius: 50%;
  animation: yc-spin 0.7s linear infinite;
}
.ycart-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== TOASTS ===== */
.ycart-toasts {
  position: fixed; left: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  z-index: 10045; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.ycart-toast {
  padding: 11px 16px; border-radius: 12px;
  background: var(--yc-surface); border: 1px solid var(--yc-line);
  color: var(--yc-text); font-size: 13.5px; font-weight: 600;
  box-shadow: 0 14px 34px rgba(6, 14, 36, 0.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform: translateY(14px) scale(0.96); opacity: 0;
  transition: transform 0.32s cubic-bezier(0.18, 0.9, 0.24, 1.2), opacity 0.28s ease;
}
.ycart-toast::before { content: "✓"; color: var(--yc-accent-2); font-weight: 800; margin-right: 8px; }
.ycart-toast.is-in { transform: translateY(0) scale(1); opacity: 1; }

@media (max-width: 560px) {
  .ycart-launcher { left: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
  .ycart-toasts { left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 76px); }
  .ycart-drawer { width: 100vw; }
}

/* состояние кнопки «Добавить в заявку» в конфигураторе */
.pcalc__cta.is-added { background: linear-gradient(135deg, #34d27b, #18a85e) !important; border-color: transparent !important; }
.pcalc__cta:disabled { opacity: 0.55; cursor: default; filter: grayscale(0.3); }

@keyframes yc-launch-in { from { transform: translateY(20px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes yc-bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.5); } }
@keyframes yc-item-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes yc-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ycart-launcher, .ycart-launcher__badge, .ycart-backdrop, .ycart-drawer, .ycart-item, .ycart-toast {
    transition-duration: 0.01ms !important; animation-duration: 0.01ms !important;
  }
}
