body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    height: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    padding-top: 50px; 
    padding-bottom: 50px;
    transition: background-color 0.3s, color 0.3s;
}

main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

#cadastro {
    display: none;
    position: static;
    transform: none;
}

#cadastro:target {
    display: flex;
}

#cadastro:target + #login {
    display: none; 
}

.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    transition: background-color 0.3s, box-shadow 0.3s;
}

h1, h2 {
    color: #333;
    margin-bottom: 25px;
    transition: color 0.3s;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
    transition: color 0.3s;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.button-container {
    display: flex;
    justify-content: space-between;
    gap: 10px; 
    margin-top: 20px;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.btn-primary {
    background-color: #0056b3;
    color: white;
}

.btn-primary:hover {
    background-color: #004494;
}

.btn-secondary {
    background-color: #ffffff;
    color: #0056b3;
    border: 1px solid #0056b3;
}

.btn-secondary:hover {
    background-color: #f2f2f2;
}

.btn-toggle-mode {
    margin-top: 20px !important; 
    width: 100% !important; 
}

.redefinir-link {
    margin-top: 15px;
}

.redefinir-link a,
.cadastro-link a {
    color: #0056b3;
    text-decoration: none;
    transition: color 0.3s;
}

.redefinir-link a:hover,
.cadastro-link a:hover {
    text-decoration: underline;
}

.cadastro-link {
    margin-top: 20px;
    font-size: 14px;
}

main {
    padding: 0 20px;
    padding-top: 80px;
}

header {
    background-color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s, box-shadow 0.3s;
}

header h1 {
    margin: 0;
    color: #0056b3;
    font-size: 24px;
}

header .btn-secondary {
    margin-left: 10px;
    width: auto;
    padding: 8px 15px;
    font-size: 14px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
    width: 100%;
}

.produto-card {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s, background-color 0.3s, box-shadow 0.3s;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.produto-card h4 {
    margin: 10px 0 5px 0;
    color: #333;
}

.produto-card p {
    font-size: 1.2em;
    font-weight: bold;
    color: #0056b3;
    margin-bottom: 15px;
}

.produto-card .product-icon {
    width: 80px;
    height: 80px;
    color: #0056b3; 
    margin-bottom: 10px;
}

.modal {
    display: none; 
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4); 
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; 
    padding: 20px;
    border-radius: 10px;
    width: 90%; 
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

#itens-carrinho {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-bottom: 20px;
}

#itens-carrinho li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#itens-carrinho li .sub-total {
    font-weight: bold;
    margin-left: auto;
}

#itens-carrinho li:last-child {
    border-bottom: none;
}

.remover-item {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 10px;
}

body.dark-mode {
    background-color: #121212; 
}

body.dark-mode .form-container,
body.dark-mode .produto-card {
    background-color: #1e1e1e; 
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1); 
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode label,
body.dark-mode p,
body.dark-mode .produto-card h4 {
    color: #e0e0e0; 
}

body.dark-mode .produto-card .product-icon {
    color: #007bff;
}

body.dark-mode .input-group input,
body.dark-mode .input-group select {
    background-color: #2c2c2c; 
    border-color: #444; 
    color: #f0f0f0; 
}

body.dark-mode .btn-primary {
    background-color: #007bff; 
}

body.dark-mode .btn-secondary {
    background-color: #1e1e1e;
    color: #007bff;
    border: 1px solid #007bff;
}

body.dark-mode .btn-secondary:hover {
    background-color: #333;
}

body.dark-mode .redefinir-link a,
body.dark-mode .cadastro-link a {
    color: #007bff;
}

body.dark-mode header {
    background-color: #1e1e1e;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

body.dark-mode header h1 {
    color: #007bff;
}

body.dark-mode .modal-content {
    background-color: #2c2c2c;
}

body.dark-mode #itens-carrinho li {
    color: #e0e0e0;
    border-bottom: 1px dashed #444;
}