/* ==========================================================================
   SEKCJA CERTYFIKATY & AKREDYTACJE — DR N. MED. MIKOŁAJ PERNAK
   Haute-Couture Editorial Aesthetic • Royal Burgundy Palette (#400D1C / #280711)
   100% jednolite tło (#FAF8F5), żywe mikroanimacje (breathing pulse,
   staggered spring cascade, shimmer sweep), szlachetna typografia Cormorant Garamond + Jost
   ========================================================================== */

/* --------------------------------------------------------------------------
   Sekcja Główna — 100% jednolite tło ze stroną (#FAF8F5)
   Zero sztucznych pasów, ramek czy odcięć po bokach
   -------------------------------------------------------------------------- */
.section-certificates {
  width: 100% !important;
  align-self: stretch !important;
  position: relative !important;
  background-color: #FAF8F5 !important; /* 100% identyczne tło jak cała strona */
  padding: clamp(56px, 6.5vw, 104px) 0 clamp(80px, 9vw, 130px) 0 !important;
  border-top: none !important;
  border-bottom: none !important;
  border: none !important;
  overflow: visible !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* Kontener */
.certs-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3.5vw, 44px);
  position: relative;
  box-sizing: border-box;
}

/* ==========================================================================
   NAGŁÓWEK SEKCJI — WYKWINTNA TYPOGRAFIA EDITORIAL
   ========================================================================== */
.certs-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto clamp(34px, 4.5vw, 52px) auto;
}

.certs-kicker {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #400D1C;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  white-space: nowrap;
}

.certs-kicker::before,
.certs-kicker::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: #400D1C;
  opacity: 0.45;
}

.certs-title {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 500;
  color: #170A0F;
  line-height: 1.15;
  margin: 0 0 16px 0;
  letter-spacing: -0.018em;
}

.certs-title em {
  font-family: 'Playfair Display', 'Cormorant Garamond', serif !important;
  font-style: italic;
  font-weight: 400;
  color: #400D1C;
  text-shadow: 0 2px 18px rgba(64, 13, 28, 0.12);
}

.certs-lead {
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: clamp(15px, 1.25vw, 16.5px);
  line-height: 1.78;
  color: #554448;
  margin: 0 auto;
  max-width: 720px;
}

/* ==========================================================================
   PIGUŁKI FILTRÓW — ROYAL BURGUNDY (#400D1C) & ODDYCHAJĄCA ANIMACJA
   ========================================================================== */
.certs-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: clamp(32px, 4vw, 46px);
  position: relative;
}

.certs-filter-btn {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 11px 24px;
  border-radius: 9999px;
  background: #FFFFFF;
  color: #2D0C15;
  border: 1px solid rgba(64, 13, 28, 0.15);
  cursor: pointer;
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 3px 10px rgba(45, 12, 21, 0.04);
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: max-content;
}

.certs-filter-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
  pointer-events: none;
}

.certs-filter-btn:hover {
  border-color: rgba(64, 13, 28, 0.45);
  color: #400D1C;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(64, 13, 28, 0.12);
}

.certs-filter-btn:hover::after {
  transform: translateX(100%);
}

.certs-filter-btn:active {
  transform: translateY(0) scale(0.96);
}

/* AKTYWNA PIGUŁKA — GŁĘBOKI KRÓLEWSKI BURGUND Z ODDYCHAJĄCYM GLOW */
.certs-filter-btn.active {
  background: linear-gradient(135deg, #400D1C 0%, #250710 100%);
  color: #F8F1E7;
  border-color: #400D1C;
  box-shadow: 0 8px 26px rgba(64, 13, 28, 0.35), 0 2px 6px rgba(64, 13, 28, 0.18);
  animation: certPillBreathe 3s ease-in-out infinite;
}

@keyframes certPillBreathe {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(64, 13, 28, 0.32), 0 0 0 0 rgba(64, 13, 28, 0.2);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 12px 32px rgba(64, 13, 28, 0.5), 0 0 16px rgba(234, 160, 152, 0.35);
    transform: translateY(-2px);
  }
}

/* Licznik w pigułce */
.certs-filter-count {
  display: inline-block;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(64, 13, 28, 0.08);
  color: #400D1C;
  transition: all 0.3s ease;
}

.certs-filter-btn.active .certs-filter-count {
  background: rgba(248, 241, 231, 0.24);
  color: #F8F1E7;
}

/* ==========================================================================
   SIATKA CERTYFIKATÓW (CERTS-GRID) & STAGGERED SPRING CASCADE
   ========================================================================== */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2vw, 28px);
  margin-bottom: clamp(32px, 4vw, 46px);
  position: relative;
  min-height: 280px;
}

/* KARTA CERTYFIKATU — SZLACHETNA OPRAWA, BURGUNDOWE AKCENTY */
.cert-card {
  background: #FFFFFF;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(64, 13, 28, 0.09);
  box-shadow: 0 4px 20px rgba(45, 12, 21, 0.04);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.32s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  user-select: none;
  will-change: transform, opacity;
}

/* Żywa mikro-animacja wejścia (Spring Cascade In) */
.cert-card.anim-in {
  animation: certCardSpringIn 0.65s cubic-bezier(0.2, 1.25, 0.4, 1) backwards;
  animation-delay: calc(var(--card-index, 0) * 80ms);
}

@keyframes certCardSpringIn {
  0% {
    opacity: 0;
    transform: translateY(34px) scale(0.91);
    filter: blur(6px);
  }
  65% {
    opacity: 1;
    transform: translateY(-5px) scale(1.018);
    filter: blur(0);
  }
  85% {
    transform: translateY(2px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Mikro-animacja wyjścia podczas zmiany kategorii */
.cert-card.anim-out {
  animation: certCardFadeOut 0.22s cubic-bezier(0.4, 0, 0.9, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 35ms);
  pointer-events: none;
}

@keyframes certCardFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
    filter: blur(4px);
  }
}

/* Luksusowy rozbłysk świetlny (shimmer sweep) przy pojawieniu się karty */
.cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 90%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-22deg);
  pointer-events: none;
  z-index: 8;
}

.cert-card.anim-in::before {
  animation: certShimmerSweep 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 80ms + 0.18s);
}

@keyframes certShimmerSweep {
  0% { left: -150%; }
  100% { left: 200%; }
}

/* HOVER KARTY — PŁYNNE WYNIESIENIE I CIEPŁY BURGUNDOWY CIEŃ */
.cert-card:hover {
  transform: translateY(-9px) scale(1.015);
  box-shadow: 0 24px 54px rgba(64, 13, 28, 0.16), 0 4px 14px rgba(45, 12, 21, 0.05);
  border-color: rgba(64, 13, 28, 0.36);
}

/* RAMKA ZDJĘCIA CERTYFIKATU (MATTE MOUNT) */
.cert-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.34;
  background: linear-gradient(175deg, #FBF9F6 0%, #EFE9E0 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(64, 13, 28, 0.06);
}

.cert-card-media picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.cert-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(64, 13, 28, 0) 65%, rgba(64, 13, 28, 0.16) 100%);
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}

.cert-card:hover .cert-card-media::after {
  opacity: 1;
}

.cert-card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(45, 12, 21, 0.09);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  background: #FFFFFF;
}

.cert-card:hover .cert-card-img {
  transform: scale(1.04) translateY(-2px);
}

/* PIGUŁKA KATEGORII NA ZDJĘCIU */
.cert-card-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  background: linear-gradient(135deg, rgba(64, 13, 28, 0.94), rgba(40, 7, 17, 0.94));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #F8F1E7;
  border: 0.5px solid rgba(248, 241, 231, 0.32);
  font-family: 'Montserrat', sans-serif !important;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
  z-index: 2;
  box-shadow: 0 3px 10px rgba(45, 12, 21, 0.22);
  white-space: nowrap;
  max-width: calc(100% - 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.28s ease;
}

.cert-card:hover .cert-card-badge {
  background: #400D1C;
  transform: translateY(-1px);
  border-color: rgba(248, 241, 231, 0.65);
}

/* LUPA ZOOM NA HOVER */
.cert-card-zoom-badge {
  position: absolute;
  bottom: 11px;
  right: 11px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #400D1C;
  color: #F8F1E7;
  border: 1px solid rgba(248, 241, 231, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(64, 13, 28, 0.35);
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.cert-card:hover .cert-card-zoom-badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* OPISY KARTY — CZYTELNE, HARMONIJNE I SZLACHETNE */
.cert-card-body {
  padding: 16px 18px 22px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background: #FFFFFF;
}

.cert-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cert-card-loc {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 10.5px;
  font-weight: 700;
  color: #400D1C;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cert-card-year {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 11px;
  color: #400D1C;
  font-weight: 700;
  background: rgba(64, 13, 28, 0.06);
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.cert-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-size: 20px;
  line-height: 1.26;
  font-weight: 600;
  color: #170A0F;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s ease;
}

.cert-card:hover .cert-card-title {
  color: #400D1C;
}

.cert-card-issuer {
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 12.5px;
  line-height: 1.55;
  color: #625357;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   WSKAŹNIK KROPKOWY NA SMARTFONY (MOBILE DOTS)
   ========================================================================== */
.certs-mobile-dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 auto 28px auto;
}

.certs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(64, 13, 28, 0.2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.certs-dot.active {
  width: 28px;
  border-radius: 9999px;
  background: #400D1C;
  box-shadow: 0 2px 8px rgba(64, 13, 28, 0.35);
}

/* ==========================================================================
   PIGUŁKA ROZWINIĘCIA ("ROZWIŃ WSZYSTKIE CERTYFIKATY") — ROYAL BURGUNDY
   ========================================================================== */
.certs-action-wrap {
  text-align: center;
  margin-top: 10px;
}

.btn-certs-show-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #400D1C 0%, #250710 100%);
  color: #F8F1E7;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 34px;
  border-radius: 9999px;
  border: 1.5px solid #400D1C;
  cursor: pointer;
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(64, 13, 28, 0.26);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn-certs-show-all::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-100%);
  transition: transform 0.65s ease;
  pointer-events: none;
}

.btn-certs-show-all:hover {
  background: linear-gradient(135deg, #531124 0%, #350A17 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 36px rgba(64, 13, 28, 0.38);
  border-color: rgba(248, 241, 231, 0.4);
}

.btn-certs-show-all:hover::before {
  transform: translateX(100%);
}

.btn-certs-show-all:active {
  transform: translateY(0) scale(0.98);
}

.btn-certs-show-all svg {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  stroke: #F8F1E7;
}

.btn-certs-show-all.expanded svg {
  transform: rotate(180deg);
}

/* ==========================================================================
   RESPONSYWNOŚĆ & ADAPTACJA MOBILNA
   ========================================================================== */
@media (max-width: 1024px) {
  .certs-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

@media (max-width: 860px) {
  /* Na tabletach i telefonach pigułki w poziomym suwaku bez zawijania! */
  .certs-filters {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 6px 20px 18px 20px !important;
    margin: 0 -20px 22px -20px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .certs-filters::-webkit-scrollbar {
    display: none !important;
  }

  .certs-filter-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 9px 18px !important;
  }

  /* Dotykowy, elegancko wyśrodkowany snap-track 4 certyfikatów (Screenshot nr 3) */
  .certs-grid:not(.is-expanded) {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 16px !important;
    padding-top: 10px !important;
    padding-bottom: 22px !important;
    /* Eleganckie odsunięcie od lewej krawędzi — karta jest wyśrodkowana z podglądem kolejnej z prawej */
    padding-left: calc(50vw - (clamp(240px, 72vw, 275px) / 2)) !important;
    padding-right: calc(50vw - (clamp(240px, 72vw, 275px) / 2)) !important;
    margin-left: calc(-1 * clamp(20px, 3.5vw, 44px)) !important;
    margin-right: calc(-1 * clamp(20px, 3.5vw, 44px)) !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    scroll-padding-left: calc(50vw - (clamp(240px, 72vw, 275px) / 2)) !important;
    scroll-padding-right: calc(50vw - (clamp(240px, 72vw, 275px) / 2)) !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .certs-grid:not(.is-expanded)::-webkit-scrollbar {
    display: none !important;
  }

  .certs-grid:not(.is-expanded) .cert-card {
    flex: 0 0 clamp(240px, 72vw, 275px) !important;
    max-width: 275px !important;
    width: clamp(240px, 72vw, 275px) !important;
    scroll-snap-align: center !important;
    scroll-snap-stop: normal !important;
  }

  /* Lekka, subtelna i płynna mikro-animacja wejścia na telefonach (bez ciężkiego blura, skali i sprężynowania) */
  .cert-card.anim-in {
    animation: certCardMobileFadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) backwards !important;
    animation-delay: calc(var(--card-index, 0) * 40ms) !important;
    will-change: opacity, transform !important;
  }

  @keyframes certCardMobileFadeIn {
    0% {
      opacity: 0;
      transform: translateY(12px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .cert-card.anim-out {
    animation: certCardMobileFadeOut 0.16s ease-out forwards !important;
  }

  @keyframes certCardMobileFadeOut {
    0% {
      opacity: 1;
      transform: translateY(0);
    }
    100% {
      opacity: 0;
      transform: translateY(-6px);
    }
  }

  /* Wyłączenie ciężkiego efektu rozbłysku (shimmer sweep) na telefonach dla 120fps/60fps */
  .cert-card::before,
  .cert-card.anim-in::before {
    display: none !important;
    animation: none !important;
  }

  /* Wyłączenie pulsowania cienia aktywnej pigułki na telefonach */
  .certs-filter-btn.active {
    animation: none !important;
    box-shadow: 0 4px 14px rgba(64, 13, 28, 0.28) !important;
  }

  /* Wyłączenie ciężkiego efektu hover na urządzeniach dotykowych */
  .cert-card:hover {
    transform: none !important;
    box-shadow: 0 4px 20px rgba(45, 12, 21, 0.04) !important;
    border-color: rgba(64, 13, 28, 0.09) !important;
  }

  .cert-card:active {
    transform: scale(0.985) !important;
    transition: transform 0.14s ease !important;
  }

  .cert-card-media {
    aspect-ratio: 1 / 1.2 !important;
    padding: 10px !important;
  }

  .cert-card-media img {
    max-height: 220px !important;
  }

  .cert-card-body {
    padding: 14px 16px 16px !important;
  }

  .cert-card-title {
    font-size: 15px !important;
    line-height: 1.35 !important;
    margin: 4px 0 6px 0 !important;
  }

  .certs-mobile-dots {
    display: flex !important;
    margin: 8px auto 24px auto !important;
  }

  /* Po rozwinięciu na telefonie: przejrzysty grid 2-kolumnowy */
  .certs-grid.is-expanded {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

@media (max-width: 540px) {
  .certs-kicker {
    font-size: 10px !important;
    letter-spacing: 0.16em !important;
    margin-bottom: 12px !important;
  }

  .certs-kicker::before,
  .certs-kicker::after {
    width: 14px !important;
  }

  .certs-title {
    font-size: clamp(28px, 8vw, 36px) !important;
    margin-bottom: 12px !important;
  }

  .certs-lead {
    font-size: 14px !important;
    line-height: 1.65 !important;
  }

  .certs-filter-btn {
    font-size: 11.5px !important;
    padding: 8px 16px !important;
  }

  .certs-grid:not(.is-expanded) .cert-card {
    flex: 0 0 74vw !important;
    max-width: 260px !important;
  }

  .certs-grid.is-expanded {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .btn-certs-show-all {
    font-size: 11.5px !important;
    padding: 13px 26px !important;
    width: 100% !important;
    max-width: 320px !important;
  }
}

/* ==========================================================================
   LIGHTBOX MODAL — ROYAL BURGUNDY ACCENTS & GŁĘBOKIE ROZMYCIE
   ========================================================================== */
.certs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.certs-lightbox.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.certs-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 8, 12, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.certs-lightbox-panel {
  position: relative;
  z-index: 2;
  background: #FFFFFF;
  border-radius: 20px;
  max-width: 980px;
  width: 100%;
  max-height: 92vh;
  box-shadow: 0 28px 72px rgba(45, 12, 21, 0.45);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: certModalPop 0.34s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes certModalPop {
  0% {
    opacity: 0;
    transform: scale(0.93) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 820px) {
  .certs-lightbox-panel {
    grid-template-columns: 1fr;
    max-height: 92vh;
    overflow-y: auto;
  }
}

.certs-lightbox-media {
  background: linear-gradient(180deg, #FAF8F5 0%, #F3EEE7 100%);
  padding: clamp(18px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 360px;
}

.certs-lightbox-media img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 32px rgba(45, 12, 21, 0.16);
  background: #FFFFFF;
}

.certs-lightbox-content {
  padding: clamp(24px, 3.5vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #FFFFFF;
}

.certs-lightbox-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.certs-lightbox-cat {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #400D1C;
  background: rgba(64, 13, 28, 0.08);
  padding: 4px 12px;
  border-radius: 9999px;
}

.certs-lightbox-counter {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 12px;
  color: #8C7F81;
  font-weight: 600;
}

.certs-lightbox-title {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
  font-weight: 600;
  color: #170A0F;
  margin: 0 0 12px 0;
}

.certs-lightbox-issuer {
  font-family: 'Jost', sans-serif !important;
  font-size: 14px;
  font-weight: 600;
  color: #400D1C;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.certs-lightbox-location {
  font-family: 'Jost', sans-serif !important;
  font-size: 13px;
  color: #777777;
  margin: 0 0 16px 0;
}

.certs-lightbox-desc {
  font-family: 'Jost', sans-serif !important;
  font-size: 14px;
  line-height: 1.72;
  color: #4A4244;
  margin: 0 0 20px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(64, 13, 28, 0.08);
}

.certs-lightbox-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid rgba(64, 13, 28, 0.08);
  margin-top: auto;
}

.certs-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FAF6F3;
  color: #2D0C15;
  border: 1px solid rgba(64, 13, 28, 0.12);
  font-family: 'Montserrat', sans-serif !important;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.certs-nav-btn:hover:not(:disabled) {
  background: #400D1C;
  color: #F8F1E7;
  border-color: #400D1C;
}

.certs-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.certs-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(64, 13, 28, 0.12);
  color: #400D1C;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.28s ease;
  box-shadow: 0 4px 14px rgba(45, 12, 21, 0.12);
}

.certs-lightbox-close:hover {
  background: #400D1C;
  color: #F8F1E7;
  transform: rotate(90deg);
}

/* --- MOBILE QA PASS: pola dotyku min. 44px --- */
@media (max-width: 860px), (pointer: coarse) {
  .certs-filter-btn {
    min-height: 44px;
  }
  .certs-dot {
    position: relative;
  }
  .certs-dot::after {
    content: '';
    position: absolute;
    inset: -18px -6px;
  }
}

@media (max-width: 860px) {
  .certs-kicker {
    font-size: 11px !important;
  }
}
