/* Estilos Gerais */
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; margin: 0; background-color: #000000; color: #ffff00; }
.main-header { background-color: #efff00; color: #000000; padding: 2rem 1rem; text-align: center; }
.main-header h1 { margin: 63px 0px 0px 0px; font-size: 2.5rem; }
main { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Barra de Pesquisa */
.search-container { margin: 2rem 0; display: flex; justify-content: center; }
#searchInput { color: #ffff00; background: #141414; width: 100%; max-width: 500px; padding: 0.8rem 1rem; font-size: 1rem; border: 1px solid #ced4da; border-radius: 25px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Carrossel de Categorias */
.category-filters-container { border-bottom: 1px solid #404249; display: flex; overflow-x: auto; white-space: nowrap; padding-bottom: 1rem; margin-bottom: 2rem; -ms-overflow-style: none; scrollbar-width: none; }
.category-filters-container::-webkit-scrollbar { display: none; }
.category-item { display: inline-block; text-align: center; margin: 0 1rem; cursor: pointer; opacity: 0.7; transition: opacity 0.2s, transform 0.2s; }
.category-item:hover { opacity: 1; transform: scale(1.05); }
.category-item.active { opacity: 1; }
.category-image { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid #484848; transition: border-color 0.2s; }
.category-item.active .category-image { border-color: #ffff00; }
.category-item-name { display: block; margin-top: 0.5rem; font-size: 0.9rem; font-weight: 500; }

/* Grid de Produtos */
#loading-message { text-align: center; padding: 3rem; font-size: 1.2rem; color: #6c757d; }
.products-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.product-card { border: 1px solid #404249; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15); }
.product-image { width: 100%; height: 200px; object-fit: cover; }
.product-info { background: #141414; border: 1px solid #ffff0000; padding: 1rem; display: flex; flex-direction: column; flex-grow: 1; }
.product-category { font-size: 0.8rem; font-weight: 500; color: #000000; background-color: #00f6ff; padding: 0.2rem 0.5rem; border-radius: 12px; margin-bottom: 0.75rem; align-self: flex-start; display: inline-block; }
.product-name { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem 0; }
.product-price { font-size: 1.5rem; font-weight: bold; color: #ffffff; margin-bottom: 1rem; }

/* =============================================================== */
/* MUDANÇA PRINCIPAL AQUI: Descrição do Produto                   */
/* =============================================================== */
.product-description {
    font-size: 0.9rem;
    color: #6c757d;
    flex-grow: 1;
    margin-bottom: 1rem;
    
    /* Mágica para cortar o texto em 3 linhas */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Define o número máximo de linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    
    /* Garante uma altura mínima para alinhar os cards */
    min-height: 48px; 
}
/* =============================================================== */

.card-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}
.buy-button {
    flex-grow: 1;
    width: auto;
    background-color: #ffff00;
    color: #000000;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.buy-button:hover { background-color: #218838; }
.details-button {
    border: 1px solid #404249;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background-color: #000000;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}
.details-button:hover { background-color: #5a6268; }

.main-footer { text-align: center; padding: 2rem 1rem; margin-top: 3rem; background-color: #141414; color: #6c757d; }

/* ================================================== */
/* ADICIONE ESTES ESTILOS NO FINAL DO SEU STYLE.CSS   */
/* ================================================== */

/* Estilos para Formulários de Login/Cadastro */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #141414;
    border: 1px solid #404249;
    border-radius: 8px;
    text-align: center;
}
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: #000;
    color: #ffff00;
    border: 1px solid #404249;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-container .buy-button {
    width: 100%;
}
.error-text {
    color: #ff4d4d;
    margin-top: 1rem;
    min-height: 1.2em;
}

/* Estilos para a Sessão do Usuário no Cabeçalho */
.user-session-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.session-link {
    color: #000000;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 1px solid #000000;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}
.session-link:hover {
    background-color: #ffffff;
    color: #000000;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffff00;
}
.logout-btn {
    background: none;
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.logout-btn:hover {
    background-color: #ff4d4d;
    color: #ffffff;
}

/* ================================================== */
/* ADICIONE ESTES ESTILOS NO FINAL DO SEU STYLE.CSS   */
/* ================================================== */

/* Estilos para a página de perfil */
.user-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #404249;
    margin-bottom: 1rem;
}
#avatar-upload-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}
.file-input-label {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}
.file-input-label:hover {
    background-color: #0056b3;
}
#upload-status {
    font-weight: bold;
}
.user-profile-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

/* ================================================== */
/* NOVOS ESTILOS PARA O CARROSSEL COM SETAS         */
/* ================================================== */

.carousel-wrapper {
    position: relative; /* Essencial para posicionar as setas */
    display: flex;
    align-items: center;
    max-width: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    border-radius: 50%; /* Deixa o botão redondo */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.2s, box-shadow 0.2s;
}

.carousel-btn:hover {
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#scroll-left-btn {
    left: -20px; /* Posiciona um pouco para fora */
}

#scroll-right-btn {
    right: -20px; /* Posiciona um pouco para fora */
}

/* Adiciona o scroll suave no carrossel */
.category-filters-container {
    scroll-behavior: smooth;
}