/* =============================================================
   WC Category Brand Navigator — Stylesheet v1.1.0
   ============================================================= */

/* ---------- Wrapper ---------- */
.wcbn-wrap {
    position: relative;
    font-family: inherit;
    color: inherit;
}

/* ---------- Breadcrumb ---------- */
.wcbn-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    color: #555;
    min-height: 24px;
}

.wcbn-bc-item {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    background: #f0f0f0;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    line-height: 1.4;
    user-select: none;
}

.wcbn-bc-item:hover,
.wcbn-bc-item:focus {
    background: #e0e0e0;
    color: #111;
    outline: 2px solid #aaa;
    outline-offset: 2px;
}

.wcbn-bc-item.wcbn-bc-home {
    background: #1a1a2e;
    color: #fff;
}

.wcbn-bc-item.wcbn-bc-home:hover,
.wcbn-bc-item.wcbn-bc-home:focus {
    background: #16213e;
    color: #fff;
}

.wcbn-bc-separator {
    color: #aaa;
    font-size: 0.75rem;
    pointer-events: none;
    user-select: none;
}

/* ---------- Panel ---------- */
.wcbn-panel {
    min-height: 80px;
    transition: opacity 0.2s;
}

.wcbn-panel.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* ---------- Category / Brand Tile Grid ---------- */
.wcbn-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(var(--wcbn-cols, 4), 1fr);
}

.wcbn-grid--cols-1 { --wcbn-cols: 1; }
.wcbn-grid--cols-2 { --wcbn-cols: 2; }
.wcbn-grid--cols-3 { --wcbn-cols: 3; }
.wcbn-grid--cols-4 { --wcbn-cols: 4; }
.wcbn-grid--cols-5 { --wcbn-cols: 5; }
.wcbn-grid--cols-6 { --wcbn-cols: 6; }

@media ( max-width: 1024px ) {
    .wcbn-grid--cols-5,
    .wcbn-grid--cols-6 { --wcbn-cols: 4; }
}

@media ( max-width: 768px ) {
    .wcbn-grid { --wcbn-cols: 2 !important; }
}

@media ( max-width: 480px ) {
    .wcbn-grid { --wcbn-cols: 1 !important; }
}

/* ---------- Tile ---------- */
.wcbn-tile {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1.5px solid #ebebeb;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.wcbn-tile:hover,
.wcbn-tile:focus {
    border-color: #1a1a2e;
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    transform: translateY(-3px);
    outline: none;
}

.wcbn-tile:active {
    transform: translateY(-1px);
}

.wcbn-tile__img-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcbn-tile__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.wcbn-tile:hover .wcbn-tile__img-wrap img {
    transform: scale(1.05);
}

.wcbn-tile__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
}

.wcbn-tile__placeholder svg {
    width: 48px;
    height: 48px;
}

.wcbn-tile__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.wcbn-tile__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

.wcbn-tile__count {
    font-size: 0.78rem;
    color: #888;
}

.wcbn-tile__badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: #1a1a2e;
    padding: 2px 7px;
    border-radius: 20px;
    width: fit-content;
    letter-spacing: 0.03em;
}

/* ---------- Products section header ---------- */
.wcbn-products-header {
    margin-bottom: 20px;
}

.wcbn-products-meta {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

/* ---------- Product grid ----------
   The theme + WooCommerce fully control layout via .products.columns-N.
   We only provide the outer wrapper width and clear any double-margins.
   -------------------------------------------------------- */
.wcbn-products {
    width: 100%;
}

.wcbn-products ul.products {
    /* Let theme columns-N classes handle the grid — don't override */
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ---------- No results ---------- */
.wcbn-no-results {
    padding: 48px 24px;
    text-align: center;
    color: #777;
    background: #fafafa;
    border-radius: 8px;
    border: 1.5px dashed #ddd;
}

.wcbn-no-results p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---------- Loading overlay ---------- */
.wcbn-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.65);
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.wcbn-wrap.is-loading .wcbn-loading {
    display: flex;
}

.wcbn-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: wcbn-spin 0.7s linear infinite;
}

@keyframes wcbn-spin {
    to { transform: rotate(360deg); }
}
