/* B2S Accordion Widget - Styles v2.2.0 */

.b2s-accordion-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.b2s-accordion {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e8eaed;
}

/* Accordion Item */
.b2s-accordion-item {
    border-bottom: 1px solid #f0f1f3;
    transition: background 0.2s ease;
}

.b2s-accordion-item:last-child {
    border-bottom: none;
}

/* Remove border for nested items */
.b2s-subcategories-wrapper > .b2s-accordion-item {
    border-bottom: 1px solid rgba(240, 241, 243, 0.5);
}

.b2s-subcategories-wrapper > .b2s-accordion-item:last-child {
    border-bottom: none;
}

/* Accordion Header */
.b2s-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s ease;
    user-select: none;
    gap: 8px;
}

.b2s-accordion-header:hover {
    background: rgba(247, 248, 250, 0.6);
}

.b2s-accordion-item.is-open > .b2s-accordion-header {
    background: rgba(240, 244, 255, 0.4);
}

/* Level 0 (Parent) specific styles */
.b2s-level-0 > .b2s-accordion-header {
    padding: 13px 16px;
}

.b2s-level-0 > .b2s-accordion-header:hover {
    background: rgba(247, 248, 250, 0.8);
}

.b2s-level-0.is-open > .b2s-accordion-header {
    background: rgba(240, 244, 255, 0.5);
}

/* Level 1+ (Children) specific styles - smaller text, different background */
.b2s-level-1 > .b2s-accordion-header {
    padding: 10px 16px 10px 28px;
}

.b2s-level-1 > .b2s-accordion-header:hover {
    background: rgba(238, 240, 245, 0.5);
}

.b2s-level-1.is-open > .b2s-accordion-header {
    background: rgba(230, 235, 250, 0.4);
}

/* Level 2 (Grand-children) */
.b2s-level-2 > .b2s-accordion-header {
    padding: 9px 16px 9px 40px;
}

.b2s-level-2 > .b2s-accordion-header:hover {
    background: rgba(235, 237, 242, 0.4);
}

.b2s-level-2.is-open > .b2s-accordion-header {
    background: rgba(225, 230, 245, 0.3);
}

.b2s-accordion-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Category icon - only for level 0 */
.b2s-cat-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e8eaed;
}

.b2s-cat-icon-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #eef0f5;
    flex-shrink: 0;
    color: #8a92a8;
}

.b2s-cat-icon-placeholder svg {
    width: 15px;
    height: 15px;
}

/* Category name link - Level 0 (Parent) */
.b2s-level-0 .b2s-cat-name,
.b2s-level-0 .b2s-cat-name:link,
.b2s-level-0 .b2s-cat-name:visited {
    font-size: 14px;
    font-weight: 600;
    color: #1a1f2e;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.2s ease;
}

/* Category name link - Level 1 (Children) - smaller text */
.b2s-level-1 .b2s-cat-name,
.b2s-level-1 .b2s-cat-name:link,
.b2s-level-1 .b2s-cat-name:visited {
    font-size: 13px;
    font-weight: 500;
    color: #2a3142;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.2s ease;
}

/* Category name link - Level 2 (Grand-children) - even smaller */
.b2s-level-2 .b2s-cat-name,
.b2s-level-2 .b2s-cat-name:link,
.b2s-level-2 .b2s-cat-name:visited {
    font-size: 12px;
    font-weight: 500;
    color: #3a4255;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.b2s-cat-name:hover,
.b2s-cat-name:focus,
.b2s-cat-name:active {
    color: #4a6cf7 !important;
    text-decoration: none !important;
}

.b2s-count {
    font-weight: 400;
    color: #9ba3b8;
    font-size: 12px;
    margin-left: 2px;
}

.b2s-level-1 .b2s-count {
    font-size: 11px;
}

.b2s-level-2 .b2s-count {
    font-size: 10px;
}

/* Arrow - down pointing chevron */
.b2s-accordion-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #9ba3b8;
    transition: transform 0.25s ease, color 0.2s ease;
}

.b2s-accordion-arrow svg {
    width: 16px;
    height: 16px;
}

.b2s-accordion-item.is-open > .b2s-accordion-header .b2s-accordion-arrow {
    transform: rotate(180deg);
    color: #4a6cf7;
}

/* Smaller arrow for children */
.b2s-level-1 .b2s-accordion-arrow,
.b2s-level-2 .b2s-accordion-arrow {
    width: 18px;
    height: 18px;
}

.b2s-level-1 .b2s-accordion-arrow svg,
.b2s-level-2 .b2s-accordion-arrow svg {
    width: 14px;
    height: 14px;
}

/* Accordion Content */
.b2s-accordion-content {
    display: none;
    padding: 4px 0 10px 0;
    background: transparent;
    animation: b2s-slideDown 0.22s ease;
}

.b2s-accordion-item.is-open > .b2s-accordion-content {
    display: block;
}

/* Level 0 content has subtle background */
.b2s-level-0 > .b2s-accordion-content {
    background: rgba(250, 251, 253, 0.6);
}

/* Level 1+ content is transparent */
.b2s-level-1 > .b2s-accordion-content,
.b2s-level-2 > .b2s-accordion-content {
    background: transparent;
    padding: 0 0 6px 0;
}

@keyframes b2s-slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subcategories wrapper */
.b2s-subcategories-wrapper {
    margin: 0;
    padding: 0;
}

/* ── Product list ──────────────────────────────────────────────────────────── */

.b2s-product-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 6px 0 !important;
}

.b2s-product-item {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid rgba(240, 241, 243, 0.6);
}

.b2s-product-item:last-child {
    border-bottom: none;
}

.b2s-product-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    text-decoration: none !important;
    transition: background 0.15s ease;
}

/* Indent products in nested levels */
.b2s-level-1 .b2s-product-link {
    padding-left: 28px;
}

.b2s-level-2 .b2s-product-link {
    padding-left: 40px;
}

.b2s-product-link:hover,
.b2s-product-link:focus,
.b2s-product-link:active,
.b2s-product-link * {
    text-decoration: none !important;
}

.b2s-product-link:hover {
    background: rgba(238, 241, 252, 0.5);
}

.b2s-product-thumb {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e8eaed;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.b2s-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 5px;
}

.b2s-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.b2s-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1f2e;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    min-width: 0;
    transition: color 0.2s ease;
}

.b2s-product-link:hover .b2s-product-name {
    color: #4a6cf7;
}

.b2s-product-price {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    line-height: 1.2;
}

.b2s-product-price ins,
.b2s-product-price > .woocommerce-Price-amount {
    font-size: 12px;
    color: #4a6cf7;
    font-weight: 700;
    text-decoration: none !important;
}

.b2s-product-price del {
    font-size: 11px;
    color: #b0b8cc;
    font-weight: 400;
    text-decoration: line-through;
    opacity: 0.85;
}

.b2s-product-price del .woocommerce-Price-amount,
.b2s-product-price del .woocommerce-Price-currencySymbol {
    color: #b0b8cc;
}

.b2s-product-price ins .woocommerce-Price-amount,
.b2s-product-price ins .woocommerce-Price-currencySymbol {
    text-decoration: none !important;
}

.b2s-product-price .woocommerce-Price-currencySymbol {
    font-size: 11px;
}

/* View all link */
.b2s-view-all {
    display: inline-block;
    margin: 8px 16px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #4a6cf7;
    text-decoration: none;
    transition: color 0.2s ease;
}

.b2s-level-1 .b2s-view-all {
    margin-left: 28px;
}

.b2s-level-2 .b2s-view-all {
    margin-left: 40px;
}

.b2s-view-all:hover {
    color: #2f4de0;
    text-decoration: underline;
}

/* No content messages */
.b2s-no-categories,
.b2s-no-products {
    font-size: 13px;
    color: #9ba3b8;
    padding: 10px 16px;
    margin: 0;
}

.b2s-level-1 .b2s-no-products {
    padding-left: 28px;
}

.b2s-level-2 .b2s-no-products {
    padding-left: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .b2s-accordion-header {
        padding: 12px 14px;
    }
    .b2s-level-1 > .b2s-accordion-header {
        padding: 10px 14px 10px 24px;
    }
    .b2s-level-2 > .b2s-accordion-header {
        padding: 9px 14px 9px 34px;
    }
    .b2s-product-link {
        padding: 8px 14px;
    }
    .b2s-level-1 .b2s-product-link {
        padding-left: 24px;
    }
    .b2s-level-2 .b2s-product-link {
        padding-left: 34px;
    }
}
