/* =========================================================
   KOREAN KIOSK — CATALOG CATEGORY TREE
   Только дерево категорий.
   Остальные стили каталога не трогаем.
   ========================================================= */

.field-error {
    display: block;
    margin-top: 6px;
    color: #d0292f;
    font-size: 13px;
    font-weight: 500;
}

.field-status {
    background: #ecfdf3;
    border: 1px solid #a6e9c2;
    color: #0a7a3c;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 20px;
}

.cart-list {
    max-width: 720px;
}

.cart-list .drawer-product > div:last-child {
    align-items: flex-end;
    gap: 8px;
    display: flex;
    flex-direction: column;
}

.cart-remove {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.cart-checkout-action {
    max-width: 720px;
    margin-top: 20px;
}

html {
    scroll-behavior: smooth;
}

#catalog-products {
    scroll-margin-top: 100px;
}

.cart-list .drawer-product {
    scroll-margin-top: 100px;
}

.unified-footer .footer-bottom {
    margin-left: auto;
    margin-right: auto;
    padding-left: 42px !important;
    padding-right: 42px !important;
}

.catalog-category-tabs a {
    display: block;
    min-height: 42px;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 12px;
    padding: 10px 13px;
    font-size: 13px;
    font-weight: 680;
    text-decoration: none;
}

.catalog-category-tabs a:hover,
.catalog-category-tabs a.active {
    background: var(--pink);
    color: var(--ink);
}

.catalog-category-menu {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    min-height: 438px;
    overflow: hidden;
}

.catalog-category-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 10px 18px 10px;
    border-right: 1px solid rgba(37, 36, 40, .08);
}

.catalog-category-tabs button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #252428;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.catalog-category-tabs button::after {
    content: "›";
    margin-left: 8px;
    color: #aaa5aa;
    font-size: 16px;
    font-weight: 400;
}

.catalog-category-tabs button:hover {
    background: #faf1f5;
    color: #ef6d9b;
}

.catalog-category-tabs button.active {
    background: #fff3f7;
    color: #ef6d9b;
}

.catalog-category-tabs button.active::after {
    color: #ef6d9b;
}

.catalog-category-panels {
    min-width: 0;
    padding: 38px 36px;
}

.catalog-category-panel[hidden] {
    display: none !important;
}

.catalog-category-panel > b {
    display: block;
    margin: 0 0 10px;
    color: #ef6d9b;
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.045em;
    text-transform: uppercase;
}

.catalog-category-panel > p {
    margin: 0 0 24px;
    color: #8d878c;
    font-size: 10px;
    line-height: 1.45;
}

.catalog-category-panel > div {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 28px;
}

.catalog-category-panel > div a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #f8f7f7;
    color: #4d494e;
    font-size: 11px;
    line-height: 1.3;
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
}

.catalog-category-panel > div a:hover {
    background: #fff0f5;
    color: #252428;
}


/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 760px) {

    .catalog-category-menu {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .catalog-category-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid rgba(37, 36, 40, .08);
        scrollbar-width: none;
    }

    .catalog-category-tabs::-webkit-scrollbar {
        display: none;
    }

    .catalog-category-tabs button {
        flex: 0 0 auto;
        width: auto;
        min-width: max-content;
        min-height: 36px;
        padding: 8px 13px;
        border-radius: 999px;
        white-space: nowrap;
    }

    .catalog-category-tabs button::after {
        display: none;
    }

    .catalog-category-panels {
        padding: 24px 16px;
    }

    .catalog-category-panel > b {
        font-size: 29px;
    }

    .catalog-category-panel > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
}

@media (max-width: 480px) {

    .catalog-category-panel > div {
        grid-template-columns: 1fr;
    }
}
.catalog-category-menu {
    grid-template-columns: 260px minmax(0, 1fr) !important;
}

.sub-product-card {
    position: relative;
}

.sub-product-card .card-product-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: none;
}

.sub-product-card .card-interactive {
    position: relative;
    z-index: 2;
}

@media (width >= 1400px) {
    .sub-product-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Подборки: кнопки обёрнуты в формы (AJAX корзина / избранное) */
.collection-product-actions form {
    display: contents;
}

.collection-product-actions button.collection-product-cart {
    color: #fff;
    background: var(--ink);
    padding: 0 14px;
}

.collection-product-actions button.collection-product-heart.active {
    color: var(--pink);
    background: #ffe6ee;
}

.collection-product-main > .collection-product-empty {
    aspect-ratio: 1 / 1.02;
    width: 100%;
    margin-bottom: 10px;
    background: #f6f4f4 !important;
    border-radius: 16px;
}

/* Главная: кнопки карточек обёрнуты в формы (AJAX корзина / избранное) */
.card-actions form,
.compact-card-actions form,
.solution-card-actions form {
    display: contents;
}

.compact-card-actions form:first-child button,
.solution-card-actions form:first-child button {
    color: #fff;
    background: var(--ink);
}

.compact-card-actions form:last-child button.active,
.solution-card-actions form:last-child button.active {
    color: var(--pink);
    background: #ffe6ee;
}

.card-heart.active {
    color: var(--pink-deep);
}

.home-tab-products[hidden],
.solution-panel[hidden] {
    display: none !important;
}

/* Главная: свайп по видео акций и сторис не прокручивает страницу вбок */
.campaign-visual,
.campaign-visual video,
.story-media-frame,
.story-media-frame video {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

/* Главная: отступ после «Смотреть все товары» до блока акций */
.catalog-section .catalog-more {
    margin-bottom: clamp(48px, 8vw, 92px);
}

/* Итог на страницах корзины и оформления */
.cart-page-total {
    margin-top: 18px;
    padding-left: 0;
    padding-right: 0;
    box-shadow: none;
}

/* ===== Оформление заказа ===== */
.checkout-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 24px;
    align-items: start;
}

.checkout-page-main {
    display: grid;
    gap: 24px;
}

.checkout-card {
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 8px 28px #1414140e;
}

.checkout-card h2 {
    margin: 6px 0 18px;
    font-size: 24px;
    letter-spacing: -.03em;
}

.checkout-card h3 {
    margin: 22px 0 10px;
    font-size: 16px;
}

.checkout-card label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 560;
}

.checkout-card input:not([type="radio"]):not([type="checkbox"]),
.checkout-card textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}

.checkout-price {
    font-style: normal;
    font-weight: 600;
    color: var(--pink-deep, #d6336c);
    margin-left: 8px;
    font-size: 13px;
}

.choice-list > label:has(input:checked) {
    border-color: var(--pink);
    background: #fff5f8;
}

.checkout-pickup-list label {
    display: flex !important;
    gap: 10px;
}

.checkout-pickup-list label:has(input:checked) {
    outline: 2px solid var(--pink);
}

.checkout-pickup-list label span {
    display: grid;
    gap: 2px;
}

.checkout-pickup-list label small {
    color: #777;
    font-weight: 450;
}

.checkout-pickup-list label.is-unavailable {
    opacity: .7;
}

.checkout-stock.is-full { color: #2f9e5a !important; font-weight: 600 !important; }
.checkout-stock.is-partial { color: #c98a00 !important; }
.checkout-stock.is-empty { color: #b04545 !important; }

.checkout-map-button {
    margin-top: 12px;
    opacity: .6;
    cursor: not-allowed;
}

.checkout-comment {
    margin-top: 22px;
}

.checkout-page-summary {
    position: sticky;
    top: 110px;
}

.checkout-page-summary .cart-list {
    max-height: 320px;
    overflow: auto;
}

.checkout-page-summary .drawer-product small {
    display: block;
    color: #777;
}

.checkout-submit {
    width: 100%;
    margin-top: 14px;
}

@media (max-width: 960px) {
    .checkout-page {
        grid-template-columns: 1fr;
    }

    .checkout-page-summary {
        position: static;
    }
}

.checkout-saved-address {
    margin-bottom: 14px;
}

.checkout-saved-address select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}

/* Подсказки в оформлении заказа (не путать с .field-status — плашкой уведомления) */
.checkout-note {
    display: block;
    margin: 10px 0 0;
    padding: 0;
    background: none;
    border: 0;
    color: #8a868c;
    font-size: 12px;
    font-weight: 450;
    line-height: 1.45;
}

.checkout-note a {
    text-decoration: underline;
}

.checkout-page-summary .consent {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    font-size: 12px;
}

.checkout-page-summary .checkout-summary {
    margin-bottom: 0;
}

.choice-list input[type="radio"],
.checkout-pickup-list input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* Главный баннер: перетаскивание мышью без выделения текста */
.hero-slider {
    -webkit-user-select: none;
    user-select: none;
}

/* Карточка магазина самовывоза: содержимое столбиком (правило шаблона .pickup-box b{grid-column:2} здесь не нужно) */
.checkout-pickup-list label > span {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    grid-column: auto !important;
    min-width: 0;
}

.checkout-pickup-list label > span > * {
    grid-column: auto !important;
    margin: 0;
    text-align: left;
}

.checkout-pickup-list label > span > b {
    font-size: 14px;
    color: var(--ink);
}

.checkout-pickup-list label {
    align-items: flex-start !important;
    padding: 14px !important;
}

.checkout-pickup-list input[type="radio"],
.choice-list input[type="radio"] {
    accent-color: var(--pink);
    margin-top: 2px;
}

/* ===== Карточка товара: галерея, характеристики, тексты, отзывы ===== */
.product-gallery {
    display: grid;
    gap: 12px;
    align-content: start;
}

.product-gallery-main {
    position: relative;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}

.product-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #ffffffe6;
    box-shadow: 0 6px 20px #14141418;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink);
}

.product-gallery-arrow.is-prev { left: 14px; }
.product-gallery-arrow.is-next { right: 14px; }

.product-gallery-counter {
    position: absolute;
    bottom: 14px;
    right: 16px;
    background: #ffffffe6;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: #555;
}

.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.product-gallery-thumbs button {
    flex: 0 0 72px;
    height: 72px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #fff;
    padding: 4px;
    cursor: pointer;
}

.product-gallery-thumbs button.is-active {
    border-color: var(--pink);
}

.product-gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery-placeholder {
    width: 100%;
    border-radius: 28px;
    background: #fff;
}

.product-characteristics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin: 22px 0;
    padding: 18px 20px;
    background: #fff;
    border-radius: 18px;
}

.product-characteristics div {
    display: grid;
    gap: 2px;
}

.product-characteristics dt {
    color: #8a868c;
    font-size: 12px;
}

.product-characteristics dd {
    margin: 0;
    font-size: 14px;
    font-weight: 560;
}

.product-texts {
    display: grid;
    gap: 12px;
    margin-top: 32px;
}

.product-texts details {
    background: #fff;
    border-radius: 18px;
    padding: 18px 22px;
}

.product-texts summary {
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
}

.product-texts p {
    margin: 12px 0 0;
    color: #555;
    line-height: 1.6;
    white-space: pre-line;
}

.product-review-summary {
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-review-form {
    display: grid;
    gap: 12px;
    margin: 18px 0 24px;
    padding: 22px;
    background: #fff;
    border-radius: 22px;
    max-width: 720px;
}

.product-review-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
}

.review-rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.review-rating-input input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.review-rating-input label {
    font-size: 30px;
    line-height: 1;
    color: #ddd;
    cursor: pointer;
    transition: color .15s;
}

.review-rating-input label:hover,
.review-rating-input label:hover ~ label,
.review-rating-input input:checked ~ label {
    color: var(--pink);
}

.product-review-list {
    margin-top: 20px;
}

.product-review-list article:nth-child(n) {
    background: #fff;
    color: var(--ink);
}

.product-review-reply {
    font-size: 14px !important;
    color: #666;
    margin-top: 0 !important;
}

@media (max-width: 720px) {
    .product-characteristics {
        grid-template-columns: 1fr;
    }
}

/* Отступ между составом/способом применения и отзывами */
.product-texts {
    margin-bottom: clamp(40px, 6vw, 72px);
}

/* Галерея прижата к верху и «прилипает» при прокрутке длинного описания */
.product-detail {
    align-items: start !important;
}

.product-gallery {
    position: sticky;
    top: 120px;
}

/* Модальное окно отзыва */
.review-dialog {
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 26px;
    box-shadow: 0 30px 80px #1414143d;
}

.review-dialog::backdrop {
    background: #1d151966;
    backdrop-filter: blur(3px);
}

.review-dialog .product-review-form {
    margin: 0;
    max-width: none;
    padding: 26px;
}

.review-dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.review-dialog-head h3 {
    margin: 6px 0 0;
    font-size: 18px;
    line-height: 1.3;
}

.review-dialog-close {
    width: 38px;
    height: 38px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: #f6f2f3;
    font-size: 22px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .product-gallery {
        position: static;
    }
}

/* Длинное описание товара — свёрнуто до ~5 строк */
.product-description p {
    margin: 0;
    white-space: pre-line;
}

.product-description.is-collapsed {
    position: relative;
    max-height: 8.2em;
    overflow: hidden;
}

.product-description.is-collapsed::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3em;
    background: linear-gradient(to bottom, transparent, var(--paper, #f8f6f4));
}

.product-description-toggle {
    margin: 8px 0 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pink-deep, #d6336c);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Галерея: перекрываем стили шаблона .product-detail-photo img (height: 460px; padding: 78px) */
.product-detail-photo.product-gallery {
    background: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.product-gallery .product-gallery-main {
    background: #fff;
    box-shadow: 0 8px 28px #1414140e;
}

.product-gallery .product-gallery-main img {
    width: 100% !important;
    height: 100% !important;
    padding: 28px !important;
    object-fit: contain !important;
    background: none !important;
}

.product-gallery .product-gallery-thumbs img {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    object-fit: contain !important;
    background: none !important;
    border-radius: 10px;
}

.product-gallery .product-gallery-placeholder {
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

/* Модальное окно отзыва — строго по центру экрана (стили шаблона сбрасывают margin у dialog) */
.review-dialog[open] {
    position: fixed;
    inset: 0;
    margin: auto !important;
    max-height: calc(100vh - 40px);
    overflow: auto;
    display: block;
}

/* Модальное окно отзыва: одна колонка, без горизонтального скролла */
.review-dialog {
    overflow-x: hidden !important;
    box-sizing: border-box;
}

.review-dialog .product-review-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.review-dialog .product-review-form > * {
    grid-column: 1 / -1 !important;
    min-width: 0;
}

.review-dialog .review-dialog-head {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
}

.review-dialog .review-dialog-head > div {
    min-width: 0;
}

.review-dialog .review-rating-input input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.review-dialog .review-rating-input {
    position: relative;
    width: max-content;
}

.review-dialog .review-rating-input label {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 2px !important;
}

.review-dialog textarea {
    width: 100% !important;
    box-sizing: border-box;
    resize: vertical;
}

.review-dialog .button {
    width: 100%;
    justify-content: center;
}

.review-dialog .checkout-note {
    margin: 0;
}

/* Каталог на телефонах: всегда 2 товара в строку (в шаблоне на 381–479px был 1 столбец) */
@media (max-width: 720px) {
    .sub-product-grid,
    .subpage .sub-content .sub-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .sub-product-grid article {
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* Мобильное меню: раздел без подкатегорий — такой же «пункт», как раскрывающиеся */
.static-catalog-tree .static-catalog-leaf {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #e7e7e7;
    border-radius: 15px;
    background: var(--kk-light-gray, #f6f4f4);
    color: var(--ink);
    font-size: 13px;
    font-weight: 720;
}

.static-menu-primary .is-accent {
    color: var(--pink-deep, #d6336c);
}

/* Корзина для гостя: кнопки входа и регистрации */
.cart-guest-note {
    margin-bottom: 12px;
}

.cart-guest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cart-guest-actions .button {
    flex: 1 1 200px;
    justify-content: center;
}

.checkout-stock-missing {
    display: block;
    margin-top: 2px;
    color: #8a868c;
    font-weight: 450;
}

/* Наличие в магазине: одна строка статуса + серая строка «Привезём: …» */
.checkout-pickup-list .checkout-stock {
    font-weight: 600 !important;
    font-size: 12px !important;
}

.checkout-pickup-list .checkout-stock-missing {
    display: block;
    margin: 0;
    color: #8a868c !important;
    font-size: 12px;
    font-weight: 450;
    line-height: 1.4;
}
