/* ====================================
   GLOBALE STYLES
   ==================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #f5f5f5;
}

/* ====================================
   LOGIN PAGE
   ==================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
}

.login-form {
    padding: 30px 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login {
    width: 100%;
    font-size: 16px;
    padding: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.login-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #999;
}

/* ====================================
   SHOP PAGE (allgemein)
   ==================================== */

.shop-page {
    background-color: #f5f5f5;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info {
    font-size: 14px;
    opacity: 0.95;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: background-color 0.3s ease;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

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

/* ====================================
   PROFESSIONAL SHOP LAYOUT
   ==================================== */

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    margin-top: 0;
}

.shop-sidebar {
    background: white;
    border-right: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 0;
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
}

#sidebar {
    padding: 0;
}

.category-section {
    border-bottom: 1px solid #eee;
}

.category-title-nav {
    padding: 15px 20px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    background: #f5f5f5;
    user-select: none;
    transition: background 0.2s ease;
}

.category-title-nav:hover {
    background: #efefef;
}

.subcategories-nav {
    background: white;
}

.subcategory-nav {
    padding: 10px 20px 10px 35px;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.subcategory-nav:hover {
    background: #f0f4ff;
    border-left-color: #667eea;
    color: #667eea;
}

/* === Hierarchische Shop-Sidebar === */
.cat-all {
    padding: 12px 20px;
    font-weight: 600;
    background: #667eea;
    color: white;
    cursor: pointer;
    user-select: none;
}
.cat-all:hover { background: #5568d3; }
.cat-all.active { background: #4b5bc4; }

.cat-node { }
.cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
    font-size: 14px;
}
.cat-header:hover { background: #f5f5f5; }
.cat-header.active { background: #e8ebff; color: #3f51b5; font-weight: 600; }
.cat-header .cat-arrow { width: 14px; color: #888; font-size: 11px; flex-shrink: 0; }
.cat-header .cat-name { flex: 1; }
.cat-header .cat-count {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 7px;
    border-radius: 10px;
}
.cat-header.active .cat-count { background: rgba(255,255,255,0.7); color: #3f51b5; }

.cat-body {
    background: #fafbff;
    border-bottom: 1px solid #eee;
}
.art-item {
    padding: 8px 15px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.art-item:hover {
    background: #eef1ff;
    border-left-color: #667eea;
    color: #3f51b5;
}
.art-item.active {
    background: #e8ebff;
    border-left-color: #3f51b5;
    color: #3f51b5;
    font-weight: 600;
}

.shop-main {
    background: #fafafa;
    padding: 30px;
    min-height: 100vh;
}

.articles-header {
    margin-bottom: 30px;
}

.articles-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.article-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-image {
    height: 180px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image svg {
    width: 100%;
    height: 100%;
    max-width: 140px;
    max-height: 140px;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.btn-block {
    width: 100%;
}

.card-detail {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.qty-section {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.qty-section label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.qty-input {
    width: 70px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-size: 13px;
}

.btn-calculate {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-calculate:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #ddd;
    color: #333;
}

.btn-secondary:hover {
    background: #ccc;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.result {
    margin-top: 15px;
}

.price-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.vendor-card {
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.vendor-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vendor-card.cheapest {
    border: 2px solid #4caf50;
    background: #f1f8f4;
}

.vendor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.vendor-header strong {
    color: #333;
    font-size: 14px;
}

.badge {
    background: #4caf50;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.vendor-prices {
    font-size: 13px;
    margin-bottom: 12px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    color: #555;
}

.price-row strong {
    color: #333;
}

.price-row.total {
    border-top: 1px solid #eee;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 600;
    color: #667eea;
}

.order-preview {
    padding: 15px;
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 8px;
}

.order-preview h4 {
    margin: 0 0 12px 0;
    color: #2e7d32;
}

.preview-details {
    background: white;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 12px;
    font-size: 13px;
}

.preview-details p {
    margin: 5px 0;
    color: #555;
}

.preview-total {
    text-align: center;
    padding: 10px;
    background: #c8e6c9;
    border-radius: 5px;
    color: #1b5e20;
    font-weight: 600;
    margin-top: 10px;
}

.preview-actions {
    display: grid;
    gap: 8px;
}

.mail-template {
    padding: 15px;
    background: #fff8e1;
    border: 2px solid #fbc02d;
    border-radius: 8px;
}

.mail-template h4 {
    margin: 0 0 12px 0;
    color: #f57f17;
}

.mail-template textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #fbc02d;
    border-radius: 5px;
    font-family: monospace;
    font-size: 11px;
    resize: none;
}

.template-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

/* ====================================
   RESPONSIVE
   ==================================== */

@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 200px 1fr;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
    }

    .shop-main {
        padding: 20px;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .articles-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .filter-section {
        grid-template-columns: 1fr;
    }

    .vendor-list {
        grid-template-columns: 1fr;
    }

    .order-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ====================================
   RESPONSIVE
   ==================================== */

@media (max-width: 600px) {
    .login-container {
        max-width: 100%;
    }

    .login-card {
        border-radius: 0;
    }

    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }
}
