/* ══════════════════════════════════════════════════════════════════════════
   BWS 2.0 — Gallery Widget
   Component Marketplace · Business Gold+ · Groups · Personal Profiles
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.bws-gallery-section {
  padding: 0 clamp(16px, 4vw, 48px) 40px;
}

.bws-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.bws-gallery-title {
  font-family: var(--font-ui, 'Rajdhani', sans-serif);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--amber-light, #e8c068);
  text-transform: uppercase;
  margin: 0;
}

/* ── Album filter tabs ───────────────────────────────────────────────────── */
.bws-gallery-albums {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bws-gallery-album-btn {
  padding: 5px 14px;
  border: 1px solid rgba(200, 137, 42, .32);
  border-radius: 999px;
  background: transparent;
  color: var(--amber, #c8892a);
  font-family: var(--font-ui, 'Rajdhani', sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.bws-gallery-album-btn:hover,
.bws-gallery-album-btn.is-active {
  background: var(--amber, #c8892a);
  color: #0a0500;
  border-color: var(--amber, #c8892a);
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.bws-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.bws-gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(200, 137, 42, .16);
  cursor: zoom-in;
  isolation: isolate;
}

.bws-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), filter .3s;
}
.bws-gallery-item:hover img {
  transform: scale(1.08);
  filter: brightness(1.06);
}

.bws-gallery-item-cap {
  position: absolute;
  inset: auto 0 0;
  padding: 24px 10px 9px;
  background: linear-gradient(transparent, rgba(6, 3, 0, .82));
  color: rgba(255, 232, 180, .92);
  font-size: 12px;
  font-family: var(--font-body, 'Inter', sans-serif);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.bws-gallery-item:hover .bws-gallery-item-cap { opacity: 1; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.bws-gallery-empty {
  grid-column: 1 / -1;
  padding: 32px 16px;
  text-align: center;
  color: rgba(200, 137, 42, .5);
  font-size: 14px;
  border: 1px dashed rgba(200, 137, 42, .2);
  border-radius: 8px;
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.bws-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, .92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  animation: bwsLbFadeIn .18s ease both;
}
@keyframes bwsLbFadeIn { from { opacity: 0 } to { opacity: 1 } }

.bws-gallery-lb-img-wrap {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bws-gallery-lb-img-wrap img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
}

.bws-gallery-lb-cap {
  max-width: 600px;
  text-align: center;
  color: rgba(255, 230, 175, .88);
  font-size: 14px;
  font-family: var(--font-body, 'Inter', sans-serif);
  line-height: 1.5;
  min-height: 20px;
}

.bws-gallery-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(200, 137, 42, .3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: var(--amber, #c8892a);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.bws-gallery-lb-nav:hover { background: rgba(200, 137, 42, .18); }
.bws-gallery-lb-prev { left: -56px; }
.bws-gallery-lb-next { right: -56px; }

.bws-gallery-lb-close {
  position: fixed;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  color: rgba(255, 220, 160, .8);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.bws-gallery-lb-counter {
  color: rgba(200, 137, 42, .55);
  font-size: 12px;
  font-family: var(--font-ui, 'Rajdhani', sans-serif);
  font-weight: 700;
  letter-spacing: .1em;
}

/* ── Dashboard management panel ─────────────────────────────────────────── */
.dash-gallery-panel {}

.dash-gallery-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.dash-gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(200, 137, 42, .18);
}
.dash-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dash-gallery-thumb-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(180, 30, 20, .85);
  border: none;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity .15s;
}
.dash-gallery-thumb:hover .dash-gallery-thumb-del { opacity: 1; }

.dash-gallery-add-form {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.dash-gallery-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dash-gallery-locked {
  padding: 18px;
  border: 1px dashed rgba(200, 137, 42, .24);
  border-radius: 8px;
  text-align: center;
  color: rgba(200, 137, 42, .55);
  font-size: 13px;
}
.dash-gallery-locked strong {
  display: block;
  margin-bottom: 6px;
  color: rgba(200, 137, 42, .8);
}
.dash-gallery-locked a {
  color: var(--amber, #c8892a);
  text-decoration: underline;
}

/* ── Component Marketplace cards ─────────────────────────────────────────── */
.dash-component-marketplace {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.dash-comp-card {
  border: 1px solid rgba(200, 137, 42, .22);
  border-radius: 10px;
  padding: 16px 14px 14px;
  background: rgba(255, 255, 255, .025);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-comp-card.is-active { border-color: rgba(200, 137, 42, .55); background: rgba(200, 137, 42, .06); }
.dash-comp-card.is-locked { opacity: .6; }

.dash-comp-icon {
  font-size: 26px;
  line-height: 1;
}
.dash-comp-name {
  font-family: var(--font-ui, 'Rajdhani', sans-serif);
  font-weight: 800;
  font-size: 15px;
  color: rgba(255, 235, 195, .9);
}
.dash-comp-desc {
  font-size: 12px;
  color: rgba(200, 165, 100, .65);
  line-height: 1.45;
  flex: 1;
}
.dash-comp-tier {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(200, 137, 42, .6);
  font-family: var(--font-ui, 'Rajdhani', sans-serif);
}
.dash-comp-status {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-ui, 'Rajdhani', sans-serif);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  text-align: center;
}
.dash-comp-card.is-active .dash-comp-status {
  background: rgba(200, 137, 42, .18);
  color: var(--amber, #c8892a);
}
.dash-comp-card.is-locked .dash-comp-status {
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .3);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .bws-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 7px;
  }
  .bws-gallery-lb-prev { left: 4px; }
  .bws-gallery-lb-next { right: 4px; }
  .bws-gallery-lb-nav  { width: 38px; height: 38px; font-size: 18px; }
}
