@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #662D91; /* Roxo da logo */
    --primary-dark: #4a1f6b;
    --secondary: #FFB600; /* Amarelo da logo */
    --secondary-hover: #e5a300;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --success: #28a745;
    --danger: #dc3545;
    --border: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.15);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: var(--primary);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: relative;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

.logo-container img {
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}
.logo-container img:hover {
    transform: scale(1.05);
}

nav.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: var(--primary-dark);
    padding: 10px 0;
}

nav.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

nav.main-nav a:hover, nav.main-nav a.active {
    background-color: var(--secondary);
    color: var(--primary-dark);
}

/* Typography & General Classes */
h1, h2, h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-4 { margin-top: 2rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--primary-dark);
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.btn-success { background-color: var(--success); color: white; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-block { width: 100%; }

/* Inputs & Forms */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(102, 45, 145, 0.2);
}

/* Cards & Layouts */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: transform 0.3s;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Carousel */
@media (max-width: 768px) {
    .carousel-container {
        aspect-ratio: 16 / 9; /* Um pouco mais alto no celular para facilitar a leitura */
    }
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16 / 7; /* Mantém uma proporção de banner */
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background-color: #f4f4f4;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Garante que a legenda fique no pé */
}
.carousel-slide.active { opacity: 1; }
.carousel-caption {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 20px;
    text-align: center;
}
.carousel-caption h3 { color: var(--secondary); margin:0; }

/* Menu Items */
.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}
.menu-item:last-child { border-bottom: none; }
.menu-info h4 { margin-bottom: 5px; color: var(--primary); }
.menu-price { font-weight: bold; color: var(--success); }
.menu-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.menu-actions input {
    width: 60px;
    text-align: center;
}

/* Cart / Summary */
.cart-summary {
    position: sticky;
    top: 120px;
    background: var(--primary);
    color: white;
}
.cart-summary h3 { color: var(--secondary); }
.cart-total {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 15px 0;
    color: var(--secondary);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th { background-color: var(--primary); color: white; }
tr:hover { background-color: #f1f1f1; }

/* Badges / Status */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-warning { background: #ffc107; color: #000; }
.badge-info { background: #17a2b8; color: #fff; }
.badge-primary { background: var(--primary); color: #fff; }
.badge-success { background: var(--success); color: #fff; }

/* Dashboard layout */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 80px);
}
.sidebar {
    width: 250px;
    background: var(--surface);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}
.sidebar a {
    display: block;
    padding: 10px 15px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: 0.2s;
}
.sidebar a:hover, .sidebar a.active {
    background: var(--primary);
    color: white;
}
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

/* Footer */
footer {
    background-color: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

@media print {
    @page { margin: 1cm; }
    body { background: white !important; }
    
    /* Esconde elementos da interface */
    .sidebar, .main-nav, header, footer, .btn, .sidebar *, 
    #login-screen, .no-print, .close-modal, .modal, .modal-content,
    .dashboard-container .sidebar, #sync-status {
        display: none !important;
    }

    .dashboard-container {
        display: block !important;
    }

    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    /* Esconde todas as seções e mostra apenas a ativa ou a de relatórios se estiver imprimindo */
    section {
        display: none !important;
    }
    
    #sec-relatorios, #sec-relatorios * {
        display: block !important;
    }
    
    #sec-relatorios table {
        display: table !important;
    }
    
    #sec-relatorios th, #sec-relatorios td {
        display: table-cell !important;
    }

    /* Estilos específicos para a bobina de 80mm */
    body.print-80mm { padding: 0; }
    body.print-80mm * { display: none !important; }
    body.print-80mm #print-area-80mm, body.print-80mm #print-area-80mm * { 
        display: block !important; 
    }
    body.print-80mm #print-area-80mm {
        width: 80mm;
        margin: 0;
        padding: 0;
        font-family: monospace;
        font-size: 12px;
        color: black;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    /* Garante que o cabeçalho de impressão A4 apareça */
    .print-only {
        display: block !important;
    }
}
