/* ==========================================================================
   App catalog ([bverr_app_catalog]): public, read-only app grid shown on
   bverr.app's own pages and fetched by bverr.com's [bverr_app_catalog_public].
   Ported from workspaces.css's "App catalog" section (same class names,
   same look) but built on bverr-tokens.css's variables instead of base.css's,
   so this works standalone wherever bverr-tokens.css is already loaded
   (My Account, Shop, Product pages, and now the REST endpoint output).
   ========================================================================== */

.bv-appcat{display:flex;flex-direction:column;gap:20px;font-family:var(--bv-font);color:var(--bv-text);}

/* Product switch (only rendered with more than one SaaS product) */
.bv-appcat__products{display:flex;flex-wrap:wrap;gap:6px;}
.bv-appcat__product{
	height:36px;padding:0 16px;border:1px solid var(--bv-border);border-radius:999px;background:var(--bv-surface);cursor:pointer;
	font:inherit;font-size:14px;font-weight:500;color:var(--bv-text-body);
}
.bv-appcat__product:hover{background:var(--bv-bg);}
.bv-appcat__product.is-active{border-color:var(--bv-text);background:var(--bv-text);color:#fff;}

.bv-appcat__intro{margin:0;font-size:14px;line-height:20px;color:var(--bv-text-body);}

.bv-catalog{border:1px solid var(--bv-border);border-radius:var(--bv-radius-lg);background:var(--bv-surface);}
.bv-catalog[hidden]{display:none;}
.bv-card__head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid var(--bv-border);}
.bv-card__head h2{margin:0;font-size:16px;line-height:24px;}
.bv-apps__count{font-size:13px;line-height:20px;color:var(--bv-text-muted);white-space:nowrap;}

.bv-catalog__tools{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:16px 20px 0;}
.bv-catalog__tools:empty{display:none;}
.bv-catalog__search{position:relative;flex:1 1 240px;max-width:360px;margin:0;color:var(--bv-text-muted);}
.bv-catalog__search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);pointer-events:none;}
.bv-catalog__search .bv-input{
	width:100%;height:40px;padding:0 12px 0 38px;border:1px solid var(--bv-border);border-radius:8px;background:var(--bv-surface);
	font:inherit;font-size:14px;color:var(--bv-text);box-sizing:border-box;
}
.bv-catalog__search .bv-input:focus{outline:none;border-color:var(--bv-primary);box-shadow:var(--bv-focus-ring);}
.bv-chips{display:flex;flex-wrap:wrap;gap:6px;}
.bv-chip{
	height:32px;padding:0 12px;border:1px solid var(--bv-border);border-radius:999px;background:var(--bv-surface);cursor:pointer;
	font:inherit;font-size:13px;font-weight:500;color:var(--bv-text-body);
}
.bv-chip:hover{background:var(--bv-bg);}
.bv-chip.is-active{border-color:var(--bv-text);background:var(--bv-text);color:#fff;}

.bv-catalog__grid{
	list-style:none;margin:0;padding:16px 20px 20px;
	display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:stretch;
}
.bv-catapp{
	display:flex;flex-direction:column;gap:10px;padding:16px;
	border:1px solid var(--bv-border);border-radius:10px;background:var(--bv-surface);
}
.bv-catapp[hidden]{display:none;}
.bv-catapp__top{display:flex;align-items:center;gap:12px;}
.bv-catapp__title{min-width:0;}
.bv-catapp__title strong{display:block;font-size:14px;line-height:20px;font-weight:600;color:var(--bv-text);}
.bv-catapp__desc{flex:1;margin:0;font-size:13px;line-height:18px;color:var(--bv-text-body);}
.bv-app__icon{flex:0 0 40px;width:40px;height:40px;border-radius:10px;overflow:hidden;background:var(--bv-bg);display:flex;align-items:center;justify-content:center;}
.bv-app__icon--lg{flex-basis:48px;width:48px;height:48px;border-radius:12px;border:1px solid var(--bv-border);box-sizing:border-box;}
.bv-app__icon img{width:100%;height:100%;object-fit:cover;display:block;}
.bv-app__icon--text{font-size:14px;font-weight:600;color:var(--bv-text-body);}
.bv-app__cat{display:block;font-size:12px;line-height:16px;color:var(--bv-text-muted);}

/* Included apps: no actions, shown first */
.bv-catapp--included{background:var(--bv-bg);border-style:dashed;}
.bv-catapp--included .bv-catapp__desc{color:var(--bv-text-muted);}
.bv-catapp--included .bv-app__icon{filter:grayscale(.35);}
.bv-badge--included{display:inline-block;margin-left:4px;padding:0 8px;border-radius:999px;background:var(--bv-success-soft);color:#067647;font-size:11px;line-height:18px;font-weight:500;vertical-align:1px;}

.bv-card__empty{margin:0;padding:16px 20px 20px;font-size:13px;line-height:18px;color:var(--bv-text-muted);}

/* Apps-per-plan row + "See plans" / "Speak to us" */
.bv-appcat__plans{display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px;padding:4px 4px 0;font-size:13px;line-height:20px;color:var(--bv-text-body);}
.bv-appcat__plans strong{color:var(--bv-text);}
.bv-appcat__plans a{color:var(--bv-primary);text-decoration:none;font-weight:600;white-space:nowrap;}
.bv-appcat__plans a:hover{text-decoration:underline;}
.bv-appcat__foot{font-size:13px;line-height:20px;color:var(--bv-text-muted);}
.bv-appcat__foot a{color:var(--bv-primary);text-decoration:none;}
.bv-appcat__foot a:hover{text-decoration:underline;}

@media(max-width:1100px){
	.bv-catalog__grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:640px){
	.bv-catalog__grid{grid-template-columns:1fr;}
	.bv-catalog__search{max-width:none;}
	.bv-card__head{flex-wrap:wrap;}
}
