/* =====================================================
   BSB Establishment Dashboard v4.1
   Supplementary styles — profile, services, shop, map
   ===================================================== */

/* Remove old max-width wrapper — let dashboard fill screen */
.bsb-wrap {
    width: 100%;
    padding: 0;
    margin: 0;
}

.bsb-master-dashboard {
    /* Keep for old master-account page compat */
    padding: 24px;
    background: #fff;
    border: 1px solid var(--bsb-border, #e4e4e2);
    border-radius: 16px;
}

/* Card header typography */
.bsb-card__header h2 { margin: 10px 0 6px; font-size: 24px; line-height: 1.2; }
.bsb-card__header p { margin: 0; color: #666; }

/* Dashboard top */
.bsb-dashboard-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 20px 0 24px; flex-wrap: wrap; }

/* ---- Services ---- */
.bsb-services-page { display: flex; flex-direction: column; gap: 0; }
.bsb-services-block { padding: 20px; background: #fff; border: 1px solid #e4e4e2; border-radius: 16px; margin-bottom: 14px; }
.bsb-services-stack { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.bsb-services-list { display: flex; flex-direction: column; gap: 16px; }

.bsb-service-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: flex-start; padding: 16px; border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; }
.bsb-service-row--category { grid-template-columns: minmax(0, 1fr) auto; }
.bsb-service-row__id { width: 72px; min-height: 72px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: #f3f4f6; font-weight: 700; font-size: 18px; color: #111; }
.bsb-service-row__info { min-width: 0; }
.bsb-service-row__name { font-size: 16px; font-weight: 700; line-height: 1.3; color: #111; }
.bsb-service-row__meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; color: #6b7280; font-size: 13px; }
.bsb-service-row__description { margin-top: 8px; color: #374151; line-height: 1.5; font-size: 13px; }
.bsb-service-row__preview { margin-top: 12px; }
.bsb-service-row__actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 120px; }

/* Field spacers */
.bsb-field-spacer { margin-top: 16px; }
.bsb-grid-spacer { margin-top: 16px; }
.bsb-actions-row-flex { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Map ---- */
.bsb-map { width: 100%; height: 380px; border-radius: 18px; overflow: hidden; background: #f3f4f6; border: 1px solid #e5e7eb; margin-top: 12px; }

/* ---- Gallery preview ---- */
.bsb-gallery-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 14px; }
.bsb-gallery-preview__item { position: relative; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid #e5e7eb; aspect-ratio: 1 / 1; }
.bsb-gallery-preview__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bsb-gallery-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(17,24,39,.8); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.bsb-gallery-preview__item:hover .bsb-gallery-remove { opacity: 1; }

/* Image preview (single) */
.bsb-image-preview { display: block; width: 100%; max-width: 240px; height: auto; border-radius: 14px; object-fit: cover; border: 1px solid #e5e7eb; }
.bsb-product-thumb { width: 100%; max-width: none; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }

/* ---- Products grid ---- */
.bsb-products-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bsb-product-card { border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid #e5e7eb; }
.bsb-product-card__image { padding: 14px; background: #f8fafc; min-height: 140px; display: flex; align-items: center; justify-content: center; }
.bsb-product-card__body { padding: 14px; }
.bsb-product-card__body h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.bsb-product-meta { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; color: #6b7280; font-size: 13px; }

/* ---- Status chips ---- */
.bsb-status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.bsb-status--pending { background: #fff7d6; color: #8a6d00; }
.bsb-status--confirmed { background: #dff5e3; color: #146c2e; }
.bsb-status--completed { background: #e8eefc; color: #23408e; }
.bsb-status--cancelled { background: #fdeaea; color: #9f1c1c; }

/* ---- Section / inline ---- */
.bsb-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.bsb-inline-status-form, .bsb-inline-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bsb-muted { color: #777; font-size: 13px; margin-top: 4px; }
.bsb-empty { padding: 18px; border: 1px dashed #ccc; border-radius: 12px; color: #666; background: #fafafa; }
.bsb-checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .bsb-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .bsb-service-row { grid-template-columns: 1fr; }
    .bsb-service-row__actions { align-items: stretch; flex-direction: row; flex-wrap: wrap; }
    .bsb-products-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .bsb-service-row { grid-template-columns: 1fr; }
    .bsb-service-row__id { width: 56px; min-height: 56px; font-size: 15px; }
    .bsb-service-row__actions { width: 100%; }
    .bsb-products-grid { grid-template-columns: 1fr; }
    .bsb-gallery-preview { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
    .bsb-map { height: 240px; border-radius: 12px; }
}
