/* static/css/carousel_produtos.css */

/* Estilização geral do carrossel */
.carousel-section {
    position: relative;
    background-color: white;
    width: 100%;
    margin: 30px auto;
    overflow: visible;
    padding: 20px 0 5px 0; /* Atualizado: Adicionado 20px de padding inferior para desgrudar */
    box-sizing: border-box;
}

.carousel__title {
    text-align: left;
    font-size: 24px;
    margin-bottom: 30px;
    padding-left: 20px;
}

.carousel__container {
    position: relative;
    width: 100%;
    overflow: hidden; /* Mantenha o overflow hidden aqui para o deslizamento dos itens */
}

.carousel__items {
    display: flex;
    transition: transform 0.3s ease-in-out;
    padding: 10px 10px 20px 10px; /* Atualizado: Adicionado padding inferior para espaçamento e sombra */
}

/* --- Item do Carrossel: Largura Fixa e Estilo --- */
.carousel__item {
    flex-shrink: 0;
    margin: 0 10px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    box-sizing: border-box;
}

.carousel__item:hover {
    transform: translateY(-2px);
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
}

.carousel__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- Imagem do Produto --- */
.carousel__image-wrapper {
    /* MUDANÇA GLOBAL: Adicionando a técnica de proporção 1:1 */
    width: 100%;

    /* NOVO: Propriedades para garantir a proporção 1:1 (Quadrado) */
    position: relative;
    padding-bottom: 100%; /* CRÍTICO: Altura igual à largura (100% da largura) */

    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;

    background-color: white;
    border-bottom: 1px solid #eee;
}

.carousel__image {
    /* MUDANÇA GLOBAL: Faz a imagem ocupar o espaço absoluto da proporção 1:1 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    object-fit: contain;
    display: block;
}

/* --- Detalhes do Conteúdo (Nome, Preço, Frete) --- */
.carousel__content-details {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* --- Título do Produto (Nome) --- */
.carousel__name {
    font-size: 14px;
    margin: 0 0 15px 0;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: normal;
    color: var(--azul-padrao);
}

.carousel__item:hover .carousel__name {
    color: #3483fa;
}

/* --- Preços --- */
.carousel__old-price {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.carousel__old-price s {
    text-decoration: line-through;
}

.carousel__old-price .old-centavos {
    font-size: 8px;
    vertical-align: super;
}

.carousel__current-price-container {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.carousel__current-price {
    font-size: 24px;
    font-weight: normal;
    color: #333;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    white-space: nowrap;
}

.carousel__current-price .integer {
    margin-left: 2px;
}

.carousel__current-price .centavos {
    font-size: 12px;
    vertical-align: super;
}

.carousel__discount {
    font-size: 12px;
    color: #00a650;
    font-weight: bold;
    flex-shrink: 0;
}

/* --- Parcelamento --- */
.carousel__installments {
    font-size: 13px;
    color: #000000e6;
    margin-bottom: 5px;
}

.carousel__installments-text {
    color: #000000e6;
}

.carousel__installments-value {
    color: #00a650;
    font-weight: bold;
}

.carousel__installments-info {
    color: #00a650;
}

/* --- Frete --- */
.carousel__shipping {
    font-size: 13px;
    color: #00a650;
    font-weight: 500;
    margin-top: 5px;
}

.carousel__shipping-text {
    color: #00a650;
}


/* --- Botões de Navegação do Carrossel --- */
.carousel__button--prev, .carousel__button--next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, font-size 0.3s ease;
    font-weight: 100;
}

.carousel__button--prev:hover, .carousel__button--next:hover {
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25);
    background-color: #f8f8f8;
}

.carousel__button--prev.disabled,
.carousel__button--next.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.carousel__button--prev.disabled:hover,
.carousel__button--next.disabled:hover {
    background-color: white;
    box-shadow: none;
}

/* Regras para Desktop */
@media (min-width: 769px) {
    .carousel__item {
        width: 170px;
    }

    .carousel__button--prev, .carousel__button--next {
        width: 64px;
        height: 64px;
        font-size: 32px;
        color: #3483fa;
    }

    .carousel__button--prev {
        left: -32px;
        transform: translateY(-50%);
    }

    .carousel__button--next {
        right: -32px;
        transform: translateY(-50%);
    }
}

/* Regras para Mobile */
@media (max-width: 768px) {
    .carousel__button--prev, .carousel__button--next {
        display: flex;
        width: 45px;
        height: 45px;
        font-size: 16px;
        color: #3483fa;
        opacity: 0.9;
    }

    .carousel__button--prev {
        left: -20px;
        transform: translateY(-50%);
    }

    .carousel__button--next {
        right: -20px;
        transform: translateY(-50%);
    }

    /* Habilita a rolagem horizontal no container do carrossel */
    .carousel__container {
        overflow-x: scroll;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .carousel-section {
        padding: 20px 10px 5px 10px; /* Atualizado: Menos padding lateral, com padding inferior */
        margin: 20px 0;
    }

    /* Oculta a barra de rolagem para navegadores baseados em WebKit */
    .carousel__container::-webkit-scrollbar {
        display: none;
    }

    /* Ajusta os itens para o alinhamento de rolagem e largura */
    .carousel__item {
        scroll-snap-align: start;
        margin: 0 5px;
        /* Atualizado: Aumenta a largura do item no mobile para caber melhor os preços */
        width: calc(42% - 10px);
    }

    .carousel__items {
        padding: 10px 5px 20px 5px !important; /* Atualizado: Mantém padding inferior extra no mobile */
    }

    .carousel__title {
        font-size: 20px;
        padding-left: 0;
    }

    /* Atualizado: Diminui a fonte do preço no mobile para evitar quebras */
    .carousel__current-price {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .carousel__item {
        margin: 0 4px;
        /* Atualizado: Em telas menores, aumenta ainda mais a proporção do card */
        width: calc(48% - 8px);
    }
    .carousel__title {
        font-size: 18px;
        padding-left: 0;
    }
    .carousel__items {
        padding: 10px 5px 20px 5px !important;
    }
    /* Atualizado: Diminui ainda mais a fonte em telas super pequenas */
    .carousel__current-price {
        font-size: 16px;
    }
    .carousel__current-price .centavos {
        font-size: 10px;
    }
}

/* --- Estilos Adicionais Exclusivos para Ícones de Categorias no Carrossel --- */
.carousel__item--category .carousel__image-wrapper {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
}

.carousel__category-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: #888; /* Alterado de azul para cinza por padrão */
    transition: transform 0.3s ease, color 0.3s ease;
}

.carousel__item--category:hover .carousel__category-icon {
    transform: translate(-50%, -50%) scale(1.1);
    color: #007bff; /* Fica azul apenas no hover */
}