/* Estilo de alinhamento*/
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

html {
    background: #FF1015;
}

body {
    background-color: #FF1015;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.conteudo-principal {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 20px;
    max-height: 12vh;
    background-color: whitesmoke;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.imagem {
    width: 110px;
    height: auto;
    display: flex;
    align-items: center;
}

#logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Navegação e Ícones (Tamanhos Restaurados) */
.itens {
    display: flex;
    justify-content: space-between;
    font-size: 2vw; /* Tamanho original restaurado */
    font-family: 'Roboto Mono', monospace;
    text-transform: uppercase;
    font-weight: 1px;
}

.itens div {
    margin-right: 30px;
}

.itens div:last-child {
    margin-right: 0;
}

.itemTexto {
    text-decoration: none;
    display: inline-block;
    position: relative;
    color: #FF1015;
}

.itemTexto::after {
    content: "";
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #FF1015;
    transform-origin: center;
    transition: transform 0.25s ease-out;
}

.itemTexto:hover::after {
    transform: scaleX(1);
}

.social {
    display: flex;
    gap: 30px;
}

.social i {
    color: black;
    font-size: 3vw; /* Tamanho original restaurado */
    transition: transform 0.3s ease;
}

#facebook:hover {
    color: blue;
}

#instagram:hover {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

#compras {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 4vw; /* Tamanho original restaurado */
}

#compras .cart-counter {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #333;
    color: white;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid whitesmoke;
    font-weight: bold;
    pointer-events: none;
}

#compras a {
    color: #FF1015;
    text-decoration: none;
}

/* Estado ativo do ícone quando há produtos */
#compras i.cart-active {
    color: #333;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}

/* Animação disparada ao adicionar/remover itens */
.cart-animate {
    animation: cartBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Conteúdo da Home */
.titulo {
    text-align: center;
    padding: 30px 0;
    font-size: 36px;
    font-weight: bold;
    color: white;
}

.marcas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.marca-btn {
    flex: 0 0 calc(25% - 30px);
    max-width: none;
    height: 130px;
    border: none;
    background: white;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.marca-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.marca-btn img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

/* Footer Ajustado */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    background-color: whitesmoke;
    margin-top: auto;
    height: auto;
    min-height: 0;
}

footer .imagem {
    width: 90px;
    height: auto;
}

footer .imagem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
}

.info p {
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #333;
    white-space: normal;
    text-align: center;
}

#direitos p {
    font-size: 13px;
    color: #333;
    margin: 0;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 75vw;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
}

.modal-close:hover {
    color: #FF1015;
}

/* Botão Voltar ao Topo */
#btnVoltar {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #FF1015;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#btnVoltar.mostrar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Imagem Ampliada no Modal */
#modal-img {
    display: none; /* Escondida por padrão */
    margin: 20px auto;
    max-width: 100%;
    max-height: 65vh; /* Garante que não ultrapasse a altura da tela */
    object-fit: contain;
    border-radius: 4px;
}

/* Botão Voltar dentro do Modal */
.modal-back {
    background-color: #333;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px auto;
    display: block;
    font-weight: bold;
    transition: background 0.3s;
}

.modal-back:hover {
    background-color: #555;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/*Deixar itens ativos na página atual*/

.itemTexto.ativo {
    cursor: default;
    pointer-events: none;
}

.itemTexto.ativo::after {
    transform: scaleX(1) !important;
}

@media (max-width: 768px) {
    header {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
        padding: 10px 12px;
        gap: 8px;
        align-items: center;
    }
    header .imagem {
        width: 60px;
        flex-shrink: 0;
    }
    .itens {
        order: 4;
        width: 100%;
        font-size: 11px;
        justify-content: center;
        gap: 8px;
    }
    .itens div {
        margin-right: 0;
    }
    .social {
        order: 2;
        margin-left: auto;
        gap: 12px;
    }
    .social i {
        font-size: 18px;
    }
    #compras {
        order: 3;
        font-size: 18px;
    }
    footer {
        flex-direction: column;
        padding: 12px;
        gap: 6px;
    }
    footer .imagem {
        width: 60px;
    }
    .info {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    .info p, #direitos p {
        font-size: 10px;
        white-space: normal;
        text-align: center;
    }
    .modal-content {
        max-width: 95vw;
        padding: 12px;
    }
    .marcas {
        gap: 15px;
        padding: 15px;
    }
    .marca-btn {
        flex: 0 0 calc(50% - 7.5px);
        height: 100px;
        max-width: 140px;
    }
}

@media (max-width: 600px) {
    header {
        padding: 8px 10px;
        gap: 6px;
    }
    header .imagem {
        width: 50px;
    }
    .itens {
        font-size: 10px;
        gap: 6px;
    }
    .itens div {
        margin-right: 0 !important;
    }
    .social {
        gap: 10px;
    }
    .social i {
        font-size: 16px;
    }
    #compras {
        font-size: 16px;
    }
    .titulo {
        font-size: 24px;
        padding: 20px 10px;
    }
    .marcas {
        gap: 10px;
        padding: 10px;
    }
    .marca-btn {
        flex: 0 0 calc(50% - 15px);
        height: 90px;
        max-width: none;
    }
    footer {
        padding: 10px;
        gap: 4px;
    }
    footer .imagem {
        width: 50px;
    }
    .info p, #direitos p {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 6px 8px;
    }
    header .imagem {
        width: 45px;
    }
    .itens {
        font-size: 9px;
        gap: 4px;
    }
    .social {
        gap: 8px;
    }
    .social i {
        font-size: 14px;
    }
    #compras {
        font-size: 14px;
    }
    .titulo {
        font-size: 20px;
        padding: 15px 8px;
    }
    .marcas {
        gap: 8px;
        padding: 8px;
    }
    .marca-btn {
        flex: 0 0 calc(50% - 12px);
        height: 80px;
    }
    .marca-btn img {
        max-width: 80%;
        max-height: 80%;
    }
    footer {
        padding: 8px;
        gap: 2px;
    }
    footer .imagem {
        width: 45px;
    }
    .info p, #direitos p {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    header .imagem {
        width: 40px;
    }
    .itens {
        font-size: 8px;
    }
    .titulo {
        font-size: 18px;
    }
    .marcas {
        gap: 6px;
        padding: 6px;
    }
    .marca-btn {
        flex: 0 0 100%;
        height: 70px;
        max-width: none;
    }
}

#produtos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    justify-content: center;
    justify-items: center;
    align-items: start;
}

#produtos-container.modal-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    max-width: 100%;
}

#produtos-container.modal-form {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

#produtos-container.modal-hidden {
    display: none;
}

.produto-grid-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    border: #ddd solid 1px;
    border-radius: 8px;
    background-color: #fff;
    padding: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 280px;
    min-height: 350px;
    flex: 0 0 280px;
}

.produto-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-add-carrinho {
    background-color: #FF1015;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    align-self: center;
}

.btn-add-carrinho:hover {
    background-color: #cc0d12;
}

.qtd-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    font-weight: bold;
}

/* Estilos para o formulário de finalização */
.form-finalizacao {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    max-width: 480px;
    justify-content: center;
}

.btn-voltar {
    background-color: #333 !important;
    flex: 1;
}

.btn-enviar {
    flex: 1.5;
}

/* ============================================
   BARRA DE PESQUISA NO MODAL
   ============================================ */

.search-bar-modal {
    background: white;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #FF1015;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    grid-column: 1 / -1;
}

.search-bar-modal:focus-within {
    box-shadow: 0 3px 10px rgba(255, 16, 21, 0.2);
    border-left-color: #cc0d12;
}

.search-bar-modal i {
    color: #FF1015;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.search-bar-modal:focus-within i {
    transform: scale(1.1);
}

.search-input-modal {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input-modal::placeholder {
    color: #999;
}

.search-input-modal:focus {
    outline: none;
    background: white;
    border-color: #FF1015;
    box-shadow: 0 0 0 2px rgba(255, 16, 21, 0.1);
}

.no-results-produtos {
    animation: fadeInMessage 0.3s ease-out;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    #produtos-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 15px;
        padding: 15px;
        max-width: 900px;
    }
    .produto-grid-item {
        padding: 12px;
        max-width: 260px;
    }
    .modal-content {
        max-width: 85vw;
        max-height: 85vh;
    }
}

@media (max-width: 900px) {
    #produtos-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
        max-width: 600px;
    }
    .produto-grid-item {
        padding: 10px;
        max-width: 280px;
    }
    .modal-content {
        max-width: 90vw;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 92vw;
        max-height: 90vh;
        padding: 12px;
        border-radius: 8px;
    }
    #produtos-container {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        max-width: 100%;
    }
    .produto-grid-item {
        padding: 8px;
        max-width: 100%;
    }
    .produto-grid-item img {
        height: 120px;
    }
    .produto-grid-item p {
        font-size: 12px;
    }
    .search-bar-modal {
        padding: 10px;
        margin-bottom: 12px;
    }
    .search-input-modal {
        font-size: 12px;
        padding: 6px 8px;
    }
    .search-bar-modal i {
        font-size: 14px;
    }
    .btn-add-carrinho {
        padding: 8px;
        font-size: 12px;
    }
    .qtd-input {
        width: 50px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .modal-content {
        max-width: 95vw;
        padding: 10px;
    }
    #produtos-container {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px;
        max-width: 100%;
    }
    .produto-grid-item {
        padding: 6px;
        max-width: 100%;
    }
    .produto-grid-item img {
        height: 100px;
    }
    .produto-grid-item p {
        font-size: 11px;
        margin-top: 4px;
    }
    .search-bar-modal {
        padding: 8px;
        gap: 6px;
        margin-bottom: 10px;
    }
    .search-input-modal {
        font-size: 11px;
        padding: 5px 7px;
    }
    .search-bar-modal i {
        font-size: 12px;
    }
    .btn-add-carrinho {
        padding: 6px;
        font-size: 11px;
    }
    .qtd-input {
        width: 45px;
        font-size: 11px;
    }
    #modal-img {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-width: 96vw;
        padding: 8px;
    }
    #produtos-container {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 6px;
        max-width: 100%;
    }
    .produto-grid-item {
        padding: 5px;
        max-width: 100%;
    }
    .produto-grid-item img {
        height: 80px;
    }
    .produto-grid-item p {
        font-size: 10px;
    }
    .search-bar-modal {
        padding: 6px;
        gap: 5px;
        margin-bottom: 8px;
    }
    .search-input-modal {
        font-size: 10px;
        padding: 4px 6px;
    }
    .search-bar-modal i {
        font-size: 11px;
    }
    .btn-add-carrinho {
        padding: 5px;
        font-size: 10px;
    }
    .qtd-input {
        width: 40px;
        padding: 1px;
        font-size: 10px;
    }
    #modal-img {
        max-height: 40vh;
    }
}

@media (max-width: 360px) {
    #produtos-container {
        gap: 5px;
        padding: 5px;
    }
    .produto-grid-item {
        padding: 4px;
    }
    .produto-grid-item img {
        height: 70px;
    }
    .search-bar-modal {
        padding: 5px;
    }
    .search-input-modal {
        font-size: 9px;
    }
    .btn-add-carrinho {
        font-size: 9px;
        padding: 4px;
    }
}