:root {
  --primary: #0066cc;
  --primary-hover: #0052a3;
  --primary-light: #e8f2fc;
  --primary-glow: rgba(0, 102, 204, 0.25);
  --secondary: #10b981;
  --dark-bg: #0f172a;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 16px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.12);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface-alt);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Header */
.app-header {
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  padding-bottom: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  user-select: none;
  cursor: pointer;
}

.brand-badge {
  background: linear-gradient(135deg, #0052a3, #0080ff);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* Search Bar */
.search-container {
  flex: 1;
  max-width: 440px;
  margin: 0 1.5rem;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 2.6rem;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: 9999px;
  font-size: 0.92rem;
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

.search-input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  display: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 2px 6px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--surface-border);
}

.btn-outline:hover {
  background: var(--surface-alt);
  border-color: var(--text-muted);
}

.btn-back {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--surface-border);
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  font-weight: 600;
}

.btn-back:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Breadcrumb Navigation */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  font-size: 0.9rem;
}

.breadcrumb-item {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb-item:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 700;
  cursor: default;
  text-decoration: none;
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-size: 0.8rem;
  user-select: none;
}

/* Context Banner */
.context-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.context-banner::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.3) 0%, rgba(0, 102, 204, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.context-img-wrapper {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.context-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.context-details {
  flex: 1;
  z-index: 1;
}

.context-badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.context-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.context-desc {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.5;
  white-space: pre-line;
  max-height: 120px;
  overflow-y: auto;
}

/* Navigation Controls Bar */
.nav-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.items-counter {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Grid & Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.catalog-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
}

.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.catalog-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.card-media {
  position: relative;
  width: 100%;
  height: 210px;
  border-bottom: 1px solid var(--surface-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Categorie e Sottocategorie: immagine a tutto spazio (cover) */
.card-category .card-media,
.card-subcategory .card-media {
  padding: 0;
  background: #f1f5f9;
}

.card-category .card-img,
.card-subcategory .card-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.catalog-card:hover.card-category .card-img,
.catalog-card:hover.card-subcategory .card-img {
  transform: scale(1.05);
}

/* Prodotti: immagine tecnica intera (contain) con sfondo studio e respiro */
.card-product .card-media {
  background: #ffffff;
  padding: 0.85rem;
}

.card-product .card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.04));
}

.catalog-card:hover.card-product .card-img {
  transform: scale(1.06);
}

.card-img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  color: #94a3b8;
  font-size: 2.5rem;
}

.card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card-badge.badge-pdf {
  background: rgba(220, 38, 38, 0.85);
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  transition: all 0.2s ease;
}

.card-description.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  max-height: none;
}

.btn-toggle-desc {
  background: var(--primary-light);
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  align-self: flex-start;
  border-radius: 9999px;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn-toggle-desc:hover {
  background: #dbeafe;
  color: var(--primary-hover);
}

.catalog-section-title {
  grid-column: 1 / -1;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid var(--surface-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.catalog-section-title:first-child {
  margin-top: 0;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-action-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.catalog-card:hover .card-action-text {
  color: var(--primary-hover);
}

/* Empty State / Welcome Screen */
.welcome-screen {
  background: var(--surface);
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  max-width: 680px;
  margin: 3rem auto;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.welcome-screen.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.welcome-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.folder-select-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.info-banner {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
}

/* In-App PDF Viewer */
.pdf-viewer-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #1e293b;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
}

.pdf-toolbar {
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-bottom: 8px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  gap: 0.75rem;
  flex-shrink: 0;
}

.pdf-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.pdf-title-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pdf-product-name {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f8fafc;
}

.pdf-file-name {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.pdf-frame-container {
  flex: 1;
  width: 100%;
  height: calc(100vh - 64px - env(safe-area-inset-top, 0px));
  position: relative;
  background: #334155;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #525659;
}

.pdf-fallback-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  max-width: 450px;
  padding: 2rem;
  background: #0f172a;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* Search Dropdown / Live Results */
.search-results-overlay {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.15s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--primary-light);
}

.search-result-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #e2e8f0;
  color: #475569;
}

.search-result-badge.badge-product {
  background: #fee2e2;
  color: #b91c1c;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.search-result-path {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile & Tablet Optimizations */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-bottom: 0.75rem;
    gap: 0.6rem;
    min-height: auto;
  }
  .brand-section {
    order: 1;
  }
  .header-actions {
    order: 2;
  }
  .search-container {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 0.25rem 0 0 0;
  }
  .brand-subtitle, .catalog-status-text {
    display: none;
  }
  .main-content {
    padding: 1rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0px));
  }
  .context-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    gap: 1rem;
  }
  .context-img-wrapper {
    width: 70px;
    height: 70px;
  }
  .context-title {
    font-size: 1.25rem;
  }
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
  .card-media {
    height: 175px;
  }
  .card-product .card-media {
    padding: 0.65rem;
  }
  .pdf-toolbar {
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    padding-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.6rem;
    height: auto;
  }
  .pdf-toolbar-left {
    width: 100%;
    justify-content: space-between;
  }
  .pdf-toolbar-right {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .card-media {
    height: 195px;
  }
  .card-body {
    padding: 1.1rem;
  }
  .card-title {
    font-size: 1.1rem;
  }
  .breadcrumb-bar {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   Showcase / Promo Video Modal Styles (Interactive Kiosk & MP4 Player)
   ========================================================================== */

.showcase-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: radial-gradient(circle at 50% 40%, #0f172a 0%, #030712 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top, 16px)) max(20px, env(safe-area-inset-right, 20px)) max(16px, env(safe-area-inset-bottom, 16px)) max(20px, env(safe-area-inset-left, 20px));
  overflow: hidden;
  user-select: none;
  animation: showcaseFadeIn 0.35s ease-out;
}

@keyframes showcaseFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Header */
.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex-shrink: 0;
  z-index: 20;
}

.showcase-brand-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.showcase-badge {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

.showcase-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.showcase-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.showcase-mode-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 2px;
  margin-right: 0.5rem;
}

.showcase-mode-switch .mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.showcase-mode-switch .mode-btn.active {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.3);
}

.showcase-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.showcase-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.showcase-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* Stage Area */
.showcase-stage-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.showcase-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.showcase-slide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  width: 100%;
  max-width: 1150px;
  align-items: center;
  padding: 2.2rem 2.8rem;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: slideFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  margin: auto auto;
}

.showcase-slide.has-qr-below {
  margin: auto auto 0 auto;
}

@keyframes slideFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Media Box & Ken Burns Effect */
.showcase-media-box {
  position: relative;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.showcase-img-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.showcase-img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
  animation: kenBurns 12s infinite alternate ease-in-out;
  transition: opacity 0.4s ease, filter 0.3s ease;
}

@keyframes kenBurns {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.06) translate(-1%, -1.5%); }
  100% { transform: scale(1.02) translate(1%, 1%); }
}

/* Content Box */
.showcase-content-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.showcase-category {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.showcase-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.showcase-tagline {
  font-size: 1.05rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.showcase-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.showcase-bullets li {
  font-size: 0.95rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.showcase-bullets li::before {
  content: '✓';
  color: #38bdf8;
  font-weight: bold;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.showcase-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.showcase-actions .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.showcase-actions .btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
}

.showcase-actions .btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-2px);
}

.showcase-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Video Player View */
.showcase-video {
  width: 100%;
  max-width: 960px;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  outline: none;
}

/* Floating QR Code VCard (Centered midway between Product Card and Player Controls) */
.showcase-qr-card {
  align-self: center;
  margin: auto auto;
  display: inline-flex;
  align-items: center;
  gap: 1.6rem;
  padding: 1.15rem 2.2rem 1.15rem 1.4rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65), 0 0 32px rgba(56, 189, 248, 0.28);
  animation: qrCardSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
  z-index: 25;
  cursor: pointer;
  flex-shrink: 0;
}

.showcase-qr-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.75), 0 0 38px rgba(56, 189, 248, 0.45);
}

@keyframes qrCardSlideUp {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.showcase-qr-box {
  width: 126px;
  height: 126px;
  background: #ffffff;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.showcase-qr-box img,
.showcase-qr-box canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.showcase-qr-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.showcase-qr-badge {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.showcase-qr-badge::before {
  content: '📱';
  font-size: 1.05rem;
}

.showcase-qr-title {
  font-size: 1.38rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.showcase-qr-url {
  font-size: 0.98rem;
  color: #94a3b8;
  text-decoration: none;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.showcase-qr-card:hover .showcase-qr-url {
  color: #38bdf8;
  text-decoration: underline;
}

/* Floating Player Bar */
.showcase-player-bar {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 0.85rem 1.4rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  z-index: 20;
}

/* Timeline */
.showcase-timeline {
  display: flex;
  gap: 6px;
  height: 6px;
  width: 100%;
  cursor: pointer;
  align-items: center;
}

.timeline-segment {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  transition: height 0.2s ease;
}

.showcase-timeline:hover .timeline-segment {
  height: 6px;
}

.segment-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: #38bdf8;
  border-radius: 2px;
}

.timeline-segment.completed .segment-fill {
  width: 100% !important;
  background: #38bdf8;
}

.timeline-segment.active .segment-fill {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

/* Controls Row */
.showcase-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.showcase-ctrls-left,
.showcase-ctrls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.06);
}

.ctrl-play {
  width: 42px;
  height: 42px;
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  font-size: 1.05rem;
}

.ctrl-play:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
}

.ctrl-text {
  width: auto;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.ctrl-text.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.showcase-time {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-left: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.showcase-current-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  text-align: center;
}

/* Responsive Rules for Showcase Modal */
@media (max-width: 900px) {
  .showcase-slide {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 520px;
    padding: 1.4rem;
    max-height: 82vh;
    overflow-y: auto;
  }
  .showcase-media-box {
    height: 230px;
  }
  .showcase-title {
    font-size: 1.8rem;
  }
  .showcase-tagline {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }
  .showcase-bullets {
    margin-bottom: 1.25rem;
    gap: 0.4rem;
  }
  .showcase-bullets li {
    font-size: 0.88rem;
  }
  .showcase-current-label {
    display: none;
  }
}

@media (max-width: 500px) {
  .showcase-modal {
    padding: max(10px, env(safe-area-inset-top, 10px)) 12px max(10px, env(safe-area-inset-bottom, 10px)) 12px;
  }
  .showcase-slide {
    padding: 1rem 0.85rem;
    border-radius: 18px;
    gap: 1rem;
  }
  .showcase-media-box {
    height: 180px;
  }
  .showcase-title {
    font-size: 1.5rem;
  }
  .showcase-actions {
    flex-direction: column;
    width: 100%;
  }
  .showcase-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .showcase-qr-card {
    padding: 0.65rem 1.1rem 0.65rem 0.85rem;
    gap: 0.9rem;
    margin: 0.6rem auto;
  }
  .showcase-qr-box {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    padding: 5px;
  }
  .showcase-qr-title {
    font-size: 1.1rem;
  }
  .showcase-qr-url {
    max-width: 190px;
    font-size: 0.82rem;
  }
  .showcase-player-bar {
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
  }
  .showcase-time {
    display: none;
  }
}

/* ==========================================================================
   Showcase Configuration Modal & GUI Styles
   ========================================================================== */

.config-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: configFadeIn 0.25s ease-out;
}

@keyframes configFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.config-panel {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 980px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  color: #ffffff;
}

/* Config Header */
.config-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  flex-shrink: 0;
  background: #111e38;
}

.config-header-left {
  display: flex;
  flex-direction: column;
}

.config-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.config-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
}

.config-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.config-header-right .btn {
  padding: 0.48rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.config-modal .btn-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  font-weight: 600;
}

.config-modal .btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #38bdf8;
  color: #38bdf8 !important;
  transform: translateY(-1px);
}

/* Config Tabs */
.config-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.config-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.config-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.config-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* Config Body */
.config-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.config-tab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
}

.config-tab-pane.active {
  display: flex;
}

.config-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.config-pane-desc {
  font-size: 0.88rem;
  color: #94a3b8;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.btn-text-danger:hover {
  text-decoration: underline;
}

/* Tab 1: Selected Items List */
.config-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.config-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.config-item-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.config-order-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.btn-order {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-order:hover:not(:disabled) {
  background: #38bdf8;
  color: #0f172a;
}

.btn-order:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.config-item-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
  flex-shrink: 0;
}

.config-item-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.config-item-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-item-model-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.config-item-category-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.btn-delete-item {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-item:hover {
  background: #ef4444;
  color: white;
}

.config-input,
.config-textarea,
.config-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.86rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.config-input:focus,
.config-textarea:focus,
.config-select:focus {
  outline: none;
  border-color: #38bdf8;
}

.config-textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
}

.config-field-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

/* Tab 2: Add Products Grid */
.config-search-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.config-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.config-catalog-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.config-catalog-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.config-catalog-card-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.config-catalog-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-catalog-card-cat {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-add-product {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-add-product:hover:not(:disabled) {
  background: #38bdf8;
  color: #0f172a;
}

.btn-add-product:disabled {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #64748b;
  cursor: default;
}

/* Tab 3: Background Options */
.bg-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.bg-card {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.bg-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.bg-card input[type="radio"] {
  display: none;
}

.bg-card.selected,
.bg-card:has(input[type="radio"]:checked) {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.bg-preview {
  height: 80px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-size: cover !important;
  background-position: center !important;
}

.color-picker-row,
.image-upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.config-timing-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.config-target-label {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #cbd5e1;
}

.config-target-label:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.config-target-label:has(input[type="radio"]:checked) {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}


