/* =================================== */
/* app.css - Estilo Principal (Baguncei Store) */
/* CORREÇÃO: Espaçamento de Botões nos Cards */
/* =================================== */

/* --- Layout Geral e Tipografia --- */

html, body {
    height: 100%;
    margin: 0;
}

body {
    color: #333;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

main {
    flex-grow: 1; 
    max-width: 1200px;
    width: 95%; 
    margin: 20px auto;
    padding: 0 15px;
    gap: 30px; 
    display: flex; 
}

/* --- Cabeçalho (Header) e Navegação --- */
header{
    background-color: #333;
    color: #fff;
    padding: 8px 20px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#logo {
    max-height: 80px; 
    width: auto;
    transition: transform 0.3s ease;
}

#logo:hover {
    transform: scale(1.05) rotate(-2deg);
}

nav ul{
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
} 

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    padding: 8px 15px; 
    border-radius: 8px; 
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
    letter-spacing: 1px;
}

nav a:hover,
nav a.active {
    background-color: #ff69b4;
    color: #333;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

/* --- Seção de Produtos (Index) --- */

#produtos {
    flex-grow: 3;
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
}

#produtos h1 {
    grid-column: 1 / -1; 
    font-size: 3em; 
    color: #00bcd4; 
    text-shadow: 3px 3px 0 #333; 
    margin-bottom: 30px;
    transform: rotate(-2deg); 
    display: inline-block;
    border-bottom: 5px solid #ffeb3b; 
    padding-bottom: 10px;
}

.card {
    background-color: #fff;
    border: 3px solid #333; 
    border-radius: 15px; 
    padding: 25px; 
    box-shadow: 8px 8px 0 #ff69b4; 
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    display: flex; 
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-8px) rotate(2deg); 
    box-shadow: 12px 12px 0 #e91e63; 
}

.card .title{
    font-size: 24px;
    color: #4CAF50;
    margin-bottom: 8px;
    font-weight: bold;
} 
.price{
    font-size: 1.4em;
    font-weight: bold;
    color: #e91e63;
    margin-bottom: 15px;
}

.card button {
    background-color: #00bcd4; 
    color: white;
    padding: 10px 18px; 
    border: none;
    border-radius: 8px; 
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    
    /* CORREÇÃO DEFINITIVA DO ESPAÇAMENTO */
    margin-top: 10px; 
    display: block; 
    width: 100%; 
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0; /* Garante que não haja margens laterais que causem desalinhamento */
}

.card button:first-of-type {
    margin-top: 15px;
}

.card button:hover {
    background-color: #ffeb3b;
    color: #333;
    transform: translateY(-1px); 
    box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}

/* --- Sidebar (Cadastro de Produto) --- */

aside {
    flex-grow: 1; 
    padding: 25px; 
    background-color: #fff;
    border: 4px dashed #ffeb3b; 
    border-radius: 15px; 
    height: fit-content;
    box-shadow: 5px 5px 10px rgba(0,0,0,0.1);
}

aside h2 {
    color: #00bcd4;
    font-size: 2.2em; 
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 1px 1px 0 #555;
}

#novo label {
    display: block;
    margin-top: 12px;
    font-weight: bold;
    color: #555;
    font-size: 1.1em;
}

#novo input[type="text"] {
    width: 100%; 
    padding: 12px; 
    margin-top: 8px;
    border: 2px solid #ccc;
    border-radius: 6px; 
    font-size: 1em;
    box-sizing: border-box;
}

#novo button[type="submit"] {
    width: 100%;
    background-color: #ff69b4; 
    color: white;
    padding: 15px; 
    margin-top: 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

#novo button[type="submit"]:hover {
    background-color: #e91e63;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.4);
}

/* --- Rodapé (Footer) --- */

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0; 
    margin-top: 0; 
    border-top: 8px solid #ffeb3b; 
    font-size: 0.9em;
}

/* --- Estilo para o Modal Customizado (Pop-up de Exclusão) --- */

#custom-modal {
    display: none; 
    position: fixed;
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border: 4px solid #ff69b4; 
    border-radius: 15px;
    text-align: center;
    box-shadow: 10px 10px 0 #00bcd4; 
    max-width: 400px;
    transform: rotate(-1deg);
}

.modal-content h3 {
    color: #e91e63;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-shadow: 1px 1px 0 #ccc;
    transform: rotate(2deg);
}

.modal-buttons button {
    background-color: #ffeb3b;
    color: #333;
    font-size: 1em;
    padding: 10px 20px;
    margin: 5px 10px;
    border: 2px solid #333;
    box-shadow: 4px 4px 0 #e91e63;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.modal-buttons button:hover {
    background-color: #ff69b4;
    color: white;
    box-shadow: 4px 4px 0 #00bcd4;
}

#cancel-delete {
    background-color: #ccc !important;
    box-shadow: 4px 4px 0 #555 !important;
    border: 2px solid #333;
}
#cancel-delete:hover {
    background-color: #a0a0a0 !important;
    color: #333 !important;
    box-shadow: 4px 4px 0 #333 !important;
}

/* --- Responsividade Básica --- */
@media (max-width: 768px) {
    header {
        flex-direction: column; 
        gap: 15px;
    }
    nav ul {
        flex-direction: column; 
        text-align: center;
    }
    main {
        flex-direction: column;
    }
}