/* Компоненты услуг для главной и /uslugi/: карточка с бланком, кнопка «Добавить»,
   подсказка «?», поле «Задача», корзина справа снизу, выдвижная панель заявки,
   указатель остальных услуг. Цвета берутся из :root страницы. */

.nw { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- карточка ---------- */
.sc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.sc-grid-4 { grid-template-columns: repeat(4, 1fr); margin-top: 30px; align-items: stretch; }
.sc {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  transition: border-color .2s, box-shadow .2s; scroll-margin-top: 18px;
}
.sc:hover { box-shadow: 0 14px 34px rgba(35, 60, 45, .09); }
.sc.is-on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 14px 34px rgba(35, 60, 45, .1); }
.sc:target { box-shadow: 0 0 0 3px rgba(47, 143, 78, .35); }

.sc-thumb {
  position: relative; height: 158px; overflow: hidden; border-radius: 17px 17px 0 0;
  background: linear-gradient(180deg, #EEF4F0 0%, #E3ECE6 100%);
  border-bottom: 1px solid var(--line);
}
.sc-thumb::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: linear-gradient(180deg, rgba(227, 236, 230, 0), rgba(214, 226, 218, .9));
}
.sc-thumb .paper {
  position: absolute; left: 50%; top: 22px; width: 168px; height: auto;
  transform: translateX(-50%) rotate(var(--r, 0deg)); transform-origin: 50% 100%;
  filter: drop-shadow(0 8px 14px rgba(35, 60, 45, .14)); transition: transform .35s ease;
}
.sc:hover .sc-thumb .paper { transform: translateX(-50%) translateY(-6px) rotate(0deg); }

.sc-body { padding: 18px 22px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sc h3 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.35px; color: var(--graphite); }
.sc h3 .q-wrap { margin-left: 6px; vertical-align: 2px; }
.sc-short { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.sc-hours { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; }
.sc-hours b { font-size: 27px; font-weight: 800; letter-spacing: -.8px; color: var(--graphite); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sc-hours span { color: var(--muted); font-size: 12.5px; font-weight: 600; }

.sc-more { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.sc-more summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 750; color: var(--green-d);
}
.sc-more summary::-webkit-details-marker { display: none; }
.sc-more summary::after { content: '+'; font-size: 20px; font-weight: 400; line-height: 1; }
.sc-more[open] summary::after { content: '−'; }
.sc-more dl { margin: 12px 0 2px; font-size: 14px; }
.sc-more dt { margin-top: 12px; color: var(--graphite); font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.sc-more dt:first-child { margin-top: 0; }
.sc-more dd { margin: 4px 0 0; color: #3C4A42; line-height: 1.55; }
.sc-more ul { margin: 0 0 0 16px; padding: 0; }
.sc-more li { margin: 0 0 3px; }

/* одно слово под карточкой: «Добавить» → «Добавлено» */
.sc-add {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 18px; border: 0; border-top: 1px solid var(--line); background: #fff; cursor: pointer;
  font: 750 15px/1.2 Manrope, -apple-system, 'Segoe UI', Arial, sans-serif; color: var(--green-d);
  transition: background .15s, color .15s;
}
.sc-add::before { content: '+'; font-size: 19px; font-weight: 500; line-height: 1; }
.sc > .sc-add, .sc-foot { border-radius: 0 0 17px 17px; }
.sc-foot .sc-add { border-radius: 0 0 0 17px; }
.sc-foot a { border-radius: 0 0 17px 0; }
.sc-add:hover { background: var(--tint); }
.sc-add:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }
.sc-add[aria-pressed="true"] { background: var(--green); color: #fff; border-top-color: var(--green); }
.sc-add[aria-pressed="true"]::before {
  content: ''; width: 12px; height: 7px; border: solid #fff; border-width: 0 0 2.2px 2.2px;
  transform: rotate(-45deg) translate(1px, -2px);
}
.sc-add[aria-pressed="true"]:hover { background: var(--green-d); }

/* компактная карточка на главной */
.sc-compact .sc-thumb { height: 118px; }
.sc-compact .sc-thumb .paper { width: 140px; top: 18px; }
.sc-compact .sc-body { padding: 16px 18px 14px; }
.sc-compact h3 { font-size: 17px; }
.sc-compact .sc-short { font-size: 13.5px; }
.sc-compact .sc-hours b { font-size: 22px; }
.sc-foot { display: flex; border-top: 1px solid var(--line); }
.sc-foot .sc-add { border-top: 0; flex: 1; }
.sc-foot a {
  display: flex; align-items: center; padding: 0 16px; border-left: 1px solid var(--line);
  color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.sc-foot a:hover { color: var(--green-d); background: var(--tint); }

/* ---------- кружок «?» ---------- */
.q-wrap { position: relative; display: inline-flex; }
.q {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #AEB8B1; background: #fff; color: var(--muted);
  font: 700 11px/1 Manrope, sans-serif; cursor: help; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.q:hover, .q:focus-visible, .q-wrap.open .q { border-color: var(--green); color: var(--green-d); outline: none; }
.q-tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(calc(-50% + var(--dx, 0px)));
  width: min(290px, calc(100vw - 48px)); padding: 12px 14px; border-radius: 12px; display: none; z-index: 40;
  background: #fff; color: #3C4A42; border: 1px solid #CFE0D4; font-size: 13px; font-weight: 500; line-height: 1.5; letter-spacing: 0;
  text-transform: none; text-align: left; white-space: normal; box-shadow: 0 14px 34px rgba(35, 60, 45, .16); pointer-events: none;
}
.q-tip::before, .q-tip::after { content: ''; position: absolute; left: 50%; top: 100%; border: 7px solid transparent; }
.q-tip::before { margin-left: calc(-7px - var(--dx, 0px)); border-top-color: #CFE0D4; }
.q-tip::after { margin-left: calc(-6px - var(--dx, 0px)); border-width: 6px; border-top-color: #fff; }
.q-wrap:hover .q-tip, .q:focus-visible + .q-tip, .q-wrap.open .q-tip { display: block; }

/* ---------- поле «Задача» в заявке ---------- */
.task-field {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; text-align: left;
  padding: 11px 14px; border: 1px solid #CBDDD1; border-radius: 10px; background: #fff;
}
.task-cap { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.task-tags { display: contents; }
.task-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 20px; background: var(--tint); color: var(--green-d); font-size: 13.5px; font-weight: 700; }
.task-tag button { border: none; background: none; color: var(--green-d); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 3px; }
.task-field select { flex: 1 1 160px; min-width: 0; width: 100%; text-overflow: ellipsis; border: none; background: none; font: 600 14px Manrope, sans-serif; color: var(--green-d); cursor: pointer; padding: 6px 2px; }
.lead-form > *, .form-grid > * { min-width: 0; }

/* ---------- корзина справа снизу ---------- */
.basket {
  position: fixed; right: 22px; bottom: 22px; z-index: 50; display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 14px 12px 16px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--green); color: #fff; font: 750 15px/1 Manrope, sans-serif;
  box-shadow: 0 12px 30px rgba(31, 107, 56, .32); animation: basket-in .25s ease;
}
.basket[hidden] { display: none; }
.basket svg { width: 24px; height: 24px; color: #fff; }
.basket-n {
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: #fff; color: var(--green-d);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-variant-numeric: tabular-nums;
}
.basket:hover { background: var(--green-d); }
.basket:focus-visible { outline: 3px solid #9FD8AF; outline-offset: 2px; }
.basket.bump { animation: basket-bump .4s ease; }
@keyframes basket-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes basket-bump { 0%, 100% { transform: none; } 35% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .basket, .basket.bump { animation: none; } .sc-thumb .paper, .sc:hover .sc-thumb .paper { transition: none; } }

/* ---------- выдвижная панель заявки ---------- */
.dr-lock, .dr-lock body { overflow: hidden; }
.dr-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20, 28, 24, .42); opacity: 0; transition: opacity .2s; }
.dr-overlay.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(460px, 100%); overflow-y: auto;
  padding: 24px 26px 30px; background: #fff; box-shadow: -18px 0 40px rgba(0, 0, 0, .14);
  transform: translateX(104%); transition: transform .22s ease;
}
.drawer.open { transform: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dr-head h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.6px; }
.dr-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 24px; line-height: 1; cursor: pointer; color: var(--graphite); }
.dr-close:hover { background: var(--light); }
.dr-lead { margin: 8px 0 18px; color: var(--muted); font-size: 15px; }
.drawer .lead-form { grid-template-columns: 1fr; }
.dr-alt { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

/* ---------- указатель остальных услуг (главная) ---------- */
.idx {
  display: grid; grid-template-columns: .8fr 1.6fr; gap: 28px 44px; margin-top: 18px; padding: 34px 36px;
  border-radius: 20px; background: #fff; border: 1px solid var(--line);
}
.idx-head h3 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.05; letter-spacing: -1.2px; font-weight: 800; margin: 0 0 12px; color: var(--graphite); }
.idx-head p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0 0 20px; }
.idx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border-top: 2px solid var(--green); align-self: start; }
.idx-item {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 14px 0; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.idx-item b { color: var(--green-d); font-size: 21px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; transition: color .15s; }
.idx-item span { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.idx-item:hover b { color: var(--green); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- файлы в заявке ---------- */
.file-field { grid-column: 1 / -1; min-width: 0; text-align: left; }
.file-drop {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  border: 1.5px dashed #B9CDBF; border-radius: 10px; background: #fff; transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.over, .file-drop:focus-within { border-color: var(--green); background: #F7FBF8; }
.file-drop svg { flex: 0 0 26px; width: 26px; height: 26px; color: var(--green-d); }
.file-drop b { display: block; font-size: 14.5px; color: var(--green-d); }
.file-drop small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.file-list:empty { display: none; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 8px; background: var(--tint); font-size: 13.5px; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; color: var(--graphite); }
.file-size { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.file-list button { border: 0; background: none; color: var(--green-d); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.file-err:not(:empty) { margin-top: 6px; color: var(--red); font-size: 13px; font-weight: 600; }

@media (max-width: 1000px) {
  .sc-grid, .sc-grid-4 { grid-template-columns: 1fr 1fr; }
  .idx { grid-template-columns: 1fr; padding: 28px 24px; }
}
@media (max-width: 620px) {
  .sc-grid, .sc-grid-4 { grid-template-columns: 1fr; }
  .basket { right: 14px; bottom: 14px; }
  .drawer { padding: 20px 18px 26px; }
  .idx-grid { grid-template-columns: 1fr 1fr; }
}
