/* Variables CSS para el tema */
:root {
    --primary-color: #556B2F; /* Un verde oliva similar al tema de la imagen */
    --primary-light: #8FBC8F;
    --primary-dark: #3b4b20;
    --accent-color: #D2B48C; /* Un color arena/madera */
    
    --bg-color: #f7f9f6;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    
    --danger: #dc3545;
    --success: #28a745;
    
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

/* Header & Navegación */
.app-header {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-area h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.badge {
    background-color: var(--primary-light);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    background-color: var(--bg-color);
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Contenido Principal */
.app-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Layout del POS */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Paneles */
.selection-panel, .summary-panel, .card-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.step-container {
    margin-bottom: 2rem;
    transition: opacity 0.3s;
}

.step-container.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin: 1.5rem 0 0.75rem 0;
}

/* Grillas de Opciones */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.options-grid.small-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.option-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    background-color: white;
}

.option-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.option-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(85, 107, 47, 0.05); /* primary-color with alpha */
}

.option-card.selected::before {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    color: var(--primary-color);
    font-weight: bold;
}

.option-card {
    position: relative;
}

.option-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.option-price {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.5rem;
    display: block;
}

/* Carrito */
.summary-panel {
    position: sticky;
    top: 5rem;
}

.cart-items {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.empty-cart-msg {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
}

.cart-item-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.cart-item-price {
    font-weight: 600;
}

.cart-totals {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
    margin-bottom: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.main-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Botones */
.action-buttons {
    display: flex;
    gap: 1rem;
}

.action-buttons.justify-end {
    justify-content: flex-end;
}

.mt-4 {
    margin-top: 1.5rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: #f1f3f5;
    color: var(--text-main);
}

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

/* Formularios & Tablas (Inventario) */
.standard-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group.row {
    display: flex;
    gap: 1rem;
}

.col {
    flex: 1;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(85, 107, 47, 0.2);
}

.help-text {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-color);
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-content h2 i {
    display: block;
    margin: 0 auto 10px;
    width: 48px;
    height: 48px;
}

/* Estilos de Impresión */
@media print {
    body * {
        visibility: hidden;
    }
    #receipt-template, #receipt-template * {
        visibility: visible;
    }
    #receipt-template {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%; /* Para impresoras térmicas (58mm/80mm) */
        max-width: 300px; /* Ancho típico de tirilla */
        margin: 0;
        padding: 0;
        font-family: monospace; /* Fuente clásica de tirilla */
        font-size: 12px;
        color: #000;
    }
    .receipt {
        padding: 10px;
    }
    .receipt-header {
        text-align: center;
        margin-bottom: 10px;
    }
    .receipt-header h3 {
        font-size: 16px;
        margin: 0 0 5px 0;
    }
    .receipt-header p {
        margin: 2px 0;
    }
    .receipt-separator {
        text-align: center;
        margin: 5px 0;
        letter-spacing: 2px;
    }
    .receipt-item {
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
    }
    .receipt-item-details {
        flex: 1;
    }
    .receipt-item-name {
        font-weight: bold;
    }
    .receipt-item-sub {
        padding-left: 10px;
        font-size: 10px;
    }
    .receipt-total {
        display: flex;
        justify-content: space-between;
        font-weight: bold;
        font-size: 14px;
        margin-top: 10px;
    }
    .receipt-footer {
        text-align: center;
        margin-top: 15px;
        font-size: 10px;
    }
}
