/* CSS Variables for easy maintenance */
:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --secondary-color: #4caf50;
    --secondary-dark: #388e3c;
    --accent-color: #ffeb3b;
    --danger-color: #f44336;
    --text-color: #333;
    --text-light: #5d4037;
    --background-light: rgba(255, 255, 255, 0.9);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    background: linear-gradient(135deg, #8d671f 0%, #f1f8e9 100%);
    font-family: var(--font-family);
    color: var(--text-color);
    min-height: 100vh;
}

/* Header */
.cabecalho {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow);
    position: relative;
    overflow: hidden;
}

.cabecalho h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

.cabecalho h1:hover {
    transform: scale(1.05);
}

.cabecalho h2 {
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--secondary-color);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Cart Widget */
.carrinho-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow);
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
}

.carrinho-widget:hover {
    transform: scale(1.1);
}

.carrinho-widget .contador {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* About Section */
.sobre {
    background-color: var(--background-light);
    padding: 20px;
    margin: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.sobre h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

.sobre p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: clamp(1rem, 3vw, 1.1rem);
}

/* Filters */
.filtros {
    text-align: center;
    margin: 20px;
}

.filtros button {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    margin: 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
}

.filtros button:hover,
.filtros button.ativo {
    background: var(--primary-color);
    color: white;
}

/* Products Title */
#titulo-produtos {
    text-align: center;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    padding: 20px;
    margin: 30px 20px;
    font-size: clamp(1.5rem, 5vw, 2rem);
    box-shadow: 0 2px 8px var(--shadow);
    border-radius: 10px;
}

/* Products Grid */
.produtos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Product Card */
.produto {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 1;
}

.produto.hidden {
    display: none;
}

.produto:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

.produto.verdura {
    border-top: 4px solid var(--secondary-color);
}

.produto.fruta {
    border-top: 4px solid var(--accent-color);
}

.produto.legume {
    border-top: 4px solid #795548;
}

.produto img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.produto img:hover {
    transform: scale(1.05);
}

.produto h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: clamp(1.1rem, 3vw, 1.2rem);
}

.produto p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    flex-grow: 1;
}

.preco {
    color: var(--secondary-color);
    font-size: clamp(1.3rem, 4vw, 1.5rem);
    font-weight: bold;
    margin: 10px 0;
}

.produto button {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
    text-transform: uppercase;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
}

.produto button:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #2e7d32 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.produto button:active {
    transform: scale(0.98);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* Gnome Animation */
.gnomo {
    position: fixed;
    width: 50px;
    height: 50px;
    font-size: 40px;
    cursor: pointer;
    z-index: 999;
    transition: var(--transition);
    animation: float 3s ease-in-out infinite;
}

.gnomo:hover {
    transform: scale(1.3) rotate(20deg);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.ativo {
    display: flex;
}

.modal-conteudo {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-conteudo h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.item-carrinho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.item-carrinho button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-top: 20px;
    text-align: right;
}

.fechar-modal {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
}

.finalizar-compra {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    font-weight: bold;
}

.finalizar-compra:hover {
    background: var(--secondary-dark);
}

/* Confetti */
.confete {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--danger-color);
    top: -10px;
    z-index: 9999;
    animation: cair 3s linear;
}

@keyframes cair {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .produtos {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        padding: 15px;
        gap: 20px;
    }

    .carrinho-widget {
        width: 50px;
        height: 50px;
    }

    .cabecalho {
        padding: 30px 15px;
    }
}

@media (max-width: 640px) {
    .produtos {
        grid-template-columns: repeat(2, 1fr);
        padding: 15px;
        gap: 15px;
    }

    .carrinho-widget {
        width: 50px;
        height: 50px;
    }

    .sobre {
        margin: 10px;
        padding: 15px;
    }
}
