/* Alpenflor — собственные стили поверх темы Shopware.
   Здесь: оверлеи/offcanvas, мобильное меню, корзина, чекаут, тосты,
   cookie-панель, панели фильтров, слайдеры, печать. */

:root {
    --sw-brand: var(--sw-color-brand-primary, #598229);
    --sw-brand-dark: var(--twt-color-brand-primary-dark, #184012);
    --sw-ink: #1f2a17;
    --sw-muted: #6b7280;
    --sw-line: #e5e7eb;
    --sw-bg: #f7f8f5;
    --sw-radius: 12px;
    --sw-shadow: 0 10px 30px rgba(15, 35, 5, .12);
}

html.sw-lock, html.sw-lock body { overflow: hidden; }

/* --------------------------------------------------- оверлеи */
.sw-backdrop {
    position: fixed; inset: 0; z-index: 1040;
    background: rgba(15, 25, 8, .45);
    opacity: 0; transition: opacity .2s ease; display: none;
}
.sw-backdrop.show { opacity: 1; }
.offcanvas.sw-offcanvas {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1045;
    width: min(440px, 92vw); max-width: 92vw;
    background: #fff; visibility: hidden; display: none; flex-direction: column;
    transform: translateX(100%); transition: transform .28s ease;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
    border: 0;
}
.offcanvas.sw-offcanvas.offcanvas-start { left: 0; right: auto; transform: translateX(-100%); }
.offcanvas.sw-offcanvas.show { visibility: visible; transform: translateX(0); }
.sw-offcanvas .offcanvas-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--sw-line);
}
.sw-offcanvas .offcanvas-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; }

/* мобильное меню */
.sw-mnav > li { border-bottom: 1px solid var(--sw-line); position: relative; }
.sw-mnav-link { display: block; padding: 13px 44px 13px 2px; font-weight: 600; color: var(--sw-ink); text-decoration: none; }
.sw-mnav-link:hover { color: var(--sw-brand); }
.sw-mnav-toggle {
    position: absolute; right: 0; top: 4px; width: 36px; height: 36px;
    border: 1px solid var(--sw-line); border-radius: 8px; background: #fff; font-size: 18px; line-height: 1;
}
.sw-mnav-sub { padding: 0 0 10px 12px; }
.sw-mnav-sub li a { display: block; padding: 7px 6px; color: #333; text-decoration: none; font-size: 15px; }
.sw-mnav-sub li a:hover { color: var(--sw-brand); }
.sw-mnav-sub .sw-mnav-sub a { padding-left: 18px; font-size: 14px; }
.sw-mobile-menu .navigation-offcanvas-actions { padding-top: 14px; }

/* --------------------------------------------------- корзина (drawer) */
.sw-ci { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sw-line); }
.sw-ci-img { flex: 0 0 78px; height: 78px; border-radius: 10px; overflow: hidden; background: var(--sw-bg); display: block; }
.sw-ci-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-ci-info { flex: 1 1 auto; min-width: 0; }
.sw-ci-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.sw-ci-msg { font-size: 12.5px; color: var(--sw-muted); margin-top: 3px; white-space: pre-wrap; }
.sw-ci-price { font-weight: 700; margin: 4px 0 6px; }
.sw-ci-qty { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sw-ci-qty .sw-ci-input { width: 62px; text-align: center; }
.sw-ci-del { text-decoration: underline; color: var(--sw-muted); font-size: 13px; }
.sw-cart-foot { border-top: 1px solid var(--sw-line); padding: 14px 18px 18px; background: #fff; }
.sw-cart-foot .sw-cart-total { font-size: 17px; margin-top: 6px; }
.sw-small { font-size: 12px; color: var(--sw-muted); }

/* --------------------------------------------------- тулбар листинга */
.sw-toolbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 10px 0 16px; margin-bottom: 10px; border-bottom: 1px solid var(--sw-line);
}
.sw-toolbar-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 0; }
.sw-toolbar .form-select { width: auto; min-width: 190px; }
.sw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sw-chip {
    border: 1px solid var(--sw-line); background: #fff; border-radius: 999px;
    padding: 6px 14px; font-size: 13.5px; cursor: pointer; transition: .15s;
}
.sw-chip:hover { border-color: var(--sw-brand); color: var(--sw-brand); }
.sw-chip.active { background: var(--sw-brand); border-color: var(--sw-brand); color: #fff; }

/* --------------------------------------------------- карточки */
.sw-box { height: 100%; position: relative; }
.sw-box .product-image-wrapper { position: relative; }
.sw-box .product-wishlist-btn {
    position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px;
    display: grid; place-items: center; border-radius: 50%;
    background: rgba(255, 255, 255, .92); border: 1px solid var(--sw-line); color: #444;
}
.sw-box .product-wishlist-btn.product-wishlist-added { color: #d03a4f; border-color: #f0c3cb; }
.sw-box .product-name { text-decoration: none; }
.sw-box .product-price { font-weight: 700; }

/* --------------------------------------------------- пустые состояния */
.sw-empty { padding: 48px 16px; text-align: center; color: var(--sw-muted); }
.sw-empty p { margin-bottom: 14px; font-size: 17px; }

/* --------------------------------------------------- чекаут */
.sw-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 20px; flex-wrap: wrap; }
.sw-steps li {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    background: #eef1ea; color: #57614f; font-size: 13.5px; font-weight: 600;
}
.sw-steps li span {
    width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #57614f;
    display: grid; place-items: center; font-size: 12px; border: 1px solid #cfd6c9;
}
.sw-steps li.active { background: var(--sw-brand); color: #fff; }
.sw-steps li.active span { background: #fff; color: var(--sw-brand); border-color: #fff; }
.sw-steps li.done { background: #dfe8d6; color: var(--sw-brand-dark); }
.sw-steps li.done span { background: var(--sw-brand); color: #fff; border-color: var(--sw-brand); }

.sw-summary { position: sticky; top: 90px; }
.sw-mini-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--sw-line); font-size: 14px; }
.sw-mini-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--sw-bg); }
.sw-mini-item span { flex: 1 1 auto; }

.sw-pay {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1.5px solid var(--sw-line); border-radius: var(--sw-radius); padding: 14px 16px; cursor: pointer;
    transition: .15s; background: #fff; height: 100%;
}
.sw-pay:hover { border-color: var(--sw-brand); }
.sw-pay.active { border-color: var(--sw-brand); box-shadow: 0 0 0 3px rgba(89, 130, 41, .13); }
.sw-pay input { accent-color: var(--sw-brand); }
.sw-pay-name { font-weight: 600; }

/* Карта — единственный способ оплаты, поэтому ошибка на поле карты показывается
   так же, как в платёжной форме: красная рамка + ореол. Снимается на input
   (см. initCheckout → err(name, '') в assets/js/shop.js). */
.sw-card .is-invalid, .sw-card .form-control.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .25) !important;
}
.sw-card .sw-err, .sw-card .invalid-feedback { color: #dc2626; }

.sw-review h3 { margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .04em; color: var(--sw-muted); font-size: 12px; }
.sw-review h3:first-child { margin-top: 0; }
.sw-review-items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--sw-line); }
.sw-review-total { display: flex; justify-content: space-between; padding: 4px 0; }
.sw-cart-table { overflow: hidden; }
.sw-cart-table .sw-ci { padding: 16px; border-bottom: 1px solid var(--sw-line); }

/* подтверждение заказа */
.sw-done-card { position: relative; }
.sw-done-seal {
    width: 64px; height: 64px; border-radius: 50%; background: var(--sw-brand); color: #fff;
    display: grid; place-items: center; font-size: 32px; margin-bottom: 14px;
}
.sw-muted { color: var(--sw-muted); }

/* --------------------------------------------------- тосты */
.sw-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.sw-toast {
    background: #223018; color: #fff; padding: 12px 16px; border-radius: 10px;
    box-shadow: var(--sw-shadow); font-size: 14.5px; animation: swIn .25s ease;
    max-width: min(92vw, 380px);
}
.sw-toast-error { background: #8f2222; }
.sw-toast-info { background: #2b3a4a; }
.sw-toast-out { opacity: 0; transform: translateY(8px); transition: .35s; }
@keyframes swIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------- cookie */
.sw-cookie {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
    background: #1d2617; color: #f2f5ef; padding: 14px 16px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .25);
}
.sw-cookie-hide { transform: translateY(110%); transition: transform .35s ease; }
.sw-cookie-inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.sw-cookie-text { flex: 1 1 320px; font-size: 14px; }
.sw-cookie-actions { display: flex; gap: 10px; }

/* --------------------------------------------------- кнопки вверх */
.sw-scroll-up {
    position: fixed; right: 18px; bottom: 88px; z-index: 1200;
    width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sw-brand); color: #fff;
    box-shadow: var(--sw-shadow); opacity: 0; pointer-events: none; transition: .25s; font-size: 20px;
}
.sw-scroll-up.sw-visible { opacity: .95; pointer-events: auto; }

/* --------------------------------------------------- слайдеры (галереи, один слайд) */
.sw-slider-done { position: relative; }
/* страховка: пока на ряде висит is-loading, тема прячет все контейнеры кадров,
   кроме первого (наш JS обычно его снимает) */
.sw-slider-done .gallery-slider-item-container { display: block !important; }
/* прятать чужие кадры можно только когда их больше одного (иначе на странице с
   одной фотографией осталось бы пустое место — JS выходит, не дойдя до show()) */
.sw-slider-done.sw-slider-multi .base-slider-item:not(.sw-slide-active),
.sw-slider-done.sw-slider-multi .gallery-slider-item:not(.sw-slide-active),
.sw-slider-done.sw-slider-multi .slick-slide:not(.sw-slide-active) { display: none; }
.sw-slider-done .sw-slide-active { display: block; }
/* Тема считала высоту кадра через tns и оставила inline min-height только на первом
   кадре: у остальных высота 0, а большая фотография внутри кадра position:absolute —
   при переключении она просто исчезала (переключатель «не работает»). Выдаём общую
   высоту всем кадрам; на мобильной (≤576 px) высота капает тема (225 px). */
@media (min-width: 577px) {
    .sw-slider-done .gallery-slider-item { min-height: var(--sw-gal-h, 260px) !important; }
}
.sw-slider-done .gallery-slider-thumbnails-item { cursor: pointer; opacity: .6; }
.sw-slider-done .gallery-slider-thumbnails-item.is-active { opacity: 1; outline: 2px solid var(--sw-brand); border-radius: 8px; }
img[data-object-fit="cover"] { object-fit: cover; }

/* --------------------------------------------------- слайдеры-ряды (product-slider)
   Ряд карточек Shopware отдаёт как display:flex, а ширину каждого .product-slider-item
   считал owl-carousel (jQuery) из data-product-slider-options: productboxMinWidth +
   gutter. jQuery в зеркале не работает, и flex сжимает 14–30 карточек до min-content
   (48–70 px): название в 2 символа, цена «в столбик». Поэтому ряд делаем горизонтальным
   скроллом; ширину карточки считает core.js и кладёт в --af-slider-w (как в оригинале),
   значения ниже — страховка, если JS не доехал. */
.product-slider-container {
    display: flex; flex-wrap: nowrap; align-items: stretch;
    gap: var(--af-slider-g, 24px);
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity; overscroll-behavior-x: contain;
    scrollbar-width: thin; scrollbar-color: #c4d0b8 transparent;
    padding: 4px 0 12px; -webkit-overflow-scrolling: touch;
}
.product-slider-container > .product-slider-item {
    flex: 0 0 var(--af-slider-w, clamp(178px, 21vw, 280px));
    min-width: 0; scroll-snap-align: start;
}
.product-slider-container .product-box { height: 100%; }
/* текст в карточке переносим по словам, а не по буквам */
.product-slider-container .product-name,
.product-slider-container .product-description,
.product-slider-container .product-price,
.cms-listing-col .product-name,
.cms-listing-col .product-price {
    word-break: normal; overflow-wrap: break-word; hyphens: none;
}
.product-slider-container .product-price { white-space: nowrap; }
/* стрелки: ряд прокручивается, поэтому показываем их всегда, а на краю глушим */
.sw-scroll-slider .base-slider-dots { display: none; }
.sw-scroll-slider .base-slider-controls { opacity: .85; }
.sw-scroll-slider:hover .base-slider-controls { opacity: 1; }
.sw-scroll-slider.sw-slider-fit .base-slider-controls { display: none; }
.base-slider-controls-prev[disabled], .base-slider-controls-next[disabled] { opacity: .25; cursor: default; }
.sw-slider-drag { cursor: grabbing; scroll-snap-type: none; }
/* активная точка галереи: тема использует tns-nav-active, наш JS добавляет и свою */
.sw-slider-done .base-slider-dots .sw-dot-active { background-color: var(--sw-brand); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sw-brand); }

@media (max-width: 767px) {
    .product-slider-container { gap: 14px; scroll-snap-type: x mandatory; }
    .product-slider-container > .product-slider-item { flex-basis: var(--af-slider-w, 78vw); }
    .sw-scroll-slider .base-slider-controls { display: none; }
}

/* шапка при прокрутке */
.header-main.sw-header-scrolled { box-shadow: 0 4px 18px rgba(0, 0, 0, .08); }
.header-main .header-cart-btn { position: relative; }
#swCartCountBadge, #swWishBadge {
    position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 999px; background: var(--sw-brand); color: #fff; font-size: 11px;
    display: none; align-items: center; justify-content: center; line-height: 1;
}
#swAccountName { font-weight: 600; }

/* --------------------------------------------------- анимации CMS (замена animate.css) */
@keyframes swFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes swFadeIn { from { opacity: 0; } to { opacity: 1; } }
[class*="animate--"], .animate__animated, .fadeInUp, .fadeIn { animation-duration: .6s; animation-fill-mode: both; }
[class*="fadeInUp"], .animate__fadeInUp { animation-name: swFadeUp; }
[class*="fadeIn"], .animate__fadeIn { animation-name: swFadeIn; }

/* --------------------------------------------------- печать */
@media print {
    .header-main, .footer-main, .sw-cookie, .sw-scroll-up, .sw-toasts, .breadcrumb,
    .sw-steps, #swScrollUp, .newsletter, .top-bar, .nav-header, .b-sidebar, .filter-panel { display: none !important; }
    body { background: #fff; }
    .sw-done-card { box-shadow: none; border: 0; padding: 0; }
    a[href]::after { content: ""; }
}

/* --------------------------------------------------- чужие бейджи и виджеты */
img[src*="signaletic"], a[href*="signaletic"], a:has(img[src*="signaletic"]),
img[src*="top_rated_company"], img[src*="excellent-shop"], img[src*="trusted-shops"],
img[src*="etrusted"], .swiss-seal-of-approval, .trusted-shops-award,
.hde-custom-footer-logos, .hde-excellent-shop-badge-container,
.account-menu-login .btn-moorl-google, .account-menu-login [name="provider"],
#tidio-chat, .tidio_blp-wrapper, .otr--cookies-txt, .cc-window { display: none !important; }

/* ------------------------------- выпадающие меню шапки (без Popper.js)
   Меню аккаунта открывалось от левого края кнопки и выходило за правый край
   страницы (замер: x=1331, ширина 200 px при вьюпорте 1424 px → +107 px).
   core.js ставит меню data-bs-popper="static" — правило темы
   .dropdown-menu-end[data-bs-popper]{right:0;left:auto} снова работает. Здесь —
   то же выравнивание без атрибута (страховка при выключенном JS) и границы,
   за которые меню не выходит. */
.dropdown-menu[data-bs-popper] { top: 100%; left: 0; margin-top: .25rem; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-menu-start { right: auto; left: 0; }
.header-main .dropdown-menu, .top-bar .dropdown-menu {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 88px);
    overflow: auto;
}
.account-menu-dropdown { width: min(340px, calc(100vw - 16px)); }
.account-menu-dropdown .account-menu { width: 100%; }
@media (max-width: 767.98px) {
    /* Тема на узких экранах прятает это меню:
       @media (max-width:767.98px){.account-menu .dropdown .dropdown-menu.show
       {display:none!important}} — в живом магазине его открывал JS отдельным
       offcanvas-оверлеем, которого в автономной копии нет. Иконка аккаунта на
       телефоне была мёртвой: клик есть, меню нет. Показываем его обычной
       панелью, прижатой к правому краю и не выходящей за экран. */
    .account-menu .dropdown .dropdown-menu.account-menu-dropdown.show {
        display: block !important;
        position: fixed;
        top: 60px;
        right: 8px;
        left: auto;
        width: calc(100vw - 16px);
        max-width: 380px;
        max-height: calc(100vh - 76px);
        overflow: auto;
        z-index: 1050;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    }
}
@media (max-width: 575px) {
    .account-menu-dropdown { width: calc(100vw - 16px); }
}

/* --------------------------------------------------- меню аккаунта: вход и регистрация
   Мёртвую форму Shopware (action="konto.html"; в зеркале от неё остались только
   hidden-поля — e-mail и пароль рисовал сервер) заменяет our block из shop.js. */
.sw-acct { padding: .25rem 0 .5rem; }
.sw-acct .form-label { font-size: .8125rem; font-weight: 600; margin-bottom: .125rem; }
.sw-acct .form-control { width: 100%; margin-bottom: .5rem; }
.sw-acct .sw-acct-actions { display: flex; gap: .5rem; }
.sw-acct .sw-acct-actions .btn { flex: 1 1 0; }
.sw-acct-note { font-size: .75rem; color: #6c757d; margin: .25rem 0 0; }
.sw-acct-hello { font-weight: 600; margin-bottom: .25rem; }
.sw-acct-mail { font-size: .8125rem; color: #6c757d; word-break: break-all; }
.account-menu-dropdown .btn-link { padding: .25rem 0; text-decoration: none; }
.account-menu-btn.sw-signed-in .header-account-name { color: var(--sw-brand); font-weight: 600; }

/* --------------------------------------------------- поля даты: своя подсказка
   Chrome рисует нативную подсказку date-поля по языку ИНТЕРФЕЙСА браузера
   («дд.мм.гггг» в русском Chrome), и lang на поле/документе на неё не влияет —
   замер tools_v2/dbg_datelang.py, out/dbg_datelang.txt. Решение: пока поле
   пустое и не в фокусе, нативный текст прозрачный, поверх — наша подсказка на
   языке страницы (core.js initDateHints + i18n dateHint). В фокусе подсказка
   прячется: там нужны нативные сегменты ввода. */
.sw-dwrap { position: relative; display: block; }
.sw-dwrap-in { display: inline-block; }
.sw-dhint {
    position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
    max-width: calc(100% - 2.75rem); overflow: hidden; white-space: nowrap;
    color: var(--sw-muted, #767676); pointer-events: none; letter-spacing: normal;
}
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit,
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit-fields-wrapper,
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit-text,
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit-day-field,
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit-month-field,
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit-year-field,
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit-hour-field,
input.sw-hintable.sw-noval:not(:focus)::-webkit-datetime-edit-minute-field { color: transparent; }
input.sw-hintable:focus + .sw-dhint,
input.sw-hintable:not(.sw-noval) + .sw-dhint { display: none; }
input.sw-hintable[disabled] + .sw-dhint,
input.sw-hintable[readonly] + .sw-dhint { opacity: .6; }

/* --------------------------------------------------- мелкие правки темы */
.product-detail-price { font-variant-numeric: tabular-nums; }
.buy-widget .btn-buy { white-space: normal; }
.js-navigation-offcanvas-initial-content { display: none !important; }
.sw-grid .product-box { height: 100%; }
.sw-nojs-hide { display: none; }
a[href="#"], a[href^="#tidio"] { cursor: default; }
.footer-main a[href="#"] { pointer-events: none; opacity: .85; }
