
.gallery-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:26px;
}
.gallery-filters{display:flex;flex-wrap:wrap;gap:10px}
.filter-button{
  border:1px solid var(--line);
  background:transparent;color:var(--muted);
  padding:10px 15px;cursor:pointer;font:inherit;font-size:.78rem;
}
.filter-button.active,.filter-button:hover{border-color:var(--wood);color:var(--wood-light)}
#galleryCounter{margin:0;color:var(--muted);font-size:.78rem}

.gallery-grid{display:grid;grid-template-columns:repeat(12,1fr);gap:18px}
.gallery-card{
  grid-column:span 4;
  position:relative;
  min-height:420px;
  overflow:hidden;
  border:1px solid var(--line);
  background:#111;
  cursor:pointer;
}
.gallery-card:nth-child(5n+1){grid-column:span 7}
.gallery-card:nth-child(5n+2){grid-column:span 5}
.gallery-card-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform .7s ease,filter .5s ease}
.gallery-card::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,transparent 35%,rgba(0,0,0,.88));
}
.gallery-card-content{position:absolute;z-index:2;left:0;right:0;bottom:0;padding:26px}
.gallery-card small{color:var(--wood-light);text-transform:uppercase;letter-spacing:.14em}
.gallery-card h3{font-size:2rem;margin:7px 0}
.gallery-card p{color:#c7c2bb;font-size:.85rem;margin:0;max-width:520px}
.gallery-card:hover .gallery-card-image{transform:scale(1.055);filter:brightness(.84)}
.gallery-loading,.gallery-empty{grid-column:1/-1;color:var(--muted)}

.lightbox{
  position:fixed;z-index:2000;inset:0;
  display:none;align-items:center;justify-content:center;
  padding:50px 85px 35px;
  background:rgba(3,3,4,.94);
  backdrop-filter:blur(16px);
}
.lightbox.open{display:flex}
.lightbox figure{margin:0;max-width:min(1200px,100%);max-height:100%;display:flex;flex-direction:column;align-items:center}
.lightbox img{max-width:100%;max-height:78vh;object-fit:contain;box-shadow:0 20px 70px rgba(0,0,0,.55)}
.lightbox figcaption{width:100%;display:flex;justify-content:space-between;gap:20px;padding-top:14px;color:var(--muted)}
.lightbox figcaption strong{color:var(--text)}
.lightbox-close,.lightbox-nav{
  position:absolute;border:0;background:transparent;color:white;cursor:pointer;
}
.lightbox-close{top:18px;right:24px;font-size:2.5rem}
.lightbox-nav{top:50%;transform:translateY(-50%);font-size:4rem;color:#d6d0c7}
.lightbox-prev{left:24px}.lightbox-next{right:24px}

@media(max-width:900px){
  .gallery-card,.gallery-card:nth-child(5n+1),.gallery-card:nth-child(5n+2){grid-column:span 6;min-height:360px}
}
@media(max-width:620px){
  .gallery-toolbar{align-items:flex-start;flex-direction:column}
  .gallery-card,.gallery-card:nth-child(5n+1),.gallery-card:nth-child(5n+2){grid-column:1/-1;min-height:380px}
  .lightbox{padding:60px 18px 25px}
  .lightbox-nav{font-size:2.8rem}
  .lightbox-prev{left:5px}.lightbox-next{right:5px}
  .lightbox figcaption{font-size:.78rem}
}
/* =========================
   PRZYCISKI GALERII I MODELI
========================= */

.gallery-card::after {
  pointer-events: none;
}

.gallery-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.gallery-action {
  position: relative;
  z-index: 3;

  min-height: 40px;
  padding: 0 15px;

  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 8, 9, 0.55);
  color: #f3f0ea;

  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  cursor: pointer;
  backdrop-filter: blur(8px);

  transition:
    border-color 0.25s ease,
    color 0.25s ease,
    background 0.25s ease;
}

.gallery-action:hover,
.gallery-action:focus-visible {
  border-color: var(--wood);
  color: var(--wood-light);
  background: rgba(8, 8, 9, 0.85);
}

.gallery-action-model {
  border-color: rgba(198, 154, 99, 0.7);
  color: var(--wood-light);
}

.gallery-card-placeholder {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(198, 154, 99, 0.16),
      transparent 33%
    ),
    linear-gradient(135deg, #252424, #0f0f10);
}

.gallery-card-placeholder span {
  width: 110px;
  height: 110px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(198, 154, 99, 0.55);
  border-radius: 50%;

  color: var(--wood-light);
  font-family: var(--serif);
  font-size: 2rem;
  letter-spacing: 0.08em;
}

/* =========================
   OKNO MODELU 3D
========================= */

.model-modal {
  position: fixed;
  z-index: 2100;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(3, 3, 4, 0.94);
  backdrop-filter: blur(18px);
}

.model-modal.open {
  display: flex;
}

.model-modal-panel {
  width: min(1320px, 100%);
  max-height: calc(100vh - 48px);

  overflow: auto;
  padding: 22px;

  border: 1px solid var(--line);
  background: #121214;

  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}

.model-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 28px;
  padding: 8px 8px 20px;
}

.model-modal-header h2 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.model-modal-header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.model-modal-close {
  flex: 0 0 auto;

  width: 48px;
  height: 48px;

  border: 1px solid var(--line);
  background: transparent;
  color: #ffffff;

  font-size: 2rem;
  line-height: 1;

  cursor: pointer;
}

model-viewer#productModelViewer {
  display: block;

  width: 100%;
  height: min(70vh, 760px);
  min-height: 480px;

  background:
    radial-gradient(
      circle at 50% 45%,
      #323234 0,
      #1b1b1e 40%,
      #0d0d0f 100%
    );

  border: 1px solid var(--line);

  --poster-color: transparent;
  --progress-bar-color: var(--wood);
}

.model-progress {
  position: absolute;

  left: 10%;
  right: 10%;
  bottom: 24px;

  height: 3px;
  overflow: hidden;

  background: rgba(255, 255, 255, 0.12);
}

.model-progress-bar {
  width: 0;
  height: 100%;

  background: var(--wood);

  transition: width 0.15s linear;
}

.model-error {
  margin: 14px 0 0;
  padding: 12px 14px;

  border: 1px solid rgba(210, 86, 65, 0.45);
  background: rgba(210, 86, 65, 0.08);

  color: #efb4a9;
}

@media (max-width: 700px) {
  .model-modal {
    padding: 10px;
  }

  .model-modal-panel {
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .model-modal-header {
    gap: 12px;
    padding: 5px 5px 14px;
  }

  .model-modal-header p:not(.eyebrow) {
    font-size: 0.78rem;
  }

  model-viewer#productModelViewer {
    height: 64vh;
    min-height: 390px;
  }
}