/* --- 1. VARIÁVEIS E CONFIGURAÇÃO BASE --- */
:root {
    --primary: #d946ef; /* Rosa vibrante / Fúcsia */
    --primary-hover: #c026d3; /* Tom mais escuro para quando passas o rato */
    --bg: #fdf4ff; /* Fundo com um toque muito leve e suave de rosa */
    --white: #ffffff;
    --text: #2e1065; /* Roxo muito escuro para o texto (garante boa leitura) */
    --gray: #7e22ce; /* Roxo acinzentado para textos secundários */
    --border: #f3e8ff; /* Bordas num tom lilás muito suave */
    --shadow: 0 10px 15px -3px rgba(217, 70, 239, 0.1); /* Sombra ligeiramente rosada */
}

* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* --- 2. HEADER E NAVEGAÇÃO --- */
header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

#cart-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* --- 3. CENTRAMENTO ABSOLUTO (LOGIN E REGISTO) --- */
.bg-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #edf2f7; /* Fundo ligeiramente diferente para destacar o card */
    margin: 0;
}

.auth-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* Tabs de navegação (Entrar / Criar Conta) */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.auth-tabs a {
    flex: 1;
    padding: 1rem;
    text-decoration: none;
    color: var(--gray);
    font-weight: 600;
    transition: 0.3s;
}

.auth-tabs a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* Campos de Formulário */
.field {
    text-align: left;
    margin-bottom: 1.2rem;
}

.field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.field input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
    font-size: 1rem;
}

.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- 4. BOTÕES PROFISSIONAIS --- */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Link "Voltar à loja" estilizado */
.auth-back-link {
    display: inline-block;
    margin-top: 1.5rem;
    text-decoration: none;
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.2s;
}

.auth-back-link:hover {
    color: var(--primary);
}

/* --- 5. GRID DE PRODUTOS (INDEX) --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.price-tag {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    display: block;
    margin: 0.8rem 0;
}

/* --- 6. LAYOUT DO CARRINHO (DUAS COLUNAS) --- */
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .cart-grid {
        grid-template-columns: 1fr;
    }
}

.cart-items-container {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.summary-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.summary-line.total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
    font-size: 1.2rem;
    font-weight: 800;
}

.btn-remove {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-remove:hover {
    background: #fee2e2;
}

/* --- 7. MODAIS / POPUPS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    box-shadow: var(--shadow);
}