﻿/* ========================================= */
/* Produktseite (product.php) Styling        */
/* Wird ZUSÄTZLICH zu style.css geladen      */
/* ========================================= */

.product-page-container {
    display: flex;
    flex-wrap: wrap; /* Ermöglicht Umbruch auf kleineren Bildschirmen */
    gap: 40px; /* Abstand zwischen Bild und Details */
    padding-top: 40px;
    padding-bottom: 60px;
}

.product-gallery-section {
    flex: 1; /* Nimmt verfügbaren Platz ein */
    min-width: 300px; /* Mindestbreite, bevor Umbruch erfolgt */
    max-width: 50%; /* Max. 50% der Breite für die Galerie */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-image-wrapper {
    width: 100%;
    max-width: 550px; /* Maximale Breite des Hauptbildes */
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* Sicherstellen, dass das Bild innerhalb des Rahmens bleibt */
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.main-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Bildgröße anpassen, ohne es zu beschneiden */
}

.thumbnail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    max-width: 550px; /* Max. Breite der Thumbnail-Leiste, passend zum Hauptbild */
}

.thumbnail-gallery img {
    width: 80px; /* Feste Breite für Thumbnails */
    height: 80px; /* Feste Höhe für Thumbnails */
    object-fit: cover; /* Thumbnails beschneiden, um den Bereich zu füllen */
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumbnail-gallery img:hover {
    border-color: var(--highlight-color);
    transform: translateY(-2px);
}

.thumbnail-gallery img.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color); /* Eine Art "Halo" um das aktive Bild */
}

.product-details-section {
    flex: 1; /* Nimmt ebenfalls verfügbaren Platz ein */
    min-width: 300px;
    max-width: 45%; /* Etwas weniger als die Galerie, um sie nebeneinander zu halten */
    padding: 0 15px; /* Innenabstand für Text */
}

.product-details-section h1 {
    font-family: var(--font-heading);
    font-size: 2.2em;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.product-details-section .product-price {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.product-details-section .product-meta-lines {
    margin-bottom: 30px;
    line-height: 1.6;
    color: var(--text-light); /* Angepasst an text-light */
}

.product-details-section .product-meta-lines .meta-separator {
    background-color: var(--border-color); /* Leichterer Separator, angepasst an border-color */
    width: 100%; /* Nun volle Breite */
    margin: 10px 0; /* Links ausgerichtet */
}

.product-description-full {
    margin-bottom: 40px;
    color: var(--text-dark);
}

.product-description-full h2 {
    font-family: var(--font-heading);
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color); /* Angepasst an border-color */
    padding-bottom: 5px;
}

.product-description-full p {
    line-height: 1.7;
}

/* Anpassung der standardmäßigen Button-Ausrichtung für alle .product-actions */
.product-details-section .product-actions {
    margin-top: 30px;
    display: flex; /* Sicherstellen, dass Flexbox für justify-content funktioniert */
    justify-content: flex-start; /* Standardmäßig linksbündig */
}

.product-details-section .buy-button {
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-details-section .buy-button:hover {
    background-color: var(--highlight-color);
}


/* Media Queries für Responsive Design */
@media (max-width: 992px) {
    .product-page-container {
        flex-direction: column;
        gap: 30px;
    }
    .product-gallery-section,
    .product-details-section {
        max-width: 100%;
        padding: 0;
    }
    .main-image-wrapper,
    .thumbnail-gallery {
        max-width: 100%;
    }
    /* .product-details-section { */
    /* text-align: center; */ /* DIESE ZEILE WURDE ENTFERNT */
    /* } */
    .product-details-section h1 {
        font-size: 1.8em;
        /* NEU/ANGEPASST: Für die Zentrierung langer Titel auf mobilen Geräten */
        text-align: center;
        width: 100%; /* Sicherstellen, dass der H1 die volle Breite einnimmt */
        margin-left: auto; /* Zentriert den H1-Block selbst */
        margin-right: auto; /* Zentriert den H1-Block selbst */
        word-break: break-word; /* Damit sehr lange Wörter sauber umbrechen */
    }
    .product-details-section .product-price {
        font-size: 1.5em;
        text-align: center; /* Stellen wir hier sicher, dass der Preis zentriert ist */
    }
    /* Button-Gruppe auch zentrieren, wenn sie schon existiert */
    .product-details-section .product-actions {
        justify-content: center; /* Zentriert die Buttons */
    }
    .breadcrumb-nav .breadcrumb {
        justify-content: center; /* Zentriert die Breadcrumb-Liste */
    }

    /* Füge hier noch die Zentrierung für die Meta-Linien hinzu, falls diese nicht zentriert sind */
    .product-details-section .product-meta-lines {
        text-align: center;
    }
    /* Und die Beschreibung */
    .product-description-full {
        text-align: center;
    }
    .product-description-full h2 {
        text-align: center;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    .product-description-full p {
        text-align: center;
    }
}@media (max-width: 576px) {
    .product-page-container {
        padding-top: 20px;
        padding-bottom: 40px;
    }
    .product-details-section h1 {
        font-size: 1.5em;
    }
    .product-details-section .product-price {
        font-size: 1.3em;
    }
    .thumbnail-gallery img {
        width: 60px;
        height: 60px;
    }
}

/* ========================================= */
/* Styling für den oberen Kaufen-Button-Wrapper */
/* Standardmäßig anzeigen und auf Desktop linksbündig */
/* ========================================= */
.product-actions.top-buy-button {
    margin-bottom: 25px; /* Abstand nach unten */
    display: flex; /* Immer anzeigen */
    justify-content: flex-start; /* Auf Desktop linksbündig */
}

/* Anpassung auf kleineren Bildschirmen */
@media (max-width: 992px) {
    .product-actions.top-buy-button {
        justify-content: center; /* Auf Mobile/Tablet zentrieren */
    }
    .product-actions.bottom-buy-button {
        justify-content: center; /* Unteren Button auf Mobile/Tablet auch zentrieren */
    }
}


/* ========================================= */
/* Magnifier / Zoom Effekt Styling           */
/* ========================================= */

#magnifier-container {
    position: relative; /* Wichtig für die Positionierung des Overlays und der Lupe */
    overflow: hidden; /* Verhindert, dass der vergrößerte Teil überläuft */
    cursor: crosshair; /* Zeigt an, dass man zoomen kann */
    width: 100%; /* Nimmt die volle Breite des main-image-wrapper ein */
    max-width: 550px; /* Oder die max-width deines Hauptbildes */
    margin: 0 auto; /* Zentrieren, falls der Wrapper breiter ist */
    height: auto; /* Höhe wird vom Bild bestimmt */
}

#magnifier-container img {
    display: block;
    width: 100%;
    height: auto;
    /* Optional: Füge hier einen Übergang für das Bild selbst hinzu,
       wenn du möchtest, dass es sich leicht bewegt */
    /* transition: transform 0.1s ease-out; */
}

/* Der Zoom-Bereich (die Lupe) */
.magnifier-lens {
    position: absolute;
    border: 2px solid var(--primary-color); /* Rahmen der Lupe */
    background-color: rgba(255, 255, 255, 0.4); /* Leichte Transparenz für die Lupe */
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 50%; /* Runde Lupe */
    pointer-events: none; /* Wichtig, damit die Mausereignisse auf das Bild darunter durchgehen */
    opacity: 0; /* Standardmäßig ausgeblendet */
    transition: opacity 0.2s ease-in-out;
    transform: scale(0.8); /* Startet etwas kleiner für einen sanften Eintritt */
    background-repeat: no-repeat; /* Für das Hintergrundbild des Zooms */
    z-index: 10; /* Stellt sicher, dass die Lupe über dem Bild liegt */
}

.magnifier-lens.active {
    opacity: 1; /* Eingeblendet, wenn aktiv */
    transform: scale(1); /* Volle Größe, wenn aktiv */
}

/* ========================================= */
/* Breadcrumb Navigation Styling             */
/* ========================================= */

.breadcrumb-nav {
    width: 100%;
    padding: 20px 0; /* Vertikaler Abstand */
    margin-bottom: 20px; /* Abstand zum Produktinhalt */
    font-size: 0.9em;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color); /* Dezenter Trenner */
}

.breadcrumb {
    list-style: none; /* Entfernt die Standard-Listenpunkte */
    display: flex; /* Stellt die Elemente nebeneinander */
    flex-wrap: wrap; /* Ermöglicht Umbruch auf kleinen Bildschirmen */
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center; /* Zentriert Text und Separator vertikal */
}

.breadcrumb li:not(:last-child)::after {
    content: '›'; /* Der Trenner zwischen den Elementen */
    margin: 0 8px; /* Abstand um den Trenner */
    color: var(--border-color); /* Farbe des Trenners */
}

.breadcrumb a {
    text-decoration: none;
    color: var(--text-dark); /* Farbe der Links */
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-color); /* Hover-Effekt */
}

.breadcrumb li:last-child span {
    color: var(--primary-color); /* Farbe des aktuellen Seitennamens */
    font-weight: 500;
}

/* Anpassung für kleinere Bildschirme */
@media (max-width: 576px) {
    .breadcrumb-nav {
        padding: 15px 0;
        margin-bottom: 15px;
        font-size: 0.85em;
    }
    .breadcrumb li:not(:last-child)::after {
        margin: 0 5px;
    }
}