div#detalhe_produto {
    width: min(1200px, calc(100% - 40px));
    margin: 80px auto;
    padding: 20px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

div#detalhe_produto .imagem-container {
    flex: 0 0 min(58vw, 760px);
    max-width: min(58vw, 760px);
}

div#detalhe_produto .produto-info {
    flex: 1;
    font-family: sans-serif;
}

div#detalhe_produto .info-item {
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

div#detalhe_produto .info-item:last-of-type {
    border-bottom: none;
}   

div#detalhe_produto .imagem {
    border: 1px solid #ddd;
    width: min(58vw, 760px);
    height: min(70vh, 680px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #f8f8f8;
    border-radius: 8px;
}

div#detalhe_produto .imagem img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

div#detalhe_produto h2 {
    margin:0;   
}

/* Estilos para o formulário de carrinho na página de detalhes */
.carrinho-form-detalhe {
    margin-top: 20px;
}

.carrinho-form-detalhe form {
    display: flex;
    flex-direction: column;
    max-width: 300px;
}

.acabamentos-lista {
    margin-bottom: 16px;
}

.acabamentos-titulo {
    font-weight: bold;
    margin-bottom: 10px;
}

.acabamentos-tipo-bloco {
    margin-bottom: 16px;
}

.acabamentos-tipo-titulo {
    font-weight: bold;
    color: #4B0E1E;
    margin-bottom: 8px;
}

.acabamento-opcao {
    margin-bottom: 10px;
}

.acabamento-opcao-conteudo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.acabamento-opcao-visual .acabamento-opcao-conteudo {
    cursor: default;
}

.acabamento-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.acabamento-radio:checked + .acabamento-opcao-conteudo {
    border-color: #4B0E1E;
    box-shadow: 0 0 0 2px rgba(75, 14, 30, 0.15);
}

.acabamento-miniatura-btn {
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    flex-shrink: 0;
}

.acabamento-miniatura {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ccc;
    display: block;
}

.acabamento-miniatura-placeholder {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 8px;
    background: transparent;
    text-align: center;
}

.acabamento-texto {
    color: #333;
    line-height: 1.4;
}

.acabamento-texto small {
    color: #666;
}

.carrinho-form-detalhe .quantidade {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.carrinho-form-detalhe .quantidade label {
    margin-right: 10px;
    font-weight: bold;
}

.carrinho-form-detalhe .quantidade input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.carrinho-form-detalhe .btn-adicionar {
    background-color: #4B0E1E;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.carrinho-form-detalhe .btn-adicionar:hover {
    background-color: #D4AF37;
}

/* Estilos para mensagens */
.mensagem-sucesso, .mensagem-erro {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto 20px auto;
}

.mensagem-sucesso {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensagem-erro {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Estilos para o carrossel */
.carousel-container {
    position: relative;
    width: min(58vw, 760px);
    height: min(70vh, 680px);
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f8f8;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-slide img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 8px;
}

.carousel-btn.next {
    right: 8px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background-color: white;
}

body.modal-aberto {
    overflow: hidden;
}

.imagem-modal[hidden] {
    display: none;
}

.imagem-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.imagem-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.imagem-modal-conteudo {
    position: relative;
    z-index: 1;
    width: min(90vw, 900px);
    max-height: 90vh;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: auto;
}

.imagem-modal-conteudo h3 {
    margin: 0 40px 16px 0;
    font-size: 20px;
}

.imagem-modal-conteudo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.imagem-modal-fechar {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #4B0E1E;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* Responsivo para o carrossel */
@media (max-width: 768px) {
    .carousel-container {
        width: 100%;
        height: min(58vh, 520px);
    }
    
    div#detalhe_produto {
        flex-direction: column;
        width: 100%;
        padding: 10px;
    }

    div#detalhe_produto .imagem-container,
    div#detalhe_produto .imagem {
        flex: none;
        max-width: 100%;
        width: 100%;
        height: min(58vh, 520px);
    }

    .acabamento-opcao-conteudo {
        align-items: flex-start;
    }

    .imagem-modal-conteudo {
        width: 100%;
        padding: 16px;
    }
}
