/* ═══════════════════════════════════════════════════════════
   FLIPBOOK POPUP - KOMPLETTE STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── OVERLAY & CONTAINER ── */

.flipbook-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow: visible !important;
}

.flipbook-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.flipbook-container {
  position: relative;
  width: 95%;
  max-width: 1240px;
  height: auto;
  background: transparent;
  border-radius: 0;
  overflow: visible !important;
  box-shadow: none;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.flipbook-overlay.is-open .flipbook-container { transform: scale(1); }

.flipbook-close {
  position: absolute;
  top: -16px; right: -16px;
  z-index: 100001;
  width: 40px; height: 40px;
  border: none;
  background: rgba(220, 38, 38, 0.95);
  color: white;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.flipbook-close:hover {
  background: #dc2626;
  transform: rotate(90deg) scale(1.1);
}

.flipbook-iframe {
  width: 100%;
  height: min(640px, 85vh);
  border: none;
  background: transparent;
  display: block;
  overflow: visible !important;
}

@media (max-width: 1200px) {
  .flipbook-iframe { height: min(600px, 85vh); }
}

/* ── MOBILE ── */

@media (max-width: 768px) {
  .flipbook-overlay {
    align-items: flex-start;
    padding: 0;
    overflow: hidden;
  }

  .flipbook-container {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    padding: 0; margin: 0;
    transform: none !important;
  }

  .flipbook-overlay.is-open .flipbook-container { transform: none !important; }

  .flipbook-iframe {
    height: 100dvh !important;
    width: 100vw !important;
  }

  .flipbook-close { display: none !important; }

  /* Config Summary - Mobile */
  .config-summary { padding: 16px 20px; }

  .config-count {
    font-size: 1.2rem;
    margin-bottom: 24px;
  }

  .config-categories { max-width: 100%; gap: 20px; }
  .config-cat h4     { font-size: 0.7rem; }

  .config-cat li {
    font-size: 0.75rem;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .config-summary { padding: 12px 16px; }
  .config-count   { font-size: 1rem; }
  .config-cat h4  { font-size: 0.65rem; }
  .config-cat li  { font-size: 0.7rem; padding: 5px 8px; }
}

/* ── CONFIG SUMMARY ── */

.config-summary {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Count — Cormorant Garamond */
.config-count {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: var(--weight-h3);
  font-style: normal;
  color: #B08D57;
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(176, 141, 87, 0.25);
  width: 100%;
}

.config-categories {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 28px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 650px;
}

.config-cat {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

/* Category heading — Inter */
.config-cat h4 {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  color: #B08D57;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  text-align: left;
  padding-bottom: 8px;
  border-bottom: 1.5px solid rgba(176, 141, 87, 0.2);
}

.config-cat ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

/* Items — Inter */
.config-cat li {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: var(--weight-body);
  color: #2c2416;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(176, 141, 87, 0.25);
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(176, 141, 87, 0.08);
}

.config-cat li:hover {
  background: rgba(176, 141, 87, 0.15);
  border-color: #B08D57;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(176, 141, 87, 0.15);
}

/* Edit button — Inter */
.btn-edit-config {
  width: 100%;
  padding: 10px 16px;
  background: rgba(176, 141, 87, 0.1);
  border: 1.5px solid rgba(176, 141, 87, 0.3);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-button);
  color: #B08D57;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-config:hover {
  background: rgba(176, 141, 87, 0.15);
  border-color: #B08D57;
}

/* ── DARK MODE ── */

html[data-theme="dim"] .config-count {
  color: #ffffff;
  border-bottom-color: rgba(176, 141, 87, 0.3);
}

html[data-theme="dim"] .config-cat h4 {
  color: #e8d4b0;
  border-bottom-color: rgba(176, 141, 87, 0.25);
}

html[data-theme="dim"] .config-cat li {
  color: #ffffff;
  background: rgba(176, 141, 87, 0.12);
  border-color: rgba(176, 141, 87, 0.3);
}

html[data-theme="dim"] .config-cat li:hover {
  background: rgba(176, 141, 87, 0.2);
  color: #ffffff;
}

html[data-theme="dim"] .btn-edit-config {
  background: rgba(176, 141, 87, 0.15);
  border-color: rgba(176, 141, 87, 0.4);
  color: #e8d4b0;
}

html[data-theme="dim"] .btn-edit-config:hover {
  border-color: #B08D57;
  color: #ffffff;
}