/* Product Page Styles */
.product-container {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 20px;
}

.loading, .error {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.2rem;
    color: var(--text-color);
}

.error {
    color: var(--secondary-color);
}

#productContent {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    gap: 2rem;
    align-items: start;
    background-color: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    width: 100%;
}

.product-images {
    position: sticky;
    top: 90px;
    width: 280px;
    grid-column: 1 / 2;
    display: block;
    align-self: start;
}

.product-main-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    aspect-ratio: 2 / 3;
    display: block;
    transition: transform 0.3s;
}

.product-main-image:hover {
    transform: scale(1.02);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--white);
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
    grid-column: 2 / 3;
    width: 100%;
}

.product-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    width: fit-content;
}

.product-name {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.product-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.product-price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.product-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.price-unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
    #productContent {
        grid-template-columns: 220px 1fr !important;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .product-images {
        width: 220px;
    }
    
    .product-name {
        font-size: 1.8rem;
    }
    
    .product-price {
        font-size: 1.8rem;
    }
}

/* Desktop: Icon verstecken */
@media (min-width: 769px) {
    .image-expand-btn {
        display: none !important;
    }
    
    .product-main-image {
        cursor: pointer;
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .product-container {
        margin: 2rem auto;
        padding: 0 15px;
    }

    #productContent {
        grid-template-columns: 1fr !important;
        gap: 0;
        padding: 0;
        position: relative;
        overflow: hidden;
        background-color: transparent;
    }

    .product-images {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        order: 1;
        pointer-events: none;
    }

    .product-main-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        aspect-ratio: auto;
        max-width: none;
        max-height: none;
        opacity: 0.3;
        filter: blur(2px);
        transform: scale(1.1);
        pointer-events: none;
    }

    .image-expand-btn {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 3;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background-color: rgba(26, 26, 26, 0.9);
        border: 2px solid var(--primary-color);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    }

    .image-expand-btn:hover {
        background-color: var(--primary-color);
        transform: translate(-50%, -50%) scale(1.1);
    }

    .image-expand-btn:hover svg {
        color: white;
    }

    .image-expand-btn svg {
        width: 24px;
        height: 24px;
        color: var(--primary-color);
        transition: color 0.3s ease;
    }

    .product-info {
        order: 2;
        text-align: center;
        align-items: center;
        width: 100%;
        position: relative;
        z-index: 2;
        background: linear-gradient(
            to bottom,
            rgba(45, 45, 45, 0.95) 0%,
            rgba(45, 45, 45, 0.98) 30%,
            rgba(45, 45, 45, 0.98) 70%,
            rgba(45, 45, 45, 0.95) 100%
        );
        padding: 2rem 1.5rem;
        border-radius: 12px;
        backdrop-filter: blur(10px);
    }
    
    .product-category {
        margin: 0 auto;
    }

    .product-name {
        font-size: 1.8rem;
        text-align: center;
    }
    
    .product-description {
        text-align: center;
    }

    .product-price-section {
        justify-content: center;
    }

    .product-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
    
    .lightbox {
        padding: 1rem;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 2.5rem;
    }
    
    .lightbox-img {
        max-width: 95%;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .product-container {
        margin: 1.5rem auto;
        padding: 0 10px;
    }

    #productContent {
        padding: 0;
        gap: 0;
    }
    
    .product-main-image {
        opacity: 0.25;
        filter: blur(3px);
    }

    .product-info {
        padding: 1.5rem 1rem;
    }

    .product-name {
        font-size: 1.6rem;
    }

    .product-price {
        font-size: 1.6rem;
    }
    
    .product-description {
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .loading, .error {
        padding: 3rem 1rem;
        font-size: 1rem;
    }
}
