/* B2S Accordion Widget - Styles v2.0.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;
}

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

.b2s-accordion-header:hover {
    background: #f7f8fa;
}

.b2s-accordion-item.is-open > .b2s-accordion-header {
    background: #f0f4ff;
    border-bottom: 1px solid #e2e8fc;
}

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

/* Category icon */
.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 */
.b2s-cat-name,
.b2s-cat-name:link,
.b2s-cat-name:visited,
.b2s-cat-name:hover,
.b2s-cat-name:focus,
.b2s-cat-name:active {
    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;
}

.b2s-cat-name:hover,
.b2s-cat-name:focus {
    color: #4a6cf7;
}

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

/* Arrow */
.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(90deg);
    color: #4a6cf7;
}

/* Accordion Content */
.b2s-accordion-content {
    display: none;
    padding: 4px 0 10px 0;
    background: #fafbfd;
    border-top: 1px solid #eef0f5;
    animation: b2s-slideDown 0.22s ease;
}

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

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

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

.b2s-product-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 6px 0 !important; /* remove all indentation */
}

.b2s-product-item {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid #f0f1f3;
}

.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;
}

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

.b2s-product-link:hover {
    background: #eef1fc;
}

.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;  /* critical: allows text-overflow:ellipsis to work in flex */
    flex: 1;
}

/* Product name now mirrors category title style */
.b2s-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1f2e;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* No fixed max-width — flex chain constrains it to the actual panel width */
    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;
}

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

/* Strikethrough regular price */
.b2s-product-price del {
    font-size: 11px;
    color: #b0b8cc;   /* muted gray — looks "disabled" */
    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;
}

/* Subcategories */
.b2s-subcategory-list {
    list-style: none !important;
    margin: 6px 0 0 0 !important;
    padding: 6px 16px !important;
    border-top: 1px solid #eef0f5;
}

.b2s-subcategory-list li {
    margin: 2px 0;
}

.b2s-subcat-link {
    font-size: 12px;
    color: #6b7899;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 0;
    transition: color 0.2s ease;
}

.b2s-subcat-link:hover {
    color: #4a6cf7;
    text-decoration: none;
}

/* 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-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;
}

/* Responsive */
@media (max-width: 768px) {
    .b2s-accordion-header {
        padding: 12px 14px;
    }
    .b2s-product-link {
        padding: 8px 14px;
    }
}
