/*
    default.css темы O4 — базовые дополнения для Webasyst-обёрток.
    Основная дизайн-система O4 (токены, шапка, футер, карточки, страницы) — в default.shop.css.
    Здесь — только связующие классы каркаса Webasyst (maincontent, container, крошки, корзина).
*/

/* Контентная область Webasyst */
.maincontent {
    min-height: 60vh;
    width: 100%;
}
/* Обёртка $content — полная ширина (секции задают отступы сами) */
.content {
    width: 100%;
}

/* Хлебные крошки O4 (родители мелкие, разделены '/' — как в карточке товара) */
.breadcrumb {
    font-size: 11px;
    color: #8a8a8a;
    font-family: var(--font-footer);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px var(--gutter) 0;
    margin-bottom: 0;
}
.breadcrumb a {
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color var(--transition);
}
.breadcrumb a:hover {
    color: #2b2b2b;
}
.breadcrumb__sep {
    opacity: 0.7;
}

/* Поиск в шапке — форма внутри бара */
.search__form {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Счётчик корзины на иконке */
.wa-cart-trigger {
    position: relative;
}
.wa-cart-trigger::after {
    content: attr(data-count);
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-footer);
    line-height: 16px;
    text-align: center;
    display: none;
}
.wa-cart-trigger[data-count]:not([data-count="0"])::after {
    display: block;
}
/* Счётчик корзины (бейдж) */
.wa-cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-footer);
    line-height: 16px;
    text-align: center;
}
/* Анимация при добавлении в корзину */
.wa-cart-trigger.is-pulse svg {
    animation: wa-cart-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wa-cart-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}
/* Тост-уведомление о добавлении в корзину */
.wa-cart-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 24px);
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 220ms ease, transform 220ms ease;
}
.wa-cart-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
    .wa-cart-trigger.is-pulse svg { animation: none; }
    .wa-cart-toast { transition: none; }
}

/* Панель в лайтбоксе: кнопка «В корзину» + лупа */
.o4-lightbox-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(20, 20, 22, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.o4-lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-footer);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 200ms ease, opacity 200ms ease;
}
.o4-lightbox-zoom {
    width: 44px;
    padding: 0;
    background: #fff;
    color: #2b2b2b;
}
.o4-lightbox-zoom:hover {
    background: #e8e8ea;
}
.o4-lightbox-zoom svg {
    width: 20px;
    height: 20px;
}
.o4-lightbox-cart {
    background: var(--accent);
    color: #fff;
}
.o4-lightbox-cart:hover {
    background: var(--accent-hover);
}
.o4-lightbox-cart.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
.o4-lightbox-cart.is-done {
    background: #ececf0;
    color: var(--muted);
    pointer-events: none;
}
/* Приближенное фото в лайтбоксе */
#swipebox-slider .slide img {
    transform-origin: center;
    max-width: 100%;
    max-height: 100%;
}
#swipebox-slider .slide img.is-zoomed {
    max-width: none;
    max-height: none;
    overflow: visible;
}
/* При увеличении не обрезать по краям, позволить панорамировать */
#swipebox-slider .slide {
    overflow: visible;
}

/* Размытый фон из текущего фото — скрывает чёрные поля */
#swipebox-overlay .o4-lb-blur {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(60px) saturate(1.2);
    transform: scale(1.15);
    pointer-events: none;
    transition: opacity 0.5s ease;
}
#swipebox-overlay .o4-lb-blur--front { opacity: 1; }
#swipebox-overlay .o4-lb-blur--back { opacity: 0; }
#swipebox-overlay #swipebox-container {
    position: relative;
    z-index: 1;
}

.category-name.catalog__title {
    margin: 0;
}

/* Микро-помощь: блок-карточки корзины Webasyst на кнопках O4 */
.offers .addtocart-btn,
.button {
    cursor: pointer;
}
/* Кнопка «В корзину» на странице товара — в стиле карточек (белая, чёрная рамка, без скруглений) */
.add2cart button[type="submit"],
.add2cart input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
    padding: 0 28px;
    border-radius: 0;
    background: #fff;
    border: 1px solid #000;
    color: #000;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-footer);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0;
    cursor: pointer;
    transition: background var(--transition);
}
.add2cart button[type="submit"]:hover,
.add2cart input[type="submit"]:hover {
    background: #f5f5f7;
}
.add2cart button[type="submit"]:disabled,
.add2cart input[type="submit"]:disabled {
    background: #ececf0;
    color: #aaa;
    border-color: #e0e0e6;
    cursor: not-allowed;
}
/* «Уже в корзине» на странице товара — некликабельная */
.add2cart .is-in-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    flex: 1 1 100% !important;
    height: 56px;
    padding: 0 28px;
    border-radius: 0;
    background: #ececf0;
    border: 1px solid #e0e0e6;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-footer);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: default;
}

/* Кнопка и количество в одном ряду — кнопка всегда на всю ширину (как .buy) */
.product .purchase .add2cart {
    flex-wrap: wrap;
    gap: 14px;
}
.product .purchase .add2cart .qty.quantity-wrapper {
    margin: 0;
}
.product .purchase .add2cart button[type="submit"],
.product .purchase .add2cart input[type="submit"],
.product .purchase .add2cart .is-in-cart {
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-top: 0 !important;
}

/* Блоки главной O4 */
.bestsellers,
.onsale {
    padding: 48px var(--gutter) 0;
}
.bestsellers .section__title,
.onsale .section__title {
    margin-bottom: 24px;
}
.welcome {
    padding: 60px var(--gutter);
    text-align: center;
}
.welcome h1 {
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 300;
    color: var(--ink);
}
