/* ═══════════════════════════════════════════════════════════════
   TREFSHOP - KOMPLETTE STYLESHEET DATEI
   Version: 2.0 mit allen Verbesserungen
   ═══════════════════════════════════════════════════════════════ */

/* CSS-VARIABLEN - ERWEITERT FÜR ALLE FARBEN */
:root {
    /* Primärfarben */
    --primary-color:       #007bff;
    --primary-hover-color: #0056b3;
    --secondary-color:     #6c757d;
    
    /* Status-Farben */
    --accent-green:        #28a745;
    --accent-green-hover:  #218838;
    --accent-red:          #dc3545;
    --accent-red-hover:    #c82333;
    
    /* Hintergrundfarben */
    --background-light:    #f0f2f5;
    --card-background:     #ffffff;
    --header-background:   #ffffff;
    --footer-background:   #1a1a2e;
    
    /* Textfarben */
    --text-dark:           #1a1a2e;
    --text-light:          #ffffff;
    --text-muted:          #6c757d;
    --price-color:         #007bff;
    
    /* UI-Elemente */
    --border-color:        #dee2e6;
    --shadow-sm:           0 2px 8px rgba(0,0,0,.07);
    --shadow-md:           0 6px 20px rgba(0,0,0,.12);
    --shadow-lg:           0 16px 48px rgba(0,0,0,.18);
    
    /* Radien */
    --radius-sm:           6px;
    --radius-md:           10px;
    --radius-lg:           16px;
    
    /* Sonstiges */
    --font:                'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition:          0.2s ease;
}

/* RESET & BASIS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

img { max-width: 100%; display: block; }

body.modal-open { overflow: hidden; }

/* BUTTONS */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    font-family: var(--font);
    text-decoration: none;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    user-select: none;
}

.button:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.primary-button   { background: var(--primary-color);  color: #fff; }
.primary-button:hover  { background: var(--primary-hover-color); }
.secondary-button { background: var(--secondary-color); color: #fff; }
.secondary-button:hover { background: #5a6268; }
.success-button   { background: var(--accent-green); color: #fff; }
.success-button:hover  { background: var(--accent-green-hover); }
.danger-button    { background: var(--accent-red);   color: #fff; }
.danger-button:hover   { background: var(--accent-red-hover); }

/* FORM-ELEMENTE */
.form-input,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: var(--font);
    color: var(--text-dark);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,123,255,.15);
}

textarea { resize: vertical; min-height: 90px; line-height: 1.55; }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Custom Checkbox */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    transition: background var(--transition), border-color var(--transition);
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 6px; height: 10px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg);
}

/* File-Input */
input[type="file"] {
    padding: 8px 10px;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: #fafafa;
    cursor: pointer;
    color: var(--text-muted);
    font-size: .875rem;
    font-family: var(--font);
}

input[type="file"]:hover { border-color: var(--primary-color); background: #f0f6ff; }

/* Color-Picker Pairing */
.color-pair {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.color-pair:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,123,255,.15);
}

input[type="color"] {
    width: 48px;
    height: 42px;
    border: none;
    border-right: 1.5px solid var(--border-color);
    cursor: pointer;
    padding: 4px;
    background: transparent;
    flex-shrink: 0;
}

.color-hex-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 10px;
    font-family: 'Courier New', monospace;
    font-size: .9rem;
    letter-spacing: .05em;
    background: transparent;
    width: auto;
}

/* Checkbox-Label */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: .95rem;
}

.checkbox-label input[type="checkbox"] { margin-top: 2px; }

/* Form-Group */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text-dark); }
.field-hint { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.field-hint-inline { font-size: .8rem; color: var(--text-muted); font-weight: 400; }
.required { color: var(--accent-red); }
.optional-hint { font-weight: 400; color: var(--text-muted); font-size: .85em; }

/* 2-spaltige Formreihe */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row-2 { grid-template-columns: 1fr; }
}

/* MESSAGE BOX */
.message-box {
    position: fixed;
    top: 24px; left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 280px; max-width: 90vw;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    font-weight: 600; font-size: .95rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: msgIn .3s ease forwards;
}

.message-box.success { background: #d4edda; color: #155724; border: 1px solid #b7dfc4; }
.message-box.error   { background: #f8d7da; color: #721c24; border: 1px solid #f1aeb5; }

@keyframes msgIn { from { opacity:0; top: 0; } to { opacity:1; top: 24px; } }

/* LOADING SPINNER */
.loading-spinner {
    width: 26px; height: 26px;
    border: 3px solid #ddd;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   FRONTEND – HEADER
   ═══════════════════════════════════════════════════════════════ */
.shop-header {
    background: var(--header-background);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px; padding-bottom: 14px;
}

.shop-brand { display: flex; align-items: center; gap: 12px; }
.shop-logo  { height: 48px; width: auto; object-fit: contain; border-radius: var(--radius-sm); }
.shop-name-text { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }

/* ═══════════════════════════════════════════════════════════════
   FRONTEND – HAUPTINHALT & ABSCHNITTE
   ═══════════════════════════════════════════════════════════════ */
.main-area { padding: 36px 0 60px; }

.info-message {
    text-align: center; padding: 32px; color: var(--text-muted); font-size: 1rem;
}

/* Produktabschnitt (wenn Kategorien aktiviert) */
.product-section-group { margin-bottom: 48px; }

/* VERBESSERT: Abschnittsüberschriften kleiner und weniger dekoriert */
.product-section-heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════
   FRONTEND – PRODUKTKARTEN
   ═══════════════════════════════════════════════════════════════ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

.product-card-image-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f5f5f5;
}

.product-card-image {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.product-card:hover .product-card-image { transform: scale(1.04); }

.product-card-content {
    padding: 18px 20px 20px;
    flex: 1; display: flex; flex-direction: column; gap: 6px;
}

.product-card-title { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); line-height: 1.3; }
.product-card-subtitle { font-size: .85rem; color: var(--text-muted); font-style: italic; }
.product-card-desc { font-size: .875rem; color: var(--text-muted); flex: 1; line-height: 1.5; }
.product-card-price {
    font-size: 1.35rem; font-weight: 800;
    color: var(--price-color); text-align: right; margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   FRONTEND – FOOTER (VERBESSERT - MITTIG)
   ═══════════════════════════════════════════════════════════════ */
.shop-footer {
    background: var(--footer-background);
    color: rgba(255,255,255,.75);
    padding: 18px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center; /* MITTIG AUSRICHTEN */
    gap: 16px;
    flex-wrap: wrap;
    text-align: center;
}

.footer-links {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-size: .85rem;
    transition: color var(--transition);
}

.footer-links a:hover { color: #fff; }

.footer-sep { color: rgba(255,255,255,.35); }

/* VERBESSERT: Anmeldebutton im Footer passender */
.footer-admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: .7rem;
    transition: all var(--transition);
    margin-left: 16px;
}

.footer-admin-link:hover { 
    background: rgba(255,255,255,.2); 
    color: #fff;
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   PRODUKT-MODAL (komplett neu)
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10,10,20,.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 16px;
}

.modal-dialog {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,.3);
    animation: modalIn .25s cubic-bezier(.22,.61,.36,1);
}

@keyframes modalIn {
    from { opacity:0; transform: translateY(24px) scale(.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}

/* Schließen-Leiste (sticky oben) */
.modal-topbar {
    flex-shrink: 0;
    display: flex; justify-content: flex-end;
    padding: 12px 14px 0;
    background: #fff;
    position: relative; z-index: 2;
}

.modal-x-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: #f0f0f0; color: #666;
    font-size: 22px; line-height: 1;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.modal-x-btn:hover { background: #e0e0e0; color: #222; }

/* Scrollbarer Inhalt */
.modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 16px 28px 28px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Hero: Galerie + Info */
.modal-hero {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.modal-gallery {
    flex: 0 0 46%;
    max-width: 46%;
}

.modal-main-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f7f7f7;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: zoom-in;
}

.modal-main-img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform .25s ease;
}

.modal-main-img:hover { transform: scale(1.02); }

/* Thumbnails – fix: flex-start verhindert abgeschnittenes 1. Bild */
.modal-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: flex-start;   /* KEIN center → kein Abschneiden */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.modal-thumbs::-webkit-scrollbar { height: 4px; }
.modal-thumbs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.modal-thumb {
    width: 72px; height: 72px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
    background: #f0f0f0;
}

.modal-thumb:hover { transform: scale(1.06); }
.modal-thumb.active { border-color: var(--primary-color); }

/* Info-Bereich */
.modal-info {
    flex: 1;
    padding-top: 6px;
    display: flex; flex-direction: column; gap: 10px;
}

.modal-title {
    font-size: 1.65rem; font-weight: 800;
    color: var(--text-dark); line-height: 1.25;
}

.modal-subtitle {
    font-size: 1rem; color: var(--text-muted); font-style: italic;
}

.modal-price {
    font-size: 2.2rem; font-weight: 900;
    color: var(--price-color); margin-top: 4px;
}

/* Trennlinie */
.modal-divider { height: 1px; background: #ebebeb; margin: 22px 0; }

/* Beschreibungs-Bereich */
.modal-desc-body {
    font-size: .98rem; color: #4a4a4a; line-height: 1.75;
}

.modal-desc-body p   { margin: 0 0 .75rem; }
.modal-desc-body p:last-child { margin-bottom: 0; }
.modal-desc-body strong { color: var(--text-dark); font-weight: 700; }
.modal-desc-body em     { font-style: italic; }
.modal-desc-body u      { text-decoration: underline; }
.modal-desc-body h2 { font-size: 1.2rem; color: var(--text-dark); margin: 1rem 0 .5rem; }
.modal-desc-body h3 { font-size: 1.05rem; color: var(--text-dark); margin: .75rem 0 .35rem; }
.modal-desc-body ul, .modal-desc-body ol { padding-left: 1.5rem; margin: .5rem 0 .75rem; }
.modal-desc-body li { margin-bottom: .25rem; }

/* Anfragebereich */
.modal-request-area {
    background: #f8f9fb;
    border-radius: var(--radius-md);
    border: 1px solid #eaecef;
    padding: 24px;
}

.modal-request-heading {
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

.modal-request-form { display: flex; flex-direction: column; gap: 14px; }

.modal-submit-row {
    display: flex; justify-content: center;
    align-items: center; gap: 14px;
    margin-top: 4px;
}

.modal-submit-btn { padding: 13px 36px; font-size: 1rem; border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════════════════════════════
   ZOOM-MODAL
   ═══════════════════════════════════════════════════════════════ */
.zoom-overlay {
    background: rgba(0,0,0,.92);
    z-index: 1100;
    padding: 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.zoom-x-btn {
    position: fixed; top: 16px; right: 20px;
    background: rgba(255,255,255,.1); color: #fff;
    z-index: 1101;
}

.zoom-x-btn:hover { background: rgba(255,255,255,.25); }

.zoomed-img {
    max-width: 95vw; max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    cursor: zoom-out;
}

/* Responsive Modal */
@media (max-width: 680px) {
    .modal-dialog { max-height: 100vh; border-radius: var(--radius-md) var(--radius-md) 0 0; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-body { padding: 12px 18px 24px; }
    .modal-hero { flex-direction: column; gap: 14px; }
    .modal-gallery { max-width: 100%; }
    .modal-main-img-wrap { aspect-ratio: 16/9; }
    .modal-title { font-size: 1.35rem; }
    .modal-price { font-size: 1.8rem; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN – GRUNDSTRUKTUR
   ═══════════════════════════════════════════════════════════════ */
.admin-panel { min-height: 100vh; display: flex; flex-direction: column; background: var(--background-light); }

.admin-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: #fff;
    padding: 0;
    box-shadow: var(--shadow-md);
    position: sticky; top: 0; z-index: 200;
}

.admin-header .container {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 14px; padding-bottom: 14px;
}

.admin-header h1 { font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }

.admin-main-content { flex: 1; padding: 28px 20px 60px; }

.admin-footer {
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: .85rem;
}

/* Tabs */
.admin-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    gap: 0;
}

.tab-button {
    padding: 13px 22px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: .95rem; font-weight: 600; font-family: var(--font);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: flex; align-items: center; gap: 7px;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.tab-button:hover { color: var(--primary-color); }
.tab-button.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content > h2 { font-size: 1.5rem; margin-bottom: 20px; color: var(--text-dark); }

/* Section Cards */
.admin-section-card {
    background: var(--card-background);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section-card h3 {
    font-size: 1.05rem; font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-card-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 16px;
}

.section-card-header h3 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

/* Sortier-Select */
.sort-controls { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--text-muted); }
.sort-select { width: auto; padding: 7px 30px 7px 10px; font-size: .88rem; }

/* Admin-Form */
.admin-form { display: flex; flex-direction: column; gap: 18px; }
.admin-form .form-group label { font-size: .875rem; }

.save-main-btn { padding: 12px 32px; font-size: 1rem; margin-top: 6px; align-self: flex-start; }

/* Upload-Label */
.upload-label {
    font-size: .875rem; font-weight: 600; color: var(--text-dark);
    display: flex; align-items: center; gap: 6px;
    margin-top: 8px; padding-top: 14px;
    border-top: 1px dashed var(--border-color);
    cursor: default;
}

/* Bild-Vorschau */
.image-preview-container {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    padding: 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-color); background: #fafafa;
    min-height: 80px;
}

.image-preview {
    max-width: 120px; max-height: 120px;
    object-fit: contain; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.remove-image-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; border: none; border-radius: var(--radius-sm);
    background: #fff; color: var(--accent-red);
    border: 1px solid var(--accent-red);
    cursor: pointer; font-size: .82rem; font-weight: 600;
    transition: background var(--transition);
}

.remove-image-btn:hover { background: #fff0f0; }

/* ═══════════════════════════════════════════════════════════════
   SORTIERBARE BILDER
   ═══════════════════════════════════════════════════════════════ */
.sortable-hint {
    font-size: .8rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 5px; margin-top: 4px;
}

.sortable-images-container {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding: 12px;
    border: 2px dashed var(--border-color); border-radius: var(--radius-sm);
    background: #fafafa; min-height: 96px; align-items: flex-start;
}

.no-images-placeholder {
    width: 100%; text-align: center; color: var(--text-muted);
    font-size: .85rem; padding: 16px 0;
}

.sortable-image-item {
    position: relative;
    width: 104px; height: 104px;
    border: 2px solid var(--border-color); border-radius: var(--radius-sm);
    overflow: hidden; background: #eee;
    display: flex; align-items: center; justify-content: center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.sortable-image-item:hover { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0,123,255,.12); }
.sortable-image-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

.drag-handle {
    position: absolute; top: 4px; left: 4px;
    background: rgba(0,0,0,.45); color: #fff;
    border-radius: 4px; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; cursor: grab; z-index: 10;
    opacity: 0; transition: opacity var(--transition);
}

.sortable-image-item:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

.delete-image-button {
    position: absolute; top: 4px; right: 4px;
    background: var(--accent-red); color: #fff;
    border: none; border-radius: 50%;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; cursor: pointer; z-index: 10;
    opacity: 0; transition: opacity var(--transition);
    padding: 0;
}

.sortable-image-item:hover .delete-image-button,
.delete-image-button:hover { opacity: 1; }

/* Mobile: immer sichtbar */
@media (max-width: 768px) {
    .sortable-image-item .drag-handle,
    .sortable-image-item .delete-image-button { opacity: 1; }
}

.sortable-ghost   { opacity: .4; background: #e8f0fe; border: 2px dashed var(--primary-color); }
.sortable-chosen  { border-color: var(--primary-color); box-shadow: 0 4px 14px rgba(0,123,255,.3); }

/* ═══════════════════════════════════════════════════════════════
   QUILL EDITOR
   ═══════════════════════════════════════════════════════════════ */
.quill-editor-container {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}

.quill-editor-container:focus-within { border-color: var(--primary-color); }

.ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fa;
    font-family: var(--font);
}

.ql-container.ql-snow { border: none; font-family: var(--font); font-size: .95rem; }
.ql-editor { min-height: 140px; max-height: 320px; overflow-y: auto; line-height: 1.65; color: var(--text-dark); }
.ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; }

/* ═══════════════════════════════════════════════════════════════
   FARB-WÄHLER (Admin) - ERWEITERT
   ═══════════════════════════════════════════════════════════════ */
.color-pickers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.color-picker-group { display: flex; flex-direction: column; gap: 6px; }
.color-picker-group label { font-size: .85rem; font-weight: 600; color: var(--text-dark); }

/* Farb-Kategorien */
.color-category { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.color-category:last-child { border-bottom: none; }
.color-category h4 { font-size: .95rem; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* ═══════════════════════════════════════════════════════════════
   ABSCHNITTE-VERWALTUNG (Admin) - NEU
   ═══════════════════════════════════════════════════════════════ */
.sections-list {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 14px;
}

.section-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 9px 14px;
    background: #f0f4ff;
    border: 1px solid #c9d8ff;
    border-radius: var(--radius-sm);
    font-size: .9rem; font-weight: 500; color: var(--text-dark);
}

.section-item-icon { color: var(--primary-color); font-size: .8rem; }
.remove-section-btn {
    background: none; border: none;
    color: var(--accent-red); cursor: pointer;
    font-size: .9rem; padding: 2px 4px;
    border-radius: 4px;
    transition: background var(--transition);
}

.remove-section-btn:hover { background: #fee; }

.add-section-row {
    display: flex; gap: 10px; align-items: flex-start;
}

.add-section-row input { flex: 1; }
.add-section-row .button { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   ADMIN-TABELLE
   ═══════════════════════════════════════════════════════════════ */
.table-scroll-wrap { overflow-x: auto; }

.admin-table {
    width: 100%; border-collapse: collapse;
    font-size: .9rem;
}

.admin-table th {
    background: var(--primary-color); color: #fff;
    padding: 11px 14px; text-align: left; font-weight: 600;
    font-size: .82rem; letter-spacing: .03em; text-transform: uppercase;
}

.admin-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.admin-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.admin-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tbody tr:hover { background: #f5f7ff; }
.admin-table img { width: 54px; height: 54px; object-fit: contain; border-radius: 4px; background: #f0f0f0; }

.actions-column { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.actions-column .button { padding: 6px 12px; font-size: .8rem; box-shadow: none; }
.actions-column .button:hover { transform: none; box-shadow: var(--shadow-sm); }

/* ═══════════════════════════════════════════════════════════════
   ADMIN – MODALS - VERBESSERTES PADDING
   ═══════════════════════════════════════════════════════════════ */
.modal {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.5);
    padding: 16px;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    position: relative;
    animation: modalIn .25s ease;
}

/* VERBESSERT: Modal mit mehr Padding für Produktbearbeitung */
.modal-content-wide { 
    max-width: 850px;
    padding: 0; /* Padding wird im Formular kontrolliert */
}

.modal-content h2 {
    font-size: 1.25rem; padding: 22px 28px 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; background: #fff; z-index: 2;
}

/* VERBESSERT: Formular-Padding im Modal */
.admin-form.in-modal { 
    padding: 24px 32px 32px; /* Mehr Padding auf allen Seiten */
    gap: 18px;
}

/* Responsive: Weniger Padding auf kleinen Screens */
@media (max-width: 768px) {
    .admin-form.in-modal { padding: 16px 20px 24px; }
    .modal-content-wide { max-width: 95%; }
}

.modal-close-btn-admin {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none;
    font-size: 26px; color: var(--text-muted);
    cursor: pointer; line-height: 1;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background var(--transition), color var(--transition);
    z-index: 3;
}

.modal-close-btn-admin:hover { background: #f0f0f0; color: var(--text-dark); }

.confirm-modal-content {
    padding: 32px 28px;
    text-align: center;
    max-width: 420px;
}

.confirm-modal-content p { font-size: 1rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   ADMIN LOGIN
   ═══════════════════════════════════════════════════════════════ */
.login-page-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--background-light);
    padding: 20px;
}

.login-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%; max-width: 380px;
}

.login-card h2 { text-align: center; margin-bottom: 28px; color: var(--primary-color); font-size: 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }

.password-toggle-btn {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1rem; padding: 0;
    transition: color var(--transition);
}

.password-toggle-btn:hover { color: var(--text-dark); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .admin-tabs { overflow-x: auto; }
    .tab-button { padding: 11px 14px; font-size: .85rem; }
    .admin-section-card { padding: 16px; }
    .admin-header h1 { font-size: 1.15rem; }
    .color-pickers-grid { grid-template-columns: 1fr; }
    .sort-select { font-size: .8rem; }
}

@media (max-width: 480px) {
    .form-row-2 { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; align-items: center; gap: 8px; }
}
