/**
 * Produktgalerie Styles
 */

/* Hauptgalerie-Container */
.woocommerce-product-gallery {
    position: relative;
    margin-bottom: 2rem;
}

/* Hauptbild */
.woocommerce-product-gallery__wrapper {
    margin: 0;
    padding: 0;
}

.woocommerce-product-gallery__image {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.woocommerce-product-gallery__image:hover img {
    transform: scale(1.03);
}

/* Thumbnails */
.flex-control-nav {
    display: flex;
    flex-wrap: wrap;
    margin: 1rem -0.5rem 0;
    padding: 0;
    list-style: none;
}

.flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    margin: 1rem -0.5rem 0;
    padding: 0;
    list-style: none;
}

.flex-control-thumbs li {
    width: 25%;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.flex-control-thumbs img {
    border-radius: 0.25rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.flex-control-thumbs img.flex-active,
.flex-control-thumbs img:hover {
    border-color: var(--accent-color);
}

/* Zoom-Icon */
.woocommerce-product-gallery__trigger {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    background-color: white;
    color: var(--text-primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.woocommerce-product-gallery__trigger:hover {
    background-color: var(--accent-color);
    color: white;
}

.woocommerce-product-gallery__trigger::before {
    content: "\f002";
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

/* Lightbox */
.pswp__bg {
    background-color: rgba(0, 0, 0, 0.9);
}

.pswp__ui--fit .pswp__top-bar,
.pswp__ui--fit .pswp__caption {
    background-color: rgba(0, 0, 0, 0.5);
}

.pswp__button--arrow--left::before,
.pswp__button--arrow--right::before {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .flex-control-thumbs li {
        width: 33.333%;
    }
}

@media (max-width: 576px) {
    .flex-control-thumbs li {
        width: 50%;
    }
}

/* Verkaufslabel */
.woocommerce-product-gallery .onsale {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Galerie-Pfeile */
.flex-direction-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.flex-direction-nav a {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    background-color: white;
    color: var(--text-primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    opacity: 0;
}

.woocommerce-product-gallery:hover .flex-direction-nav a {
    opacity: 1;
}

.flex-direction-nav a:hover {
    background-color: var(--accent-color);
    color: white;
}

.flex-direction-nav .flex-prev {
    left: 1rem;
}

.flex-direction-nav .flex-next {
    right: 1rem;
}

/* Zoom-Effekt */
.zoomImg {
    background-color: white;
    transition: opacity 0.5s ease;
}

/* Benutzerdefinierte Galerie-Navigation */
.optimizemefy-gallery-nav {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.optimizemefy-gallery-nav button {
    background-color: transparent;
    border: none;
    color: var(--text-secondary-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.optimizemefy-gallery-nav button:hover {
    color: var(--accent-color);
}

.optimizemefy-gallery-nav .gallery-count {
    display: flex;
    align-items: center;
    margin: 0 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary-color);
}

/* Bildunterschriften */
.woocommerce-product-gallery__image .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.woocommerce-product-gallery__image:hover .caption {
    opacity: 1;
}
