/* ====================================== 
        CONTAINER PRINCIPAL
   ====================================== 
*/
.container {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

@media(max-width: 1080px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
}

/* ====================================== 
        FILTRO - COLUNA
   ====================================== 
*/
.coluna1 {
    display: flex;
    flex-direction: column;
    background: black;
    color: white;
    align-items: center;
    flex: 0 0 25%;
    min-width: 200px;
    position: sticky;
    top: 0;
    border-bottom-left-radius: 20px;
    border-top-left-radius: 20px;
    padding: 10px;
}

@media(max-width: 1080px){
    .coluna1 {
        position: relative;
        max-width: 100%;
        height: auto;
        min-height: auto;
        padding: 20px;
        top: auto;
        flex: none;
        z-index: auto;
        border-radius: 20px;
    }
    .coluna1 img{
        height: 150px;
        width: 350px;
        margin: 5px;
    }
}

.coluna1 p {
    margin-left: 13px;
    font-size: 22px;
    position: relative;
}

.coluna1 footer {
    margin-top: 25px;
    height: auto;
}

.campo-opcoes {
    padding: 10px;
    font-size: 16px;
    background-color: white;
    color: #000;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* ====================================== 
        SELECT E BOTÃO DO FILTRO
   ====================================== 
*/
.estilo-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 16px;
    margin: 10px;
    width: 100%;
    max-width: 300px;
    height: 40px;
    color: #000;
    cursor: pointer;
    border-radius: 4px;
    padding: 0 10px;
    box-sizing: border-box;
    text-align: center;
}
.estilo-select:hover {
    background-color: #cfcfcf;
}

.estilo-button {
    font-size: 16px;
    margin: 10px;
    width: 100%;
    max-width: 300px;
    height: 40px;
    background: #838dff;
    color: #000;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
}
.estilo-button:hover {
    background: #6a75f7;
}

/* ====================================== 
        OPÇÃO DE PESQUISAR
   ====================================== 
*/
.campo-pesquisa {
    position: relative;
    width: 100%;
    max-width: 300px;
}
.icone {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}
/* ====================================== 
        INFO DA PEÇA
   ====================================== 
*/
.coluna2 {
    flex: 2;
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.6);
    color: rgb(0, 0, 0);
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    padding: 20px;
}

@media(max-width: 1080px) {
    .coluna2 {
        padding: 15px;
        border-radius: 20px;
        min-height: auto;
        flex: 1;
        margin-top: 20px;
    }
}

/* ====================================== 
        CAIXA DE TODAS AS PEÇAS
   ====================================== 
*/
.box-pecas {
    background-color: #ffffff;
    margin: 10px 0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-sizing: border-box;
    width: 100%;
}

.caixa-lista-produtos {
    display: flex;
    flex-direction: column;
    background: #e4e4e4;
    border-radius: 10px;
    padding: 10px;
    flex: 1;
    margin: 20px;
    box-sizing: border-box;
    border: 1px solid #cacaca;
}

@media(max-width: 1080px) {
    .caixa-lista-produtos {
        margin: 10px;
        padding: 15px;
    }
}

/* ====================================== 
        ESTILO DA PEÇA 
   ====================================== 
*/
.peca {
    box-shadow: 0 0 4px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
    background: white;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-left: 20px;
}

.peca:hover {
    background-color: #e6f0ff;
    border-color: #4da3ff;
}

.peca.selecionada {
    background-color: #000;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #007bff;
}

.pecas {
    opacity: 1;
    transition: none;
}
.pecas.fade-out {
    opacity: 0;
    transform: translateY(10px);
}
.pecas.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================== 
        PAGINAÇÃO 
   ====================================== 
*/
.paginacao {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 10px 10px 10px;
    flex-wrap: nowrap;
}

.paginacao button {
    padding: 6px 12px;
    border: 1px solid #000;
    background: #e0e0e0;
    cursor: pointer;
    min-width: 40px;
}
.paginacao button.ativa {
    background: #000;
    color: #fff;
}
.paginacao button:hover {
    background: #bebdbd;
}

/* ====================================== 
        ANIMAÇÃO DE CARREGAMENTO
   ====================================== 
*/
.loader {
    width: 50px;
    height: 50px;
    border: 6px solid #ddd;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    animation: girar 1s linear infinite;
    margin: 30px auto;
}
.hidden {
    display: none;
}

/* ====================================== 
        POP-UP
   ====================================== 
*/

#popupImagem {
  display: none; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.popup-imagem-box {
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.popup-imagem-box img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Botão de Fechar PopUp Grande*/
.popup-imagem-box button {
    margin-top: 10px;
    padding: 6px 14px;
    border: 1px solid #000000;
    background: #000000;
    color: white;
    cursor: pointer;
    border-radius: 3px;
}
.popup-imagem-box button:hover {
    background: #0056b3;
}

#popupImagemGrande {
    max-width: 100%;
    max-height: 80vh; 
}

/* Oculta as setas por padrão */
.arrow {
  display: inline-block;
  width: 50px; 
  height: 50px; 
  background-color: rgba(0, 0, 0, 0.5) !important; 
  border-radius: 50% !important; 
  color: #fff; 
  font-size: 1.5em; 
  text-align: center; 
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  border: none;
}

.arrow:hover{
    background-color: #505050 !important;
}

/* Exibe as setas em telas maiores que 360px */
@media (min-width: 360px) {
    .arrow {
        display: block;
    }
    .prev {
        left: 10px; /* posição à esquerda */
    }
    .next {
        right: 10px; /* posição à direita */
    }
}

/* ====================================== 
        CAIXA DA DESCRIÇÃO
   ====================================== 
*/
#descricao {
    min-height: 100px;
    max-height: 220px;
}

/* ====================================== 
        ESTILO DE TODAS AS PEÇAS
   ====================================== 
*/
.detalhe-peca {
    display: grid;
    grid-template-columns: 2fr 1fr;
    background: #ffffff;
    border-radius: 12px;
    box-sizing: border-box;
    width: 100%;
    margin: 10px 0;
}
.detalhe-peca.colunas {
    grid-template-columns: 1fr;
}

a {
    text-decoration: none;
    color: inherit;
}

@media(max-width: 1080px) {
    .detalhe-peca, .box-pecas {
        grid-template-columns: 1fr;
        margin: 10px;
        width: calc(100% - 20px);
    }
}

.info-peca {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
}
.info-peca p {
    font-size: 16px;
    text-align: center;
    margin: 5px 0;
}
.campo {
    border: 1px solid #d3d3d3;
    border-radius: 8px;
    background: #ececec;
    text-align: center;
    width: 95%;
    min-height: 50px;
    word-wrap: break-word;
    white-space: normal;
    color: #505050;
    padding: 10px;
    box-sizing: border-box;
    margin: 0 auto;
}

#imagem-grande {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.imagem-peca {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #a8a8a8;
    background: #ededed;
    border-radius: 10px;
    max-height: 350px;
    max-width: 500px;
    padding: 10px;
    box-sizing: border-box;
    margin: 10px;
    cursor: pointer;
}

.image-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 495px;
    max-height: 395px;
}

@media(max-width: 1080px){
    .image-display{
        max-width: 100%;
        max-height: 100%;
    }
}

#current-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

@media(max-width: 1080px){
    .imagem-peca{
        max-width: 100%;
        max-height: 100%;
    }
}

/* ====================================== 
        ANIMAÇÃO DO LOADER
   ====================================== 
*/
@keyframes girar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}