/* ============================================================
   brand.css — стилі сторінки бренду
   ============================================================ */

/* ── base ── */
.page-brand body,
.page-brand main,
.page-brand .brand-page {
    background: #f7f7f9;
    color: #222;
}

h1 {
    font-size: clamp(20px, 3vw, 28px);
    color: #2d0a1a;
    margin-bottom: 16px;
    font-weight: 800;
}

.section-title {
    font-size: clamp(16px, 2.2vw, 22px);
    color: #2d0a1a;
    margin: 24px 0 14px;
    font-weight: 700;
}

/* ── breadcrumb ── */
.breadcrumb_brand {
    max-width: 1600px;
    width: 100%;
    margin: 20px auto 10px;
    padding: 0 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.breadcrumb_brand a { color: #db2777; text-decoration: none; font-weight: 500; }
.breadcrumb_brand a:hover { text-decoration: underline; }
.breadcrumb_brand span { color: #aaa; }
.breadcrumb_brand span:last-child { color: #555; font-weight: 600; }

/* ── mobile filter bar — hidden on desktop ── */
.bsp-mobile-filter-bar { display: none; }

/* ── DESKTOP: two-column layout, centered ── */
.brand-page {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 32px 60px;
    box-sizing: border-box;
}

/* ── LEFT: filter sidebar ── */
.catalog_filtr.bsp-filtr-left {
    flex: 0 0 300px;
    width: 300px;
    position: sticky;
    top: 24px;
    /* Фільтр розтягується на всю свою природну висоту.
       Якщо він виявляється вищим за екран — з'являється внутрішній скрол. */
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(219,39,119,0.2) transparent;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    box-sizing: border-box;
    align-self: flex-start;
    padding: 0;
    order: 0; /* left */
}
.catalog_filtr.bsp-filtr-left::-webkit-scrollbar { width: 4px; }
.catalog_filtr.bsp-filtr-left::-webkit-scrollbar-thumb {
    background: rgba(219,39,119,0.2);
    border-radius: 2px;
}

/* ── RIGHT: main content ── */
.bsp-brand-content {
    flex: 1 1 auto;
    min-width: 0;
    order: 1; /* right */
}

/* ── brand hero card ── */
.brand-container {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 24px;
}
.brand-card {
    width: clamp(140px, 20vw, 200px);
    background: #fff;
    border: 1px solid #f0e0eb;
    border-radius: 16px;
    padding: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #222;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(219,39,119,0.09);
}
.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(219,39,119,0.15);
}
.brand-card img,
.brand-card .no-photo {
    width: 100%;
    height: clamp(120px, 16vw, 160px);
    margin-bottom: 12px;
}
.brand-card img { object-fit: cover; object-position: center; }
.brand-card .no-photo {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fdf3f6;
    color: #e07aaa;
    font-size: 13px;
}
.bsp-brand-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    padding: 0 14px;
    color: #2d0a1a;
    text-align: center;
}

/* ── inline mobile filter (desktop: hidden) ── */
.bsp-inline-filter-wrap { display: none; }

/* ── sort row ── */
.bsp-sort-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
#sortSelect {
    padding: 9px 14px;
    border: 1.5px solid #f0e0eb;
    border-radius: 10px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    background: #fff;
    outline: none;
    font-family: system-ui, sans-serif;
}
#sortSelect:focus { border-color: #db2777; }

/* ── products grid ── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: clamp(10px, 1.4vw, 18px);
}

/* ── product card ── */
.product-card.bsp-card {
    background: #fff;
    border: 1px solid #f0e0eb;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #222;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.product-card.bsp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(219,39,119,0.13);
}
.product-card.bsp-card img {
    width: calc(100% + 24px);
    margin: -12px -12px 0;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 10px 10px 0 0;
    background: #fafafa;
    display: block;
    clip-path: inset(0 0 0 0 round 10px 10px 0 0);
    margin-bottom: 10px;
}
.product-sub { color: #bbb; font-size: 10px; margin-bottom: 3px; position: relative; z-index: 2; text-transform: uppercase; letter-spacing: 0.04em; }
.product-card.bsp-card h3 {
    color: #2d0a1a; font-size: 13px; font-weight: 600; margin: 0 0 6px;
    line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; overflow: hidden; position: relative; z-index: 2;
}
.price { font-size: 15px; font-weight: 800; color: #db2777; margin: 0 0 8px; position: relative; z-index: 2; }
.bsp-badges { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; position: relative; z-index: 2; }
.bsp-badge {
    display: block; background: #ffe7f2; color: #c2185b; padding: 4px 8px;
    border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%; box-sizing: border-box;
}
.bsp-badge strong { color: #880e4f; margin-left: 3px; font-weight: 700; }
.bsp-card__size { display: block; font-size: 11px; font-weight: 600; color: #db2777; margin: 4px 0 6px; position: relative; z-index: 2; }
.bsp-card__bottom { margin-top: auto; position: relative; z-index: 2; min-height: 28px; }

.bsp-btn--pill {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    position: absolute;
    bottom: 10px; right: 10px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #db2777;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(219,39,119,0.32);
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition: width 0.28s cubic-bezier(0.4,0,0.2,1), border-radius 0.28s ease, background 0.18s ease, opacity 0.2s ease;
}
.product-card.bsp-card:hover .bsp-btn--pill { opacity: 1; }
.bsp-btn--pill:hover:not(:disabled) {
    width: 140px; border-radius: 999px; background: #b01f63;
    justify-content: flex-start; padding-left: 12px; font-size: 0;
}
.bsp-btn--pill:hover:not(:disabled)::after { content: 'Додати в кошик'; font-size: 12px; font-weight: 600; white-space: nowrap; }
.bsp-btn--dis { background: #d9c4ce !important; cursor: not-allowed !important; box-shadow: none !important; opacity: 0.5 !important; }

.empty-products {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-size: 15px;
    padding: 48px 20px;
    line-height: 1.5;
}

/* ============================================================
   MOBILE ≤ 700px
   ============================================================ */
@media (max-width: 700px) {

    /* single column */
    .brand-page {
        display: block;
        padding: 0 12px 40px;
        margin: 0;
    }

    /* hide desktop sticky sidebar */
    .catalog_filtr.bsp-filtr-left { display: none; }

    /* content area */
    .bsp-brand-content { padding-top: 16px; }

    /* brand hero centered */
    .brand-container { justify-content: center; margin-bottom: 20px; }
    .brand-card { width: clamp(140px, 42vw, 180px); }
    .brand-card img,
    .brand-card .no-photo { height: clamp(110px, 32vw, 148px); }

    h1 { text-align: center; font-size: clamp(18px, 5vw, 22px); }
    .section-title { font-size: 16px; text-align: center; }

    /* ── mobile filter toggle block ── */
    .bsp-inline-filter-wrap {
        display: block;
        margin-bottom: 16px;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        overflow: hidden;
    }

    /* toggle button */
    .bsp-mobile-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 13px 16px;
        background: none;
        border: none;
        font-size: 14px;
        font-weight: 700;
        color: #2d0a1a;
        cursor: pointer;
        box-sizing: border-box;
        gap: 8px;
    }
    .bsp-mobile-toggle-btn .bsp-tog-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .bsp-mobile-toggle-btn svg.bsp-tog-icon {
        width: 17px; height: 17px;
        stroke: #db2777;
        fill: none;
        flex-shrink: 0;
    }
    .bsp-mobile-toggle-btn .bsp-tog-count {
        background: #db2777;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        border-radius: 999px;
        padding: 2px 7px;
        line-height: 1.5;
        display: none;
    }
    .bsp-mobile-toggle-btn .bsp-tog-count.visible { display: inline-block; }
    .bsp-tog-chevron {
        width: 16px; height: 16px;
        stroke: #94a3b8;
        fill: none;
        flex-shrink: 0;
        transition: transform 0.22s ease;
    }
    .bsp-inline-filter-wrap.open .bsp-tog-chevron {
        transform: rotate(180deg);
    }

    /* collapsible body */
    .bsp-mobile-filter-body {
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.35s cubic-bezier(0.22,1,0.36,1);
        border-top: 1px solid #f1f5f9;
    }
    .bsp-inline-filter-wrap.open .bsp-mobile-filter-body {
        max-height: 1800px;
    }

    /* hide filtr-panel-title inside mobile form */
    .bsp-mobile-filter-body .filtr-panel-title { display: none; }

    .bsp-sort-row { justify-content: flex-end; }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .product-card.bsp-card { padding: 10px; border-radius: 12px; }
    .product-card.bsp-card img { width: calc(100% + 20px); margin: -10px -10px 0; }
    .product-card.bsp-card h3 { font-size: 12px; }
    .price { font-size: 13px; }

    .bsp-btn--pill {
        opacity: 1;
        width: 24px; height: 24px;
        font-size: 14px;
        bottom: 8px; right: 8px;
    }
    .bsp-btn--pill:hover:not(:disabled),
    .bsp-btn--pill:active:not(:disabled) { width: 120px; }

    .empty-products { font-size: 14px; padding: 40px 16px; }
}