/* =========================================================
   Category page only - left column as offcanvas
   OpenCart 2.3 + Journal 3.2
   ========================================================= */

/* Активира се само ако JS добави класа */
body.category-offcanvas-ready #product-category {
    position: relative;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* 1) Изкарваме column-left от нормалния layout поток */
body.category-offcanvas-ready #column-left {
    position: fixed !important;
    top: 0;
    left: -360px;
    width: 320px !important;
    max-width: calc(100vw - 32px);
    height: 100vh;
    margin: 0 !important;
    padding: 20px 18px 24px;
    overflow-y: auto;
    background: #ffffff;
    z-index: 99999;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.18);
    transition: left 0.28s ease;
    display: block !important;
}

/* Отваряне */
body.category-offcanvas-ready.offcanvas-filter-open #column-left {
    left: 0;
}

/* 2) Разтягане на main content на 100% */
body.category-offcanvas-ready #product-category > .row,
body.category-offcanvas-ready #product-category .row {
    display: flex;
    flex-wrap: wrap;
}

body.category-offcanvas-ready #product-category > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.category-offcanvas-ready #product-category #content,
body.category-offcanvas-ready #product-category > .row > #content {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    text-align: center;
}

/* Ако Journal държи wrapper-и с ширини */
body.category-offcanvas-ready #product-category .grid-row,
body.category-offcanvas-ready #product-category .grid-cols,
body.category-offcanvas-ready #product-category .grid-col,
body.category-offcanvas-ready #product-category .grid-items {
    width: 100%;
}

/* 3) Overlay */
.category-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.34);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

body.category-offcanvas-ready.offcanvas-filter-open .category-filter-overlay {
    opacity: 1;
    visibility: visible;
}

/* 4) Бутон за отваряне */
button.category-filter-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto !important;
    min-width: 200px !important;
    margin: 0 auto 18px !important;
    padding: 11px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 99px;
    background: #fff;
    color: #222;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

button.category-filter-toggle:hover,
button.category-filter-toggle:focus {
    border-color: #1f4d3a;
    color: #1f4d3a;
}

button.category-filter-toggle i {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

button.category-filter-toggle span {
    display: inline-block;
    line-height: 1;
}

/* 5) Бутон за затваряне вътре в offcanvas */
.category-filter-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #222;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

/* Заглавна лента в панела */
.category-filter-panel-head {
    position: sticky;
    top: -20px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -20px -18px 16px;
    padding: 16px 18px;
    background: #fff;
    border-bottom: 1px solid #ececec;
}

.category-filter-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    line-height: 1.2;
}

/* =========================================================
   Category filter - floating trigger on scroll
   ========================================================= */

button.category-filter-floating {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    z-index: 100001 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px 18px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #1f4d3a !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, 12px, 0);
    -webkit-transform: translate3d(0, 12px, 0);
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease, background 0.2s ease;
}

button.category-filter-floating.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

button.category-filter-floating:hover,
button.category-filter-floating:focus {
    background: #16382a !important;
    color: #ffffff !important;
}

button.category-filter-floating i {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    color: #ffffff;
}

button.category-filter-floating span {
    display: inline-block;
    line-height: 1;
    color: #ffffff;
}

body.offcanvas-filter-open button.category-filter-floating {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, 12px, 0);
    -webkit-transform: translate3d(0, 12px, 0);
}

@media (max-width: 767px) {
    button.category-filter-floating {
        right: 14px !important;
        bottom: 14px !important;
        padding: 11px 16px !important;
        font-size: 13px !important;
    }

    button.category-filter-floating i {
        font-size: 13px;
    }
}

