:root{
    --bg: #ffffff;
    --text: #111;
    --muted:#666;
    --border:#e9e9e9;
    --card:#f6f6f6;
    --shadow: 0 10px 30px rgba(0,0,0,.06);
    --radius: 16px;
}

*{ box-sizing:border-box; }
body{
    margin:12px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container{
    width: 100%;
    max-width: 1600px;              /* было 1100 */
    margin: 0 auto;
    padding: 0 clamp(12px, 3vw, 32px);
}



.topbar{
    border-bottom:1px solid var(--border);
    position: sticky;
    top:0;
    background:#fff;
    z-index: 10;
}

.topbar__inner{
    height:64px;
    display:flex;
    align-items:center;
    gap:16px;
}

@media (max-width: 768px){
    .topbar__inner{
        height: auto;
        flex-wrap: wrap;
        padding: 10px 0;
    }
    .nav{
        flex-wrap: wrap;
        gap: 10px;
    }
}


.logo{
    font-weight:800;
    text-decoration:none;
    color:#000;
    letter-spacing:.2px;
}

.nav{
    display:flex;
    gap:14px;
    align-items:center;
}

.nav__link{
    text-decoration:none;
    color:#111;
    font-size:14px;
}

.search{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:8px;
    width: 360px;
    max-width: 45vw;
}

.search__input{
    width:100%;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius: 999px;
    outline:none;
}

.search__btn{
    border:1px solid var(--border);
    background:#fff;
    border-radius: 999px;
    padding:10px 12px;
    cursor:pointer;
}

.icon-btn{
    text-decoration:none;
    border:1px solid var(--border);
    padding:10px 12px;
    border-radius:999px;
}
.dropdown{
    position:relative
}
/* меню */
.dropdown__menu{
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 999;

    /* ВАЖНО: тут не делаем overflow-y */
    overflow: visible;
    padding: 0;
}

/* показываем меню */
.dropdown.is-open .dropdown__menu{ display:block; }

/* 2 колонки */
.dropdown__menuInner{
    display: flex;
    gap: 0;
}

/* слева список со скроллом */
.dropdown__list{
    min-width: 260px;
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 12px;
}

/* справа панель подкатегорий */
.dropdown__subpane{
    min-width: 260px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 14px 12px;
    border-left: 1px solid var(--border);
}

/* заголовок справа */
.dropdown__subpaneTitle{
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

/* панели (скрыты по умолчанию) */
.dropdown__subpanel{
    display: none;
}

/* подсветка активной строки */
.dropdown__row.is-active{
    background: #f4f4f4;
}

/* пустое состояние */
.dropdown__subempty{
    color: var(--muted);
    font-size: 14px;
}

/* родительская строка */
.dropdown__row{
    position: relative;
    display:flex;
    align-items:center;
    gap:10px;
    border-radius: 10px;
}

/* делаем ссылку на всю ширину */
.dropdown__row .dropdown__item{
    flex: 1;
    border-top: 0 !important;     /* убираем твой border-top для item+item */
    border-radius: 10px !important;
}

/* стрелка справа */
.dropdown__arrow{
    color: var(--muted);
    font-size: 16px;
    padding-right: 6px;
    user-select:none;
}

/* подменю справа */
.dropdown__submenu{
    display:none;
    position:absolute;
    top: -8px;
    left: calc(100% - -12px);
    min-width: 220px;
    background:#fff;
    border:1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 80;
}

/* показываем подменю при наведении на строку */
.dropdown__row.has-children:hover .dropdown__submenu{
    display:block;
}

/* "мостик" чтобы курсор не терял hover между родителем и подменю */
.dropdown__row.has-children::after{
    content:"";
    position:absolute;
    top:0;
    right:-10px;
    width:10px;
    height:100%;
}

/* пункты подменю */
.dropdown__subitem{
    display:block;
    padding:10px 12px;
    text-decoration:none;
    color:#111;
    border-radius:10px;
}

.dropdown__subitem:hover{
    background:#f4f4f4;
}

.dropdown__btn{
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;

    font: inherit;
    color: #111;

    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* убрать стандартную рамку при клике */
.dropdown__btn:focus{
    outline: none;
}

/* но оставить красивый фокус для клавиатуры (Tab) */
.dropdown__btn:focus-visible{
    outline: 2px solid rgba(0,0,0,.15);
    outline-offset: 2px;
}

/* эффект как у ссылок меню */
.dropdown__btn:hover{
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* когда открыто */
.dropdown.is-open .dropdown__btn{
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ссылки в меню категорий: без подчеркивания, черные */
.dropdown__menu a,
.dropdown__item,
.dropdown__subitem{
    color: #111;
    text-decoration: none;
}

/* чтобы при hover не появлялось подчеркивание */
.dropdown__menu a:hover,
.dropdown__item:hover,
.dropdown__subitem:hover{
    text-decoration: none;
}

/* расстояние сверху/снизу внутри меню */
.dropdown__menu{
    padding: 14px 12px; /* было 8px */
}

/* расстояние между пунктами */
.dropdown__item,
.dropdown__subitem{
    padding: 10px 12px;
    margin: 2px 0;      /* добавляет “воздух” между строками */
    border-radius: 10px;
}


.section{
    padding: 26px 0;
}

.section__title{
    text-align:center;
    font-size: 42px;
    margin: 16px 0 18px;
    letter-spacing:.3px;
}

.divider{
    border:0;
    border-top:1px solid var(--border);
    margin: 0;
}

.section__actions{
    display:flex;
    justify-content:center;
    margin-top: 16px;
}

.btn{
    border:1px solid var(--border);
    background:#fff;
    padding:10px 18px;
    border-radius: 999px;
    text-decoration:none;
    color:#111;
}

.carousel{
    position:relative;
}

.carousel__row{
    display:flex;
    gap:16px;
    overflow-x:auto;
    align-items:stretch;
    padding: 8px 44px; /* место под кнопки */
    scroll-snap-type: x mandatory;
    scroll-behavior:smooth;
}


.carousel__row .card{
    flex:0 0 220px;      /* фикс ширина карточки */
    max-width:220px;
    height:360px;        /* фикс высота карточки */
}

/* фиксируем высоту картинки */
.carousel__row .card__img,
.carousel__row .card__placeholder{
    height:150px;        /* одинаковая высота у всех */
}

/* тело карточки — чтобы цена была внизу */
.carousel__row .card__body{
    flex:1;
    display:flex;
    flex-direction:column;
}

/* описание — максимум 2 строки и ... */
.carousel__row .card__desc{
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

/* если вдруг где-то описание стало одной строкой */
.card__desc{
    overflow:hidden;
}

.carousel__row::-webkit-scrollbar{ height:10px; }
.carousel__row::-webkit-scrollbar-thumb{ background:#ddd; border-radius:999px; }

@media (max-width: 640px){

    /* прячем стрелки карусели */
    .carousel__btn{ display:none; }

    /* карусель больше не “лента”, а сетка */
    .carousel__row{
        overflow: visible;
        flex-wrap: wrap;
        gap: 12px;
        padding: 0;
        justify-content: flex-start;
    }

    /* карточки по 2 в ряд */
    .carousel__row .card{
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
        height: auto;              /* чтобы не было странных растяжений */
    }

    /* фиксируем высоту картинки, чтобы все карточки были одинаковые */
    .carousel__row .card__img,
    .carousel__row .card__placeholder{
        height: 140px;
    }

    /* одинаковая высота текстовых блоков */
    .carousel__row .card__name{
        min-height: 2.6em;         /* ~2 строки */
    }
    .carousel__row .card__desc{
        min-height: 2.7em;         /* ~2 строки */
    }
}

.carousel__btn{
    position:absolute;
    top:50%;
    transform: translateY(-50%);
    width:36px;
    height:36px;
    border-radius:999px;
    border:1px solid var(--border);
    background:#fff;
    cursor:pointer;
    box-shadow: var(--shadow);
}
.carousel__btn.left{ left: 6px; }
.carousel__btn.right{ right: 6px; }

.card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    overflow:hidden;

    display:flex;
    flex-direction:column;

    transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}


.card:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 22px rgba(0,0,0,.08);
    filter:brightness(.98);
}

.card__imgWrap{
    display:block;
    background:#f6f6f6;
}

.card__img{
    width:100%;
    height:180px;
    object-fit:cover;
    display:block;
    transition:transform .15s ease, filter .15s ease;
}

.card:hover .card__img{
    transform:scale(1.02);
    filter:brightness(.96);
}

.card__placeholder{
    height:180px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#777;
}

.card__body{
    padding:14px 14px 16px;
    display:flex;
    flex-direction:column;
    gap:6px;
    flex:1; /* чтобы цена могла уйти вниз одинаково */
}

.card__name{
    display:block;
    font-weight:700;
    color:#111;
    text-decoration:none;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.card__desc{
    color:#666;
    font-size:14px;
    line-height:1.3;

    display:-webkit-box;
    -webkit-line-clamp:2;       /* 2 строки */
    -webkit-box-orient:vertical;
    overflow:hidden;
}

.card__sku{
    color:#888;
    font-size:13px;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.card__price{
    font-weight:800;
    margin-top: 8px;
}

@media (max-width: 640px){
    .section{ padding: 18px 0; }
    .section__title{
        font-size: 36px;
        margin: 10px 0 14px;
    }
}


.products-head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    padding: 18px 0 10px;
}
.products-title{
    margin:0;
    font-size: 34px;
}
.chips{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.chip{
    border:1px solid var(--border);
    padding:8px 14px;
    border-radius: 999px;
    text-decoration:none;
    color:#111;
    font-size: 14px;
}
.chip--active{
    background:#111;
    color:#fff;
    border-color:#111;
}

.grid{
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
}

/* MOBILE FIRST для каталога /products */
@media (max-width: 640px){
    .grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .card__img,
    .card__placeholder{
        height: 150px;
    }

    .card__name,
    .card__desc{
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .products-head .chips{
        display: none !important;
    }

}

@media (min-width: 420px){
    .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (min-width: 768px){
    .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1024px){
    .grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1400px){
    .grid{ grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
}

.pager{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
    padding-bottom: 30px;
}
.muted{ color: var(--muted); }
.btn.disabled{
    pointer-events:none;
    opacity:.5;
}


.search__btn--icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    padding:0;
}

.search__btn--icon .icon{
    width:20px;
    height:20px;
    display:block;
    object-fit:contain;
}


.social{
    position: relative;
    display: inline-flex;
    align-items: center;
}

.social__toggle .icon{
    width:20px;
    height:20px;
    display:block;
    object-fit:contain;
}

.social__menu{
    position:absolute;
    top: calc(100% + 10px);   /* вниз */
    right: 0;
    display:flex;
    flex-direction: column;
    gap:10px;

    opacity:0;
    transform: translateY(-8px);
    pointer-events:none;

    transition: opacity .18s ease, transform .18s ease;
}

.social__menu.is-open{
    opacity:1;
    transform: translateY(0);
    pointer-events:auto;
}

.social__item{
    width:52px;
    height:52px;
    border-radius:999px;
    background:#fff;
    border:1px solid var(--border);
    box-shadow: var(--shadow);

    display:flex;
    align-items:center;
    justify-content:center;

    transition: transform .12s ease;
}

.social__item:hover{
    transform: translateY(-2px);
}

.social__item img{
    width:28px;
    height:28px;
    object-fit:contain;
    display:block;
}

.search{
    margin-left:auto;
    position: relative;
    width: 420px;
    max-width: 45vw;
}

.search__icon{
    position:absolute;
    left:14px;
    top:50%;
    transform: translateY(-50%);
    width:18px;
    height:18px;
    opacity:.6;
    pointer-events:none;
}

.search__icon img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

.search__input{
    width:100%;
    padding: 12px 14px 12px 44px; /* слева место под иконку */
    border:1px solid var(--border);
    border-radius: 999px;
    outline:none;
    background:#f5f5f5;
}

.breadcrumbs{
    padding: 14px 0 6px;
    color: var(--muted);
    font-size: 13px;
}
.breadcrumbs a{
    color: var(--muted);
    text-decoration:none;
}
.breadcrumbs a:hover{ text-decoration:underline; }

.product{
    display:grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 26px;
    padding: 14px 0 40px;
}

@media (max-width: 1024px){
    .product{
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .gallery__main{
        height: 320px;
    }
}

@media (max-width: 480px){
    .gallery__main{
        height: 260px;
        padding: 12px;
    }
    .thumb{
        width: 64px;
        height: 64px;
    }
    .pinfo__title{
        font-size: 28px;
    }
}


.gallery__main{
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    height: 420px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.gallery__main img{
    width:100%;
    height:100%;
    object-fit: contain;
    display:block;
}

.gallery__placeholder{
    color: var(--muted);
}

.gallery__thumbs{
    display:flex;
    gap:10px;
    margin-top: 12px;
    overflow-x:auto;
    padding-bottom: 6px;
}

.thumb{
    border:1px solid var(--border);
    background:#fff;
    border-radius: 12px;
    width: 82px;
    height: 82px;
    padding: 8px;
    cursor:pointer;
    flex: 0 0 auto;
}

.thumb img{
    width:100%;
    height:100%;
    object-fit: contain;
    display:block;
}

.pinfo__title{
    margin: 0 0 10px;
    font-size: 34px;
}

.pinfo__meta{
    display:flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pinfo__price{
    font-size: 28px;
    font-weight: 800;
    margin: 8px 0 18px;
}

.pinfo__actions{
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.btn--dark{
    background:#111;
    color:#fff;
    border-color:#111;
}

.pinfo__section{
    margin-top: 18px;
}

.pinfo__section h3{
    margin: 0 0 10px;
}

.pinfo__text{
    white-space: normal;
    overflow-wrap: anywhere;   /* современно: переносит где угодно */
    word-break: break-word;    /* на всякий случай для старых браузеров */
}

.pinfo__json{
    white-space: pre-wrap;     /* сохраняет переносы, но переносит строки */
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* адаптив */
@media (max-width: 900px){
    .product{ grid-template-columns: 1fr; }
    .gallery__main{ height: 340px; }
    .pinfo__title{ font-size: 28px; }
}

.social__wa{ position: relative; }

.social__waBtn{
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.social__waMenu{
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 999;
}

.social__wa.is-open .social__waMenu{ display: block; }

.social__waLink{
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #111;
    text-decoration: none;
    white-space: nowrap;
}

.social__waLink:hover{ background:#f4f4f4; }


.spec-list{
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
    overflow: hidden;
}

.spec-list li{
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}

.spec-list li:first-child{ border-top: 0; }

.spec-key{
    color: #777;
    font-weight: 600;
}

.spec-val{
    color: #111;
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* адаптив */
@media (max-width: 640px){
    .spec-list li{
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .spec-key{ font-size: 12px; }
}

.badge{
    display:inline-flex;
    align-items:center;
    width:fit-content;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    border:1px solid transparent;
}
.badge--ok{ color: #16a34a; }
.badge--no{ color: #dc2626; }


.stock{
    margin-top: 8px;
    font-weight: 600;
}

.stock--yes{ color: #16a34a; } /* зелёный */
.stock--no { color: #dc2626; } /* красный */


.card__stock{
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
}

.card__stock--yes{ color: #16a34a; }
.card__stock--no { color: #dc2626; }

/* ===== MOBILE DRAWER ===== */
/* ===== MOBILE DRAWER ===== */
.m-burger{
    display:none;
    width:40px;
    height:40px;
    border:1px solid var(--border);   /* <-- добавь, чтобы кнопка была видима */
    background:#fff;                  /* <-- вместо transparent */
    padding:8px;
    border-radius:10px;
    cursor:pointer;

    /* чтобы полоски красиво центровались */
    display:none;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:5px;
}

.m-burger span{
    display:block;
    width:20px;                       /* <-- ВАЖНО: ширина полосок */
    height:2px;
    margin:0;                         /* <-- убираем твои 6px */
    background-color:#111 !important; /* <-- на случай, если где-то перебивают */
    border-radius:2px;
    opacity:1;
}


/* overlay */
.m-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
    z-index: 998;
}

/* drawer */
.m-drawer{
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    width:min(86vw, 340px);
    background:#fff;
    transform:translateX(-102%);
    transition:transform .25s ease;
    z-index: 999;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    display:flex;
    flex-direction:column;
}
.m-drawer__head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:14px 14px;
    border-bottom:1px solid var(--border);
}
.m-drawer__title{ font-weight:700; }
.m-drawer__close{
    border:0;
    background:transparent;
    font-size:18px;
    cursor:pointer;
    width:36px; height:36px;
    border-radius:10px;
}
.m-drawer__nav{
    padding:12px 10px;
    overflow:auto;
}
.m-drawer__link{
    display:block;
    padding:12px 12px;
    border-radius:12px;
    text-decoration:none;
    color:#111;
}
.m-drawer__link:hover{ background:#f4f4f4; }
.m-drawer__sep{
    height:1px;
    background: var(--border);
    margin:10px 8px;
}
.m-drawer__subttl{
    padding: 6px 12px;
    color: var(--muted);
    font-size: 13px;
}

/* opened state */
body.drawer-open{
    overflow:hidden;
}
body.drawer-open .m-overlay{
    opacity:1;
    pointer-events:auto;
}
body.drawer-open .m-drawer{
    transform:translateX(0);
}
@media (max-width: 640px){

    /* скрыть лого */
    .topbar__inner .logo.desktop-only{ display:none !important; }


    /* показать бургер */
    .m-burger{
        display:inline-flex;
        align-items:center;
        justify-content:center;
    }

    /* скрыть desktop-меню */
    .topbar__inner > .nav{
        display:none !important;
    }

    /* поиск занимает ширину */
    .topbar__inner{
        display:flex;
        align-items:center;
        gap:10px;
    }
    .topbar__inner .search{
        flex:1;
        min-width:0;
    }
}

/* ===== MOBILE CATEGORIES ACCORDION ===== */
.m-acc { margin: 4px 0; }

.m-acc__sum{
    list-style: none;
    display:flex;
    align-items:center;
    justify-content:space-between;
    cursor:pointer;
}

/* убрать стандартный маркер у summary */
.m-acc__sum::-webkit-details-marker{ display:none; }
.m-acc__sum::marker{ content:""; }

.m-acc__chev{
    color: var(--muted);
    transition: transform .15s ease;
    font-size: 18px;
}

.m-acc[open] .m-acc__chev{
    transform: rotate(90deg);
}

.m-acc__body{
    padding: 6px 6px 10px 10px;
}

.m-drawer__sublink{
    display:block;
    padding:10px 12px;
    margin:4px 0;
    border-radius:12px;
    text-decoration:none;
    color:#111;
    background:#f7f7f7;
    border:1px solid var(--border);
}

.m-drawer__sublink:hover{
    background:#f0f0f0;
}


.logo{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #111;
    font-weight: 800;
}

.logo__img{
    width: 104px;
    height: 154px;
    object-fit: contain;
    display: block;
}

.logo__text{
    line-height: 1;
}

/* по умолчанию скрываем мобильное лого */
.logo--mobile{ display:none; }
.logo__img--mobile{ width:74px; height:104px; object-fit:contain; display:block; }

@media (max-width: 640px){
    /* показываем только иконку-лого */
    .logo--mobile{ display:inline-flex; align-items:center; }


    /* выравнивание в одну строку */
    .topbar__inner{
        display:flex;
        align-items:center;
        gap:10px;
    }

    /* поиск занимает остаток */
    .topbar__inner .search{
        flex:1;
        min-width:0;
    }
}

