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

html, body {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
}

/* Haupt-Layout */
body > main {
  flex: 1;
}

/* Header */
.header {
  background: white;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Top-Leiste: Logo links, Account rechts */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Suchleiste unterhalb */
.searchbar-wrapper {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.searchbar {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Account-Button */
.account-erstellen img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  transition: background 0.2s;
}

.account-erstellen:hover img {
  background: #f0f0f0;
}

/* Kartenlayout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 24px;
}

/* Kartenstil */
.card {
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #ddd;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden; /* WICHTIG: Verhindert dass Bilder überlaufen */
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

/* NEUE STYLES FÜR BILDER IN KARTEN */
.card img {
  width: 100%;
  height: 180px; /* Feste Höhe für einheitliche Darstellung */
  object-fit: cover; /* Bild wird beschnitten um das Seitenverhältnis zu erhalten */
  border-radius: 8px;
  background: #f0f0f0; /* Fallback-Hintergrund */
  margin-bottom: 8px;
}

/* NEUE STYLES FÜR TEXT IN KARTEN */
.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.3;
}

.card p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
}

.card p strong {
  color: #28a745; /* Grün für Preise */
  font-size: 1.2rem;
  font-weight: 700;
}

/* NEUE STYLES FÜR LOADING/ERROR STATES */
.loading, .error, .empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  border: 1px solid #ddd;
  color: #666;
  font-size: 1.1rem;
}

.error {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.empty {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}




/* Hauptlink oben im Main – falls du den brauchst */
main > a {
  display: block;
  text-align: right;
  margin: 16px 24px 0 0;
  font-weight: bold;
  color: #0077cc;
  text-decoration: none;
}

main > a:hover {
  text-decoration: underline;
}

/* Footer fixiert am unteren Rand */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 16px;
  background: #f1f1f1;
  font-size: 14px;
  color: #555;
  border-top: 1px solid #ddd;
}

footer .informations a {
  color: #0077cc;
  text-decoration: none;
}

footer .informations a:hover {
  text-decoration: underline;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  .card {
    padding: 16px;
  }
  

        /* Detailansicht Modal Styles */
        .detail-modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            animation: fadeIn 0.3s ease-out;
        }

        .detail-modal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .detail-content {
            background-color: white;
            border-radius: 12px;
            max-width: 900px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
            animation: slideIn 0.3s ease-out;
        }

        .detail-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            border-bottom: 1px solid #e0e0e0;
        }

        .detail-title {
            font-size: 24px;
            font-weight: bold;
            color: #333;
            margin: 0;
        }

        .close-button {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
            padding: 5px;
            width: 35px;
            height: 35px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s ease;
        }

        .close-button:hover {
            background-color: #f0f0f0;
            color: #333;
        }

        .detail-body {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            padding: 30px;
        }

        .detail-image-section {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .detail-main-image {
            width: 100%;
            height: 300px;
            object-fit: cover;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .detail-info-section {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .detail-price {
            font-size: 32px;
            font-weight: bold;
            color: #007bff;
            margin: 0;
        }

        .detail-description {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            line-height: 1.6;
            color: #333;
        }

        .detail-meta {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-top: 20px;
        }

        .meta-item {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .meta-label {
            font-weight: bold;
            color: #666;
            font-size: 14px;
            text-transform: uppercase;
        }

        .meta-value {
            color: #333;
            font-size: 16px;
        }

        .detail-actions {
            display: flex;
            gap: 15px;
            margin-top: 30px;
        }

        .action-button {
            flex: 1;
            padding: 12px 24px;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .primary-button {
            background-color: #007bff;
            color: white;
        }

        .primary-button:hover {
            background-color: #0056b3;
        }

        .secondary-button {
            background-color: #6c757d;
            color: white;
        }

        /* Kontakt-Button spezielle Styles */
        .primary-button:disabled {
            background-color: #6c757d;
            cursor: not-allowed;
        }

        .primary-button:disabled:hover {
            background-color: #6c757d;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .detail-content {
                width: 95%;
                max-height: 95vh;
            }

            .detail-body {
                grid-template-columns: 1fr;
                gap: 20px;
                padding: 20px;
            }

            .detail-price {
                font-size: 24px;
            }

            .detail-actions {
                flex-direction: column;
            }
        }

        /* Animationen */
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes slideIn {
            from { 
                opacity: 0;
                transform: translateY(-50px) scale(0.9);
            }
            to { 
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* Hover-Effekt für Karten */
        .card {
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }

        /* Bestehende Styles für Fehlermeldungen etc. */
        .error {
            text-align: center;
            padding: 40px;
            color: #dc3545;
            font-size: 18px;
            background-color: #f8d7da;
            border-radius: 8px;
            margin: 20px;
        }

        .loading {
            text-align: center;
            padding: 40px;
            color: #6c757d;
            font-size: 18px;
        }

        .empty {
            text-align: center;
            padding: 40px;
            color: #6c757d;
            font-size: 18px;
        }
