/**
 * Estilos aprimorados para galeria de produto do WooCommerce
 * - Implementa layout responsivo
 * - Melhora espaçamento entre elementos
 * - Otimiza visualização mobile
 *
 * @package Alpha_Futevolei
 */

/* === LAYOUT BÁSICO DA GALERIA === */
.woocommerce-product-gallery {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
}

.custom-gallery {
    width: 100%;
}

/* === SLIDES PRINCIPAIS === */
.main-swiper-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.main-gallery-slide {
    text-align: center;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-image {
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* === MINIATURAS (THUMBNAILS) === */
.thumbnails-carousel {
    position: relative;
    width: 100%;
    margin-top: 10px;
    height: 100px;
}

.thumbnails-carousel .swiper-slide {
    height: 80px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.thumbnails-carousel .swiper-slide:hover {
    opacity: 1;
}

.thumbnail-item {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 5px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnail-item.active {
    border-color: var(--primary-color, #0073aa);
    opacity: 1;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === BOTÕES DE NAVEGAÇÃO === */
.swiper-nav-button,
.thumbs-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.swiper-nav-button:hover,
.thumbs-nav-button:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.main-swiper-button-prev,
.swiper-button-prev {
    left: 10px;
}

.main-swiper-button-next,
.swiper-button-next {
    right: 10px;
}

.swiper-nav-button::after,
.thumbs-nav-button::after {
    font-size: 18px !important;
    color: #333;
}

/* === ESTILOS PARA QUANTIDADE E ADD TO CART === */
.woocommerce div.product form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 1.5rem 0;
    gap: 15px;
}

/* Ajuste para produtos variáveis */
.woocommerce div.product form.cart.variations_form {
    flex-direction: column;
    align-items: flex-start;
}

.woocommerce div.product form.cart.variations_form .single_variation_wrap {
    width: 100%;
}

.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

/* Container do input de quantidade */
.woocommerce div.product form.cart .quantity {
    float: none;
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
    width: 130px;
    height: 45px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Previne que o botão ultrapasse a borda */
}

/* Botões de quantidade */
.woocommerce div.product form.cart .quantity .quantity-button {
    width: 38px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    z-index: 2;
    border: none;
    box-shadow: none;
    padding: 0;
    transition: background-color 0.2s ease;
    outline: none;
}

.woocommerce div.product form.cart .quantity .minus {
    border-radius: 5px 0 0 5px;
}

.woocommerce div.product form.cart .quantity .plus {
    border-radius: 0 5px 5px 0;
}

.woocommerce div.product form.cart .quantity .quantity-button:hover {
    background-color: #e5e5e5;
}

.woocommerce div.product form.cart .quantity .quantity-button:active {
    background-color: #ddd;
}

/* Input de quantidade */
.woocommerce div.product form.cart .quantity input.qty {
    width: 54px;
    height: 45px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: none;
    box-shadow: none;
    -moz-appearance: textfield;
    padding: 0;
    background-color: #fff;
}

.woocommerce div.product form.cart .quantity input.qty::-webkit-outer-spin-button,
.woocommerce div.product form.cart .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botão Adicionar ao Carrinho */
.woocommerce div.product form.cart .single_add_to_cart_button {
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 5px;
    transition: all 0.3s ease;
    float: none;
    margin: 0;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* === RESPONSIVIDADE === */
@media screen and (max-width: 768px) {
    .product-layout {
        flex-direction: column;
    }
    
    .product-gallery-column,
    .product-summary-column {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .product-gallery-column {
        margin-bottom: 2rem;
    }
    
    .main-swiper-container {
        height: auto;
    }
    
    .thumbnails-carousel {
        height: 80px;
    }
    
    .thumbnails-carousel .swiper-slide {
        height: 60px;
    }
    
    .swiper-nav-button,
    .thumbs-nav-button {
        width: 35px;
        height: 35px;
    }
    
    .swiper-nav-button::after,
    .thumbs-nav-button::after {
        font-size: 16px !important;
    }
    
    /* Ajusta o layout para mobile */
    .woocommerce div.product form.cart,
    .woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .woocommerce div.product form.cart .quantity {
        width: 120px;
        flex: 0 0 120px;
    }
    
    .woocommerce div.product form.cart .single_add_to_cart_button {
        flex: 1;
    }
}

@media screen and (max-width: 480px) {
    .woocommerce div.product form.cart,
    .woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .woocommerce div.product form.cart .quantity {
        width: 100%;
        max-width: none;
        margin-bottom: 10px;
    }
    
    .woocommerce div.product form.cart .single_add_to_cart_button {
        width: 100%;
    }
}
