/* style.css */

/* --- Grundlegende Stile & Typografie --- */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Merriweather:wght@400;700&display=swap');

body {
    background-color: #FCFDFB; /* Helles, sauberes Weiss */
    color: #384a34; /* Dunkles, sattes Grün für Text */
    font-family: 'Lato', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
}

.content {
    flex: 1;
}

/* --- Navbar --- */
.navbar {
    background-color: #FFFFFF;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.5rem 0;
}

.navbar-brand img {
    height: 60px; /* Reduzierte Höhe für ein schlankeres Design */
    width: auto;
}

.nav-link {
    color: #384a34 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #6c8c47 !important;
}

/* --- Buttons --- */
.btn-primary {
    background-color: #6c8c47; /* Natürliches Grün */
    border-color: #5a7735;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #5a7735;
    border-color: #49622a;
}

.btn-outline-primary {
    color: #6c8c47;
    border-color: #6c8c47;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: #6c8c47;
    color: #FFFFFF;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}


/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/products/Broadfork_1.jpg') no-repeat center center;
    background-size: cover;
    height: 60vh;
    color: #FFFFFF;
}

.hero-section .display-4 {
    font-family: 'Merriweather', serif;
}

/* --- Produktkarten --- */
.card {
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.product-card-home {
    cursor: pointer;
}

.product-card-img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    object-position: center;
    background-color: #f8f8f8;
    padding: 8px;
}

.card-title {
    color: #2e4a29;
}

.card-text {
    color: #555;
}


/* --- Footer --- */
.footer {
    background-color: #384a34; /* Dunkelgrün passend zum Text */
    color: #FFFFFF;
    padding: 2rem 0;
}

.footer a {
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #f4f1ea; /* Hellerer Ton für Hover */
}


/* --- Utility & Sonstiges --- */
.cart-product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

/* Carousel Anpassungen */
.carousel-item {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1);
}

/* --- Product Detail Page --- */
#mainProductImage {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border: 1px solid #dee2e6;
}

.thumbnail-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    transition: border-color 0.2s ease-in-out;
    border: 2px solid transparent;
}

.thumbnail-img.active-thumb,
.thumbnail-img:hover {
    border-color: #6c8c47; /* Highlight color from buttons */
}

/* --- Lightbox / Image Zoom --- */
.product-image-container {
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
}

.product-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.05);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.product-image-container:hover .product-image-overlay {
    opacity: 1;
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.3s;
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 2001;
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* --- Cart Page Improvements --- */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cart-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.cart-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: box-shadow 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cart-item-image-wrapper {
    flex: 0 0 100px;
    margin-right: 1.5rem;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #2e4a29;
    text-decoration: none;
}

.cart-item-title:hover {
    color: #6c8c47;
}

.cart-item-price-single {
    font-size: 0.9rem;
    color: #6c757d;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cart-quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.cart-quantity-btn {
    border: none;
    background: #f8f9fa;
    padding: 0.375rem 0.75rem;
    color: #384a34;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-quantity-btn:hover {
    background: #e2e6ea;
}

.cart-quantity-display {
    padding: 0.375rem 0.75rem;
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    background: #fff;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

.cart-item-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: #384a34;
    min-width: 80px;
    text-align: right;
}

.cart-summary-card {
    background: #fcfdfb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.cart-summary-total {
    border-top: 2px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #2e4a29;
}

.empty-cart-container {
    text-align: center;
    padding: 4rem 2rem;
}

@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-image-wrapper {
        margin-bottom: 1rem;
    }

    .cart-item-actions {
        width: 100%;
        margin-top: 1rem;
        justify-content: space-between;
    }
}

/* ===== Cart Badge ===== */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #d32f2f;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cart-badge.pulse {
    animation: badgePulse 0.5s ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===== Toast Customization ===== */
.toast {
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-body {
    font-weight: 500;
}

/* ===== Cart Preview Dropdown ===== */
.cart-preview-dropdown {
    width: 380px;
    max-width: 90vw;
    padding: 0;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
}

#cart-preview-content {
    max-height: 500px;
    overflow-y: auto;
}

.cart-preview-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.cart-preview-item:last-child {
    border-bottom: none;
}

.cart-preview-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.cart-preview-item-details {
    flex: 1;
    min-width: 0;
}

.cart-preview-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #384a34;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-preview-item-quantity {
    font-size: 0.85rem;
    color: #6c757d;
}

.cart-preview-item-total {
    font-weight: 700;
    color: #384a34;
    font-size: 0.95rem;
}

.cart-preview-footer {
    padding: 16px;
    background-color: #f8f9fa;
    border-top: 2px solid #e0e0e0;
}

.cart-preview-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.cart-preview-total-final {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid #dee2e6;
    font-size: 1.05rem;
}

.cart-preview-empty,
.cart-preview-loading {
    padding: 2rem 1rem;
}

@media (max-width: 576px) {
    .cart-preview-dropdown {
        width: 320px;
    }
}