/* «В 1 клик» + окно «Забронировать товар» (inc/14-quick-book.php). Кнопки темы с !important — перебиваем точечно. */
.smg-q1, .smg-q1-open, .smg-q1-hint {
    --q1-brand: #0091bf;
    --q1-brand-dark: #007aa3;
    --q1-link: #0095cb;
    --q1-text: #484c51;
    --q1-muted: #60646c;
    --q1-line: #e3e6ea;
    --q1-field: #cfd4da;
    --q1-soft: #f6f8fa;
    --q1-danger: #e24b41;
}

/* ── Кнопка на карточке: второстепенная, как «Добавить гравировку» ── */
html body button.smg-q1-open.smg-q1-open.smg-q1-open,
html body button.smg-q1-open.smg-q1-open.smg-q1-open:hover,
html body button.smg-q1-open.smg-q1-open.smg-q1-open:focus,
html body button.smg-q1-open.smg-q1-open.smg-q1-open:active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 48px !important;
    margin: 12px 0 0 !important;
    padding: 0 16px !important;
    border: 1px solid rgba(11, 133, 169, .24) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: var(--q1-link) !important;
    font: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    outline: none !important;
    transition: border-color .15s, background-color .15s;
}
html body button.smg-q1-open.smg-q1-open.smg-q1-open:hover { border-color: var(--q1-link) !important; background: #f3fafd !important; }
html body button.smg-q1-open.smg-q1-open.smg-q1-open:active { background: #e8f5fb !important; }
html body button.smg-q1-open.smg-q1-open.smg-q1-open:focus-visible { outline: 2px solid var(--q1-brand) !important; outline-offset: 2px; }

/* ── Окно ── */
html.smg-q1-lock, html.smg-q1-lock body { overflow: hidden !important; }
.smg-q1 {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    color: var(--q1-text);
    font-size: 15px; line-height: 1.45;
}
.smg-q1[hidden] { display: none !important; }
.smg-q1__back { position: absolute; inset: 0; background: rgba(20, 24, 28, .48); opacity: 0; transition: opacity .18s; }
.smg-q1__box {
    position: relative; width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow: auto;
    background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
    transform: translateY(12px); opacity: 0; transition: transform .18s, opacity .18s;
}
.smg-q1.is-open .smg-q1__back { opacity: 1; }
.smg-q1.is-open .smg-q1__box { transform: none; opacity: 1; }
.smg-q1 [hidden] { display: none !important; }

html body .smg-q1 button.smg-q1__x.smg-q1__x,
html body .smg-q1 button.smg-q1__x.smg-q1__x:hover,
html body .smg-q1 button.smg-q1__x.smg-q1__x:focus,
html body .smg-q1 button.smg-q1__x.smg-q1__x:active {
    position: absolute !important; top: 10px; right: 10px;
    width: 40px !important; height: 40px !important; padding: 0 !important; margin: 0 !important;
    display: flex !important; align-items: center; justify-content: center;
    background: none !important; border: 0 !important; border-radius: 10px !important; box-shadow: none !important;
    color: #8a8f97 !important; cursor: pointer; outline: none !important;
}
html body .smg-q1 button.smg-q1__x.smg-q1__x:hover { color: var(--q1-text) !important; background: var(--q1-soft) !important; }
html body .smg-q1 button.smg-q1__x.smg-q1__x:focus-visible { outline: 2px solid var(--q1-brand) !important; }

.smg-q1__title { margin: 0 40px 14px 0 !important; padding: 0 !important; font-size: 21px !important; line-height: 1.25 !important; font-weight: 700 !important; color: #2b2f33 !important; text-transform: none !important; }

.smg-q1__item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--q1-line); border-radius: 12px; background: var(--q1-soft); }
.smg-q1__img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; flex: none; }
.smg-q1__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.smg-q1__meta b { font-weight: 600; color: #2b2f33; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.smg-q1__meta span { font-size: 13px; color: var(--q1-muted); }
.smg-q1__price { flex: none; font-weight: 700; color: #2b2f33; white-space: nowrap; }

.smg-q1__lead { margin: 14px 0 16px !important; color: var(--q1-muted); }

.smg-q1__label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--q1-text); }
.smg-q1 input.smg-q1__inp {
    display: block; width: 100% !important; height: 48px !important; margin: 0 !important; padding: 0 14px !important;
    border: 1px solid var(--q1-field) !important; border-radius: 10px !important; background: #fff !important; box-shadow: none !important;
    font: inherit !important; font-size: 17px !important; color: #2b2f33 !important;
}
.smg-q1 input.smg-q1__inp:focus { outline: none !important; border-color: var(--q1-brand) !important; box-shadow: 0 0 0 3px rgba(0, 145, 191, .15) !important; }
.smg-q1 input.smg-q1__inp::placeholder { color: #a9aeb5; opacity: 1; }
.smg-q1 input.smg-q1__inp--err, .smg-q1 input.smg-q1__inp--err:focus { border-color: var(--q1-danger) !important; box-shadow: 0 0 0 3px rgba(226, 75, 65, .12) !important; }
.smg-q1__err { margin: 6px 0 0 !important; font-size: 13px; color: var(--q1-danger); }
.smg-q1__label--mt { margin-top: 16px; }

.smg-q1__seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.smg-q1__seg label { margin: 0; cursor: pointer; }
.smg-q1__seg input { position: absolute; opacity: 0; pointer-events: none; }
.smg-q1__seg span {
    display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 6px;
    border: 1px solid var(--q1-field); border-radius: 10px; background: #fff; font-size: 14px; color: var(--q1-text);
    white-space: nowrap; transition: border-color .15s, background-color .15s;
}
.smg-q1__seg .smg-ico { flex: none; }
.smg-q1__seg label:hover span { border-color: #aeb5bd; }
.smg-q1__seg input:checked + span { border-color: var(--q1-brand); background: #eef8fc; color: var(--q1-brand-dark); font-weight: 600; }
.smg-q1__seg input:focus-visible + span { outline: 2px solid var(--q1-brand); outline-offset: 2px; }
.smg-q1__nick { margin-top: 8px; }

.smg-q1__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

html body .smg-q1 button.smg-q1__cta.smg-q1__cta,
html body .smg-q1 button.smg-q1__cta.smg-q1__cta:hover,
html body .smg-q1 button.smg-q1__cta.smg-q1__cta:focus,
html body .smg-q1 button.smg-q1__cta.smg-q1__cta:active {
    display: flex !important; align-items: center; justify-content: center; gap: 8px;
    width: 100% !important; height: 52px !important; margin: 20px 0 0 !important; padding: 0 16px !important;
    border: 0 !important; border-radius: 12px !important; box-shadow: none !important; outline: none !important;
    background: var(--q1-brand) !important; color: #fff !important;
    font: inherit !important; font-size: 16px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important;
    cursor: pointer; transition: background-color .15s;
}
html body .smg-q1 button.smg-q1__cta.smg-q1__cta:hover { background: var(--q1-brand-dark) !important; }
html body .smg-q1 button.smg-q1__cta.smg-q1__cta:focus-visible { outline: 2px solid var(--q1-brand-dark) !important; outline-offset: 2px; }
html body .smg-q1 button.smg-q1__cta.smg-q1__cta.is-busy { opacity: .75; cursor: default; }
html body .smg-q1 button.smg-q1__cta--ghost.smg-q1__cta--ghost,
html body .smg-q1 button.smg-q1__cta--ghost.smg-q1__cta--ghost:hover,
html body .smg-q1 button.smg-q1__cta--ghost.smg-q1__cta--ghost:focus,
html body .smg-q1 button.smg-q1__cta--ghost.smg-q1__cta--ghost:active { background: #fff !important; color: var(--q1-link) !important; border: 1px solid rgba(11, 133, 169, .24) !important; }
html body .smg-q1 button.smg-q1__cta--ghost.smg-q1__cta--ghost:hover { background: #f3fafd !important; border-color: var(--q1-link) !important; }

.smg-q1__legal { margin: 12px 4px 0 !important; font-size: 11.5px; line-height: 1.5; color: #8a8f97; text-align: center; }
.smg-q1__legal a { color: var(--q1-link) !important; font-weight: 600; text-decoration: none !important; }
.smg-q1__legal a:hover { text-decoration: underline !important; }

/* Экран «Бронь принята» */
.smg-q1__ok { width: 52px; height: 52px; border-radius: 50%; background: #e6f5ec; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.smg-q1__when { margin: 0 !important; font-size: 16px; font-weight: 600; color: #2b2f33; }
.smg-q1__when span { display: block; font-weight: 400; font-size: 14px; color: var(--q1-muted); }
.smg-q1__sub { margin: 8px 0 16px !important; color: var(--q1-muted); font-size: 14px; }
.smg-q1__alt .smg-alt-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.smg-q1__alt .smg-alt-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
    border: 1px solid var(--q1-line); border-radius: 10px; background: #fff;
    color: var(--q1-text) !important; text-decoration: none !important; font-size: 14px;
}
.smg-q1__alt .smg-alt-btn:hover { border-color: var(--q1-link); color: var(--q1-link) !important; }

/* Подсказка «Сначала выберите вариант» */
.smg-q1-hint {
    position: fixed; left: 50%; bottom: 24px; z-index: 2147483001; transform: translate(-50%, 20px);
    max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 10px;
    background: #2b2f33; color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.smg-q1-hint.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
    .smg-q1 { align-items: flex-end; padding: 0; }
    .smg-q1__box { max-width: none; max-height: 92dvh; border-radius: 16px 16px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateY(40px); }
    .smg-q1__title { font-size: 19px !important; }
}

/* ── Каталог и главная: «В 1 клик» текстовой ссылкой ──
   Обычная карточка — по центру под «Добавить к заявке», прижата к кнопке (у кнопки снизу свои 15px).
   Широкая — справа от кнопки, по центру по высоте. Везде одинаковый вид: 13px, пунктир, при наведении — сплошная линия. */
html body li.product button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop,
html body li.product button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:hover,
html body li.product button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:focus,
html body li.product button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:active {
    display: block !important;
    align-self: center;
    width: auto !important;
    height: auto !important;
    margin: -11px auto -6px !important;
    padding: 4px 6px !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--q1-link) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-align: center !important;
    text-decoration: underline dotted !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 3px !important;
    white-space: nowrap;
    cursor: pointer;
}
html body li.product button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:hover {
    color: var(--q1-brand-dark) !important;
    text-decoration-style: solid !important;
}
html body li.product button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:focus-visible { outline: 2px solid var(--q1-brand) !important; outline-offset: 1px; }

/* Широкая карточка: в строке с ценой и кнопкой */
html body li.product.wide .price_line button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop,
html body li.product.wide .price_line button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:hover,
html body li.product.wide .price_line button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:focus,
html body li.product.wide .price_line button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:active {
    display: inline-block !important;
    margin: 0 0 0 14px !important;
    vertical-align: middle;
}

/* Обычная карточка товара с вариантами без выбранного варианта (нет «таблеток», кнопка «Выбрать …») — ссылку прячем.
   Где таблетки есть (главная, десктоп), RVPA ставит data-selected — ссылка видна. */
html body li.product.mini.product-type-variable:not(:has([data-selected]:not([data-selected=""]))) button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop { display: none !important; }

/* Телефон: та же картинка, но зона нажатия ~40px (лишнее съедают отрицательные отступы) */
@media (max-width: 767px) {
    html body li.product.mini button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop,
    html body li.product.mini button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:hover,
    html body li.product.mini button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:focus,
    html body li.product.mini button.smg-q1-open.smg-q1-open--loop.smg-q1-open--loop:active {
        margin: -15px auto -13px !important;
        padding: 11px 14px !important;
    }
}
