/* Wortmann Produktkatalog – Quattlender IT Solutions */
/* CI: #1c1b1a (dunkel), #004f9f (blau), #0bbbef (akzent), #f5f5f5 (bg) */

#qits-katalog {
  font-family: 'Gotham Pro', system-ui, -apple-system, sans-serif;
  color: #1c1b1a;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

/* ── Header ── */
.kat-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #004f9f;
}
.kat-header h2 {
  font-size: 1.6rem;
  margin: 0;
  color: #004f9f;
  flex-shrink: 0;
}
.kat-search {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  position: relative;
}
.kat-search input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color .2s;
  box-sizing: border-box;
}
.kat-search input:focus {
  outline: none;
  border-color: #004f9f;
}
.kat-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: #999;
  pointer-events: none;
}
.kat-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.kat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 2px solid #004f9f;
  border-radius: 6px;
  background: #fff;
  color: #004f9f;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.kat-btn:hover {
  background: #004f9f;
  color: #fff;
}
.kat-btn.active {
  background: #004f9f;
  color: #fff;
}
.kat-btn-accent {
  border-color: #0bbbef;
  color: #0bbbef;
}
.kat-btn-accent:hover, .kat-btn-accent.active {
  background: #0bbbef;
  color: #fff;
}

/* ── Layout ── */
.kat-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ── Sidebar ── */
.kat-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 12px 0;
}
.kat-sidebar::-webkit-scrollbar { width: 4px; }
.kat-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.kat-sidebar-group {
  margin-bottom: 4px;
}
.kat-sidebar-group-title {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.kat-sidebar-group-title:hover { color: #004f9f; }
.kat-sidebar-group-title .arrow {
  font-size: 0.65rem;
  transition: transform .2s;
}
.kat-sidebar-group.collapsed .kat-sidebar-items { display: none; }
.kat-sidebar-group.collapsed .arrow { transform: rotate(-90deg); }
.kat-sidebar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px 6px 24px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #444;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.kat-sidebar-item:hover {
  background: #f0f7ff;
  color: #004f9f;
}
.kat-sidebar-item.active {
  background: #e8f2ff;
  color: #004f9f;
  font-weight: 600;
  border-left-color: #004f9f;
}
.kat-sidebar-count {
  font-size: 0.78rem;
  color: #999;
  background: #f0f0f0;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}
.kat-sidebar-item.active .kat-sidebar-count {
  background: #004f9f;
  color: #fff;
}

/* ── Main Content ── */
.kat-main {
  flex: 1;
  min-width: 0;
}

/* ── Toolbar ── */
.kat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}
.kat-toolbar-info {
  font-size: 0.9rem;
  color: #666;
}
.kat-toolbar-info strong { color: #1c1b1a; }
.kat-toolbar-sort select {
  padding: 6px 28px 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.88rem;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* ── Produkt-Grid ── */
.kat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Produkt-Card ── */
.kat-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.kat-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.kat-card-img {
  position: relative;
  aspect-ratio: 4/3;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout;
}
.kat-card-img img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  width: auto;
  height: auto;
}
.kat-card-img .no-img {
  font-size: 2.5rem;
  color: #ddd;
}
.kat-card-img .placeholder-img {
  max-width: 70%;
  max-height: 70%;
  opacity: 0.8;
}
.kat-card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kat-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kat-badge-promo {
  background: #0bbbef;
  color: #fff;
}
.kat-badge-cat {
  background: #004f9f;
  color: #fff;
}
.kat-card-ampel {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.ampel-gruen { background: #22c55e; }
.ampel-gelb { background: #f59e0b; }
.ampel-rot { background: #ef4444; }

.kat-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.kat-card-hersteller {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.kat-card-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kat-card-specs {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.kat-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
}
.kat-card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #004f9f;
}
.kat-card-price small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: #999;
}
.kat-card-ampel-text {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kat-card-ampel-text .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ── Pagination ── */
.kat-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 24px 0;
}
.kat-page-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #444;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all .15s;
}
.kat-page-btn:hover { border-color: #004f9f; color: #004f9f; }
.kat-page-btn.active {
  background: #004f9f;
  color: #fff;
  border-color: #004f9f;
}
.kat-page-btn:disabled {
  opacity: .4;
  cursor: default;
}
.kat-page-dots { padding: 0 4px; color: #999; }

/* ── Kategorie-Übersicht (Startseite) ── */
.kat-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.kat-overview-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.kat-overview-card:hover {
  border-color: #004f9f;
  box-shadow: 0 2px 8px rgba(0,79,159,.12);
}
.kat-overview-card h3 {
  font-size: 0.95rem;
  margin: 0 0 4px;
  color: #1c1b1a;
}
.kat-overview-card .count {
  font-size: 0.82rem;
  color: #888;
}

/* ── Detailansicht ── */
.kat-detail {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 24px;
  text-align: left;
}
.kat-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #004f9f;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  cursor: pointer;
}
.kat-detail-back:hover { text-decoration: underline; }
.kat-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.kat-detail-gallery {
  background: #f8f8f8;
  border-radius: 8px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout;
}
.kat-detail-gallery img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  width: auto;
  height: auto;
}
.kat-detail-gallery .no-img {
  font-size: 4rem;
  color: #ddd;
}
.kat-detail-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
}
.kat-detail-thumb {
  width: 60px;
  height: 60px;
  border: 2px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
}
.kat-detail-thumb.active { border-color: #004f9f; }
.kat-detail-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.kat-detail-info h2.kat-detail-name,
.kat-detail-info h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
  color: #1c1b1a;
}
.kat-detail-hersteller {
  font-size: 0.88rem;
  color: #888;
  margin-bottom: 16px;
}
.kat-detail-price-box {
  background: #f0f7ff;
  border: 1px solid #d0e3f7;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.kat-detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: #004f9f;
}
.kat-detail-price-netto {
  font-size: 0.88rem;
  color: #666;
  margin-top: 2px;
}
.kat-detail-ampel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.88rem;
}
.kat-detail-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #004f9f;
  color: #fff;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
  margin-bottom: 20px;
}
.kat-detail-cta:hover { background: #003d7a; }
.kat-detail-meta {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 20px;
}
.kat-detail-meta span { margin-right: 16px; }
.kat-detail-specs {
  border-top: 1px solid #e5e5e5;
  padding-top: 16px;
}
.kat-detail-specs h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: #004f9f;
}
.kat-detail-specs-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #444;
  white-space: pre-line;
}
.kat-detail-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.85rem;
}
.kat-detail-specs-table tr:nth-child(even) { background: #f8f8f8; }
.kat-detail-specs-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
}
.kat-detail-specs-table td:first-child {
  font-weight: 600;
  color: #666;
  width: 35%;
}

.kat-detail-html table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.kat-detail-html td, .kat-detail-html th {
  padding: 5px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
.kat-detail-html tr:nth-child(even) { background: #f8f8f8; }
.kat-detail-html strong { color: #444; }

/* ── Promotion Banner (Produktdetail) ── */
.kat-promo-banner {
  background: #0bbbef;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
}
.kat-promo-banner strong {
  font-weight: 700;
}
.kat-promo-banner span {
  font-size: 0.82rem;
  opacity: 0.9;
}

/* ── Promotion Group (Aktionsseite) ── */
.kat-promo-group {
  margin-bottom: 32px;
}
.kat-promo-group-header {
  background: linear-gradient(135deg, #004f9f 0%, #0bbbef 100%);
  color: #fff;
  padding: 16px 20px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}
.kat-promo-group-header h3 {
  font-size: 1.1rem;
  margin: 0 0 4px;
  font-weight: 700;
}
.kat-promo-group-dates {
  font-size: 0.85rem;
  opacity: 0.9;
  display: block;
  margin-bottom: 4px;
}
.kat-promo-group-count {
  font-size: 0.78rem;
  opacity: 0.7;
}
.kat-promo-group .kat-grid {
  border: 1px solid #e5e5e5;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  background: #fafafa;
}

/* ── Loading / Empty ── */
.kat-loading, .kat-empty {
  text-align: center;
  padding: 48px 16px;
  color: #888;
  font-size: 1rem;
}
.kat-loading::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: 16px auto 0;
  border: 3px solid #e5e5e5;
  border-top-color: #004f9f;
  border-radius: 50%;
  animation: kat-spin .8s linear infinite;
}
@keyframes kat-spin { to { transform: rotate(360deg); } }

/* ── Breadcrumb ── */
.kat-breadcrumb {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 16px;
}
.kat-breadcrumb a {
  color: #004f9f;
  text-decoration: none;
  cursor: pointer;
}
.kat-breadcrumb a:hover { text-decoration: underline; }
.kat-breadcrumb .sep { margin: 0 6px; }

/* ── Disclaimer ── */
.kat-disclaimer {
  margin-top: 32px;
  padding: 16px;
  background: #f8f8f8;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
}

/* ── Mobile Sidebar Toggle ── */
.kat-mobile-toggle {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .kat-grid { grid-template-columns: repeat(2, 1fr); }
  .kat-sidebar { width: 220px; }
}

@media (max-width: 768px) {
  #qits-katalog { padding: 0 12px; overflow-x: hidden; max-width: 100vw; box-sizing: border-box; }
  .kat-layout { flex-direction: column; }
  .kat-main { max-width: 100%; overflow-x: hidden; }
  .kat-detail-specs-table { display: block; overflow-x: auto; }
  .kat-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    display: none;
  }
  .kat-sidebar.open { display: block; }
  .kat-mobile-toggle {
    display: inline-flex;
  }
  .kat-grid { grid-template-columns: 1fr; }
  .kat-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .kat-search { flex: 1; min-width: 150px; max-width: none; }
  .kat-header-actions { width: 100%; }
  .kat-header-actions .kat-btn { flex: 1; justify-content: center; }
  .kat-detail { padding: 16px; overflow: hidden; }
  .kat-detail-layout { grid-template-columns: 1fr; gap: 20px; }
  .kat-detail-gallery { aspect-ratio: 4/3; }
  .kat-detail-thumbs { flex-wrap: wrap; }
  .kat-detail-info { overflow-wrap: break-word; word-break: break-word; }
  .kat-detail-info h1 { font-size: 1.2rem; }
  .kat-detail-price { font-size: 1.4rem; }
  .kat-detail-cta { width: 100%; justify-content: center; box-sizing: border-box; }
  .kat-detail-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .kat-detail-meta span { margin-right: 0; }
  .kat-detail-html { overflow-x: auto; }
  .kat-detail-specs-text { word-break: break-word; }
  .kat-toolbar { padding: 8px 12px; }
  .kat-overview { grid-template-columns: repeat(2, 1fr); }
  .kat-breadcrumb { margin-bottom: 12px; }
}

@media (max-width: 480px) {
  .kat-overview { grid-template-columns: 1fr; }
  .kat-detail-info h1 { font-size: 1.1rem; }
}

/* ── Nicht retournierbar ── */
.kat-detail-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-top: 12px;
}

/* ── Lizenztyp ── */
.kat-detail-license {
  background: #e8f4fd;
  color: #004f9f;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-top: 8px;
}

/* ── Naechste Lieferung ── */
.kat-detail-delivery {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-top: 8px;
}
