/* Reset & Base */
:root {
    --primary-color: #fca5a5; /* pastel red/pink */
    --primary-hover: #f87171;
    --secondary-color: #bbf7d0; /* pastel green */
    --text-main: #334155;
    --text-muted: #64748b;
    --bg-color: #fefce8; /* pastel yellow/cream background */
    --card-bg: #ffffff;
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

:focus {
    outline: none;
}

@view-transition {
    navigation: auto;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main.container {
    animation: pageEnter 0.4s ease-out forwards;
    flex-grow: 1;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    padding: 0.5rem 0 1rem 0;
    text-align: center;
}

.header-logo {
    max-width: 320px;
    max-height: 280px;
    width: auto;
    height: auto;
    margin: -1rem auto 0.5rem auto;
    display: block;
    transition: all 0.3s ease-in-out;
    transform-origin: top center;
    border: none;
    mix-blend-mode: multiply;
    clip-path: inset(4px);
    filter: brightness(1.05) contrast(1.1);
}

.logo {
    font-size: 2rem;
    color: var(--text-main);
    line-height: 1.1;
}

.logo span {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.tagline {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Filters */
.category-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    /* Hide scrollbar for clean look */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.category-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background-color: var(--card-bg);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.filter-btn:active {
    transform: scale(0.95);
    background-color: var(--primary-hover);
    transition: none;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first: 1 column */
    gap: 1.5rem;
    padding-bottom: 3rem;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    background-color: #f1f5f9;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.badge {
    background-color: var(--secondary-color);
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-image-container .badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    margin-top: auto;
}

.btn-whatsapp {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #22c55e;
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.btn-whatsapp:hover {
    background-color: #16a34a;
}
.btn-whatsapp:active {
    transform: scale(0.96);
    background-color: #15803d;
    transition: none;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    background-color: var(--card-bg);
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 4px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-link {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Contact Page */
.contact-section {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.contact-card {
    background-color: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.contact-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.contact-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    transition: transform 0.2s, opacity 0.2s;
}

.contact-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}
.contact-btn:active {
    transform: scale(0.96);
    opacity: 1;
    transition: none;
}

.whatsapp-btn {
    background-color: #22c55e;
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Fix para a navegação sticky no mobile */
.header-wrapper {
    display: contents;
}

/* Tablet & Desktop (Progressive Enhancement) */
@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    .form-actions a, .form-actions button {
        width: auto;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================
   DASHBOARD & FORMS (Área Restrita)
   ========================================= */

/* Login */
.login-section { display: flex; justify-content: center; padding: 3rem 1rem; }
.login-card { background: var(--card-bg); padding: 2.5rem; border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); width: 100%; max-width: 400px; text-align: center; }
.login-title { color: var(--primary-color); margin-bottom: 0.5rem; }
.login-subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; }

/* Dashboard */
.dashboard-section { padding: 1rem 1rem 3rem 1rem; max-width: 800px; margin: 0 auto; }
.dashboard-header { display: flex; flex-direction: column; gap: 1rem; text-align: center; margin-bottom: 2rem; }
.dashboard-header h2 { color: var(--primary-color); font-size: 1.8rem; }
.header-actions { display: flex; gap: 0.5rem; justify-content: center; width: 100%; }
.header-actions a { flex: 1; display: flex; justify-content: center; align-items: center; text-align: center; font-size: 0.9rem; padding: 0.8rem 0.5rem; }
.dashboard-list { display: flex; flex-direction: column; gap: 1rem; }
.dash-card { background: var(--card-bg); border-radius: 15px; padding: 1rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.dash-card-img { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--bg-color); }
.dash-card-img img { width: 100%; height: 100%; object-fit: cover; }
.dash-card-img .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 0.7rem; color: #999; }
.dash-card-info { flex-grow: 1; text-align: left; }
.dash-card-info h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.dash-card-info p { color: var(--secondary-color); font-weight: bold; font-size: 0.9rem; margin-bottom: 0.3rem;}
.dash-badges { display: flex; gap: 0.3rem; }
.badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 10px; font-weight: bold; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.warning { background: #fef9c3; color: #854d0e; }

.dash-card-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.btn-edit, .btn-delete { font-size: 0.8rem; padding: 0.4rem 0.8rem; border-radius: 8px; text-decoration: none; text-align: center; font-weight: bold; transition: all 0.2s ease; }
.btn-edit { background: #f1f5f9; color: #334155; }
.btn-edit:active { transform: scale(0.95); background: #e2e8f0; transition: none; }
.btn-delete { background: #fff1f2; color: #be123c; }
.btn-delete:active { transform: scale(0.95); background: #fecdd3; transition: none; }

/* Formulários genéricos */
.form-section { padding: 2rem 1rem; max-width: 500px; margin: 0 auto; }
.form-card { background: var(--card-bg); padding: 2rem; border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.custom-form { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; text-align: left; }
.form-group label { font-weight: 600; color: var(--text-color); font-size: 0.95rem; }
.form-input { padding: 0.8rem; border-radius: 12px; border: 1px solid #e2e8f0; font-family: inherit; font-size: 1rem; background: #f8fafc; transition: border 0.3s; }
.form-input:focus { outline: none; border-color: var(--secondary-color); background: #fff; }

.form-file-input { font-size: 0.95rem; color: var(--text-muted); cursor: pointer; }
.form-file-input::file-selector-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    margin-right: 1rem;
    transition: all 0.2s;
}
.form-file-input::file-selector-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}
.form-file-input::file-selector-button:active {
    background-color: #f43f5e;
    transform: scale(0.95);
}

.help-text { font-size: 0.8rem; color: #64748b; }
.error-list { color: #e11d48; font-size: 0.85rem; list-style: none; padding: 0; margin: 0; }
.form-actions { display: flex; flex-direction: column-reverse; gap: 1rem; margin-top: 1.5rem; }
.form-actions a, .form-actions button { width: 100%; display: flex; justify-content: center; align-items: center; }
.btn-outline { display: inline-flex; justify-content: center; align-items: center; padding: 0.8rem 1.5rem; border-radius: 25px; font-weight: 700; font-size: 1rem; color: var(--text-muted); border: 1px solid #cbd5e1; text-decoration: none; cursor: pointer; background: transparent; font-family: inherit; white-space: nowrap; transition: all 0.2s ease; }
.btn-outline:active { transform: scale(0.96); background-color: #f1f5f9; transition: none; }
.btn-delete-confirm { padding: 0.8rem 1.5rem; border-radius: 25px; font-weight: 600; color: white; background: #e11d48; border: none; cursor: pointer; text-decoration: none; transition: all 0.2s ease; }
.btn-delete-confirm:active { transform: scale(0.96); background-color: #be123c; transition: none; }
.warning-text { color: #e11d48; font-size: 0.9rem; font-weight: bold; margin-top: 0.5rem; }
.error-msg { color: #e11d48; font-size: 0.9rem; margin-bottom: 1rem; font-weight: 600; }

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
    font-size: 1rem;
    white-space: nowrap;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}
.btn-primary:active {
    background-color: #f43f5e;
    transform: scale(0.96);
    transition: none;
}
.w-full {
    width: 100%;
}

/* Modal de Recorte (Cropper) */
.crop-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center; padding: 1rem; }
.crop-modal-content { background: var(--card-bg); width: 100%; max-width: 500px; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.crop-modal-header { padding: 1rem; text-align: center; font-weight: bold; font-size: 1.2rem; border-bottom: 1px solid #e2e8f0; }
.crop-container { width: 100%; height: 60vh; max-height: 400px; background: #000; }
.crop-container img { max-width: 100%; display: block; }
.crop-modal-footer { padding: 1rem; display: flex; flex-direction: column-reverse; gap: 1rem; border-top: 1px solid #e2e8f0; }
.crop-modal-footer button { width: 100%; }
.crop-preview-container { margin-top: 1rem; display: none; flex-direction: column; align-items: center; gap: 0.5rem; }
.crop-preview-img { width: 150px; height: 150px; border-radius: 15px; object-fit: cover; border: 2px solid var(--primary-color); }

/* Header Responsivo para PC */
@media (min-width: 768px) {
    .header-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: var(--card-bg);
        padding: 0.5rem 5%;
        margin-bottom: 2rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .main-header {
        padding: 0;
        background: transparent;
    }
    .main-header .container {
        padding: 0;
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
    .header-logo {
        max-height: 80px;
        width: auto;
        margin: 0;
    }
    .tagline {
        margin: 0;
        font-size: 1rem;
    }
    .main-nav {
        margin: 0;
        padding: 0;
        border-bottom: none;
        box-shadow: none;
        position: static;
        background: transparent;
    }
}
