/**
 * Hauptstile für Amazon-Produkt-Grid und Produktkacheln
 * Diese CSS-Datei enthält alle benötigten Stile für das Produktraster
 */

/* Wrapper für das gesamte Produktraster */
.aam-products-wrapper {
    margin-bottom: 40px;
}

/* Kategorie-Überschrift */
.aam-category-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

/* Grundlegendes Grid-Layout - wird durch die PHP-Dateien pro Shortcode angepasst */
.aam-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Standard: 3 Spalten */
    gap: 20px;
    margin-bottom: 30px;
}

/* Produktbox mit Schatten und Hover-Effekt */
.aam-product-box {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.aam-product-box:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* Bild-Container mit relativer Positionierung */
.aam-product-image-container {
    position: relative;
    overflow: hidden;
}

/* Produktbild mit festem Seitenverhältnis */
.aam-product-image {
    position: relative;
    padding-top: 75%; /* Festgelegtes Seitenverhältnis 4:3 */
    background: #f9f9f9;
    overflow: hidden;
}

.aam-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
}

.aam-product-box:hover .aam-product-image img {
    transform: scale(1.05);
}

/* Rabatt-Badge */
.aam-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff5722, #e91e63);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Overlay für Amazon-Button mit Hover-Effekt */
.aam-amazon-overlay {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    transition: bottom 0.3s ease;
    text-align: center;
}

.aam-product-box:hover .aam-amazon-overlay {
    bottom: 0;
}

.aam-amazon-button {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    display: block;
}

.aam-amazon-icon {
    margin-right: 5px;
}

/* Fallback für fehlendes Bild */
.aam-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-style: italic;
    background-color: #f5f5f5;
}

/* Bildquellenangabe */
.aam-image-credit {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    color: #666;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Produktinformationsbereich */
.aam-product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Produkttitel mit fester Höhe */
.aam-product-title {
    height: 44px; /* Platz für 2 Zeilen Text */
    overflow: hidden;
    font-size: 16px;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.aam-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.aam-product-title a:hover {
    color: #0066cc;
}

/* Meta-Informationen (Preis und Bewertung) */
.aam-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.aam-product-price {
    font-size: 18px;
    font-weight: bold;
    color: #e63946; /* Etwas anderer Rotton als Amazon */
}

.aam-product-rating {
    display: flex;
    align-items: center;
}

.aam-stars {
    color: #ffd700;
    margin-right: 5px;
    font-size: 16px;
}

.aam-rating-text {
    font-size: 14px;
    color: #666;
}

/* Produktbeschreibung mit fester Höhe */
.aam-product-description {
    height: 60px; /* Platz für 3 Zeilen */
    overflow: hidden;
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Button für Details-Seite */
.aam-details-button {
    margin-top: auto; /* Push to bottom */
    text-align: center;
}

.aam-details-link {
    display: inline-block;
    background: #4a77c0; /* Blauton statt Amazon-Orange */
    color: white !important;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    text-align: center;
}

.aam-details-link:hover {
    background: #3d63a1;
    transform: translateY(-2px);
}

/* Admin-Informationen */
.aam-admin-info {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    text-align: center;
}

/* Meldungen */
.aam-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 5px;
    border-left: 5px solid #ffc107;
}

.aam-no-products {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-radius: 5px;
    color: #6c757d;
}

/* ===== NEUE STYLES FÜR PRODUKTVORSCHLAG-SYSTEM ===== */

/* Container für "Keine Produkte" Meldung */
.aam-no-products-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.aam-no-products-header h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 24px;
}

.aam-no-products-header p {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 16px;
}

/* Produktvorschlag-Formular */
.aam-suggestion-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.aam-suggestion-form h4 {
    color: #007cba;
    margin-bottom: 20px;
    text-align: center;
}

.aam-form-row {
    margin-bottom: 15px;
}

.aam-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.aam-form-row input,
.aam-form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

.aam-form-row input:focus,
.aam-form-row textarea:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 5px rgba(0,124,186,0.3);
}

.aam-form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.aam-suggest-button {
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    flex: 1;
    transition: all 0.3s ease;
}

.aam-suggest-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.aam-suggest-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.aam-cancel-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    flex: 0 0 100px;
    transition: all 0.3s ease;
}

.aam-cancel-button:hover {
    background: #5a6268;
}

/* Gäste-Meldung */
.aam-guest-message {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.aam-guest-message h4 {
    color: #007cba;
    margin-bottom: 15px;
}

.aam-auth-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.aam-login-button,
.aam-register-button {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.aam-login-button {
    background: #007cba;
    color: white !important;
}

.aam-register-button {
    background: #28a745;
    color: white !important;
}

.aam-login-button:hover,
.aam-register-button:hover {
    transform: translateY(-2px);
}

/* Ergebnis-Meldungen */
#aam-suggestion-result {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

#aam-suggestion-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#aam-suggestion-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Paginierung */
.aam-pagination {
    margin-top: 30px;
    text-align: center;
}

.aam-pagination .page-numbers {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #333;
    text-decoration: none;
}

.aam-pagination .current {
    background: #4a77c0;
    color: white;
    border-color: #4a77c0;
}

.aam-pagination a:hover {
    background: #f5f5f5;
}

/* Admin Debug-Ausgabe */
.aam-admin-debug {
    margin-top: 20px;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 5px;
    font-size: 13px;
}

.aam-admin-debug ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.aam-product-content p {
    margin-bottom: 1em;
}
.aam-product-content h3, 
.aam-product-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.aam-product-content ul, 
.aam-product-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}
.aam-product-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .aam-no-products-container {
        margin: 20px 10px;
        padding: 20px;
    }
    
    .aam-form-buttons {
        flex-direction: column;
    }
    
    .aam-cancel-button {
        flex: 1;
    }
    
    .aam-auth-buttons {
        flex-direction: column;
    }
}