/* Template gallery — wizard alternative entry (browse layout) */
body.wizard-gallery-page {
  margin: 0;
  background: var(--wizard-page-bg, #f4f6f8);
  color: var(--wizard-text, #1a1a1a);
}

/* Same horizontal bounds as wizard `.page` (see styles.css + --ss-max-width) */
.wizard-gallery-page .page {
  box-sizing: border-box;
}

html[data-theme="schlauesocke-2026"] .wizard-gallery-page .panel.wizard-gallery-main {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.wizard-gallery-page .gallery-page-inner {
  display: grid;
  gap: 0;
  min-width: 0;
  padding-bottom: 32px;
}

.wizard-gallery-page .gallery-hero {
  margin-bottom: 28px;
}

.wizard-gallery-page .gallery-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}

.wizard-gallery-page .gallery-hero p {
  margin: 0;
  max-width: 52rem;
  color: var(--wizard-muted, #5c6570);
  line-height: 1.5;
}

.wizard-gallery-page .browse-layout {
  display: block;
  min-width: 0;
}

.wizard-gallery-page .browse-main {
  min-width: 0;
}

.wizard-gallery-page .library-search {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--wizard-border, #d8dee6);
  border-radius: 10px;
  font: inherit;
  margin-bottom: 10px;
  background: #fff;
}

.wizard-gallery-page .library-count {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--wizard-muted, #5c6570);
}

#design-grid.catalogue-bands,
.wizard-step1-design-grid.catalogue-bands {
  display: block;
  min-height: 120px;
}

/* Shared grid/card layout (standalone gallery + wizard step 1 embed) */
.catalogue-bands .grid-masonry {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
}

.catalogue-bands .grid-masonry-col {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.catalogue-bands .grid-masonry-col > .card {
  width: 100%;
  flex-shrink: 0;
}

.catalogue-bands article.card,
.step-1-categories--picker .sock-option-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.catalogue-bands article.card:hover,
.catalogue-bands article.card:focus-within,
.step-1-categories--picker .sock-option-card:hover,
.step-1-categories--picker .sock-option-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.catalogue-bands article.card.selected {
  outline: 3px solid var(--wizard-accent, #0078b4);
  outline-offset: 2px;
}

.step-1-categories--picker .sock-option-card.active {
  outline: 3px solid var(--schlauesocke-green, #5ba54a);
  outline-offset: 2px;
  border-color: transparent;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.catalogue-bands .card-thumb--fluid,
.step-1-categories--picker .sock-option-card .card-thumb--fluid {
  position: relative;
  min-height: 140px;
  background: linear-gradient(145deg, #e8ecf0 0%, #f8fafc 100%);
}

.catalogue-bands .card-thumb--fluid:has(.catalogue-img.loaded),
.step-1-categories--picker .sock-option-card .card-thumb--fluid:has(.catalogue-img.loaded) {
  min-height: 0;
}

.catalogue-bands .card-glow-stage,
.step-1-categories--picker .sock-option-card .card-glow-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.catalogue-bands .card-glow-stage img,
.step-1-categories--picker .sock-option-card .card-glow-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(28px) brightness(1.1);
  opacity: 0.45;
  transform: scale(1.15);
}

.catalogue-bands .catalogue-img,
.step-1-categories--picker .sock-option-card .catalogue-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.catalogue-bands .catalogue-img.loaded,
.step-1-categories--picker .sock-option-card .catalogue-img.loaded {
  opacity: 1;
}

.catalogue-bands .catalogue-img.load-failed,
.step-1-categories--picker .sock-option-card .catalogue-img.load-failed {
  opacity: 0.35;
}

.catalogue-bands .card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.catalogue-bands article.card:hover .card-overlay {
  opacity: 1;
}

.catalogue-bands .card-overlay button {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.catalogue-bands .card-overlay .btn-view {
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
}

.catalogue-bands .card-overlay .btn-customize {
  background: var(--wizard-accent, #0078b4);
  color: #fff;
}

.catalogue-bands .card-caption,
.step-1-categories--picker .sock-option-card .sock-option-title {
  padding: 10px 12px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--wizard-text, #1a1a1a);
}

.catalogue-bands #catalogue-load-sentinel {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-height: 1px;
  margin-top: 8px;
  clear: both;
  pointer-events: none;
}

.gallery-load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0 8px;
}

.gallery-load-more-wrap[hidden] {
  display: none !important;
}

.gallery-load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 28px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: var(--schlauesocke-green, #5ba54a);
  box-shadow: 0 2px 10px rgba(91, 165, 74, 0.35);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery-load-more-btn:hover:not(:disabled),
.gallery-load-more-btn:focus-visible:not(:disabled) {
  background: #4d9440;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(91, 165, 74, 0.4);
}

.gallery-load-more-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.wizard-gallery-page .gallery-load-status,
.wizard-step1-gallery .gallery-load-status {
  text-align: center;
  padding: 16px;
  font-size: 0.9rem;
  color: var(--wizard-muted, #5c6570);
}

.catalogue-bands article.card.is-starting {
  pointer-events: none;
  opacity: 0.72;
}

.gallery-detail-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
}

.gallery-detail-panel.open {
  display: flex;
}

.gallery-detail-inner {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
}

.gallery-detail-inner img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.gallery-detail-title {
  margin: 12px 0 6px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.gallery-detail-summary {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--wizard-muted, #5c6570);
}

.gallery-detail-status {
  flex: 1 0 100%;
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--wizard-muted, #5c6570);
}

.gallery-detail-status.hidden {
  display: none;
}

.gallery-detail-status--error {
  color: #b42318;
  font-weight: 600;
}

.gallery-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.gallery-detail-actions .gallery-detail-close-btn {
  flex: 0 1 auto;
}

.gallery-detail-actions .gallery-detail-start-btn {
  flex: 1 1 200px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}

.gallery-detail-actions .gallery-detail-start-btn[aria-busy="true"] {
  cursor: wait;
  opacity: 0.92;
}

.gallery-detail-actions .gallery-detail-start-btn:disabled {
  cursor: wait;
  opacity: 0.85;
}

.wizard-gallery-page .gallery-alt-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--wizard-accent, #0078b4);
}

/* Embedded in wizard step 1 */
.wizard-step1-gallery .library-search {
  width: 100%;
  max-width: none;
  padding: 10px 12px;
  border: 1px solid var(--wizard-border, #d8dee6);
  border-radius: 10px;
  font: inherit;
  margin-bottom: 8px;
  background: #fff;
  box-sizing: border-box;
}

.wizard-step1-gallery .library-count {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--wizard-muted, #5c6570);
}

.wizard-step1-design-grid.catalogue-bands {
  min-height: 80px;
}

.wizard-step1-gallery-detail-panel.gallery-detail-panel {
  z-index: 60;
}
