/* --- product-modal.css --- */

/* Base Modal Styling */
.product-modal-custom .modal-content {
    background-color: #2c2c2c; /* Dunkler Hintergrund für den Content-Bereich */
    border: none;
    border-radius: 1rem; /* Leichter abgerundet */
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3); /* Stärkerer, aber weicherer Schatten */
    overflow: hidden; /* Wichtig für die visuellen Bereiche */
    color: #fff; /* Standardtextfarbe weiß */
}

/* Modal Header (only for close button) */
.product-modal-custom .modal-header {
    position: absolute; /* Über das Bild legen */
    top: 0;
    right: 0;
    z-index: 10; /* Über dem Bild */
    border-bottom: none;
    padding: 0.75rem; /* Weniger Padding */
}

.product-modal-custom .btn-close {
    background-color: rgba(255, 255, 255, 0.2); /* Leicht transparenter weißer Hintergrund */
    border-radius: 50%; /* Rund */
    padding: 0.4rem;
    opacity: 1; /* Immer sichtbar */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Leichter Schatten */
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.product-modal-custom .btn-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.product-modal-custom .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25); /* Heller Fokus-Ring */
}

/* Modal Body Layout */
.product-modal-custom .modal-body {
    padding: 0; /* Kein Padding hier, die inneren Bereiche bekommen es */
}

/* Product Image Area (top light section on mobile, left on desktop) */
.product-modal-custom .product-image-area {
    background-color: #f8f8f8; /* Heller Hintergrund wie im Screenshot */
    padding: 2rem 1.5rem; /* Padding für den Inhalt im Bildbereich */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px; /* Mindesthöhe für das Bild auf Mobile */
    max-height: 300px; /* Max. Höhe, damit es nicht zu groß wird auf Desktop */
    overflow: hidden;
    /* rounded-top für Mobile */
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.product-modal-custom .product-image-area img {
    max-height: 100%; /* Bild füllt den Bereich */
    width: auto; /* Breite anpassen */
    object-fit: contain; /* Bild wird angepasst, nicht beschnitten */
    display: block; /* Entfernt zusätzlichen Platz unter dem Bild */
}

/* Product Details Area (bottom dark section on mobile, right on desktop) */
.product-modal-custom .product-details-area {
    padding: 1.5rem 2rem 1rem 2rem; /* Padding für den Inhalt */
    background-color: #2c2c2c; /* Ensure dark background for this section */
    /* rounded-bottom für Mobile */
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

/* Product Title */
.product-modal-custom .product-title {
    font-size: clamp(1.8rem, 5vw, 2.8rem); /* Größerer Titel, responsiv */
    line-height: 1.2;
    margin-bottom: 0.5rem;
    text-align: left; /* Text linksbündig */
}

/* Product Volume/Size */
.product-modal-custom .product-volume {
    font-size: 1rem;
    color: #b0b0b0 !important; /* Helles Grau */
    margin-bottom: 1rem; /* Abstand nach unten */
}

/* Price Info Section */
.product-modal-custom .price-info {
    margin-bottom: 1.5rem;
}

.product-modal-custom .current-price {
    font-size: clamp(2rem, 5vw, 2.5rem); /* Hauptpreisgröße, responsiv */
    font-weight: 800; /* Extra fett */
    color: #ff6600 !important; /* Kräftiges Rot/Orange wie im Screenshot */
    line-height: 1;
}

.product-modal-custom .old-price {
    font-size: 1.1rem; /* Kleinerer alter Preis */
    color: #888 !important; /* Dunkleres Grau für durchgestrichenen Preis */
    margin-left: 0.5rem;
}

.product-modal-custom .unit-price {
    font-size: 1rem;
    color: #888 !important; /* Einheitspreis in Grau */
    text-align: right;
}

/* Product Description */
.product-modal-custom .product-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8) !important; /* Leicht transparentes Weiß */
    margin-bottom: 1.5rem;
    text-align: left; /* Links ausgerichtet */
}

/* Action Links (Produktinfo, Melden) */
.product-modal-custom .action-links a {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 0;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.product-modal-custom .action-links a:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.05); /* Leichter Hover-Effekt */
}

.product-modal-custom .action-links .border-bottom {
    border-color: rgba(255, 255, 255, 0.1) !important; /* Dezente Trennlinie */
}

/* Allergens Section */
.product-modal-custom .allergens-section {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important; /* Dezente Trennlinie */
}

.product-modal-custom .allergens-section p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5) !important; /* Sehr dezent */
    margin-bottom: 0.75rem;
}

.product-modal-custom .allergens-section .badge {
    background-color: rgba(255, 255, 255, 0.1) !important; /* Heller Hintergrund */
    color: rgba(255, 255, 255, 0.7) !important; /* Heller Text */
    border-color: rgba(255, 255, 255, 0.2) !important; /* Heller Rand */
    font-size: 0.75em;
    padding: 0.4em 0.8em;
    white-space: normal;
    text-align: center;
}

/* Modal Footer (bottom light section) */
.product-modal-custom .modal-footer {
    background-color: #f0f0f0; /* Sehr helles Grau wie im Screenshot */
    border-top: none; /* Keine obere Linie */
    padding: 1.5rem;
    border-bottom-left-radius: 1rem; /* Anpassung an Modal-Radius */
    border-bottom-right-radius: 1rem;
}

/* Quantity Selector in Footer */
.product-modal-custom .quantity-selector {
    max-width: 170px;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Leichter Schatten */
    background-color: #fff; /* Weiße Box */
    border: 1px solid #ddd;
}

.product-modal-custom .quantity-selector .btn {
    font-size: 1.1rem;
    padding: 0.6rem 0.9rem;
    border: none;
    color: #333; /* Dunkle Icons */
    transition: background-color 0.2s ease;
}

.product-modal-custom .quantity-selector .btn:hover {
    background-color: #eee; /* Leichter Hover-Effekt */
}

.product-modal-custom .quantity-selector .form-control {
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    background-color: transparent;
    box-shadow: none;
    padding: 0.6rem 0;
    height: auto;
    color: #333; /* Dunkler Text für die Zahl */
}

/* Add to Cart Button in Footer */
.product-modal-custom .btn-add-to-cart {
    font-size: 1.05rem;
    padding: 0.8rem 1.75rem;
    border-radius: 2rem;
    background-color: #007bff; /* Blau wie im Screenshot */
    border-color: #007bff;
    color: #fff;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap; /* Verhindert Zeilenumbruch */
}

.product-modal-custom .btn-add-to-cart:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.product-modal-custom .btn-add-to-cart .add-to-cart-text {
    margin-right: 0.75rem;
    display: inline-flex; /* Für Icon und Text nebeneinander */
    align-items: center;
}

.product-modal-custom .btn-add-to-cart .add-to-cart-price {
    font-size: 1.15rem;
}


/* --- Responsive Adjustments for Desktop (Bild links, Details rechts) --- */
@media (min-width: 768px) {
    .product-modal-custom .modal-content {
        display: flex; /* Makes the content flex container */
        flex-direction: row; /* Arranges children horizontally */
        height: auto; /* Allow height to adapt */
    }

    .product-modal-custom .modal-header {
        position: absolute; /* Remain absolute for positioning over image */
        top: 0;
        right: 0; /* Adjust right to be inside the content */
        left: auto;
        padding: 1.25rem; /* Etwas mehr padding auf Desktop */
    }

    .product-modal-custom .modal-body {
        display: flex; /* Flexbox für Bild- und Detailbereiche */
        flex-grow: 1; /* Nimmt den verbleibenden Platz ein */
        padding: 0; /* Reset body padding, inner areas have padding */
    }

    .product-modal-custom .col-md-5,
    .product-modal-custom .col-md-7 {
        /* Bootstrap columns handle width, we just need flex properties */
        display: flex;
        flex-direction: column; /* Ensure inner content stacks vertically */
    }

    .product-modal-custom .product-image-area {
        flex-grow: 1; /* Bildbereich füllt verfügbaren Raum in der Spalte */
        border-top-left-radius: 1rem; /* Oben links abgerundet */
        border-top-right-radius: 0; /* Oben rechts eckig */
        border-bottom-left-radius: 1rem; /* Unten links abgerundet */
        min-height: 450px; /* Erhöhte Mindesthöhe für Desktop-Ansicht */
        max-height: none; /* Keine maximale Höhe auf Desktop */
        padding: 3rem 2rem; /* Mehr Padding auf Desktop */
    }

    .product-modal-custom .product-details-area {
        flex-grow: 1; /* Detailsbereich füllt verfügbaren Raum in der Spalte */
        padding: 2.5rem; /* Einheitliches Padding für Details auf Desktop */
        border-top-left-radius: 0; /* Oben links eckig */
        border-bottom-right-radius: 1rem; /* Unten rechts abgerundet */
        border-top-right-radius: 1rem; /* Oben rechts abgerundet */
        border-bottom-left-radius: 0; /* Unten links eckig */
    }

    .product-modal-custom .modal-footer {
        flex-shrink: 0; /* Footer soll nicht schrumpfen */
        border-top-left-radius: 0; /* Angleichung an Content-Layout */
        border-bottom-left-radius: 0; /* Anpassung an Content-Layout */
        border-top-right-radius: 0; /* Angleichung an Content-Layout */
        border-bottom-right-radius: 1rem; /* Muss nur unten rechts abgerundet sein */
        padding-left: 2.5rem; /* Passend zum Detailsbereich */
        padding-right: 2.5rem;
    }

    /* Text alignment for desktop */
    .product-modal-custom .product-title,
    .product-modal-custom .product-volume,
    .product-modal-custom .product-description,
    .product-modal-custom .allergens-section p {
        text-align: left;
    }

    .product-modal-custom .action-links .d-flex,
    .product-modal-custom .allergens-section .d-flex {
        justify-content: flex-start;
    }

    .product-modal-custom .quantity-selector {
        margin-left: 0; /* Remove auto margin for centering */
    }
}