@import url("../styles.css");

body {
    font-family: var(--fonte-texto);
    color: var(--cor-texto-principal);
    background-color: #f8f8f8;
}

main {
    padding: 40px 0;
}

.secao-detalhes-produto {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.secao-detalhes-produto h2 {
    font-size: 39px;
    font-weight: 700;
    color: var(--cor-texto-principal);
    margin-bottom: 20px;
}

.container-produto-principal {
    display: grid;
    /* Imagem | Detalhes | Ícones */
    grid-template-columns: 1fr 1fr auto;
    gap: 60px;
    align-items: flex-start;
}

.produto-imagem {
    display: flex;
    justify-content: center;
    align-items: center;
}

.produto-imagem img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.produto-detalhes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#nomeProduto {
    font-size: 39px;
    font-weight: 700;
    color: var(--cor-de-links);
    margin: 0;
}

#descricaoProduto {
    font-size: 20px;
    line-height: 1.6;
    color: var(--cor-de-links);
    margin: 0;
}

#precoProduto {
    font-size: 31px;
    font-weight: 600;
    color: var(--cor-de-links);
    margin: 0;
}

.acoes-usuario {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    align-self: start;
    justify-self: end;
}

.acoes-usuario img {
    cursor: pointer;
    width: 30px;
    transition: transform 0.2s ease;
}

.acoes-usuario img:hover {
    transform: scale(1.1);
}

.icone-curtir.curtido {
    filter: invert(16%) sepia(85%) saturate(7356%) hue-rotate(358deg) brightness(97%) contrast(118%);
}

.opcoes-cor h3,
.opcoes-quantidade h3,
.opcoes-tamanho h3 {
    font-size: 24px;
    font-weight: bold;
    color: #444;
    margin: 0 0 10px 0;
}

.opcoes-cor-selecao {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.opcoes-cor-selecao input[type="radio"] {
    display: none;
}

.opcoes-cor-selecao .cor-swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: color 0.2s ease;
}

.opcoes-cor-selecao .cor-swatch span {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ccc;
    transition: border-color 0.2s ease;
}
.cor-swatch-bege { background-color: #F5F5DC; }
.cor-swatch-branca { background-color: #FFFFFF; }
.cor-swatch-cinza { background-color: #C0C0C0; }

.opcoes-cor-selecao input[type="radio"]:checked + .cor-swatch span {
    border-color: #6a1b9a;
    border-width: 3px;
}

.opcoes-cor-selecao .cor-swatch:hover span {
    border-color: #4a148c;
}


.quantidade-controle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantidade-controle button {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 35px;
    height: 35px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.quantidade-controle button:hover {
    background-color: #eee;
}

.quantidade-controle input {
    width: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    height: 35px;
    font-size: 16px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.botao-adicionar-carrinho {
    background-color: #6a1b9a;
    color: white;
    font-size: 20px;
    font-weight: bold;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: background-color 0.2s ease;
}

.botao-adicionar-carrinho:hover {
    background-color: #4a148c;
}

#tamanho-selecao {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z' fill='%236a1b9a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 24px;
    
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px 40px 10px 15px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
}

.opcoes__acoes {
    display: flex;
    gap: 15px; /* Espaço entre os botões */
    align-items: center;
}

.botao-adicionar-carrinho.botao-secundario {
    text-align: center;
    text-decoration: none; 
    line-height: normal; /* Garante alinhamento vertical */
    box-sizing: border-box; 
    width: 100%; 
}

.notificacao-carrinho {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s ease-in-out;
    z-index: 1000; /* Garante que fique acima de outros elementos */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notificacao-carrinho.mostrar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notificacao-carrinho a {
    color: white;
    font-weight: bold;
    text-decoration: underline;
}


@media (max-width: 768px) {
    .container-produto-principal {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .acoes-usuario {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #nomeProduto {
        font-size: 24px;
    }

    #precoProduto {
        font-size: 24px;
    }

    .secao-detalhes-produto h2 {
        font-size: 20px;
        text-align: center;
    }
}

@media screen and (min-width: 360px) and (max-width: 500px) {
    .container-produto-principal {
        padding: 10px;
    }

    .secao-detalhes-produto h2 {
        font-size: 16px;
    }

    .produto-imagem {
        order: 1; /* Coloca a imagem primeiro */
    }

    .acoes-usuario {
        order: 2; /* Coloca os ícones logo abaixo da imagem */
        justify-content: center;
        margin-right: 0;
    }

    .produto-detalhes {
        order: 3; /* Coloca os detalhes por último */
    }

    #nomeProduto {
        font-size: 24px;
    }

    #precoProduto {
        font-size: 24px;
    }

    .botao-adicionar-carrinho {
        padding: 12px 20px;
        font-size: 16px;
    }
}