/* PMW Konfigurator Styles */

#pmw-konfigurator { font-family: inherit; position: relative; }

/* Sticky Header */
#pmw-header {
    position: sticky; top: 0; z-index: 100;
    background: #2c2c2c; color: #fff;
    padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
}

#pmw-box-buttons { display: flex; gap: 8px; }

#pmw-size-toggle {
    background: transparent; border: 2px solid #666; color: #ccc;
    border-radius: 6px; padding: 6px 14px; cursor: pointer;
    text-align: center; line-height: 1.3; font-size: 11px;
    transition: border-color 0.15s, background 0.15s;
}
#pmw-size-toggle:hover { border-color: #999; color: #fff; }

.pmw-box-btn {
    background: transparent; border: 2px solid #666; color: #ccc;
    border-radius: 6px; padding: 6px 14px; cursor: pointer;
    text-align: center; line-height: 1.3;
    transition: border-color 0.15s, background 0.15s;
}
.pmw-box-btn:hover { border-color: #999; color: #fff; }
.pmw-box-btn.pmw-box-active { border-color: #4a90d9; background: #1a3a5c; color: #fff; }
.pmw-box-label { display: block; font-weight: bold; font-size: 14px; }
.pmw-box-limit { display: block; font-size: 11px; opacity: 0.8; }

#pmw-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#pmw-counter { font-size: 15px; font-weight: bold; min-width: 120px; }

#pmw-btn-auffuellen, #pmw-btn-reset {
    background: #444; color: #ddd; border: 1px solid #666;
    border-radius: 4px; padding: 7px 14px; cursor: pointer; font-size: 13px;
    transition: background 0.15s;
}
#pmw-btn-auffuellen:hover, #pmw-btn-reset:hover { background: #555; color: #fff; }

#pmw-btn-warenkorb {
    background: #4a90d9; color: #fff; border: none;
    border-radius: 4px; padding: 8px 18px; font-size: 13px; font-weight: bold;
    cursor: pointer; transition: background 0.15s, opacity 0.3s;
}
#pmw-btn-warenkorb:hover:not(:disabled) { background: #357abf; }
#pmw-btn-warenkorb:disabled { background: #555; color: #999; cursor: not-allowed; opacity: 0.45; }

/* Kategorie-Filter */
#pmw-filter {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 16px; background: #fafafa; border-bottom: 1px solid #e0e0e0;
}

.pmw-chip {
    background: #f0f0f0; border: 1px solid #ccc; color: #555;
    border-radius: 20px; padding: 5px 13px; font-size: 12px;
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pmw-chip:hover { border-color: #4a90d9; color: #4a90d9; }
.pmw-chip.pmw-chip-active { background: #e8f0fe; border-color: #4a90d9; color: #2c6fba; font-weight: bold; }

/* Karten-Grid */
#pmw-karten-grid { padding: 16px; padding-bottom: 80px; }

.pmw-kategorie-header {
    font-size: 14px; font-weight: bold; color: #333;
    margin: 20px 0 8px; padding-bottom: 5px; border-bottom: 2px solid #e0e0e0;
}
.pmw-kategorie-header:first-child { margin-top: 0; }

.pmw-karten-gruppe {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 8px;
}

/* Card size variants */
#pmw-konfigurator.pmw-size-50 .pmw-karten-gruppe { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

/* Listenansicht */
#pmw-konfigurator.pmw-size-liste .pmw-karten-gruppe { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; }
#pmw-konfigurator.pmw-size-liste .pmw-karte {
    display: flex; align-items: center; border-radius: 4px; padding: 4px 8px;
}
#pmw-konfigurator.pmw-size-liste .pmw-karte-name {
    flex: 1; padding: 0; min-height: 0; font-size: 13px; text-align: left; cursor: pointer;
}
#pmw-konfigurator.pmw-size-liste .pmw-karte-controls { border-top: none; padding: 0; }

/* Einzelne Karte */
.pmw-karte {
    border: 2px solid #ddd; border-radius: 6px; overflow: hidden;
    background: #fff; transition: border-color 0.15s, background 0.15s;
}
.pmw-karte.pmw-karte-selected { border-color: #4a90d9; background: #f0f7ff; }
.pmw-karte.pmw-karte-disabled { opacity: 0.5; }

.pmw-karte-bild { cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden; width: 100%; }
.pmw-karte-img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.pmw-karte-placeholder { background: #e0e0e0; width: 100%; height: 100%; }

.pmw-karte-name {
    padding: 5px 6px; font-size: 11px; text-align: center; cursor: pointer;
    line-height: 1.3; min-height: 30px;
    display: flex; align-items: center; justify-content: center;
}

.pmw-karte-controls {
    display: flex; align-items: center; justify-content: center;
    gap: 5px; padding: 5px; border-top: 1px solid #eee;
}
.pmw-karte-selected .pmw-karte-controls { border-top-color: #d0e4f5; }

.pmw-btn-minus, .pmw-btn-plus {
    width: 24px; height: 24px; border-radius: 4px; border: none;
    font-size: 16px; font-weight: bold; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; padding: 0; box-sizing: border-box;
    transition: background 0.1s;
}
.pmw-btn-minus { background: #e0e0e0; color: #000; }
.pmw-btn-minus:hover:not(:disabled) { background: #ccc; }
.pmw-btn-minus:disabled { background: #f0f0f0; color: #bbb; cursor: not-allowed; }
.pmw-btn-plus  { background: #4a90d9; color: #000; }
.pmw-btn-plus:hover:not(:disabled)  { background: #357abf; }
.pmw-btn-plus:disabled  { background: #ddd; color: #bbb; cursor: not-allowed; }

.pmw-karte-menge { font-size: 14px; font-weight: bold; min-width: 20px; text-align: center; }

/* Bottom-Bar */
#pmw-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
    background: #f5f5f5; border-top: 2px solid #ddd;
    padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
#pmw-bottom-info { font-size: 13px; color: #555; }

#pmw-btn-warenkorb-bottom {
    background: #4a90d9; color: #fff; border: none;
    border-radius: 4px; padding: 10px 22px; font-size: 14px; font-weight: bold;
    cursor: pointer; transition: background 0.15s, opacity 0.3s;
}
#pmw-btn-warenkorb-bottom:hover:not(:disabled) { background: #357abf; }
#pmw-btn-warenkorb-bottom:disabled { background: #aaa; cursor: not-allowed; opacity: 0.45; }

/* Order-Anzeige */
.pmw-karten-liste { margin-top: 6px; font-size: 13px; line-height: 1.7; color: #444; }

/* Fehler */
.pmw-error { color: #c0392b; font-style: italic; }

/* Responsive */
@media (max-width: 480px) {
    #pmw-header { flex-direction: column; align-items: flex-start; }
    #pmw-header-actions { width: 100%; justify-content: space-between; }
    .pmw-karten-gruppe { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
